A86: sprite
[Prev][Next][Index][Thread]
A86: sprite
am i doing this right? because i get garbage when i do this...
#include "asm86.h"
#INCLUDE "TI86ASM.INC"
.org $D748
call _clrLCD
ld b,(0)
ld c,(0)
ld hl,(pic)
call DrawPic
ret
; IN : D = y (0-7 inclusive)
; E = x (0-15 inclusive)
; HL-> sprite
;
; OUT: AF, BC, DE, HL, IX modified
DrawPic:
push hl
pop ix ; ix-> sprite
srl d ; de = 128y+x (16 bytes/row, 8 rows)
rra
and $80
or e ; add x offset (remember x <= 15)
ld e,a
ld hl,$FC00 ; hl-> vid mem
add hl,de ; hl-> vid mem + offset
ld b,8 ; initialize loop counter
ld de,$0010 ; initialize line increment
; originally 30b/126t to this point
; now 19b/90t to this point
DrawPicLoop:
ld a,(ix+0) ; get byte from sprite
ld (hl),a ; put byte on screen
inc ix ; move to next byte in sprite
add hl,de ; move to next line on screen
; originally 10b/66t inside loop
; now 7b/47t inside loop
djnz DrawPicLoop
ret
pic:
.db 8,8
.db %00000000
.db %11111111
.db %00000000
.db %11111111
.db %00000000
.db %11111111
.db %00000000
.db %11111111
.end
.end