forgot to gitignore
This commit is contained in:
parent
086bdfca2c
commit
be49deb44e
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
*.bin
|
||||
gfx/venv
|
||||
gfx/*.asm
|
BIN
gfx/cursor.bmp
Normal file
BIN
gfx/cursor.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 930 B |
18
gfx/cvbmp.py
Normal file
18
gfx/cvbmp.py
Normal file
|
@ -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} ')
|
21
gfx_util.asm
21
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
|
Loading…
Reference in a new issue