X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgfx.asm;h=ced086302fe11c9ac1c5025d81cd6a322e040839;hb=3ec4a3e6d73d15500e48c87f31f2193603e94d56;hp=796ede04b4e17acde19f78b7bc879510a6080bc4;hpb=2cef53ae69622dc995fa0f4ac7a6d793684b4403;p=ld45_start_nothing diff --git a/src/gfx.asm b/src/gfx.asm index 796ede0..ced0863 100644 --- a/src/gfx.asm +++ b/src/gfx.asm @@ -1,24 +1,9 @@ ; vi:filetype=nasm ts=8 sts=8 sw=8: -; -; list of functions -; ----------------- -; init_gfx -; initializes the video hardware and graphics routines -; clear -; clears the framebuffer (not vmem) -; clobbers: eax, ecx, edi -; swap_buffers -; copies the framebuffer to video memory -; clobbers: eax, ecx, edi, esi -; wait_vsync -; clobbers: al, dx -; set_palette_entry(idx[al], r[ah], g[bl], b[bh]) -; colors are 0-255 bits 32 section .text -VIDMEM_ADDR equ 0a0000h -FRAMEBUF_ADDR equ 090000h +%define GFX_ASM_ +%include "gfx.inc" REG_CRTC_STATUS equ 3dah CRTC_VBLANK_BIT equ 08h @@ -26,9 +11,8 @@ CRTC_VBLANK_BIT equ 08h REG_DAC_ADDR equ 3c8h REG_DAC_DATA equ 3c9h + extern sprsheet extern sprsheet_cmap - extern sprsheet_tiles - global init_gfx init_gfx: @@ -46,8 +30,13 @@ init_gfx: call set_palette_entry inc cl jnz .cmaploop - ret + ; force color 0 to black + xor ax, ax + xor bx, bx + call set_palette_entry + + ret global clear clear: @@ -114,7 +103,7 @@ slow_sprite: add edi, eax ; di <- (y - 16) * 320 + (x - 16) add edi, FRAMEBUF_ADDR - mov esi, sprsheet_tiles + mov esi, sprsheet ; calculate sprite id offset (each spr is 32*32=1k) mov eax, [ebp + 8] shl eax, 10