| Line 70... |
Line 70... |
| 70 |
((uint8_t*)buf)[0x40] = 0x80;
|
70 |
((uint8_t*)buf)[0x40] = 0x80;
|
| 71 |
((uint8_t*)buf)[0x42] = 0x29;
|
71 |
((uint8_t*)buf)[0x42] = 0x29;
|
| 72 |
memcpy(&((uint8_t*)buf)[0x47], label, 0xb);
|
72 |
memcpy(&((uint8_t*)buf)[0x47], label, 0xb);
|
| 73 |
memcpy(&((uint8_t*)buf)[0x52], "FAT32 ", 8);
|
73 |
memcpy(&((uint8_t*)buf)[0x52], "FAT32 ", 8);
|
| 74 |
((uint16_t*)buf)[0xff] = 0xaa55;
|
74 |
((uint16_t*)buf)[0xff] = 0xaa55;
|
| 75 |
PASS_RC(storage_write_sectors_md(volume, startsector, 1, buf), 2, 0);
|
75 |
PASS_RC_FREE(storage_write_sectors_md(volume, startsector, 1, buf), 2, 0, buf);
|
| 76 |
memset(buf, 0, sectorsize);
|
76 |
memset(buf, 0, sectorsize);
|
| 77 |
buf[0] = 0x41615252;
|
77 |
buf[0] = 0x41615252;
|
| 78 |
buf[0x79] = 0x61417272;
|
78 |
buf[0x79] = 0x61417272;
|
| 79 |
buf[0x7a] = clustercount - 1;
|
79 |
buf[0x7a] = clustercount - 1;
|
| 80 |
buf[0x7b] = 2;
|
80 |
buf[0x7b] = 2;
|
| 81 |
buf[0x7f] = 0xaa550000;
|
81 |
buf[0x7f] = 0xaa550000;
|
| 82 |
PASS_RC(storage_write_sectors_md(volume, startsector + 1, 1, buf), 2, 1);
|
82 |
PASS_RC_FREE(storage_write_sectors_md(volume, startsector + 1, 1, buf), 2, 1, buf);
|
| 83 |
statusinit(statususer, fatsectors);
|
83 |
statusinit(statususer, fatsectors);
|
| 84 |
uint32_t cursect = 0;
|
84 |
uint32_t cursect = 0;
|
| 85 |
for (i = 0; i < fatsectors; i += 32)
|
85 |
for (i = 0; i < fatsectors; i += 32)
|
| 86 |
{
|
86 |
{
|
| 87 |
memset(buf, 0, 32 * sectorsize);
|
87 |
memset(buf, 0, 32 * sectorsize);
|
| 88 |
if (!i) memcpy(buf, "\xf8\xff\xff\x0f\xff\xff\xff\xff\xff\xff\xff\x0f", 12);
|
88 |
if (!i) memcpy(buf, "\xf8\xff\xff\x0f\xff\xff\xff\xff\xff\xff\xff\x0f", 12);
|
| 89 |
PASS_RC(storage_write_sectors_md(volume, startsector + reserved + i,
|
89 |
PASS_RC_FREE(storage_write_sectors_md(volume, startsector + reserved + i,
|
| 90 |
MIN(fatsectors - i, 32), buf), 2, 2);
|
90 |
MIN(fatsectors - i, 32), buf), 2, 2, buf);
|
| 91 |
statuscallback(statususer, i);
|
91 |
statuscallback(statususer, i);
|
| 92 |
}
|
92 |
}
|
| 93 |
memset(buf, 0, secperclus * sectorsize);
|
93 |
memset(buf, 0, secperclus * sectorsize);
|
| 94 |
memcpy(buf, label, 11);
|
94 |
memcpy(buf, label, 11);
|
| 95 |
((uint8_t*)buf)[0xc] = 0x80;
|
95 |
((uint8_t*)buf)[0xc] = 0x80;
|
| 96 |
PASS_RC(storage_write_sectors_md(volume, startsector + database, secperclus, buf), 2, 3);
|
96 |
PASS_RC_FREE(storage_write_sectors_md(volume, startsector + database,
|
| - |
|
97 |
secperclus, buf), 2, 3, buf);
|
| 97 |
free(buf);
|
98 |
free(buf);
|
| 98 |
disk_mount(volume);
|
99 |
disk_mount(volume);
|
| 99 |
}
|
100 |
}
|