tfv: also play victory music

This commit is contained in:
Vince Weaver 2021-01-19 16:27:24 -05:00
parent c5f571126e
commit 716ab79c2e
5 changed files with 94 additions and 9 deletions

View File

@ -85,7 +85,7 @@ tfv_world.o: tfv_world.s zp.inc \
graphics_map/tfv_backgrounds.inc \
graphics_battle/battle_graphics.inc \
tfv_sprites.inc battle_sprites.inc \
play_music.s music/fighting.pt3
play_music.s music/fighting.pt3 music/victory.pt3 music/battle_music.inc
ca65 -o tfv_world.o tfv_world.s -l tfv_world.lst
graphics_map/tfv_backgrounds.inc:
@ -94,6 +94,9 @@ graphics_map/tfv_backgrounds.inc:
graphics_battle/battle_graphics.inc:
cd graphics_battle && make
music/battle_music.inc:
cd battle_music && make
###
@ -101,3 +104,4 @@ graphics_battle/battle_graphics.inc:
clean:
rm -f *~ TITLE.GR *.o *.lst TFV_CREDITS TFV_TITLE TFV_FLYING TFV_WORLD HELLO LOADER
cd graphics_battle && make clean
cd music && make clean

View File

@ -29,9 +29,12 @@ $04-$07 lores page 1
$08-$0b lores page 2
$0c-$0f background graphics
$10-$1f ??
$20-??? code B6-20 = 38.4k
$B6-$BD multiply tables
$20-??? code AE-20 = 36.4k
$AE-$B5 music buffer 2k
$B6-$BD multiply tables 2k
$BE-$BF ??
$C0-$CF I/O
$D0-$FF ROM

28
games/tfv/music/Makefile Normal file
View File

@ -0,0 +1,28 @@
#include ../Makefile.inc
PNG2RLE = ../../../utils/gr-utils/png2rle
PNG2GR = ../../../utils/gr-utils/png2gr
LZSA = ~/research/lzsa/lzsa/lzsa
all: battle_music.inc
####
battle_music.inc: \
fighting.lzsa victory.lzsa
echo "fighting_lzsa: .incbin \"fighting.lzsa\"" > battle_music.inc
echo "victory_lzsa: .incbin \"victory.lzsa\"" >> battle_music.inc
%.gr: %.png
$(PNG2GR) $< $@
%.lzsa: %.pt3
$(LZSA) -r -f2 $< $@
####
clean:
rm -f *~ *.o *.lst *.gr *.lzsa battle_music.inc

View File

@ -5,6 +5,7 @@ setup_music:
;===================================
lda #0
sta DONE_PLAYING
lda #1
sta LOOP
; detect mockingboard
@ -37,6 +38,7 @@ mockingboard_found:
; init song
;==================
jsr music_load_fighting
jsr pt3_init_song
jmp done_setup_sound
@ -50,6 +52,33 @@ done_setup_sound:
rts
music_load_fighting:
lda #<(fighting_lzsa)
sta getsrc_smc+1
lda #>(fighting_lzsa)
sta getsrc_smc+2
lda #$AE
jsr decompress_lzsa2_fast
rts
music_load_victory:
lda #<(victory_lzsa)
sta getsrc_smc+1
lda #>(victory_lzsa)
sta getsrc_smc+2
lda #$AE
jsr decompress_lzsa2_fast
rts
;==========================
; includes
;==========================
@ -62,9 +91,6 @@ done_setup_sound:
.include "pt3_lib_mockingboard_setup.s"
PT3_LOC = still_more_fighting
.align $100
still_more_fighting:
.incbin "music/fighting.pt3"
PT3_LOC = $AE00
.include "music/battle_music.inc"

View File

@ -45,6 +45,7 @@ do_battle:
and #SOUND_MOCKINGBOARD
beq no_mockingboard
jsr music_load_fighting
jsr pt3_init_song
cli
@ -381,6 +382,29 @@ battle_game_over:
victory_dance:
; start music
lda SOUND_STATUS
and #SOUND_MOCKINGBOARD
beq no_mockingboard_victory
sei
jsr clear_ay_both
jsr music_load_victory
jsr pt3_init_song
cli
no_mockingboard_victory:
lda #34
sta HERO_X
lda #20