1 ; vi:filetype=nasm ts=8 sts=8 sw=8:
8 REG_CRTC_STATUS equ 3dah
9 CRTC_VBLANK_BIT equ 08h
21 ; setup the spritesheet palette
22 mov esi, sprsheet_cmap
30 call set_palette_entry
34 ; force color 0 to black
37 call set_palette_entry
43 mov edi, FRAMEBUF_ADDR
51 mov esi, FRAMEBUF_ADDR
59 mov dx, REG_CRTC_STATUS
62 and al, CRTC_VBLANK_BIT
66 and al, CRTC_VBLANK_BIT
74 inc dx ; dx <- REG_DAC_DATA
87 ; slow_sprite(int id, int x, int y)
88 ; assumptions: 32x32, one after the other, 0 is transparent
95 mov eax, [ebp + 16] ; ax <- y
96 sub eax, 16 ; ax <- y - 16 (center sprite vertically)
100 add eax, ebx ; ax <- (y - 16) * 320
101 mov edi, [ebp + 12] ; di <- x
102 sub edi, 16 ; di <- x - 16 (center sprite horizontally)
103 add edi, eax ; di <- (y - 16) * 320 + (x - 16)
104 add edi, FRAMEBUF_ADDR
107 ; calculate sprite id offset (each spr is 32*32=1k)