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

@@ -16,22 +16,26 @@
#include "make_const_nonconst.h"
#include "levels/ending/header.h"
const LevelScript level_ending_entry[] = {
/*0*/ INIT_LEVEL(),
/*1*/ LOAD_LEVEL_DATA(ending),
/*4*/ ALLOC_LEVEL_POOL(),
/*5*/ AREA(/*index*/ 1, ending_geo_area_1),
/*7*/ END_AREA(),
/*8*/ FREE_LEVEL_POOL(),
/*9*/ SLEEP(/*frames*/ 60),
/*10*/ BLACKOUT(/*active*/ FALSE),
/*11*/ LOAD_AREA(/*area*/ 1),
/*12*/ TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 75, /*color*/ 0x00, 0x00, 0x00),
/*14*/ SLEEP(/*frames*/ 120),
/*15*/ CALL(/*arg*/ 0, /*func*/ lvl_play_the_end_screen_sound),
// L1:
/*17*/ SLEEP(/*frames*/ 1),
/*18*/ JUMP(level_ending_entry + 17), // goto L1 (loop sleep 1 forever)
const LevelScript level_ending_entry_loop[] = {
SLEEP(/*frames*/ 1),
JUMP(level_ending_entry_loop), // (loop sleep 1 forever)
};
const LevelScript level_ending_entry[] = {
INIT_LEVEL(),
LOAD_LEVEL_DATA(ending),
ALLOC_LEVEL_POOL(),
AREA(/*index*/ 1, ending_geo_area_1),
END_AREA(),
FREE_LEVEL_POOL(),
SLEEP(/*frames*/ 60),
BLACKOUT(/*active*/ FALSE),
LOAD_AREA(/*area*/ 1),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 75, /*color*/ 0x00, 0x00, 0x00),
SLEEP(/*frames*/ 120),
CALL(/*arg*/ 0, /*func*/ lvl_play_the_end_screen_sound),
JUMP(level_ending_entry_loop), // (loop sleep 1 forever)
};

View File

