Added shoot animations and more sound
Animation system now supports multiple sprite sizes
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 249 B |
BIN
Art/026CatShoot.gif
Normal file
After Width: | Height: | Size: 245 B |
BIN
Art/026CatShoot.xcf
Normal file
BIN
Art/027CatShoot.gif
Normal file
After Width: | Height: | Size: 239 B |
BIN
Art/027CatShoot.xcf
Normal file
BIN
Art/028CatShoot.gif
Normal file
After Width: | Height: | Size: 249 B |
BIN
Art/028CatShoot.xcf
Normal file
BIN
Art/029Cat.gif
Before Width: | Height: | Size: 281 B After Width: | Height: | Size: 242 B |
BIN
Art/029Cat.xcf
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 263 B |
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 268 B |
BIN
Art/032CatHit.gif
Normal file
After Width: | Height: | Size: 281 B |
BIN
Art/032CatHit.xcf
Normal file
Before Width: | Height: | Size: 275 B After Width: | Height: | Size: 275 B |
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
BIN
Art/035CatShoot.gif
Normal file
After Width: | Height: | Size: 245 B |
BIN
Art/035CatShoot.xcf
Normal file
BIN
Art/036CatShoot.gif
Normal file
After Width: | Height: | Size: 240 B |
BIN
Art/036CatShoot.xcf
Normal file
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
2
Makefile
@ -94,5 +94,5 @@ art:
|
||||
.PHONY: sound
|
||||
sound:
|
||||
rm -f $(GENSOUND)/*
|
||||
./GenerateSoundBank.sh Sound/CatHowl.wav 11264 Sound/Meow1.wav 5513
|
||||
./GenerateSoundBank.sh Sound/CatHowl.wav 11264 Sound/Meow1.wav 5513 Sound/Meow2.wav 5513 Sound/Meow3.wav 5513 Sound/Meow4.wav 5513
|
||||
rm -f $(GENSOUND)/*
|
||||
|
BIN
Sound/Meow1.wav
BIN
Sound/Meow2.wav
Normal file
BIN
Sound/Meow3.wav
Normal file
BIN
Sound/Meow4.wav
Normal file
@ -1,2 +1,5 @@
|
||||
$0000 CatHowl 8192 bytes 11264 Hz
|
||||
$2000 Meow1 8192 bytes 5513 Hz
|
||||
$4000 Meow2 8192 bytes 5513 Hz
|
||||
$6000 Meow3 8192 bytes 5513 Hz
|
||||
$8000 Meow4 8192 bytes 5513 Hz
|
||||
|
BIN
SoundBank#060000
632
animation.s
@ -5,19 +5,24 @@
|
||||
; Created by Quinn Dunki on 6/28/23
|
||||
;
|
||||
|
||||
ANIMATION_SIZE_16x16=0
|
||||
ANIMATION_SIZE_16x32=2
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; renderAnimation
|
||||
;
|
||||
; Y = Base sprite index
|
||||
; X = Number of frames
|
||||
; A = Animation size (use constants above)
|
||||
; PARAML0 = Pointer to X,Y (16 bits each, Y is bottom relative)
|
||||
; Trashes PARAML0,PARAML1,SCRATCHL2
|
||||
;
|
||||
; Trashes A,X,Y,PARAML0,PARAML1,PARAML2,SCRATCHL2
|
||||
;
|
||||
renderAnimation:
|
||||
SAVE_AXY
|
||||
sta PARAML2
|
||||
sty PARAML1
|
||||
|
||||
|
||||
phx ; Calculate VRAM position
|
||||
jsr vramPtr
|
||||
cpx #$ffff
|
||||
@ -29,12 +34,13 @@ renderAnimation:
|
||||
|
||||
ldx #1
|
||||
|
||||
renderHitAnimationLoop:
|
||||
renderAnimationLoop:
|
||||
|
||||
; Preserve background
|
||||
phx
|
||||
ldx SCRATCHL2
|
||||
jsr protectAnimation16x32
|
||||
ldy SCRATCHL2
|
||||
ldx PARAML2
|
||||
jsr (protectionRoutines,x)
|
||||
plx
|
||||
|
||||
; Render animation frame
|
||||
@ -46,18 +52,18 @@ renderHitAnimationLoop:
|
||||
|
||||
; Restore background
|
||||
phx
|
||||
ldx SCRATCHL2
|
||||
jsr unrenderAnimation16x32
|
||||
ldy SCRATCHL2
|
||||
ldx PARAML2
|
||||
jsr (unrenderRoutines,x)
|
||||
plx
|
||||
|
||||
; Next frame
|
||||
inc PARAML1
|
||||
inx
|
||||
cpx #6
|
||||
bne renderHitAnimationLoop
|
||||
cpx PARAML0
|
||||
bne renderAnimationLoop
|
||||
|
||||
renderAnimationDone:
|
||||
RESTORE_AXY
|
||||
rts
|
||||
|
||||
renderAnimationSkip:
|
||||
@ -65,17 +71,25 @@ renderAnimationSkip:
|
||||
bra renderAnimationDone
|
||||
|
||||
|
||||
; Jump tables for various animation sizes
|
||||
protectionRoutines:
|
||||
.word protectAnimation16x16,protectAnimation16x32
|
||||
unrenderRoutines:
|
||||
.word unrenderAnimation16x16,unrenderAnimation16x32
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; protectAnimation16x32
|
||||
; protectAnimation16x16
|
||||
;
|
||||
; Saves background behind this sprite
|
||||
; X = VRAM position of upper left of sprite
|
||||
; Y = VRAM position of upper left of sprite
|
||||
; Trashes A
|
||||
;
|
||||
; Brace for large unrolled loop in 3..2..1...
|
||||
;
|
||||
protectAnimation16x32:
|
||||
phy
|
||||
protectAnimation16x16:
|
||||
phx
|
||||
tyx
|
||||
ldy #0
|
||||
|
||||
lda SHADOWVRAMBANK,x
|
||||
@ -348,6 +362,296 @@ protectAnimation16x32:
|
||||
lda SHADOWVRAMBANK+160*15+6,x
|
||||
sta savedBackground,y
|
||||
|
||||
plx
|
||||
rts
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; protectAnimation16x32
|
||||
;
|
||||
; Saves background behind this sprite
|
||||
; Y = VRAM position of upper left of sprite
|
||||
; Trashes A
|
||||
;
|
||||
; Brace for large unrolled loop in 3..2..1...
|
||||
;
|
||||
protectAnimation16x32:
|
||||
phx
|
||||
tyx
|
||||
ldy #0
|
||||
|
||||
lda SHADOWVRAMBANK,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*2+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*2+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*2+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*3,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*3+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*3+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*3+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*4+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*4+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*4+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*5,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*5+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*5+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*5+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*6+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*6+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*6+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*7,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*7+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*7+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*7+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*8,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*8+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*8+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*8+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*9,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*9+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*9+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*9+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*10,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*10+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*10+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*10+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*11,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*11+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*11+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*11+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*12,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*12+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*12+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*12+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*13,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*13+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*13+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*13+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*14,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*14+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*14+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*14+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*15,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*15+2,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*15+4,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
lda SHADOWVRAMBANK+160*15+6,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
iny
|
||||
|
||||
lda SHADOWVRAMBANK+160*16,x
|
||||
sta savedBackground,y
|
||||
iny
|
||||
@ -618,20 +922,21 @@ protectAnimation16x32:
|
||||
lda SHADOWVRAMBANK+160*31+6,x
|
||||
sta savedBackground,y
|
||||
|
||||
ply
|
||||
plx
|
||||
rts
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; unrenderAnimation16x32
|
||||
; unrenderAnimation16x16
|
||||
;
|
||||
; X = VRAM position of upper left of sprite
|
||||
; Y = VRAM position of upper left of sprite
|
||||
;
|
||||
; Brace for large unrolled loop in 3..2..1...
|
||||
;
|
||||
unrenderAnimation16x32:
|
||||
unrenderAnimation16x16:
|
||||
SAVE_AXY
|
||||
|
||||
tyx
|
||||
ldy #0
|
||||
|
||||
lda savedBackground,y
|
||||
@ -904,6 +1209,295 @@ unrenderAnimation16x32:
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*15+6,x
|
||||
|
||||
RESTORE_AXY
|
||||
rts
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; unrenderAnimation16x32
|
||||
;
|
||||
; Y = VRAM position of upper left of sprite
|
||||
;
|
||||
; Brace for large unrolled loop in 3..2..1...
|
||||
;
|
||||
unrenderAnimation16x32:
|
||||
SAVE_AXY
|
||||
|
||||
tyx
|
||||
ldy #0
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*2+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*2+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*2+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*3,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*3+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*3+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*3+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*4+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*4+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*4+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*5,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*5+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*5+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*5+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*6,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*6+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*6+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*6+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*7,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*7+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*7+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*7+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*8,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*8+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*8+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*8+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*9,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*9+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*9+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*9+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*10,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*10+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*10+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*10+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*11,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*11+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*11+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*11+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*12,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*12+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*12+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*12+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*13,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*13+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*13+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*13+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*14,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*14+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*14+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*14+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*15,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*15+2,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*15+4,x
|
||||
iny
|
||||
iny
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*15+6,x
|
||||
iny
|
||||
iny
|
||||
|
||||
lda savedBackground,y
|
||||
sta SHADOWVRAMBANK+160*16,x
|
||||
iny
|
||||
|
@ -63,6 +63,8 @@ terrainData = $f500
|
||||
; .endrepeat
|
||||
terrainDataEnd = terrainData + (TERRAINWIDTH/2 * 2)
|
||||
|
||||
; Stash the size of the sound bank at the end of sound memory so loader can pass it to sound system
|
||||
soundBankSize=$04fffe
|
||||
|
||||
; projectileData struct offsets
|
||||
JD_PRECISEX = 132
|
||||
|
@ -5,7 +5,7 @@ FEATURES {
|
||||
MEMORY {
|
||||
ZP: start = $0080, size = $001A, define = yes;
|
||||
HEADER: start = $0000, size = $0004, file = %O;
|
||||
RAM: start = %S, size = $9600 - %S, file = %O, define = yes;
|
||||
RAM: start = %S, size = $FFFF - %S, file = %O, define = yes;
|
||||
MOVE: start = $0000, size = $FFFF, file = %O, define = yes;
|
||||
LC: start = $D400, size = $0C00, define = yes;
|
||||
}
|
||||
|
26
loader.s
@ -152,6 +152,24 @@ loadData:
|
||||
.addr fileRead
|
||||
bne ioError
|
||||
|
||||
NATIVE
|
||||
|
||||
; Copy sound data into bank 4
|
||||
ldx fileReadLen
|
||||
txa
|
||||
sta soundBankSize ; Note size of sound bank for later copying to Ensoniq RAM
|
||||
lda #4
|
||||
ldy #0
|
||||
jsr copyBytes
|
||||
|
||||
EMULATION
|
||||
|
||||
; Load rest of sound data into bank 0 (needed if sound size exceeds BUFFERSIZE)
|
||||
jsr PRODOS
|
||||
.byte $ca
|
||||
.addr fileRead
|
||||
bne ioError
|
||||
|
||||
; Close the file
|
||||
jsr PRODOS
|
||||
.byte $cc
|
||||
@ -159,10 +177,14 @@ loadData:
|
||||
|
||||
NATIVE
|
||||
|
||||
; Copy sound data into bank 4
|
||||
; Copy rest of code into bank 2 (needed if code size exceeds BUFFERSIZE)
|
||||
ldx fileReadLen
|
||||
txa
|
||||
clc
|
||||
adc soundBankSize ; Accumulate size of sound bank for later copying to Ensoniq RAM
|
||||
sta soundBankSize
|
||||
lda #4
|
||||
ldy #0
|
||||
ldy #BUFFERSIZE
|
||||
jsr copyBytes
|
||||
|
||||
; Set up a long jump into bank 2, and
|
||||
|
64
player.s
@ -20,7 +20,7 @@ playerData:
|
||||
.word 2 ; Power
|
||||
.word 100 ; Anger
|
||||
.byte 8,"SPROCKET " ; Name
|
||||
.word 26 ; Base Sprite
|
||||
.word 29 ; Base Sprite
|
||||
.word 0,5,7,0,0,0,0,0 ; Prices
|
||||
.word 0 ; Current weapon
|
||||
.word 7 ; Treats
|
||||
@ -183,6 +183,7 @@ playerDeltaPowerClampHigh:
|
||||
;
|
||||
playerFire:
|
||||
SAVE_AXY
|
||||
sty SCRATCHL2
|
||||
PLAYERPTR_Y
|
||||
|
||||
; Check that we can afford it
|
||||
@ -206,14 +207,18 @@ playerFire:
|
||||
sbc SCRATCHL
|
||||
sta playerData+PD_TREATS,y
|
||||
|
||||
; Animate the shooting
|
||||
phy
|
||||
ldy SCRATCHL2
|
||||
jsr renderShootAnimation
|
||||
ply
|
||||
|
||||
; Prepare projectile parameters
|
||||
pla
|
||||
sta projectileParams+8
|
||||
lda playerData+GO_POSX,y
|
||||
sta projectileParams
|
||||
lda playerData+GO_POSY,y
|
||||
clc
|
||||
adc #GAMEOBJECTHEIGHT
|
||||
sta projectileParams+2
|
||||
lda playerData+PD_ANGLE,y
|
||||
sta projectileParams+4
|
||||
@ -348,29 +353,72 @@ renderHitAnimation:
|
||||
jsr unrenderCrosshair
|
||||
|
||||
lda playerData+GO_POSX,y
|
||||
sta renderHitAnimationPos
|
||||
sta renderAnimationPos
|
||||
lda playerData+GO_POSY,y
|
||||
clc
|
||||
adc #GAMEOBJECTHEIGHT
|
||||
sta renderHitAnimationPos+2
|
||||
lda #renderHitAnimationPos
|
||||
sta renderAnimationPos+2
|
||||
lda #renderAnimationPos
|
||||
sta PARAML0
|
||||
ldx #5
|
||||
|
||||
lda playerData+PD_BASESPRITE,y
|
||||
inc ; Hit animation starts right above base sprite
|
||||
tay
|
||||
lda #ANIMATION_SIZE_16x32
|
||||
jsr renderAnimation
|
||||
|
||||
jsr renderPlayers
|
||||
|
||||
RESTORE_AXY
|
||||
RESTORE_AXY
|
||||
rts
|
||||
|
||||
renderHitAnimationPos:
|
||||
renderAnimationPos:
|
||||
.word 0,0
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; renderShootAnimation
|
||||
;
|
||||
; Y = Player index to render
|
||||
; Trashes PARAML0,SCRATCHL
|
||||
;
|
||||
renderShootAnimation:
|
||||
SAVE_AXY
|
||||
|
||||
; Play meow sound
|
||||
phy
|
||||
ldy #SOUND_MEOW1
|
||||
jsr playSound
|
||||
ply
|
||||
|
||||
PLAYERPTR_Y
|
||||
|
||||
jsr unrenderPlayers
|
||||
jsr unrenderCrosshair
|
||||
|
||||
lda playerData+GO_POSX,y
|
||||
sta renderAnimationPos
|
||||
lda playerData+GO_POSY,y
|
||||
sta renderAnimationPos+2
|
||||
lda #renderAnimationPos
|
||||
sta PARAML0
|
||||
|
||||
ldx #3
|
||||
|
||||
lda playerData+PD_BASESPRITE,y
|
||||
clc
|
||||
adc #6 ; Shoot animation starts 6 above base sprite
|
||||
tay
|
||||
lda #ANIMATION_SIZE_16x16
|
||||
jsr renderAnimation
|
||||
|
||||
jsr renderPlayers
|
||||
|
||||
RESTORE_AXY
|
||||
rts
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; renderPlayerHeader
|
||||
;
|
||||
|
16
sound.s
@ -6,15 +6,22 @@
|
||||
;
|
||||
|
||||
|
||||
NUM_SOUNDS = 2
|
||||
NUM_SOUNDS = 5
|
||||
|
||||
SOUND_HOWL=0
|
||||
SOUND_MEOW1=2
|
||||
SOUND_MEOW2=4
|
||||
SOUND_MEOW3=6
|
||||
SOUND_MEOW4=8
|
||||
|
||||
|
||||
soundTable:
|
||||
; Sound Ram Address, Wave Size, Low Frequency
|
||||
.byte $00,WAVE_SIZE_8192,200 ; SOUND_HOWL
|
||||
.byte $20,WAVE_SIZE_8192,100 ; SOUND_MEOW1
|
||||
.byte $20,WAVE_SIZE_8192,150 ; SOUND_MEOW1
|
||||
.byte $40,WAVE_SIZE_8192,200 ; SOUND_MEOW2
|
||||
.byte $60,WAVE_SIZE_8192,150 ; SOUND_MEOW3
|
||||
.byte $80,WAVE_SIZE_8192,150 ; SOUND_MEOW4
|
||||
|
||||
|
||||
; Ensoniq Control Register bit patterns
|
||||
@ -123,7 +130,8 @@ initSoundSystem:
|
||||
lda #$0000 ; Sound location in bank 4
|
||||
sta PARAML0
|
||||
ldx #$04
|
||||
ldy #11749
|
||||
lda soundBankSize ; Far pointer
|
||||
tay
|
||||
jsr copyToSoundRAM
|
||||
|
||||
; Configure all our oscillators
|
||||
@ -133,6 +141,7 @@ initSoundSystem:
|
||||
ldy #0
|
||||
|
||||
initSoundSystemLoop:
|
||||
|
||||
BITS8A
|
||||
lda soundTable,y
|
||||
sta PARAM0
|
||||
@ -170,7 +179,6 @@ initSoundSystemReady:
|
||||
RESTORE_AXY
|
||||
rts
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; playSound
|
||||
;
|
||||
|
12
spritebank.s
@ -2,22 +2,24 @@
|
||||
|
||||
|
||||
DrawSpriteBank :
|
||||
ASL ; A=Sprite Number ($0000-$001F)
|
||||
ASL ; A=Sprite Number ($0000-$0025)
|
||||
TAX ; Y=Target Screen Address ($2000-$9D00)
|
||||
LDA SpriteBankNum,X ; Relative Sprite Number Table
|
||||
JMP (SpriteBankBank,X) ; Bank Number Table
|
||||
|
||||
SpriteBankNum :
|
||||
.dbyt $0B00,$0A00,$1800,$1100,$1200,$1700,$1E00,$1C00
|
||||
.dbyt $1500,$1600,$1B00,$1F00,$0D00,$0F00,$1000,$1D00
|
||||
.dbyt $1A00,$1900,$1400,$1300,$0C00,$0E00,$0600,$0000
|
||||
.dbyt $0300,$0400,$0800,$0900,$0700,$0200,$0100,$0500
|
||||
.dbyt $0C00,$0B00,$1E00,$1700,$1800,$1D00,$2400,$2200
|
||||
.dbyt $1B00,$1C00,$2100,$2500,$1100,$1500,$1600,$2300
|
||||
.dbyt $2000,$1F00,$1A00,$1900,$0D00,$1200,$0600,$0000
|
||||
.dbyt $0300,$0400,$1000,$1300,$0E00,$0900,$0800,$0700
|
||||
.dbyt $0200,$0100,$0500,$0F00,$1400,$0A00
|
||||
|
||||
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,SpriteBankBank00,SpriteBankBank00
|
||||
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
|
||||
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
|
||||
|
||||
SpriteBankBank00 :
|
||||
JSL $AA0000
|
||||
|