dos33fsprogs/games/peasant/hgr_1x5_sprite.s

42 lines
578 B
ArmAsm
Raw Normal View History

2021-08-12 18:07:19 +00:00
;======================
; hgr 1x5 draw sprite
;======================
; over-writes
; SPRITE in INL/INH
; Location at CURSOR_X CURSOR_Y*7
; X, Y, A trashed
hgr_draw_sprite_1x5:
; set up pointers
lda INL
sta h1x5_smc1+1
lda INH
sta h1x5_smc1+2
ldx #0
hgr_1x5_sprite_yloop:
2021-08-25 00:42:11 +00:00
txa ; row
2021-08-12 18:07:19 +00:00
clc
2021-08-25 00:42:11 +00:00
adc CURSOR_Y ; add in y offset
2021-08-12 18:07:19 +00:00
2021-08-25 00:42:11 +00:00
; calc GBASL/GBASH from lookup table
2021-08-25 00:42:11 +00:00
tay
lda hposn_low,Y
sta GBASL
2021-08-25 00:42:11 +00:00
lda hposn_high,Y
sta GBASH
2021-08-12 18:07:19 +00:00
ldy CURSOR_X
h1x5_smc1:
lda $D000,X ; not $0000 or it will make it ZP
sta (GBASL),Y
inx
cpx #5
bne hgr_1x5_sprite_yloop
rts