Skip to content

Commit

Permalink
Add warnings about music/sfx macro usage
Browse files Browse the repository at this point in the history
These are not game limitations, just restrictions for
the macros to behave properly
  • Loading branch information
dannye committed Jul 28, 2016
1 parent 4992ae2 commit dbe2a3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions audio/headers/sfxheaders1.asm
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ SFX_Go_Outside_1::
SFX_Save_1::
sfx SFX_Save_1, CH4_ | CH5_

; the Pokeflute sound effect directly hijacks channel 2
SFX_Pokeflute::
db CH2
dw SFX_Pokeflute_Ch2
Expand Down
6 changes: 3 additions & 3 deletions macros.asm
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,10 @@ CH5_ EQU 1 << CH5
CH6_ EQU 1 << CH6
CH7_ EQU 1 << CH7

; channel 0 is not optional
music: MACRO
db ((((\2 & CH0_) >> CH0) + ((\2 & CH1_) >> CH1) + ((\2 & CH2_) >> CH2) + ((\2 & CH3_) >> CH3)) - 1) << 6 | CH0
IF \2 & CH0_
dw \1_Ch0
ENDC
dw \1_Ch0
IF \2 & CH1_
db CH1
dw \1_Ch1
Expand All @@ -434,6 +433,7 @@ music: MACRO
ENDC
ENDM

; do not start a sound effect with channel 5 or 6, only channel 4 or 7
sfx: MACRO
IF \2 & CH4_
db ((((\2 & CH4_) >> CH4) + ((\2 & CH5_) >> CH5) + ((\2 & CH6_) >> CH6) + ((\2 & CH7_) >> CH7)) - 1) << 6 | CH4
Expand Down

0 comments on commit dbe2a3b

Please sign in to comment.