diff --git a/.gitignore b/.gitignore index f26ab64..a83872b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ **/.vscode/ **/*.fxf -**/wallpaper.inc -**/wallpapr.raw +**/bg.inc +**/bg.raw **/fox32os.img diff --git a/bg/bg.png b/bg/bg.png new file mode 100644 index 0000000..5e668f0 Binary files /dev/null and b/bg/bg.png differ diff --git a/bg/main.asm b/bg/main.asm new file mode 100644 index 0000000..28e28e4 --- /dev/null +++ b/bg/main.asm @@ -0,0 +1,24 @@ +; background image utility + + ; open the background file and draw it + ; if the file can't be opened, then just exit + mov r0, bg_file_name + mov r1, 0 + mov r2, bg_file_struct + call open + cmp r0, 0 + ifz call end_current_task + + ; read the background file directly into the background framebuffer + mov r0, 1228800 ; 640x480x4 + mov r1, bg_file_struct + mov r2, 0x02000000 + call read + + call end_current_task + +bg_file_name: data.str "bg raw" +bg_file_struct: data.fill 0, 8 + + #include "../../fox32rom/fox32rom.def" + #include "../fox32os.def" diff --git a/build.sh b/build.sh index 9a8ce19..b454be9 100755 --- a/build.sh +++ b/build.sh @@ -28,9 +28,12 @@ echo "assembling barclock" echo "assembling terminal" ../fox32asm/target/release/fox32asm terminal/main.asm base_image/terminal.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 +echo "assembling bg" +../fox32asm/target/release/fox32asm bg/main.asm base_image/bg.fxf + +echo "creating bg.raw" +../tools/gfx2inc/target/release/gfx2inc 640 480 bg/bg.png bg/bg.inc +../fox32asm/target/release/fox32asm bg/bg.inc base_image/bg.raw echo "adding files to fox32os.img" cd base_image