From dbe2a3b1683caeab446ece53dce8d5e8b0fd0e07 Mon Sep 17 00:00:00 2001 From: dannye Date: Wed, 27 Jul 2016 20:57:46 -0500 Subject: Add warnings about music/sfx macro usage These are not game limitations, just restrictions for the macros to behave properly --- audio/headers/sfxheaders1.asm | 1 + macros.asm | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/audio/headers/sfxheaders1.asm b/audio/headers/sfxheaders1.asm index c06370ca..45dad274 100644 --- a/audio/headers/sfxheaders1.asm +++ b/audio/headers/sfxheaders1.asm @@ -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 diff --git a/macros.asm b/macros.asm index d5159005..ca123d97 100644 --- a/macros.asm +++ b/macros.asm @@ -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 @@ -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 -- cgit v1.2.3