From be49deb44ef47955f41f2bbcd0093ddda028f230 Mon Sep 17 00:00:00 2001 From: maelstrom Date: Thu, 25 Jul 2024 20:28:01 +0300 Subject: [PATCH] forgot to gitignore --- .gitignore | 3 +++ gfx/cursor.bmp | Bin 0 -> 930 bytes gfx/cvbmp.py | 18 ++++++++++++++++++ gfx_util.asm | 21 +++++++++++++++++++++ main.bin | Bin 810 -> 0 bytes 5 files changed, 42 insertions(+) create mode 100644 .gitignore create mode 100644 gfx/cursor.bmp create mode 100644 gfx/cvbmp.py delete mode 100644 main.bin 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 0000000000000000000000000000000000000000..665733671e7ad322b608c1d26cd97c6aef6981cc GIT binary patch literal 930 zcma*jF%H5o3ZzLO5J;iE=(+3g_RRxN~TkHj`d5;-2-r{(^9u@kN5DBLIMv~DB@@tnQa zv-F-TXR3=@ehVw_+RA>b=6NW;|5LMc=()CZp0%!JYp!Nn&RWlvw&!Rgj#g_VH;MrU AqW}N^ literal 0 HcmV?d00001 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 6bfd5a093a4036ee547c8e1c68e3628e83f3d0ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 810 zcmdnOw1IIW(^iIU47(W^`ws7BU^pvW#QKVXfq`+KVa*FBhS&eL@U7uEP|A4ttibDU zum8Dt274>G1_k*CSt+|SGZxrRl~%>&SC)422|8}QqwS%K)+T)~@} zfoww{`{Lu~gN(0lfK3CseJ2;gE(V70ADa&u1OXk^{DYzNP4jEU2(UwcGn9S?Dg+r< z!WFPV7bF<*{q~E)Aj>*$?0&)g{c-2T&O=+;HZYtOO+4(8nv;{Sqfnk-l#`;UVCBL9 E08u2aVgLXD