Support for custom projectile rendering

This commit is contained in:
blondie7575 2018-12-26 17:29:13 -07:00
parent b06048a9d9
commit c6d1fd00b2
7 changed files with 49 additions and 7 deletions

BIN
Art/014Stand.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

39
fan.s
View File

@ -58,9 +58,46 @@ updateFan:
sta projectileData+JD_STATIC,y sta projectileData+JD_STATIC,y
jsr endProjectile jsr endProjectile
; Now set up the stand
lda projectileData+GO_POSX,y
sta standGameObjectData+GO_POSX
lda projectileData+GO_POSY,y
sec
sbc #GAMEOBJECTHEIGHT
sta standGameObjectData+GO_POSY,y
updateFanDone: updateFanDone:
RESTORE_AXY RESTORE_AXY
rts rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; renderFan
;
; Y = Offset to projectile structure
;
renderFan:
SAVE_AXY
lda projectileData+JD_STATIC,y
beq renderFanDone ; Don't render the stand until we're static
; Render the stand under the fan
lda #standGameObjectData
sta PARAML0
lda #14
jsr renderGameObject
renderFanDone:
RESTORE_AXY
rts
; Fake game object for rendering the stand
standGameObjectData:
.word 40 ; X pos in pixels (from right terrain edge)
.word 38 ; Y pos in pixels (from bottom terrain edge)
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Saved background 64 bytes
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

Binary file not shown.

View File

@ -112,7 +112,7 @@ projectileTypes:
.word 12 ; Frame 2 .word 12 ; Frame 2
.addr deployFan ; Deploy .addr deployFan ; Deploy
.addr updateFan ; Update .addr updateFan ; Update
.addr 0 ; Render .addr renderFan ; Render
;.word ; Padding to 16-byte boundary (none needed) ;.word ; Padding to 16-byte boundary (none needed)
@ -687,7 +687,12 @@ renderProjectileFlat:
renderProjectileGoSprite: renderProjectileGoSprite:
jsr renderGameObject jsr renderGameObject
; Check for special deployment code
lda projectileTypes+PT_RENDER,x
beq renderProjectileDone
JSRA
renderProjectileDone: renderProjectileDone:
RESTORE_AXY RESTORE_AXY
rts rts

View File

@ -2,18 +2,18 @@
DrawSpriteBank : DrawSpriteBank :
ASL ; A=Sprite Number ($0000-$000D) ASL ; A=Sprite Number ($0000-$000E)
TAX ; Y=Target Screen Address ($2000-$9D00) TAX ; Y=Target Screen Address ($2000-$9D00)
LDA SpriteBankNum,X ; Relative Sprite Number Table LDA SpriteBankNum,X ; Relative Sprite Number Table
JMP (SpriteBankBank,X) ; Bank Number Table JMP (SpriteBankBank,X) ; Bank Number Table
SpriteBankNum : SpriteBankNum :
.dbyt $0100,$0000,$0900,$0400,$0500,$0800,$0C00,$0B00 .dbyt $0100,$0000,$0A00,$0500,$0600,$0900,$0D00,$0C00
.dbyt $0700,$0600,$0A00,$0D00,$0200,$0300 .dbyt $0800,$0700,$0B00,$0E00,$0200,$0300,$0400
SpriteBankBank : SpriteBankBank :
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00 .addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00 .addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
SpriteBankBank00 : SpriteBankBank00 :
JSL $AA0000 JSL $AA0000