| Index: apps/bootmenu-ipodclassic/main.c | 
| — | — | @@ -348,11 +348,22 @@ | 
| 349 | 349 |  | 
| 350 | 350 | bool mainchooser_preblit(struct chooser_data* data) | 
| 351 | 351 | { | 
| 352 |  | -    char buf[4];
 | 
|  | 352 | +    char buf[6]; | 
|  | 353 | +    struct rtc_datetime dt; | 
|  | 354 | +    rtc_read_datetime(&dt); | 
|  | 355 | +    snprintf(buf, sizeof(buf), "%02d:%02d", dt.hour, dt.minute); | 
|  | 356 | +    // clock | 
|  | 357 | +    rendertext(framebuf, 287, 4, 320, 0xffffcccc, 0, buf); | 
| 353 | 358 | struct chooser_action_handler_wheel_data* adata; | 
| 354 | 359 | adata = (struct chooser_action_handler_wheel_data*)(data->actionhandlerdata); | 
| 355 | 360 | snprintf(buf, sizeof(buf), "%3d", adata->timeout_remaining / 1000000); | 
| 356 |  | -    rendertext(framebuf, 302, 232, 320, 0xffffcccc, 0, buf);
 | 
|  | 361 | +    // remaining time | 
|  | 362 | +    rendertext(framebuf, 299, 229, 320, 0xffffcccc, 0, buf); | 
|  | 363 | +    unsigned int batt_level = 22 * read_battery_mwh_current(0) / read_battery_mwh_full(0); | 
|  | 364 | +    // remaining battery level | 
|  | 365 | +    ui->blendcolor(batt_level, 6, 0xc0ffcccc, framebuf, 5, 5, 320, framebuf, 5, 5, 320); | 
|  | 366 | +    // background of the rest space | 
|  | 367 | +    ui->blendcolor(22 - batt_level, 6, 0x40000000, framebuf, 5 + batt_level, 5, 320, framebuf, 5 + batt_level, 5, 320); | 
| 357 | 368 | return false; | 
| 358 | 369 | } | 
| 359 | 370 |  | 
| — | — | @@ -543,6 +554,17 @@ | 
| 544 | 555 | boot = (struct libboot_api*)libboot->api; | 
| 545 | 556 | struct emcorelib_header* libui = loadlib(LIBUI_IDENTIFIER, LIBUI_API_VERSION, "libui   "); | 
| 546 | 557 | ui = (struct libui_api*)libui->api; | 
|  | 558 | +    // draw the battery meter box | 
|  | 559 | +    // top line | 
|  | 560 | +    ui->blendcolor(24, 1, 0xffffcccc, bg, 4, 4, 320, bg, 4, 4, 320); | 
|  | 561 | +    // bottom line | 
|  | 562 | +    ui->blendcolor(24, 1, 0xffffcccc, bg, 4, 11, 320, bg, 4, 11, 320); | 
|  | 563 | +    // left line | 
|  | 564 | +    ui->blendcolor(1, 6, 0xffffcccc, bg, 4, 5, 320, bg, 4, 5, 320); | 
|  | 565 | +    // right line | 
|  | 566 | +    ui->blendcolor(1, 6, 0xffffcccc, bg, 27, 5, 320, bg, 27, 5, 320); | 
|  | 567 | +    // tip - right | 
|  | 568 | +    ui->blendcolor(1, 4, 0xffffcccc, bg, 28, 6, 320, bg, 28, 6, 320); | 
| 547 | 569 | framebuf = malloc(320 * 240 * 3); | 
| 548 | 570 | if (!framebuf) panicf(PANIC_KILLTHREAD, "Could not allocate framebuffer!"); | 
| 549 | 571 |  | 
| Index: apps/bootmenu-ipodnano2g/main.c | 
| — | — | @@ -418,11 +418,22 @@ | 
| 419 | 419 |  | 
| 420 | 420 | bool mainchooser_preblit(struct chooser_data* data) | 
| 421 | 421 | { | 
| 422 |  | -    char buf[4];
 | 
|  | 422 | +    char buf[6]; | 
|  | 423 | +    struct rtc_datetime dt; | 
|  | 424 | +    rtc_read_datetime(&dt); | 
|  | 425 | +    snprintf(buf, sizeof(buf), "%02d:%02d", dt.hour, dt.minute); | 
|  | 426 | +    // clock | 
|  | 427 | +    rendertext(framebuf, 143, 4, 176, 0xffffcccc, 0, buf); | 
| 423 | 428 | struct chooser_action_handler_wheel_data* adata; | 
| 424 | 429 | adata = (struct chooser_action_handler_wheel_data*)(data->actionhandlerdata); | 
| 425 | 430 | snprintf(buf, sizeof(buf), "%3d", adata->timeout_remaining / 1000000); | 
| 426 |  | -    rendertext(framebuf, 158, 124, 176, 0xffffcccc, 0, buf);
 | 
|  | 431 | +    // remaining time | 
|  | 432 | +    rendertext(framebuf, 155, 121, 176, 0xffffcccc, 0, buf); | 
|  | 433 | +    unsigned int batt_level = 22 * read_battery_mwh_current(0) / read_battery_mwh_full(0); | 
|  | 434 | +    // remaining battery level | 
|  | 435 | +    ui->blendcolor(batt_level, 6, 0xc0ffcccc, framebuf, 5, 5, 176, framebuf, 5, 5, 176); | 
|  | 436 | +    // background of the rest space | 
|  | 437 | +    ui->blendcolor(22 - batt_level, 6, 0x40000000, framebuf, 5 + batt_level, 5, 176, framebuf, 5 + batt_level, 5, 176); | 
| 427 | 438 | return false; | 
| 428 | 439 | } | 
| 429 | 440 |  | 
| — | — | @@ -673,6 +684,17 @@ | 
| 674 | 685 | boot = (struct libboot_api*)libboot->api; | 
| 675 | 686 | struct emcorelib_header* libui = loadlib(LIBUI_IDENTIFIER, LIBUI_API_VERSION, "libui   "); | 
| 676 | 687 | ui = (struct libui_api*)libui->api; | 
|  | 688 | +    // draw the battery meter box | 
|  | 689 | +    // top line | 
|  | 690 | +    ui->blendcolor(24, 1, 0xffffcccc, bg, 4, 4, 176, bg, 4, 4, 176); | 
|  | 691 | +    // bottom line | 
|  | 692 | +    ui->blendcolor(24, 1, 0xffffcccc, bg, 4, 11, 176, bg, 4, 11, 176); | 
|  | 693 | +    // left line | 
|  | 694 | +    ui->blendcolor(1, 6, 0xffffcccc, bg, 4, 5, 176, bg, 4, 5, 176); | 
|  | 695 | +    // right line | 
|  | 696 | +    ui->blendcolor(1, 6, 0xffffcccc, bg, 27, 5, 176, bg, 27, 5, 176); | 
|  | 697 | +    // tip - right | 
|  | 698 | +    ui->blendcolor(1, 4, 0xffffcccc, bg, 28, 6, 176, bg, 28, 6, 176); | 
| 677 | 699 | framebuf = malloc(176 * 132 * 3); | 
| 678 | 700 | if (!framebuf) panicf(PANIC_KILLTHREAD, "Could not allocate framebuffer!"); | 
| 679 | 701 | framebuf2 = malloc(176 * 132 * 3); | 
| Index: apps/beeper/convert.php | 
| — | — | @@ -82,6 +82,7 @@ | 
| 83 | 83 | '4+1/2' => 1.5, | 
| 84 | 84 | '4' => 1, | 
| 85 | 85 | '8' => .5, | 
|  | 86 | +    '8.5' => .75, | 
| 86 | 87 | '8+1/2+1/4' => .3 + 5/4, | 
| 87 | 88 | '16' => .25, | 
| 88 | 89 | '32' => .125, |