barclock: Initial commit

This commit is contained in:
Ry 2022-09-09 16:39:08 -07:00
parent ee2103eda5
commit 7b113056f7
3 changed files with 50 additions and 0 deletions

46
barclock/main.asm Normal file
View File

@ -0,0 +1,46 @@
; menu bar clock
loop:
; if no time has passed, don't bother redrawing the clock
in r0, 0x80000705
cmp.8 r0, [second_counter]
ifz jmp loop_end
mov.8 [second_counter], r0
; hour
in r0, 0x80000703
mov r1, 584
cmp r0, 12
ifgt call afternoon
mov r2, 0
mov r3, 0xFFFFFFFF
mov r4, 0xFF3F3F3F
mov r5, 30
call draw_decimal_to_overlay
; separator
movz.8 r0, [second_counter]
rem.8 r0, 2
cmp r0, 0
ifz mov r0, ':'
ifnz mov r0, ' '
call draw_font_tile_to_overlay
add r1, 8
; minute
in r0, 0x80000704
call draw_decimal_to_overlay
loop_end:
call yield_task
rjmp loop
afternoon:
sub r0, 12
add r1, 8
ret
second_counter: data.8 0
#include "../../fox32rom/fox32rom.def"
#include "../fox32os.def"

View File

@ -1 +1,2 @@
launcherfxf launcherfxf
barclockfxf

View File

@ -16,6 +16,9 @@ echo "assembling kernel"
echo "assembling launcher" echo "assembling launcher"
../fox32asm/target/release/fox32asm launcher/main.asm base_image/launcher.fxf ../fox32asm/target/release/fox32asm launcher/main.asm base_image/launcher.fxf
echo "assembling barclock"
../fox32asm/target/release/fox32asm barclock/main.asm base_image/barclock.fxf
echo "creating wallpapr.raw" echo "creating wallpapr.raw"
../tools/gfx2inc/target/release/gfx2inc 640 480 launcher/wallpaper.png launcher/wallpaper.inc ../tools/gfx2inc/target/release/gfx2inc 640 480 launcher/wallpaper.png launcher/wallpaper.inc
../fox32asm/target/release/fox32asm launcher/wallpaper.inc base_image/wallpapr.raw ../fox32asm/target/release/fox32asm launcher/wallpaper.inc base_image/wallpapr.raw