freemyipod r256 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r255‎ | r256 | r257 >
Date:00:57, 5 November 2010
Author:theseven
Status:new
Tags:
Comment:
iPod Nano 2G installer: Use osos instead of osbk and don't tell the user to remove the installer using ipodpatcher on failures if the it was launched through a bootnote.
Modified paths:
  • /apps/installer-nano2g/main.c (modified) (history)

Diff [purge]

Index: apps/installer-nano2g/main.c
@@ -490,6 +490,7 @@
491491 uint32_t* script;
492492 #define scriptb ((uint8_t*)script)
493493 uint32_t dummy;
 494+ int deleterc = 1;
494495 struct progressbar_state progressbar;
495496 bool repartition = false;
496497 bool appleflash;
@@ -527,7 +528,7 @@
528529 backlight_set_brightness(177);
529530 backlight_on(true);
530531
531 - if (*script) remove((char*)&script[1]);
 532+ if (*script) deleterc = remove((char*)&script[1]);
532533 script = &script[1 + *script];
533534
534535 if (norword[0x400] == 0x53436667) appleflash = false;
@@ -555,15 +556,18 @@
556557 }
557558 else if (button == 4)
558559 {
559 - ucl_decompress(bitmapdata[BMPIDX_CANCELLED], bitmapsize[BMPIDX_CANCELLED],
560 - bmpbuffer, &dummy);
561 - memcpy(lcdbuffer, backdrop, 0xb580);
562 - renderbmp(lcdbuffer, bmpbuffer, 176);
563 - displaylcd(0, 175, 0, 131, lcdbuffer, 0);
564 - sleep(500000);
565 - button = 0;
566 - while (!button) wakeup_wait(&eventwakeup, TIMEOUT_BLOCK);
567 - memcpy((void*)0x2202bf00, "diskmodehotstuff\1\0\0", 20);
 560+ if (deleterc)
 561+ {
 562+ ucl_decompress(bitmapdata[BMPIDX_CANCELLED], bitmapsize[BMPIDX_CANCELLED],
 563+ bmpbuffer, &dummy);
 564+ memcpy(lcdbuffer, backdrop, 0xb580);
 565+ renderbmp(lcdbuffer, bmpbuffer, 176);
 566+ displaylcd(0, 175, 0, 131, lcdbuffer, 0);
 567+ sleep(500000);
 568+ button = 0;
 569+ while (!button) wakeup_wait(&eventwakeup, TIMEOUT_BLOCK);
 570+ memcpy((void*)0x2202bf00, "diskmodehotstuff\1\0\0", 20);
 571+ }
568572 shutdown(false);
569573 reset();
570574 }
@@ -636,7 +640,7 @@
637641 diaguclptr = newptr;
638642 }
639643 progressbar_setpos(&progressbar, 70, false);
640 - if (readfw("DNANkbso", &ososptr, &osossize)) osossize = 0;
 644+ if (readfw(deleterc ? "DNANkbso" : "DNANsoso", &ososptr, &osossize)) osossize = 0;
641645 if (osossize)
642646 {
643647 if (((uint8_t*)ososptr)[0x64d48] == 0x2b && ((uint8_t*)ososptr)[0x64d54] == 0x34)