Add support for preset options to be used with BETTER_REVERB (#508)

* Bugfix: BETTER_REVERB starts before buffers are ready

* Add support for preset options to be used with BETTER_REVERB

* Some BETTER_REVERB cleanup

* The funny whoops

* Address suggested level script change

* Bugfix: useReverb crashes when disabled

* Allow window size override for vanilla-esque BETTER_REVERB presets

* Remove unnecessary downsampling limit check

* Fix up a few things + some slight reformatting

* Add light documentation to the BETTER_REVERB parameters

* Adjust BETTER_REVERB preset types to make more sense

* Reset BETTER_REVERB data buffer to be unallocated when not in use

* Properly disable BETTER_REVERB when disabling all reverb processing

* Remove an unnecessary BETTER_REVERB ifdef

* Remove D_80332108

* Revise BETTER_REVERB config description
This commit is contained in:
Gregory Heskett
2023-01-24 09:22:49 -05:00
committed by GitHub
parent d702f188c6
commit 7fdb5af8fd
25 changed files with 462 additions and 414 deletions

View File

@@ -38,6 +38,6 @@
/**
* Uses a much better implementation of reverb over vanilla's fake echo reverb. Great for caves or eerie levels, as well as just a better audio experience in general.
* Reverb parameters can be configured in audio/synthesis.c to meet desired aesthetic/performance needs. Currently US/JP only. Hurts emulator and console performance.
* Reverb presets can be configured in audio/data.c to meet desired aesthetic/performance needs. More detailed usage info can also be found on the HackerSM64 Wiki page.
*/
// #define BETTER_REVERB

View File

@@ -420,12 +420,30 @@ enum GoddardScene {
#define GAMMA(enabled) \
CMD_BBBB(LEVEL_CMD_SET_GAMMA, 0x04, enabled, 0x00)
#define SET_BACKGROUND_MUSIC(settingsPreset, seq) \
#ifdef BETTER_REVERB
#define SET_BACKGROUND_MUSIC_WITH_REVERB(settingsPreset, seq, reverbPresetConsole, reverbPresetEmulator) \
CMD_BBH(LEVEL_CMD_SET_MUSIC, 0x08, settingsPreset), \
CMD_HH(seq, 0x0000)
CMD_BBH(reverbPresetConsole, reverbPresetEmulator, seq)
#define SET_MENU_MUSIC_WITH_REVERB(seq, reverbPresetConsole, reverbPresetEmulator) \
CMD_BBH(LEVEL_CMD_SET_MENU_MUSIC, 0x08, seq), \
CMD_BBH(reverbPresetConsole, reverbPresetEmulator, 0x0000)
#else
// Functionally identical to calling SET_BACKGROUND_MUSIC if BETTER_REVERB is disabled
#define SET_BACKGROUND_MUSIC_WITH_REVERB(settingsPreset, seq, reverbPresetConsole, reverbPresetEmulator) \
CMD_BBH(LEVEL_CMD_SET_MUSIC, 0x08, settingsPreset), \
CMD_HH(0x0000, seq)
// Functionally identical to calling SET_MENU_MUSIC if BETTER_REVERB is disabled
#define SET_MENU_MUSIC_WITH_REVERB(seq, reverbPresetConsole, reverbPresetEmulator) \
CMD_BBH(LEVEL_CMD_SET_MENU_MUSIC, 0x04, seq)
#endif
#define SET_BACKGROUND_MUSIC(settingsPreset, seq) \
SET_BACKGROUND_MUSIC_WITH_REVERB(settingsPreset, seq, 0x00, 0x00)
#define SET_MENU_MUSIC(seq) \
CMD_BBH(LEVEL_CMD_SET_MENU_MUSIC, 0x04, seq)
SET_MENU_MUSIC_WITH_REVERB(seq, 0x00, 0x00)
#define STOP_MUSIC(fadeOutTime) \
CMD_BBH(LEVEL_CMD_FADEOUT_MUSIC, 0x04, fadeOutTime)