Index: apps/bootmenu-ipodnano2g/images/icons.psd |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: apps/bootmenu-ipodnano2g/images/background.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: apps/bootmenu-ipodnano2g/images/background.psd |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: apps/bootmenu-ipodnano2g/images/crapple.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: apps/bootmenu-ipodnano2g/images/crapple.png |
Property changes on: apps/bootmenu-ipodnano2g/images/crapple.png |
___________________________________________________________________ |
Added: svn:mime-type |
## -0,0 +1 ## |
| 1 | +application/octet-stream |
\ No newline at end of property |
Index: apps/bootmenu-ipodnano2g/images/rockbox.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: apps/bootmenu-ipodnano2g/images/crapple.psd |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: apps/bootmenu-ipodnano2g/images/crapple.psd |
Property changes on: apps/bootmenu-ipodnano2g/images/crapple.psd |
___________________________________________________________________ |
Added: svn:mime-type |
## -0,0 +1 ## |
| 2 | +application/octet-stream |
\ No newline at end of property |
Index: apps/bootmenu-ipodnano2g/images/rockbox.psd |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: apps/bootmenu-ipodnano2g/images/icons.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: apps/bootmenu-ipodnano2g/main.c |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | struct chooser_action_handler_wheel_data* adata;
|
15 | 15 | adata = (struct chooser_action_handler_wheel_data*)(data->actionhandlerdata);
|
16 | 16 | snprintf(buf, sizeof(buf), "%3d", adata->timeout_remaining / 1000000);
|
17 | | - rendertext(framebuf, 302, 232, 320, 0xffffcccc, 0, buf);
|
| 17 | + rendertext(framebuf, 158, 124, 176, 0xffffcccc, 0, buf);
|
18 | 18 | return false;
|
19 | 19 | }
|
20 | 20 |
|
— | — | @@ -20,10 +20,10 @@ |
21 | 21 |
|
22 | 22 | struct chooser_renderer_iconflow_itemdata mychooser_rparams_0 =
|
23 | 23 | {
|
24 | | - .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 80), LIBUI_POINT(0, 56)),
|
25 | | - LIBUI_POINT(80, 72)),
|
26 | | - .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 80), LIBUI_POINT(0, 56)),
|
27 | | - LIBUI_POINT(80, 72)),
|
| 24 | + .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 31)),
|
| 25 | + LIBUI_POINT(44, 40)),
|
| 26 | + .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 31)),
|
| 27 | + LIBUI_POINT(44, 40)),
|
28 | 28 | .text = "Power off",
|
29 | 29 | .text_color = 0xffffcccc,
|
30 | 30 | };
|
— | — | @@ -30,40 +30,70 @@ |
31 | 31 |
|
32 | 32 | struct chooser_renderer_iconflow_itemdata mychooser_rparams_1 =
|
33 | 33 | {
|
34 | | - .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 80), LIBUI_POINT(0, 0)),
|
35 | | - LIBUI_POINT(80, 25)),
|
36 | | - .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 80), LIBUI_POINT(0, 0)),
|
37 | | - LIBUI_POINT(80, 25)),
|
38 | | - .text = "Rockbox",
|
| 34 | + .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 177)),
|
| 35 | + LIBUI_POINT(44, 43)),
|
| 36 | + .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 177)),
|
| 37 | + LIBUI_POINT(44, 43)),
|
| 38 | + .text = "Original firmware",
|
39 | 39 | .text_color = 0xffffcccc,
|
40 | 40 | };
|
41 | 41 |
|
42 | 42 | struct chooser_renderer_iconflow_itemdata mychooser_rparams_2 =
|
43 | 43 | {
|
44 | | - .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 80), LIBUI_POINT(0, 25)),
|
45 | | - LIBUI_POINT(80, 31)),
|
46 | | - .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 80), LIBUI_POINT(0, 25)),
|
47 | | - LIBUI_POINT(80, 31)),
|
48 | | - .text = "emCORE console",
|
| 44 | + .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 0)),
|
| 45 | + LIBUI_POINT(44, 14)),
|
| 46 | + .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 0)),
|
| 47 | + LIBUI_POINT(44, 14)),
|
| 48 | + .text = "Rockbox",
|
49 | 49 | .text_color = 0xffffcccc,
|
50 | 50 | };
|
51 | 51 |
|
52 | 52 | struct chooser_renderer_iconflow_itemdata mychooser_rparams_3 =
|
53 | 53 | {
|
54 | | - .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 80), LIBUI_POINT(0, 130)),
|
55 | | - LIBUI_POINT(80, 55)),
|
56 | | - .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 80), LIBUI_POINT(0, 130)),
|
57 | | - LIBUI_POINT(80, 55)),
|
| 54 | + .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 14)),
|
| 55 | + LIBUI_POINT(44, 17)),
|
| 56 | + .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 14)),
|
| 57 | + LIBUI_POINT(44, 17)),
|
| 58 | + .text = "emCORE console",
|
| 59 | + .text_color = 0xffffcccc,
|
| 60 | +};
|
| 61 | +
|
| 62 | +struct chooser_renderer_iconflow_itemdata mychooser_rparams_4 =
|
| 63 | +{
|
| 64 | + .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 71)),
|
| 65 | + LIBUI_POINT(44, 31)),
|
| 66 | + .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 71)),
|
| 67 | + LIBUI_POINT(44, 31)),
|
58 | 68 | .text = "UMSboot",
|
59 | 69 | .text_color = 0xffffcccc,
|
60 | 70 | };
|
61 | 71 |
|
| 72 | +struct chooser_renderer_iconflow_itemdata mychooser_rparams_5 =
|
| 73 | +{
|
| 74 | + .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 133)),
|
| 75 | + LIBUI_POINT(44, 44)),
|
| 76 | + .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 133)),
|
| 77 | + LIBUI_POINT(44, 44)),
|
| 78 | + .text = "Diagnostics mode",
|
| 79 | + .text_color = 0xffffcccc,
|
| 80 | +};
|
| 81 | +
|
| 82 | +struct chooser_renderer_iconflow_itemdata mychooser_rparams_6 =
|
| 83 | +{
|
| 84 | + .icon = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 102)),
|
| 85 | + LIBUI_POINT(44, 31)),
|
| 86 | + .icon_selected = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 44), LIBUI_POINT(0, 102)),
|
| 87 | + LIBUI_POINT(44, 31)),
|
| 88 | + .text = "Disk mode",
|
| 89 | + .text_color = 0xffffcccc,
|
| 90 | +};
|
| 91 | +
|
62 | 92 | struct chooser_renderer_iconflow_params mychooser_rparams =
|
63 | 93 | {
|
64 | 94 | .version = CHOOSER_RENDERER_LIST_PARAMS_VERSION,
|
65 | | - .copy_dest = LIBUI_LOCATION(LIBUI_BUFFER(NULL, 320), LIBUI_POINT(0, 0)),
|
66 | | - .copy_src = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 320), LIBUI_POINT(0, 0)),
|
67 | | - LIBUI_POINT(320, 240)),
|
| 95 | + .copy_dest = LIBUI_LOCATION(LIBUI_BUFFER(NULL, 176), LIBUI_POINT(0, 0)),
|
| 96 | + .copy_src = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 176), LIBUI_POINT(0, 0)),
|
| 97 | + LIBUI_POINT(176, 132)),
|
68 | 98 | .bg_dest = LIBUI_LOCATION(LIBUI_BUFFER(NULL, 0), LIBUI_POINT(0, 0)),
|
69 | 99 | .bg_src = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 0), LIBUI_POINT(0, 0)),
|
70 | 100 | LIBUI_POINT(0, 0)),
|
— | — | @@ -71,12 +101,12 @@ |
72 | 102 | .fill_dest = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 0), LIBUI_POINT(0, 0)),
|
73 | 103 | LIBUI_POINT(0, 0)),
|
74 | 104 | .fill_color = 0,
|
75 | | - .viewport = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 320), LIBUI_POINT(0, 30)),
|
76 | | - LIBUI_POINT(320, 130)),
|
77 | | - .text_pos = LIBUI_POINT(160, 215),
|
| 105 | + .viewport = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 176), LIBUI_POINT(0, 16)),
|
| 106 | + LIBUI_POINT(176, 72)),
|
| 107 | + .text_pos = LIBUI_POINT(88, 118),
|
78 | 108 | .blit_dest = LIBUI_POINT(0, 0),
|
79 | | - .blit_src = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 320), LIBUI_POINT(0, 0)),
|
80 | | - LIBUI_POINT(320, 240)),
|
| 109 | + .blit_src = LIBUI_SURFACE(LIBUI_LOCATION(LIBUI_BUFFER(NULL, 176), LIBUI_POINT(0, 0)),
|
| 110 | + LIBUI_POINT(176, 132)),
|
81 | 111 | .smoothness = 500000,
|
82 | 112 | .startposition = -3,
|
83 | 113 | .iconsinview = 4,
|
— | — | @@ -111,8 +141,8 @@ |
112 | 142 | .rendererparams = &mychooser_rparams,
|
113 | 143 | .userparams = NULL,
|
114 | 144 | .tickinterval = 990000,
|
115 | | - .itemcount = 4,
|
116 | | - .defaultitem = 1,
|
| 145 | + .itemcount = 7,
|
| 146 | + .defaultitem = 2,
|
117 | 147 | .items =
|
118 | 148 | {
|
119 | 149 | {
|
— | — | @@ -134,6 +164,21 @@ |
135 | 165 | .user = (void*)3,
|
136 | 166 | .actionparams = NULL,
|
137 | 167 | .renderparams = &mychooser_rparams_3
|
| 168 | + },
|
| 169 | + {
|
| 170 | + .user = (void*)4,
|
| 171 | + .actionparams = NULL,
|
| 172 | + .renderparams = &mychooser_rparams_4
|
| 173 | + },
|
| 174 | + {
|
| 175 | + .user = (void*)5,
|
| 176 | + .actionparams = NULL,
|
| 177 | + .renderparams = &mychooser_rparams_5
|
| 178 | + },
|
| 179 | + {
|
| 180 | + .user = (void*)6,
|
| 181 | + .actionparams = NULL,
|
| 182 | + .renderparams = &mychooser_rparams_6
|
138 | 183 | }
|
139 | 184 | }
|
140 | 185 | };
|
— | — | @@ -183,8 +228,21 @@ |
184 | 229 | if (!rbxlogo) panicf(PANIC_KILLTHREAD, "Could not decode Rockbox logo!");
|
185 | 230 | png->png_destroy(handle);
|
186 | 231 | free(buf);
|
187 | | - framebuf = malloc(320 * 240 * 3);
|
| 232 | + size = bootflash_filesize("crapple ");
|
| 233 | + if (size == -1) panicf(PANIC_KILLTHREAD, "Could not find OF logo!");
|
| 234 | + buf = memalign(0x10, size);
|
| 235 | + if (!buf) panicf(PANIC_KILLTHREAD, "Could not allocate buffer for OF logo!");
|
| 236 | + bootflash_read("crapple ", buf, 0, size);
|
| 237 | + handle = png->png_open(buf, size);
|
| 238 | + if (!handle) panicf(PANIC_KILLTHREAD, "Could not parse OF logo!");
|
| 239 | + struct png_rgba* crapple = png->png_decode_rgba(handle);
|
| 240 | + if (!rbxlogo) panicf(PANIC_KILLTHREAD, "Could not decode OF logo!");
|
| 241 | + png->png_destroy(handle);
|
| 242 | + free(buf);
|
| 243 | + framebuf = malloc(176 * 132 * 3);
|
188 | 244 | if (!framebuf) panicf(PANIC_KILLTHREAD, "Could not allocate framebuffer!");
|
| 245 | + void* framebuf2 = malloc(176 * 132 * 3);
|
| 246 | + if (!framebuf2) panicf(PANIC_KILLTHREAD, "Could not allocate framebuffer 2!");
|
189 | 247 | mychooser.actionhandler = ui->chooser_action_handler_wheel;
|
190 | 248 | mychooser.renderer = ui->chooser_renderer_iconflow;
|
191 | 249 | mychooser_rparams.copy_dest.buf.addr = framebuf;
|
— | — | @@ -199,6 +257,12 @@ |
200 | 258 | mychooser_rparams_2.icon_selected.loc.buf.addr = icons;
|
201 | 259 | mychooser_rparams_3.icon.loc.buf.addr = icons;
|
202 | 260 | mychooser_rparams_3.icon_selected.loc.buf.addr = icons;
|
| 261 | + mychooser_rparams_4.icon.loc.buf.addr = icons;
|
| 262 | + mychooser_rparams_4.icon_selected.loc.buf.addr = icons;
|
| 263 | + mychooser_rparams_5.icon.loc.buf.addr = icons;
|
| 264 | + mychooser_rparams_5.icon_selected.loc.buf.addr = icons;
|
| 265 | + mychooser_rparams_6.icon.loc.buf.addr = icons;
|
| 266 | + mychooser_rparams_6.icon_selected.loc.buf.addr = icons;
|
203 | 267 | void* firmware = NULL;
|
204 | 268 | while (!firmware)
|
205 | 269 | {
|
— | — | @@ -212,15 +276,54 @@ |
213 | 277 | case 1:
|
214 | 278 | {
|
215 | 279 | int i;
|
216 | | - for (i = 0; i <= 300; i += 60)
|
| 280 | + for (i = 23; i <= 115; i += 23)
|
217 | 281 | {
|
218 | | - if (i < 300)
|
219 | | - ui->blend(320, 240, 50, framebuf, 0, 0, 320,
|
220 | | - framebuf, 0, 0, 320, bg, 0, 0, 320);
|
221 | | - else memcpy(framebuf, bg, 320 * 240 * 3);
|
222 | | - ui->blit(MIN(280, i), 86, 3, framebuf, 320 - i, 10, 320, rbxlogo, 0, 0, 280);
|
223 | | - displaylcd(0, 0, 320, 240, framebuf, 0, 0, 320);
|
| 282 | + if (i < 115)
|
| 283 | + ui->blend(176, 132, 50, framebuf, 0, 0, 176,
|
| 284 | + framebuf, 0, 0, 176, bg, 0, 0, 176);
|
| 285 | + else memcpy(framebuf, bg, 176 * 132 * 3);
|
| 286 | + memcpy(framebuf2, framebuf, 176 * 132 * 3);
|
| 287 | + ui->blenda(111, i, 255, framebuf2, 32, 0, 176,
|
| 288 | + framebuf2, 32, 0, 176, crapple, 0, 115 - i, 111);
|
| 289 | + displaylcd(0, 0, 176, 132, framebuf2, 0, 0, 176);
|
224 | 290 | }
|
| 291 | + int fd = file_open("/.boot/appleos.bin", O_RDONLY);
|
| 292 | + if (fd > 0)
|
| 293 | + {
|
| 294 | + size = filesize(fd);
|
| 295 | + if (size > 0)
|
| 296 | + {
|
| 297 | + void* buf = memalign(0x10, size);
|
| 298 | + if (buf)
|
| 299 | + {
|
| 300 | + if (read(fd, buf, size) == size) firmware = buf;
|
| 301 | + else free(buf);
|
| 302 | + }
|
| 303 | + }
|
| 304 | + close(fd);
|
| 305 | + }
|
| 306 | + if (!firmware)
|
| 307 | + {
|
| 308 | + rendertext(framebuf2, 7, 73, 176, 0xff3333ff, 0xa0000000, "Loading appleos.bin failed!");
|
| 309 | + rendertext(framebuf2, 7, 81, 176, 0xff3333ff, 0xa0000000, " Returning to main menu. ");
|
| 310 | + displaylcd(0, 0, 176, 132, framebuf2, 0, 0, 176);
|
| 311 | + sleep(5000000);
|
| 312 | + }
|
| 313 | + break;
|
| 314 | + }
|
| 315 | + case 2:
|
| 316 | + {
|
| 317 | + int i;
|
| 318 | + for (i = 2; i <= 52; i += 10)
|
| 319 | + {
|
| 320 | + if (i < 52)
|
| 321 | + ui->blend(176, 132, 50, framebuf, 0, 0, 176,
|
| 322 | + framebuf, 0, 0, 176, bg, 0, 0, 176);
|
| 323 | + else memcpy(framebuf, bg, 176 * 132 * 3);
|
| 324 | + ui->blit(154, MIN(47, i), 3, framebuf, 11, MAX(0, i - 47), 176,
|
| 325 | + rbxlogo, 0, MAX(0, 47 - i), 154);
|
| 326 | + displaylcd(0, 0, 176, 132, framebuf, 0, 0, 176);
|
| 327 | + }
|
225 | 328 | int fd = file_open("/.rockbox/rockbox.ipod", O_RDONLY);
|
226 | 329 | if (fd > 0)
|
227 | 330 | {
|
— | — | @@ -240,9 +343,9 @@ |
241 | 344 | }
|
242 | 345 | if (!firmware)
|
243 | 346 | {
|
244 | | - rendertext(framebuf, 76, 140, 320, 0xff3333ff, 0xa0000000, "Loading rockbox.ipod failed!");
|
245 | | - rendertext(framebuf, 76, 148, 320, 0xff3333ff, 0xa0000000, " Trying fallback image... ");
|
246 | | - displaylcd(0, 0, 320, 240, framebuf, 0, 0, 320);
|
| 347 | + rendertext(framebuf, 4, 73, 176, 0xff3333ff, 0xa0000000, "Loading rockbox.ipod failed!");
|
| 348 | + rendertext(framebuf, 4, 81, 176, 0xff3333ff, 0xa0000000, " Trying fallback image... ");
|
| 349 | + displaylcd(0, 0, 176, 132, framebuf, 0, 0, 132);
|
247 | 350 | sleep(5000000);
|
248 | 351 | size = bootflash_filesize("rockbox ");
|
249 | 352 | if (size > 0)
|
— | — | @@ -283,17 +386,17 @@ |
284 | 387 | }
|
285 | 388 | if (!firmware)
|
286 | 389 | {
|
287 | | - memcpy(framebuf, bg, 320 * 240 * 3);
|
288 | | - rendertext(framebuf, 91, 140, 320, 0xff3333ff, 0xa0000000, "Loading Rockbox failed!");
|
289 | | - rendertext(framebuf, 91, 148, 320, 0xff3333ff, 0xa0000000, "Returning to main menu.");
|
290 | | - displaylcd(0, 0, 320, 240, framebuf, 0, 0, 320);
|
| 390 | + memcpy(framebuf, bg, 176 * 132 * 3);
|
| 391 | + rendertext(framebuf, 19, 73, 176, 0xff3333ff, 0xa0000000, "Loading Rockbox failed!");
|
| 392 | + rendertext(framebuf, 19, 81, 176, 0xff3333ff, 0xa0000000, "Returning to main menu.");
|
| 393 | + displaylcd(0, 0, 176, 132, framebuf, 0, 0, 176);
|
291 | 394 | sleep(5000000);
|
292 | 395 | }
|
293 | 396 | break;
|
294 | 397 | }
|
295 | | - case 2:
|
| 398 | + case 3:
|
296 | 399 | goto leave;
|
297 | | - case 3:
|
| 400 | + case 4:
|
298 | 401 | size = bootflash_filesize("umsboot ");
|
299 | 402 | if (size > 0)
|
300 | 403 | {
|
— | — | @@ -326,25 +429,107 @@ |
327 | 430 | }
|
328 | 431 | if (!firmware)
|
329 | 432 | {
|
330 | | - memcpy(framebuf, bg, 320 * 240 * 3);
|
331 | | - rendertext(framebuf, 91, 140, 320, 0xff3333ff, 0xa0000000, "Loading UMSboot failed!");
|
332 | | - rendertext(framebuf, 91, 148, 320, 0xff3333ff, 0xa0000000, "Returning to main menu.");
|
333 | | - displaylcd(0, 0, 320, 240, framebuf, 0, 0, 320);
|
| 433 | + memcpy(framebuf, bg, 176 * 132 * 3);
|
| 434 | + rendertext(framebuf, 19, 73, 176, 0xff3333ff, 0xa0000000, "Loading UMSboot failed!");
|
| 435 | + rendertext(framebuf, 19, 81, 176, 0xff3333ff, 0xa0000000, "Returning to main menu.");
|
| 436 | + displaylcd(0, 0, 176, 132, framebuf, 0, 0, 132);
|
334 | 437 | sleep(5000000);
|
335 | 438 | }
|
336 | 439 | break;
|
| 440 | + case 5:
|
| 441 | + size = bootflash_filesize("diagmode");
|
| 442 | + if (size > 0)
|
| 443 | + {
|
| 444 | + void* buf = memalign(0x10, size);
|
| 445 | + if (buf)
|
| 446 | + {
|
| 447 | + bootflash_read("diagmode", buf, 0, size);
|
| 448 | + if (bootflash_attributes("diagmode") & 0x800)
|
| 449 | + {
|
| 450 | + void* buf2 = malloc(0x10000);
|
| 451 | + if (buf2)
|
| 452 | + {
|
| 453 | + if (!ucl_decompress(buf, size, buf2, (uint32_t*)&size))
|
| 454 | + {
|
| 455 | + free(buf);
|
| 456 | + buf = realloc(buf2, size);
|
| 457 | + if (!buf) buf = buf2;
|
| 458 | + firmware = buf;
|
| 459 | + }
|
| 460 | + else
|
| 461 | + {
|
| 462 | + free(buf2);
|
| 463 | + free(buf);
|
| 464 | + }
|
| 465 | + }
|
| 466 | + else free(buf);
|
| 467 | + }
|
| 468 | + else firmware = buf;
|
| 469 | + }
|
| 470 | + }
|
| 471 | + if (!firmware)
|
| 472 | + {
|
| 473 | + memcpy(framebuf, bg, 176 * 132 * 3);
|
| 474 | + rendertext(framebuf, 13, 73, 176, 0xff3333ff, 0xa0000000, "Loading diag mode failed!");
|
| 475 | + rendertext(framebuf, 13, 81, 176, 0xff3333ff, 0xa0000000, " Returning to main menu. ");
|
| 476 | + displaylcd(0, 0, 176, 132, framebuf, 0, 0, 176);
|
| 477 | + sleep(5000000);
|
| 478 | + }
|
| 479 | + break;
|
| 480 | + case 6:
|
| 481 | + size = bootflash_filesize("diskmode");
|
| 482 | + if (size > 0)
|
| 483 | + {
|
| 484 | + void* buf = memalign(0x10, size);
|
| 485 | + if (buf)
|
| 486 | + {
|
| 487 | + bootflash_read("diskmode", buf, 0, size);
|
| 488 | + if (bootflash_attributes("diskmode") & 0x800)
|
| 489 | + {
|
| 490 | + void* buf2 = malloc(0x10000);
|
| 491 | + if (buf2)
|
| 492 | + {
|
| 493 | + if (!ucl_decompress(buf, size, buf2, (uint32_t*)&size))
|
| 494 | + {
|
| 495 | + free(buf);
|
| 496 | + buf = realloc(buf2, size);
|
| 497 | + if (!buf) buf = buf2;
|
| 498 | + firmware = buf;
|
| 499 | + }
|
| 500 | + else
|
| 501 | + {
|
| 502 | + free(buf2);
|
| 503 | + free(buf);
|
| 504 | + }
|
| 505 | + }
|
| 506 | + else free(buf);
|
| 507 | + }
|
| 508 | + else firmware = buf;
|
| 509 | + }
|
| 510 | + }
|
| 511 | + if (!firmware)
|
| 512 | + {
|
| 513 | + memcpy(framebuf, bg, 176 * 132 * 3);
|
| 514 | + rendertext(framebuf, 13, 73, 176, 0xff3333ff, 0xa0000000, "Loading disk mode failed!");
|
| 515 | + rendertext(framebuf, 13, 81, 176, 0xff3333ff, 0xa0000000, " Returning to main menu. ");
|
| 516 | + displaylcd(0, 0, 176, 132, framebuf, 0, 0, 176);
|
| 517 | + sleep(5000000);
|
| 518 | + }
|
| 519 | + break;
|
337 | 520 | }
|
338 | 521 | }
|
339 | 522 | leave:
|
| 523 | + free(framebuf2);
|
340 | 524 | free(framebuf);
|
| 525 | + free(crapple);
|
341 | 526 | free(rbxlogo);
|
342 | 527 | free(icons);
|
343 | 528 | free(bg);
|
344 | 529 | release_library(libui);
|
| 530 | + release_library(libpng);
|
| 531 | + release_library(libboot);
|
345 | 532 | library_unload(libui);
|
346 | | - release_library(libpng);
|
347 | 533 | library_unload(libpng);
|
348 | | - release_library(libboot);
|
349 | 534 | library_unload(libboot);
|
350 | 535 | if (firmware)
|
351 | 536 | {
|
Index: apps/bootmenu-ipodnano2g/Makefile |
— | — | @@ -1,4 +1,4 @@ |
2 | | -NAME := bootmenu-ipodclassic
|
| 2 | +NAME := bootmenu-ipodnano2g
|
3 | 3 | STACKSIZE := 4096
|
4 | 4 | COMPRESS := true
|
5 | 5 |
|
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | OBJCOPY := $(CROSS)objcopy
|
22 | 22 | ELF2ECA := $(CROSS)elf2emcoreapp
|
23 | 23 |
|
24 | | -LIBINCLUDES := -I$(LIBPNGDIR)/export -I$(LIBUIDIR)/export
|
| 24 | +LIBINCLUDES := -I$(LIBBOOTDIR)/export -I$(LIBPNGDIR)/export -I$(LIBUIDIR)/export
|
25 | 25 |
|
26 | 26 | CFLAGS += -Os -fno-pie -fno-stack-protector -fomit-frame-pointer -I. -I$(EMCOREDIR)/export $(LIBINCLUDES) -ffunction-sections -fdata-sections -mcpu=arm940t -DARM_ARCH=4
|
27 | 27 | LDFLAGS += "$(shell $(CC) -print-libgcc-file-name)" --emit-relocs --gc-sections
|