Skip to content

Commit

Permalink
Use kick drum sample for MermaidHut6Drums machine
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed Jun 16, 2024
1 parent cb0c932 commit 1a0d03a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/inst.asm
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ _Envelope:

.SEGMENT "PRGE_InstSample"

.GLOBAL Data_SampleKickDrum_arr657
.EXPORT Data_SampleKickDrum_arr657
.PROC Data_SampleKickDrum_arr657
: .assert * .mod kDmcSampleAlign = 0, error
.incbin "out/samples/inst_kick.dm"
Expand Down
6 changes: 4 additions & 2 deletions src/rooms/mermaid_hut6.asm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
.INCLUDE "../platform.inc"
.INCLUDE "../program.inc"
.INCLUDE "../room.inc"
.INCLUDE "../sample.inc"

.IMPORT DataA_Room_Hut_sTileset
.IMPORT Data_Empty_sActor_arr
Expand All @@ -50,7 +51,7 @@
.IMPORT Func_MovePlatformLeftTowardPointX
.IMPORT Func_MovePlatformTopTowardPointY
.IMPORT Func_Noop
.IMPORT Func_PlaySfxFlopDown
.IMPORT Func_PlaySfxSample
.IMPORT Ppu_ChrObjSewer
.IMPORT Ram_MachineGoalHorz_u8_arr
.IMPORT Ram_MachineGoalVert_u8_arr
Expand Down Expand Up @@ -428,7 +429,8 @@ _MachineLight:
.ENDPROC

.PROC FuncA_Machine_MermaidHut6Drums_TryAct
jsr Func_PlaySfxFlopDown ; TODO: use kick drum sample instead
lda #eSample::KickDrum ; param: eSample to play
jsr Func_PlaySfxSample
lda #$08
sta Ram_MachineSlowdown_u8_arr + kDrumsMachineIndex
mul #2 ; param: num frames
Expand Down
9 changes: 5 additions & 4 deletions src/sample.asm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
.INCLUDE "sample.inc"
.INCLUDE "sound.inc"

.IMPORT Data_SampleKickDrum_arr657
.IMPORT Ram_Sound_sChanSfx_arr
.IMPORTZP Zp_Next_sChanSfx_arr

Expand All @@ -45,7 +46,6 @@ kSampleGap1Size = kDmcSampleAlign - (* .mod kDmcSampleAlign)
;;; The DMC sample rate (0-$f) to use for each sample.
.PROC Data_SampleRate_u8_arr
D_ARRAY .enum, eSample
d_byte BossRoar0, $0
d_byte BossRoar1, $1
d_byte BossRoar2, $2
d_byte BossRoar3, $3
Expand All @@ -60,13 +60,13 @@ kSampleGap1Size = kDmcSampleAlign - (* .mod kDmcSampleAlign)
d_byte Harm, $e
d_byte JumpAnna, $f
d_byte JumpGronta, $e
d_byte KickDrum, $e
D_END
.ENDPROC

;;; The encoded start address for each sample.
.PROC Data_SampleStart_u8_arr
D_ARRAY .enum, eSample
d_byte BossRoar0, <(Data_SampleBoss_arr >> 6)
d_byte BossRoar1, <(Data_SampleBoss_arr >> 6)
d_byte BossRoar2, <(Data_SampleBoss_arr >> 6)
d_byte BossRoar3, <(Data_SampleBoss_arr >> 6)
Expand All @@ -81,6 +81,7 @@ kSampleGap1Size = kDmcSampleAlign - (* .mod kDmcSampleAlign)
d_byte Harm, <(Data_SampleHarm_arr >> 6)
d_byte JumpAnna, <(Data_SampleJump_arr >> 6)
d_byte JumpGronta, <(Data_SampleJump_arr >> 6)
d_byte KickDrum, <(Data_SampleKickDrum_arr657 >> 6)
D_END
.ENDPROC

Expand Down Expand Up @@ -131,7 +132,6 @@ kSampleGap2Size = kDmcSampleAlign - (* .mod kDmcSampleAlign)
;;; The encoded byte length for each sample.
.PROC Data_SampleLength_u8_arr
D_ARRAY .enum, eSample
d_byte BossRoar0, .sizeof(Data_SampleBoss_arr) >> 4
d_byte BossRoar1, .sizeof(Data_SampleBoss_arr) >> 4
d_byte BossRoar2, .sizeof(Data_SampleBoss_arr) >> 4
d_byte BossRoar3, .sizeof(Data_SampleBoss_arr) >> 4
Expand All @@ -146,13 +146,13 @@ kSampleGap2Size = kDmcSampleAlign - (* .mod kDmcSampleAlign)
d_byte Harm, .sizeof(Data_SampleHarm_arr) >> 4
d_byte JumpAnna, .sizeof(Data_SampleJump_arr) >> 4
d_byte JumpGronta, .sizeof(Data_SampleJump_arr) >> 4
d_byte KickDrum, 657 >> 4
D_END
.ENDPROC

;;; The number of frames to play each sample for.
.PROC Data_SampleFrames_u8_arr
D_ARRAY .enum, eSample
d_byte BossRoar0, 132
d_byte BossRoar1, 127
d_byte BossRoar2, 117
d_byte BossRoar3, 110
Expand All @@ -167,6 +167,7 @@ kSampleGap2Size = kDmcSampleAlign - (* .mod kDmcSampleAlign)
d_byte Harm, 5
d_byte JumpAnna, 9
d_byte JumpGronta, 12
d_byte KickDrum, 13
D_END
.ENDPROC

Expand Down
4 changes: 2 additions & 2 deletions src/sample.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

;;; Samples that can be played on the DMC as sound effects.
.ENUM eSample
BossRoar0 ; a boss roar (deepest)
BossRoar1 ; a boss roar
BossRoar1 ; a boss roar (deep)
BossRoar2 ; a boss roar
BossRoar3 ; a boss roar
BossRoar4 ; a boss roar
Expand All @@ -34,6 +33,7 @@
Harm ; when Anna gets hurt
JumpAnna ; when Anna jumps
JumpGronta ; when Gronta jumps
KickDrum ; used by game music and by drums machine
NUM_VALUES
.ENDENUM

Expand Down

0 comments on commit 1a0d03a

Please sign in to comment.