Subversion Repositories freemyipod

Rev

Rev 530 | Rev 547 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 530 Rev 546
Line 130... Line 130...
130
        clustercount = (totalsectors - fatsectors - reserved) / secperclus;
130
        clustercount = (totalsectors - fatsectors - reserved) / secperclus;
131
        fatsectors = (clustercount + 1025) >> 10;
131
        fatsectors = (clustercount + 1025) >> 10;
132
    }
132
    }
133
    uint32_t database = fatsectors + reserved;
133
    uint32_t database = fatsectors + reserved;
134
    uint32_t clusoffset = 0;
134
    uint32_t clusoffset = 0;
135
    uint32_t* buf = memalign(0x20000, 0x10);
135
    uint32_t* buf = memalign(0x10, 0x20000);
136
    memset(buf, 0, 0x800);
136
    memset(buf, 0, 0x800);
137
    memcpy(buf, "\xeb\x58\x00MSWIN5.0\0\x10", 0xd);
137
    memcpy(buf, "\xeb\x58\x00MSWIN5.0\0\x10", 0xd);
138
    ((uint8_t*)buf)[0xd] = secperclus;
138
    ((uint8_t*)buf)[0xd] = secperclus;
139
    ((uint16_t*)buf)[7] = reserved;
139
    ((uint16_t*)buf)[7] = reserved;
140
    memcpy(&((uint8_t*)buf)[0x10], "\x01\0\0\0\0\xf8\0\0\x3f\0\xff", 0xb);
140
    memcpy(&((uint8_t*)buf)[0x10], "\x01\0\0\0\0\xf8\0\0\x3f\0\xff", 0xb);
Line 218... Line 218...
218
 
218
 
219
    disk_unmount(0);
219
    disk_unmount(0);
220
    bool updating = disk_mount(0);
220
    bool updating = disk_mount(0);
221
    cputc(3, '.');
221
    cputc(3, '.');
222
 
222
 
223
    norbuf = memalign(0x100000, 0x10);
223
    norbuf = memalign(0x10, 0x100000);
224
    oldnor = memalign(0x100000, 0x10);
224
    oldnor = memalign(0x10, 0x100000);
225
    memset(norbuf, 0xff, 0x100000);
225
    memset(norbuf, 0xff, 0x100000);
226
    cputc(3, '.');
226
    cputc(3, '.');
227
    bootflash_readraw(oldnor, 0, 0x100000);
227
    bootflash_readraw(oldnor, 0, 0x100000);
228
    cputc(3, '.');
228
    cputc(3, '.');
229
    if (oldnorword[0x400] == 0x53436667) appleflash = false;
229
    if (oldnorword[0x400] == 0x53436667) appleflash = false;
Line 440... Line 440...
440
                panic(PANIC_KILLTHREAD, "\nBad installation script!");
440
                panic(PANIC_KILLTHREAD, "\nBad installation script!");
441
        }
441
        }
442
        cost += script[sp++];
442
        cost += script[sp++];
443
        progressbar_setpos(&progressbar, cost, false);
443
        progressbar_setpos(&progressbar, cost, false);
444
    }
444
    }
-
 
445
 
-
 
446
    if (oldnor) free(oldnor);
-
 
447
 
445
    ui->blenda(165, 36, 255, framebuf, 0, 0, 165, bg, 77, 100, 320, actions, 0, 72, 165);
448
    ui->blenda(165, 36, 255, framebuf, 0, 0, 165, bg, 77, 100, 320, actions, 0, 72, 165);
446
    displaylcd(77, 100, 165, 36, framebuf, 0, 0, 165);
449
    displaylcd(77, 100, 165, 36, framebuf, 0, 0, 165);
447
    progressbar_init(&progressbar, 15, 304, 135, 159, 0x77ff, 0xe8, 0x125f, 0, 256);
450
    progressbar_init(&progressbar, 15, 304, 135, 159, 0x77ff, 0xe8, 0x125f, 0, 256);
448
    for (i = 0; i < 256; i++)
451
    for (i = 0; i < 256; i++)
449
    {
452
    {
450
        bootflash_writeraw(&norbuf[i << 12], i << 12, 1 << 12);
453
        bootflash_writeraw(&norbuf[i << 12], i << 12, 1 << 12);
451
        progressbar_setpos(&progressbar, i, false);
454
        progressbar_setpos(&progressbar, i, false);
452
    }
455
    }
453
 
456
 
-
 
457
    free(norbuf);
-
 
458
    free(framebuf);
-
 
459
    free(actions);
-
 
460
    free(bg);
-
 
461
 
-
 
462
    release_library(libui);
-
 
463
    release_library(libpng);
-
 
464
    library_unload(libui);
-
 
465
    library_unload(libpng);
-
 
466
 
454
    shutdown(false);
467
    shutdown(false);
455
    reset();
468
    reset();
456
}
469
}