Skip to content

Commit

Permalink
Fine pitch effect
Browse files Browse the repository at this point in the history
  • Loading branch information
ADM228 committed Jan 13, 2024
1 parent f8fb47a commit 8439cd7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
18 changes: 17 additions & 1 deletion source/sound/SNESFM.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1175,12 +1175,28 @@ namespace ParseSongData

JMP ReadByte

if !SNESFM_CFG_PITCHBEND
FinePitch:
MOV X, !BACKUP_X
MOV A, (CHTEMP_SONG_POINTER_L)+Y
CMP A, CH1_PITCHBEND_IDX_SNG+X
BEQ +
MOV CH1_PITCHBEND_IDX_SNG+X, A
SET0 !PLAYBACK_FLAGS
+ INCW CHTEMP_SONG_POINTER_L
JMP Y00ReadByte
endif

OpcodeTable:
fillword POPX_ReadByte
dw NoAttack ; $68, Disable attack
dw POPX_ReadByte ; $69, Arp table
dw POPX_ReadByte ; $6A, Pitch table
dw POPX_ReadByte ; $6B, Fine pitch
if !SNESFM_CFG_PITCHBEND
dw FinePitch ; $6B, Fine pitch
else
dw POPX_ReadByte
endif
fill 2*4

dw SetVolumeL_or_R ; $70, Set left volume
Expand Down
8 changes: 6 additions & 2 deletions source/sound/songData.asm
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ dw NoteDataNone, NoteDataNone, NoteDataNone, NoteDataNone

nNoteDataBass1:
db !INSTRUMENT|($00<<1) ; Set instrument to 0
db !FINE_PITCH, $00
db !VOL_SET_BOTH, $7F
db $30, !nWAIT|($10<<1)
db !VOL_SET_BOTH, $40
Expand All @@ -123,10 +124,13 @@ nNoteDataBass1:
db $42, !nWAIT|($10<<1)
db $39, !nWAIT|($10<<1)

db !FINE_PITCH, $40
db !REF_SET, 11
dw nNoteDataBass1+1
db !REF_RPT, 0
dw nNoteDataBass1+3
db !FINE_PITCH, $80
db !REF_RPT, 2
db !FINE_PITCH, $c0
db !REF_RPT, 6

db !JUMP
dw NoteDataNone
Expand Down

0 comments on commit 8439cd7

Please sign in to comment.