diff --git a/Art/020CatHit.gif b/Art/020Cat.gif similarity index 100% rename from Art/020CatHit.gif rename to Art/020Cat.gif diff --git a/Art/026CatShoot.gif b/Art/026CatShoot.gif new file mode 100644 index 0000000..ccb65c8 Binary files /dev/null and b/Art/026CatShoot.gif differ diff --git a/Art/026CatShoot.xcf b/Art/026CatShoot.xcf new file mode 100644 index 0000000..f616d76 Binary files /dev/null and b/Art/026CatShoot.xcf differ diff --git a/Art/027CatShoot.gif b/Art/027CatShoot.gif new file mode 100644 index 0000000..f940f88 Binary files /dev/null and b/Art/027CatShoot.gif differ diff --git a/Art/027CatShoot.xcf b/Art/027CatShoot.xcf new file mode 100644 index 0000000..7ceb359 Binary files /dev/null and b/Art/027CatShoot.xcf differ diff --git a/Art/028CatShoot.gif b/Art/028CatShoot.gif new file mode 100644 index 0000000..3aa9289 Binary files /dev/null and b/Art/028CatShoot.gif differ diff --git a/Art/028CatShoot.xcf b/Art/028CatShoot.xcf new file mode 100644 index 0000000..2654e39 Binary files /dev/null and b/Art/028CatShoot.xcf differ diff --git a/Art/029Cat.gif b/Art/029Cat.gif index 905c44c..5077956 100644 Binary files a/Art/029Cat.gif and b/Art/029Cat.gif differ diff --git a/Art/029Cat.xcf b/Art/029Cat.xcf index f6cc467..fd876af 100644 Binary files a/Art/029Cat.xcf and b/Art/029Cat.xcf differ diff --git a/Art/027Cat.gif b/Art/030CatHit.gif similarity index 100% rename from Art/027Cat.gif rename to Art/030CatHit.gif diff --git a/Art/027Cat.xcf b/Art/030CatHit.xcf similarity index 100% rename from Art/027Cat.xcf rename to Art/030CatHit.xcf diff --git a/Art/028Cat.gif b/Art/031CatHit.gif similarity index 100% rename from Art/028Cat.gif rename to Art/031CatHit.gif diff --git a/Art/028Cat.xcf b/Art/031CatHit.xcf similarity index 100% rename from Art/028Cat.xcf rename to Art/031CatHit.xcf diff --git a/Art/032CatHit.gif b/Art/032CatHit.gif new file mode 100644 index 0000000..905c44c Binary files /dev/null and b/Art/032CatHit.gif differ diff --git a/Art/032CatHit.xcf b/Art/032CatHit.xcf new file mode 100644 index 0000000..f6cc467 Binary files /dev/null and b/Art/032CatHit.xcf differ diff --git a/Art/030Cat.gif b/Art/033CatHit.gif similarity index 100% rename from Art/030Cat.gif rename to Art/033CatHit.gif diff --git a/Art/030Cat.xcf b/Art/033CatHit.xcf similarity index 100% rename from Art/030Cat.xcf rename to Art/033CatHit.xcf diff --git a/Art/031Cat.gif b/Art/034CatHit.gif similarity index 100% rename from Art/031Cat.gif rename to Art/034CatHit.gif diff --git a/Art/031Cat.xcf b/Art/034CatHit.xcf similarity index 100% rename from Art/031Cat.xcf rename to Art/034CatHit.xcf diff --git a/Art/035CatShoot.gif b/Art/035CatShoot.gif new file mode 100644 index 0000000..2c8f72b Binary files /dev/null and b/Art/035CatShoot.gif differ diff --git a/Art/035CatShoot.xcf b/Art/035CatShoot.xcf new file mode 100644 index 0000000..fd6626b Binary files /dev/null and b/Art/035CatShoot.xcf differ diff --git a/Art/036CatShoot.gif b/Art/036CatShoot.gif new file mode 100644 index 0000000..ab94b37 Binary files /dev/null and b/Art/036CatShoot.gif differ diff --git a/Art/036CatShoot.xcf b/Art/036CatShoot.xcf new file mode 100644 index 0000000..2e9b564 Binary files /dev/null and b/Art/036CatShoot.xcf differ diff --git a/Art/026Cat.gif b/Art/037CatShoot.gif similarity index 100% rename from Art/026Cat.gif rename to Art/037CatShoot.gif diff --git a/Art/026Cat.xcf b/Art/037CatShoot.xcf similarity index 100% rename from Art/026Cat.xcf rename to Art/037CatShoot.xcf diff --git a/Makefile b/Makefile index d100061..3c858f1 100644 --- a/Makefile +++ b/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)/* diff --git a/Sound/CatHowl.wav b/Sound/CatHowl.wav index 0b2669a..9489c2e 100644 Binary files a/Sound/CatHowl.wav and b/Sound/CatHowl.wav differ diff --git a/Sound/Meow1.wav b/Sound/Meow1.wav index 36c0d4b..3c20152 100644 Binary files a/Sound/Meow1.wav and b/Sound/Meow1.wav differ diff --git a/Sound/Meow2.wav b/Sound/Meow2.wav new file mode 100644 index 0000000..149f75e Binary files /dev/null and b/Sound/Meow2.wav differ diff --git a/Sound/Meow3.wav b/Sound/Meow3.wav new file mode 100644 index 0000000..07cbd94 Binary files /dev/null and b/Sound/Meow3.wav differ diff --git a/Sound/Meow4.wav b/Sound/Meow4.wav new file mode 100644 index 0000000..789e7dd Binary files /dev/null and b/Sound/Meow4.wav differ diff --git a/Sound/SoundMap.txt b/Sound/SoundMap.txt index df69755..4fbdadb 100644 --- a/Sound/SoundMap.txt +++ b/Sound/SoundMap.txt @@ -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 diff --git a/SoundBank#060000 b/SoundBank#060000 index c2bad6d..0e29782 100644 Binary files a/SoundBank#060000 and b/SoundBank#060000 differ diff --git a/SpriteBank#060000 b/SpriteBank#060000 index 9eefdea..fdae4bb 100644 Binary files a/SpriteBank#060000 and b/SpriteBank#060000 differ diff --git a/animation.s b/animation.s index 382dfcb..34387e9 100644 --- a/animation.s +++ b/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 diff --git a/equates.s b/equates.s index fea714a..cb56d1b 100644 --- a/equates.s +++ b/equates.s @@ -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 diff --git a/linkerConfig b/linkerConfig index 4a1b127..753cf7e 100644 --- a/linkerConfig +++ b/linkerConfig @@ -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; } diff --git a/loader.s b/loader.s index d828503..7cfe557 100644 --- a/loader.s +++ b/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 diff --git a/player.s b/player.s index 91f6bcf..34ecea0 100644 --- a/player.s +++ b/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 ; diff --git a/sound.s b/sound.s index 0f3659f..4be7c97 100644 --- a/sound.s +++ b/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 ; diff --git a/spritebank.s b/spritebank.s index 4595080..329dec3 100644 --- a/spritebank.s +++ b/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