mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2025-01-30 06:31:55 +00:00
Fix sprite stamp rendering for 8x16 and 16x8 sprites
This commit is contained in:
parent
217b1a95f5
commit
3063ab88f9
@ -208,10 +208,10 @@ TILE_CTRL_MASK equ $FE00
|
||||
|
||||
; Sprite constants
|
||||
SPRITE_HIDE equ $2000
|
||||
SPRITE_16X16 equ $1800
|
||||
SPRITE_16X8 equ $1000
|
||||
SPRITE_8X16 equ $0800
|
||||
SPRITE_8X8 equ $0000
|
||||
SPRITE_16X16 equ $1800 ; 16 pixels wide x 16 pixels tall
|
||||
SPRITE_16X8 equ $1000 ; 16 pixels wide x 8 pixels tall
|
||||
SPRITE_8X16 equ $0800 ; 8 pixels wide x 16 pixels tall
|
||||
SPRITE_8X8 equ $0000 ; 8 pixels wide x 8 pixels tall
|
||||
SPRITE_VFLIP equ $0400
|
||||
SPRITE_HFLIP equ $0200
|
||||
|
||||
|
@ -63,10 +63,10 @@ _DrawSpriteStamp
|
||||
_DrawSprite
|
||||
jmp (draw_sprite,x)
|
||||
|
||||
draw_sprite dw draw_8x8,draw_8x8h,draw_8x8v,draw_8x8hv
|
||||
dw draw_8x16,draw_8x16h,draw_8x16v,draw_8x16hv
|
||||
dw draw_16x8,draw_16x8h,draw_16x8v,draw_16x8hv
|
||||
dw draw_16x16,draw_16x16h,draw_16x16v,draw_16x16hv
|
||||
draw_sprite dw draw_8x8,draw_8x8h,draw_8x8v,draw_8x8hv ; 8 wide x 8 tall
|
||||
dw draw_8x16,draw_8x16h,draw_8x16v,draw_8x16hv ; 8 wide x 16 tall
|
||||
dw draw_16x8,draw_16x8h,draw_16x8v,draw_16x8hv ; 16 wide by 8 tall
|
||||
dw draw_16x16,draw_16x16h,draw_16x16v,draw_16x16hv ; 16 wide by 16 tall
|
||||
|
||||
dw :rtn,:rtn,:rtn,:rtn ; hidden bit is set
|
||||
dw :rtn,:rtn,:rtn,:rtn
|
||||
@ -75,17 +75,30 @@ draw_sprite dw draw_8x8,draw_8x8h,draw_8x8v,draw_8x8hv
|
||||
:rtn rts
|
||||
|
||||
draw_8x8
|
||||
draw_8x8h
|
||||
tax
|
||||
jmp _DrawTile8x8
|
||||
|
||||
draw_8x8h
|
||||
tax
|
||||
clc
|
||||
tya
|
||||
adc #64
|
||||
tay
|
||||
jmp _DrawTile8x8
|
||||
|
||||
draw_8x8v
|
||||
draw_8x8hv
|
||||
tax
|
||||
jmp _DrawTile8x8V
|
||||
|
||||
draw_8x8hv
|
||||
tax
|
||||
clc
|
||||
tya
|
||||
adc #64
|
||||
tay
|
||||
jmp _DrawTile8x8V
|
||||
|
||||
draw_8x16
|
||||
draw_8x16h
|
||||
tax
|
||||
jsr _DrawTile8x8
|
||||
clc
|
||||
@ -97,17 +110,51 @@ draw_8x16h
|
||||
tay
|
||||
jmp _DrawTile8x8
|
||||
|
||||
draw_8x16v
|
||||
draw_8x16hv
|
||||
draw_8x16h
|
||||
tax
|
||||
jsr _DrawTile8x8V
|
||||
clc
|
||||
tya
|
||||
adc #64
|
||||
tay
|
||||
jsr _DrawTile8x8
|
||||
clc
|
||||
txa
|
||||
adc #{8*SPRITE_PLANE_SPAN}
|
||||
tax
|
||||
tya
|
||||
adc #{128*32} ; 32 tiles to the next vertical one, each tile is 128 bytes
|
||||
tay
|
||||
jmp _DrawTile8x8
|
||||
|
||||
draw_8x16v
|
||||
clc
|
||||
tax
|
||||
tya
|
||||
pha
|
||||
adc #{128*32}
|
||||
tay
|
||||
jsr _DrawTile8x8V
|
||||
clc
|
||||
txa
|
||||
adc #{8*SPRITE_PLANE_SPAN}
|
||||
tax
|
||||
ply
|
||||
jmp _DrawTile8x8V
|
||||
|
||||
draw_8x16hv
|
||||
clc
|
||||
tax
|
||||
tya
|
||||
adc #64
|
||||
pha
|
||||
adc #{128*32}
|
||||
tay
|
||||
jsr _DrawTile8x8V
|
||||
clc
|
||||
txa
|
||||
adc #{8*SPRITE_PLANE_SPAN}
|
||||
tax
|
||||
ply
|
||||
jmp _DrawTile8x8V
|
||||
|
||||
draw_16x8
|
||||
@ -126,6 +173,7 @@ draw_16x8h
|
||||
clc
|
||||
tax
|
||||
tya
|
||||
adc #64
|
||||
pha
|
||||
adc #128
|
||||
tay
|
||||
@ -152,6 +200,7 @@ draw_16x8hv
|
||||
clc
|
||||
tax
|
||||
tya
|
||||
adc #64
|
||||
pha
|
||||
adc #128
|
||||
tay
|
||||
|
Loading…
x
Reference in New Issue
Block a user