freemyipod r546 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r545‎ | r546 | r547 >
Date:22:38, 6 February 2011
Author:theseven
Status:new
Tags:
Comment:
Installer for iPod Classic: Fix some bugs
Modified paths:
  • /apps/installer-ipodclassic/Makefile (modified) (history)
  • /apps/installer-ipodclassic/main.c (modified) (history)

Diff [purge]

Index: apps/installer-ipodclassic/main.c
@@ -132,7 +132,7 @@
133133 }
134134 uint32_t database = fatsectors + reserved;
135135 uint32_t clusoffset = 0;
136 - uint32_t* buf = memalign(0x20000, 0x10);
 136+ uint32_t* buf = memalign(0x10, 0x20000);
137137 memset(buf, 0, 0x800);
138138 memcpy(buf, "\xeb\x58\x00MSWIN5.0\0\x10", 0xd);
139139 ((uint8_t*)buf)[0xd] = secperclus;
@@ -220,8 +220,8 @@
221221 bool updating = disk_mount(0);
222222 cputc(3, '.');
223223
224 - norbuf = memalign(0x100000, 0x10);
225 - oldnor = memalign(0x100000, 0x10);
 224+ norbuf = memalign(0x10, 0x100000);
 225+ oldnor = memalign(0x10, 0x100000);
226226 memset(norbuf, 0xff, 0x100000);
227227 cputc(3, '.');
228228 bootflash_readraw(oldnor, 0, 0x100000);
@@ -442,6 +442,9 @@
443443 cost += script[sp++];
444444 progressbar_setpos(&progressbar, cost, false);
445445 }
 446+
 447+ if (oldnor) free(oldnor);
 448+
446449 ui->blenda(165, 36, 255, framebuf, 0, 0, 165, bg, 77, 100, 320, actions, 0, 72, 165);
447450 displaylcd(77, 100, 165, 36, framebuf, 0, 0, 165);
448451 progressbar_init(&progressbar, 15, 304, 135, 159, 0x77ff, 0xe8, 0x125f, 0, 256);
@@ -451,6 +454,16 @@
452455 progressbar_setpos(&progressbar, i, false);
453456 }
454457
 458+ free(norbuf);
 459+ free(framebuf);
 460+ free(actions);
 461+ free(bg);
 462+
 463+ release_library(libui);
 464+ release_library(libpng);
 465+ library_unload(libui);
 466+ library_unload(libpng);
 467+
455468 shutdown(false);
456469 reset();
457470 }
Index: apps/installer-ipodclassic/Makefile
@@ -210,13 +210,8 @@
211211
212212 flashfiles/emcore-ipodclassic.bin: $(EMCOREDIR)/build/ipodclassic/emcore.bin emcore
213213 @echo [EMBCFG] $@
214 - @$(EMCOREBOOTCFG) $< $@ "(3, '/.emcore/boot.emcoreapp', None, (2, 'bootmenu', None, None))"
 214+ @$(EMCOREBOOTCFG) $< $@ "(3, '/.boot/init.emcoreapp', None, (2, 'bootmenu', None, None))"
215215
216 -$(EMBIOSDIR)/build/ipodclassic/embios.bin: embios
217 -
218 -embios:
219 - @make -C $(EMBIOSDIR) ipodclassic
220 -
221216 emcore:
222217 @make -C $(EMCOREDIR) ipodclassic
223218