barclock: Initial commit
This commit is contained in:
parent
ee2103eda5
commit
7b113056f7
46
barclock/main.asm
Normal file
46
barclock/main.asm
Normal 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"
|
|
@ -1 +1,2 @@
|
|||
launcherfxf
|
||||
barclockfxf
|
||||
|
|
3
build.sh
3
build.sh
|
@ -16,6 +16,9 @@ echo "assembling kernel"
|
|||
echo "assembling launcher"
|
||||
../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"
|
||||
../tools/gfx2inc/target/release/gfx2inc 640 480 launcher/wallpaper.png launcher/wallpaper.inc
|
||||
../fox32asm/target/release/fox32asm launcher/wallpaper.inc base_image/wallpapr.raw
|
||||
|
|
Loading…
Reference in New Issue
Block a user