.def _gfx_Or_TransparentSprite_NoClip mpLcdRange .equ 0E30000h lcdLpbase .equ 0014h mpLcdLpbase .equ mpLcdRange + lcdLpbase ti_lcdWidth .equ 320 CurrentBuffer .equ mpLcdLpbase segment code _gfx_Or_TransparentSprite_NoClip: _draw_gfx_or: ; Draws a transparent sprite to the current buffer ; Arguments: ; arg0 : Pointer to sprite ; arg1 : X coordinate ; arg2 : Y coordinate ; Returns: ; None ld iy,0 add iy,sp ld hl,(iy+6) ; hl = x coordinate ld c,(iy+9) ; c = y coordinate ld iy,(iy+3) ; iy -> sprite struct ld de,(CurrentBuffer) add hl,de ld b,ti_lcdWidth / 2 mlt bc add hl,bc add hl,bc ; hl -> place to draw push hl ld a,(iy+0) ld (_draw_gfx_or__loop+1),a ld a,(iy+1) lea de,iy+2 pop iy push ix ld ixh,a ; ixh = height of sprite _draw_gfx_or__loop: ld b,0 lea hl,iy _draw_gfx_or_plot: ; loop to handle transparent plotting ld a,(de) or a jr z,_draw_gfx_or_plot__next or (hl) ld (hl),a _draw_gfx_or_plot__next: inc hl inc de djnz _draw_gfx_or_plot ld bc,ti_lcdWidth add iy,bc dec ixh ; loop for height jr nz,_draw_gfx_or__loop pop ix ; restore stack pointer ret