@@ -26,10 +26,10 @@
#include "game/object_list_processor.h"
const LevelScript level_intro_splash_screen[] = {
INIT_LEVEL(),
#ifdef SKIP_TITLE_SCREEN
EXIT_AND_EXECUTE_WITH_CODE(/*seg*/ SEGMENT_MENU_INTRO, _introSegmentRomStart, _introSegmentRomEnd, level_intro_mario_head_regular, _introSegmentBssStart, _introSegmentBssEnd),
#endif
INIT_LEVEL(),
LOAD_GODDARD(),
LOAD_BEHAVIOR_DATA(),
LOAD_LEVEL_DATA(intro),
@@ -48,6 +48,7 @@ const LevelScript level_intro_splash_screen[] = {
// Start animation
LOAD_AREA(/*area*/ 1),
SET_MENU_MUSIC(/*seq*/ SEQ_SOUND_PLAYER),
CALL(/*arg*/ LVL_INTRO_PLAY_ITS_A_ME_MARIO, /*func*/ lvl_intro_update),
CALL(/*arg*/ 0, /*func*/ load_mario_area),
@@ -70,6 +71,7 @@ const LevelScript level_intro_splash_screen[] = {
// Start animation
LOAD_AREA(/*area*/ 1),
SET_MENU_MUSIC(/*seq*/ SEQ_SOUND_PLAYER),
CALL(/*arg*/ LVL_INTRO_PLAY_ITS_A_ME_MARIO, /*func*/ lvl_intro_update),
SLEEP(/*frames*/ 75),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0x00, 0x00, 0x00),

View File

@@ -57,40 +57,44 @@ const LevelScript level_main_menu_entry_file_select[] = {
EXIT_AND_EXECUTE(/*seg*/ SEGMENT_GLOBAL_LEVEL_SCRIPT, _scriptsSegmentRomStart, _scriptsSegmentRomEnd, level_main_scripts_entry),
};
const LevelScript level_main_menu_entry_act_select_exit[] = {
EXIT(),
};
const LevelScript level_main_menu_entry_act_select[] = {
/* 0*/ CALL(/*arg*/ 0, /*func*/ lvl_set_current_level),
/* 2*/ JUMP_IF(/*op*/ OP_EQ, /*arg*/ FALSE, (level_main_menu_entry_act_select + 42)), // goto L1 (exit)
/* 5*/ INIT_LEVEL(),
/* 6*/ LOAD_GODDARD(),
/*10*/ LOAD_LEVEL_DATA(menu),
/*13*/ ALLOC_LEVEL_POOL(),
CALL(/*arg*/ 0, /*func*/ lvl_set_current_level),
JUMP_IF(/*op*/ OP_EQ, /*arg*/ FALSE, (level_main_menu_entry_act_select_exit)),
INIT_LEVEL(),
LOAD_GODDARD(),
LOAD_LEVEL_DATA(menu),
ALLOC_LEVEL_POOL(),
/*14*/ AREA(/*index*/ 2, geo_menu_act_selector_strings),
/*16*/ OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, -100, 0, /*angle*/ 0, 0, 0, /*behParam*/ BP(0x04, 0x00, 0x00, 0x00), /*beh*/ bhvActSelector),
/*22*/ TERRAIN(/*terrainData*/ main_menu_seg7_collision),
/*24*/ END_AREA(),
AREA(/*index*/ 2, geo_menu_act_selector_strings),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 0, -100, 0, /*angle*/ 0, 0, 0, /*behParam*/ BP(0x04, 0x00, 0x00, 0x00), /*beh*/ bhvActSelector),
TERRAIN(/*terrainData*/ main_menu_seg7_collision),
END_AREA(),
/*25*/ FREE_LEVEL_POOL(),
/*26*/ LOAD_AREA(/*area*/ 2),
FREE_LEVEL_POOL(),
LOAD_AREA(/*area*/ 2),
#ifdef NO_SEGMENTED_MEMORY
// sVisibleStars is set to 0 during FIXED_LOAD above on N64, but not when NO_SEGMENTED_MEMORY is used.
// lvl_init_act_selector_values_and_stars must be called here otherwise the previous
// value is retained and causes incorrect drawing during the 16 transition frames.
CALL(/*arg*/ 0, /*func*/ lvl_init_act_selector_values_and_stars),
#endif
/*27*/ TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
/*29*/ SLEEP(/*frames*/ 16),
/*30*/ SET_MENU_MUSIC(/*seq*/ 0x000D),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_FROM_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
SLEEP(/*frames*/ 16),
SET_MENU_MUSIC(/*seq*/ 0x000D),
#ifndef NO_SEGMENTED_MEMORY
/*31*/ CALL( /*arg*/ 0, /*func*/ lvl_init_act_selector_values_and_stars),
CALL( /*arg*/ 0, /*func*/ lvl_init_act_selector_values_and_stars),
#endif
/*33*/ CALL_LOOP(/*arg*/ 0, /*func*/ lvl_update_obj_and_load_act_button_actions),
/*35*/ GET_OR_SET(/*op*/ OP_SET, /*var*/ VAR_CURR_ACT_NUM),
/*36*/ STOP_MUSIC(/*fadeOutTime*/ 0x00BE),
/*37*/ TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
/*39*/ SLEEP(/*frames*/ 16),
/*40*/ CLEAR_LEVEL(),
/*41*/ SLEEP_BEFORE_EXIT(/*frames*/ 1),
// L1:
/*42*/ EXIT(),
CALL_LOOP(/*arg*/ 0, /*func*/ lvl_update_obj_and_load_act_button_actions),
GET_OR_SET(/*op*/ OP_SET, /*var*/ VAR_CURR_ACT_NUM),
STOP_MUSIC(/*fadeOutTime*/ 0x00BE),
TRANSITION(/*transType*/ WARP_TRANSITION_FADE_INTO_COLOR, /*time*/ 16, /*color*/ 0xFF, 0xFF, 0xFF),
SLEEP(/*frames*/ 16),
CLEAR_LEVEL(),
SLEEP_BEFORE_EXIT(/*frames*/ 1),
EXIT(),
};