2017-08-13 22:36:12 +00:00
|
|
|
;
|
|
|
|
; gameobject
|
|
|
|
; Code and data structures related to the game objects
|
|
|
|
;
|
|
|
|
; Created by Quinn Dunki on 8/13/17
|
|
|
|
;
|
|
|
|
|
2017-09-30 00:53:05 +00:00
|
|
|
GAMEOBJECTWIDTH = 16
|
|
|
|
GAMEOBJECTHEIGHT = 16
|
2017-08-13 22:36:12 +00:00
|
|
|
|
2017-09-02 19:32:40 +00:00
|
|
|
; Base class sample:
|
|
|
|
;gameobjectData:
|
|
|
|
; .word 40 ; X pos in pixels (from right terrain edge)
|
|
|
|
; .word 38 ; Y pos in pixels (from bottom terrain edge)
|
2017-09-30 00:53:05 +00:00
|
|
|
; .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
|
2017-08-27 05:34:49 +00:00
|
|
|
|
|
|
|
GO_POSX = 0 ; Byte offsets into gameobject data structure
|
|
|
|
GO_POSY = 2
|
|
|
|
GO_BACKGROUND = 4
|
2017-08-13 22:36:12 +00:00
|
|
|
|
|
|
|
|
2017-09-02 19:32:40 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; placeGameObjectOnTerrain
|
|
|
|
;
|
|
|
|
; PARAML0 = Pointer to gameobject data
|
|
|
|
; Trashes SCRATCHL
|
|
|
|
;
|
|
|
|
placeGameObjectOnTerrain:
|
|
|
|
SAVE_AY
|
|
|
|
|
|
|
|
ldy #GO_POSX
|
|
|
|
lda (PARAML0),y
|
|
|
|
clc ; Map into reversed terrain X space
|
|
|
|
adc #GAMEOBJECTWIDTH
|
|
|
|
sta SCRATCHL
|
|
|
|
lda #TERRAINWIDTH
|
|
|
|
sec
|
|
|
|
sbc SCRATCHL
|
|
|
|
|
2017-09-13 16:56:34 +00:00
|
|
|
and #$fffe ; Force even
|
2017-09-02 19:32:40 +00:00
|
|
|
tay
|
|
|
|
lda terrainData,y
|
|
|
|
|
|
|
|
clc
|
|
|
|
adc #GAMEOBJECTHEIGHT
|
|
|
|
ldy #GO_POSY
|
|
|
|
sta (PARAML0),y
|
|
|
|
|
|
|
|
RESTORE_AY
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
2017-08-13 22:36:12 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2017-10-27 03:15:52 +00:00
|
|
|
; vramPtr
|
2017-08-13 22:36:12 +00:00
|
|
|
;
|
2017-10-27 03:15:52 +00:00
|
|
|
; PARAML0 = Pointer to gameobject data
|
2017-10-19 19:59:24 +00:00
|
|
|
; X => Offset to upper left corner of VRAM, or -1 if offscreen
|
2017-08-13 22:36:12 +00:00
|
|
|
;
|
2017-10-27 03:15:52 +00:00
|
|
|
; Trashes SCRATCHL
|
2017-10-19 19:59:24 +00:00
|
|
|
;
|
2017-10-27 03:15:52 +00:00
|
|
|
vramPtr:
|
|
|
|
SAVE_AY
|
2017-08-13 22:36:12 +00:00
|
|
|
|
|
|
|
; X
|
2017-10-27 03:15:52 +00:00
|
|
|
ldy #GO_POSX
|
|
|
|
lda (PARAML0),y
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-08-13 22:36:12 +00:00
|
|
|
lsr
|
2017-09-02 19:32:40 +00:00
|
|
|
cmp leftScreenEdge
|
2017-10-19 19:59:24 +00:00
|
|
|
bmi vramPtrSkip ; Gameobject is off left edge of screen
|
2017-09-02 19:32:40 +00:00
|
|
|
cmp rightScreenEdge
|
2017-10-19 19:59:24 +00:00
|
|
|
bpl vramPtrSkip ; Gameobject is off right edge of screen
|
2017-09-02 19:32:40 +00:00
|
|
|
|
|
|
|
sec ; Convert byte x-pos to screenspace
|
|
|
|
sbc leftScreenEdge
|
2017-08-13 22:36:12 +00:00
|
|
|
sta SCRATCHL
|
|
|
|
|
|
|
|
; Y
|
|
|
|
sec
|
|
|
|
lda #200
|
2017-10-27 03:15:52 +00:00
|
|
|
ldy #GO_POSY
|
|
|
|
sbc (PARAML0),y
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
bmi vramPtrSkip ; Gameobject is off top edge of screen
|
2017-08-13 22:36:12 +00:00
|
|
|
cmp #200 - GAMEOBJECTHEIGHT
|
2017-10-19 19:59:24 +00:00
|
|
|
bpl vramPtrSkip ; Gameobject is off bottom edge of screen
|
2017-08-13 22:36:12 +00:00
|
|
|
|
|
|
|
asl
|
|
|
|
tax
|
|
|
|
lda vramYOffset,x
|
|
|
|
clc
|
|
|
|
adc SCRATCHL
|
2017-09-30 00:53:05 +00:00
|
|
|
adc #$2000
|
|
|
|
tax ; X now contains the bank address of the upper left corner
|
2017-10-19 19:59:24 +00:00
|
|
|
bra vramPtrDone
|
|
|
|
|
|
|
|
vramPtrSkip:
|
|
|
|
ldx #-1
|
|
|
|
|
|
|
|
vramPtrDone:
|
2017-10-27 03:15:52 +00:00
|
|
|
RESTORE_AY
|
|
|
|
rts
|
2017-10-19 19:59:24 +00:00
|
|
|
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2017-10-27 03:15:52 +00:00
|
|
|
; renderGameObject
|
|
|
|
;
|
|
|
|
; PARAML0 = Pointer to gameobject data
|
|
|
|
; A = Sprite index
|
2017-10-19 19:59:24 +00:00
|
|
|
;
|
|
|
|
; Trashes SCRATCHL
|
|
|
|
;
|
2017-10-27 03:15:52 +00:00
|
|
|
renderGameObject:
|
|
|
|
SAVE_XY
|
2017-10-19 19:59:24 +00:00
|
|
|
|
|
|
|
; Find gameobject location in video memory
|
2017-10-27 03:15:52 +00:00
|
|
|
jsr vramPtr
|
2017-10-19 19:59:24 +00:00
|
|
|
cpx #0
|
|
|
|
bmi renderGameobjectDone
|
|
|
|
|
|
|
|
; Call compiled sprite code
|
|
|
|
txy
|
|
|
|
clc
|
|
|
|
jsr DrawSpriteBank
|
|
|
|
|
|
|
|
renderGameobjectDone:
|
2017-10-27 03:15:52 +00:00
|
|
|
RESTORE_XY
|
|
|
|
rts
|
2017-10-19 19:59:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; protectGameObject
|
|
|
|
;
|
|
|
|
; Saves background behind this game object
|
2017-10-27 03:15:52 +00:00
|
|
|
; A = Pointer to gameobject background data
|
2017-10-19 19:59:24 +00:00
|
|
|
; X = VRAM position of upper left of game object
|
|
|
|
;
|
|
|
|
; Trashes SCRATCHL
|
|
|
|
;
|
|
|
|
protectGameObject:
|
|
|
|
phy
|
|
|
|
ldy #0
|
2017-08-27 05:34:49 +00:00
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SCRATCHL
|
2017-08-27 05:34:49 +00:00
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*2+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*2+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*2+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*3,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*3+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*3+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*3+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*4+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*4+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*4+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*5,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*5+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*5+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*5+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*6+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*6+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*6+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*7,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*7+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*7+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*7+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*8,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*8+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*8+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*8+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*9,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*9+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*9+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*9+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*10,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*10+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*10+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*10+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*11,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*11+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*11+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*11+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*12,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*12+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*12+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*12+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*13,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*13+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*13+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*13+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*14,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*14+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*14+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*14+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 20:01:36 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*15,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*15+2,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*15+4,x
|
|
|
|
sta (SCRATCHL),y
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-19 19:59:24 +00:00
|
|
|
lda SHADOWVRAMBANK+160*15+6,x
|
|
|
|
sta (SCRATCHL),y
|
2017-08-13 22:36:12 +00:00
|
|
|
|
2017-09-30 00:53:05 +00:00
|
|
|
ply
|
2017-10-19 19:59:24 +00:00
|
|
|
rts
|
2017-08-25 04:45:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2017-10-27 03:15:52 +00:00
|
|
|
; unrenderGameObject
|
2017-08-25 04:45:05 +00:00
|
|
|
;
|
2017-10-27 03:15:52 +00:00
|
|
|
; PARAML0 = Pointer to gameobject data
|
2017-08-27 05:34:49 +00:00
|
|
|
; Trashes SCRATCHL
|
2017-08-25 04:45:05 +00:00
|
|
|
;
|
2017-10-27 03:15:52 +00:00
|
|
|
unrenderGameObject:
|
2017-08-25 04:45:05 +00:00
|
|
|
SAVE_AXY
|
|
|
|
|
2017-10-19 19:59:24 +00:00
|
|
|
; Find gameobject location in video memory
|
2017-10-27 03:15:52 +00:00
|
|
|
jsr vramPtr
|
2017-10-19 19:59:24 +00:00
|
|
|
cpx #0
|
|
|
|
bmi unrenderGameobjectSkip
|
2017-09-05 19:48:30 +00:00
|
|
|
bra unrenderGameobjectBackground
|
|
|
|
|
|
|
|
unrenderGameobjectSkip:
|
|
|
|
jmp unrenderGameobjectDone
|
|
|
|
|
|
|
|
unrenderGameobjectBackground:
|
2017-10-27 03:15:52 +00:00
|
|
|
ldy #GO_BACKGROUND
|
2017-10-19 19:59:24 +00:00
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160+4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*2+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*2+4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*2+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*3,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*3+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*3+4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*3+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*4+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*4+4,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*4+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*5,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*5+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*5+4,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*5+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*6+2,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*6+4,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*6+6,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*7,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*7+2,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*7+4,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*7+6,x
|
2017-09-30 20:01:36 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*8,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*8+2,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*8+4,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*8+6,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-09-30 00:53:05 +00:00
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*9,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*9+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*9+4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*9+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*10,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*10+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*10+4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*10+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*11,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*11+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*11+4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*11+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*12,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*12+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*12+4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*12+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*13,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*13+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*13+4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*13+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*14,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*14+2,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*14+4,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*14+6,x
|
2017-09-30 00:53:05 +00:00
|
|
|
iny
|
|
|
|
iny
|
|
|
|
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*15,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*15+2,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*15+4,x
|
2017-08-27 05:34:49 +00:00
|
|
|
iny
|
|
|
|
iny
|
2017-10-27 03:15:52 +00:00
|
|
|
lda (PARAML0),y
|
2017-10-19 19:59:24 +00:00
|
|
|
sta SHADOWVRAMBANK+160*15+6,x
|
2017-08-25 04:45:05 +00:00
|
|
|
|
|
|
|
unrenderGameobjectDone:
|
|
|
|
RESTORE_AXY
|
2017-10-27 03:15:52 +00:00
|
|
|
rts
|