diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e9b363 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.bin +gfx/venv +gfx/*.asm \ No newline at end of file diff --git a/gfx/cursor.bmp b/gfx/cursor.bmp new file mode 100644 index 0000000..6657336 Binary files /dev/null and b/gfx/cursor.bmp differ diff --git a/gfx/cvbmp.py b/gfx/cvbmp.py new file mode 100644 index 0000000..c0c4031 --- /dev/null +++ b/gfx/cvbmp.py @@ -0,0 +1,18 @@ +from PIL import Image +im = Image.open('cursor.bmp') + +pixels = list(im.getdata()) +w, h = im.size + +with open('gfxd_cursor.asm', 'w') as f: + f.write(f'gfxd_cursor_dim: db {w} db {h}\n') + f.write('gfxd_cursor: ') + + for px in pixels: + if px == (255, 255, 255, 255): + c = '0x0F' + elif px == (0, 0, 0, 255): + c = '0x00' + else: + c = '0xFF' + f.write(f'db {c} ') \ No newline at end of file diff --git a/gfx_util.asm b/gfx_util.asm index e69de29..428d1b7 100644 --- a/gfx_util.asm +++ b/gfx_util.asm @@ -0,0 +1,21 @@ +VMEM equ 0xA000 + +; di = y*320+x +; ah = reserved +; al = color +; bx = width +; cx = height +gfx_rect: + pusha + + ; Set es to VMEM + push VMEM + pop es + + .loop: + mov [es:di], al + + jmp .loop + + popa + ret \ No newline at end of file diff --git a/main.bin b/main.bin deleted file mode 100644 index 6bfd5a0..0000000 Binary files a/main.bin and /dev/null differ