diff --git a/Makefile b/Makefile index 72da8da..a19de5b 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,11 @@ EE_TOOL_PREFIX = mips64r5900el-ps2-elf- EE_CC := $(EE_TOOL_PREFIX)gcc -EE_OBJS = b4p_debug_menu_pages.o \ +EE_OBJS = b4p_debug_main_menu_page.o \ + b4p_debug_menu_page_manager.o \ + b4p_debug_menu_pages.o \ b4p_debug_menu_state.o \ + b4p_debug_original_menu_page.o \ b4p_debug_test_menu_page.o \ b4p_debug_vselect_component.o \ b4p_debug_vselect_option_component.o \ diff --git a/include/b4p_debug_background_component.h b/include/b4p_debug_background_component.h index 7ee9418..345a1cc 100644 --- a/include/b4p_debug_background_component.h +++ b/include/b4p_debug_background_component.h @@ -32,7 +32,7 @@ struct CB4DebugBackgroundComponent { // 0xC // B4 Functions // -------------------------------- -typedef void (*const CB4DebugBackgroundComponent__Prepare_t)(CB4DebugBackgroundComponent* _this); +typedef void (*CB4DebugBackgroundComponent__Prepare_t)(CB4DebugBackgroundComponent* _this); extern CB4DebugBackgroundComponent__Prepare_t CB4DebugBackgroundComponent__Prepare; diff --git a/include/b4p_debug_main_menu_page.h b/include/b4p_debug_main_menu_page.h index e7c9c28..5566575 100644 --- a/include/b4p_debug_main_menu_page.h +++ b/include/b4p_debug_main_menu_page.h @@ -1,8 +1,7 @@ -#ifndef B4P_DEBUG_MENU_COMPONENT_BASE_H_INCLUDED -#define B4P_DEBUG_MENU_COMPONENT_BASE_H_INCLUDED +#ifndef B4P_DEBUG_MAIN_MENU_PAGE_H_INCLUDED +#define B4P_DEBUG_MAIN_MENU_PAGE_H_INCLUDED -#include -#include +#include "b4p_debug_menu_page_base.h" // -------------------------------- // Enums @@ -13,11 +12,28 @@ // Structs // -------------------------------- +typedef struct CB4DebugMainMenuPage CB4DebugMainMenuPage; +typedef struct CB4DebugMainMenuPage__vtable CB4DebugMainMenuPage__vtable; + +struct CB4DebugMainMenuPage { // 0x28 + CB4DebugMenuPageBase mBase; +}; + +struct CB4DebugMainMenuPage__vtable { // 0x18 + CB4DebugMenuPageBase__vtable __vtable; +}; // -------------------------------- // Declarations // -------------------------------- +extern CB4DebugMainMenuPage gDebugMainMenuPage; +extern CB4DebugMainMenuPage__vtable gDebugMainMenuPage__vtable; + +void CB4DebugMainMenuPage__Prepare(CB4DebugMainMenuPage* _this); +void CB4DebugMainMenuPage__Update(CB4DebugMainMenuPage* _this); +void CB4DebugMainMenuPage__Release(CB4DebugMainMenuPage* _this); +void CB4DebugMainMenuPage__ApplyVSelectOption(CB4DebugMainMenuPage* _this); // -------------------------------- // B4 Variables diff --git a/include/b4p_debug_menu_component_base.h b/include/b4p_debug_menu_component_base.h index c80a5c1..0074b7b 100644 --- a/include/b4p_debug_menu_component_base.h +++ b/include/b4p_debug_menu_component_base.h @@ -36,5 +36,8 @@ struct CB4DebugMenuComponentBase { // 0xC // B4 Functions // -------------------------------- +typedef void (*CB4DebugMenuComponentBase__Release_t)(CB4DebugMenuComponentBase* _this); + +extern CB4DebugMenuComponentBase__Release_t CB4DebugMenuComponentBase__Release; #endif diff --git a/include/b4p_debug_menu_page_base.h b/include/b4p_debug_menu_page_base.h index 7cdec33..0490df0 100644 --- a/include/b4p_debug_menu_page_base.h +++ b/include/b4p_debug_menu_page_base.h @@ -2,8 +2,11 @@ #define B4P_DEBUG_MENU_PAGE_BASE_H_INCLUDED #include +#include #include "b4p_vtable.h" +#define COUNT_OF(x) ((sizeof(x) / sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) + // -------------------------------- // Enums // -------------------------------- @@ -16,11 +19,12 @@ typedef struct CB4DebugMenuPageBase CB4DebugMenuPageBase; typedef struct CB4DebugMenuPageBase__vtable CB4DebugMenuPageBase__vtable; -// Take advantage of these 8 unused bytes to add a custom vtable (ApplyVSelectOption) -struct CB4DebugMenuPageBase__vtable { // 0x18 - __vtbl_ptr_type ApplyVSelectOption; // uint8_t __pad0[8]; +// Added "Prepare" and "ApplyVSelectOption" methods to the original vtable structure +struct CB4DebugMenuPageBase__vtable { // 0x20 + __vtbl_ptr_type Prepare; // uint8_t __pad0[8]; __vtbl_ptr_type Update; __vtbl_ptr_type Release; + __vtbl_ptr_type ApplyVSelectOption; }; struct CB4DebugMenuPageBase { // 0x4 @@ -31,7 +35,8 @@ struct CB4DebugMenuPageBase { // 0x4 // Declarations // -------------------------------- -typedef void (*ApplyVSelectOption_t)(CB4DebugMenuPageBase *_this); +typedef void (*CB4DebugMenuPageBase__ApplyVSelectOption_t)(CB4DebugMenuPageBase* _this); +typedef void (*CB4DebugMenuPageBase__Release_t)(CB4DebugMenuPageBase* _this); // -------------------------------- // B4 Variables @@ -42,7 +47,7 @@ typedef void (*ApplyVSelectOption_t)(CB4DebugMenuPageBase *_this); // B4 Functions // -------------------------------- -typedef void (*const CB4DebugMenuPageBase__Prepare_t)(CB4DebugMenuPageBase* _this); +typedef void (*CB4DebugMenuPageBase__Prepare_t)(CB4DebugMenuPageBase* _this); extern CB4DebugMenuPageBase__Prepare_t CB4DebugMenuPageBase__Prepare; diff --git a/include/b4p_debug_menu_page_manager.h b/include/b4p_debug_menu_page_manager.h index 39759e2..5ff66c6 100644 --- a/include/b4p_debug_menu_page_manager.h +++ b/include/b4p_debug_menu_page_manager.h @@ -26,6 +26,7 @@ struct CB4DebugMenuPageManager { // 0x10 // Declarations // -------------------------------- +void CB4DebugMenuPageManager__ImmediateLeadOut2(CB4DebugMenuPageManager* _this, EB4MenuFlowEvents leEvent); // -------------------------------- // B4 Variables @@ -37,7 +38,7 @@ extern CB4DebugMenuPageManager* gDebugMenuPageManager; // B4 Functions // -------------------------------- -typedef void (*const CB4DebugMenuPageManager__ImmediateLeadOut_t)(void* _this, EB4MenuFlowEvents leEvent); +typedef void (*CB4DebugMenuPageManager__ImmediateLeadOut_t)(CB4DebugMenuPageManager* _this, EB4MenuFlowEvents leEvent); extern CB4DebugMenuPageManager__ImmediateLeadOut_t CB4DebugMenuPageManager__ImmediateLeadOut; diff --git a/include/b4p_debug_menu_pages.h b/include/b4p_debug_menu_pages.h index 194e570..b3c0d51 100644 --- a/include/b4p_debug_menu_pages.h +++ b/include/b4p_debug_menu_pages.h @@ -4,6 +4,8 @@ #include #include "b4p_debug_original_menu_page.h" +#define NB_PAGES 3 + // -------------------------------- // Enums // -------------------------------- @@ -30,6 +32,8 @@ struct CB4DebugMenuPages { // 0x70 // Declarations // -------------------------------- +extern CB4DebugMenuPageBase* gapDebugMenuPagesBases[]; + void CB4DebugMenuPages__InitHook(); // -------------------------------- @@ -42,7 +46,7 @@ extern CB4DebugMenuPages* gDebugMenuPages; // B4 Functions // -------------------------------- -typedef void (*const CB4DebugMenuPages__Init_t)(); +typedef void (*CB4DebugMenuPages__Init_t)(); extern CB4DebugMenuPages__Init_t CB4DebugMenuPages__Init; diff --git a/include/b4p_debug_menu_state.h b/include/b4p_debug_menu_state.h index f444b14..9764d04 100644 --- a/include/b4p_debug_menu_state.h +++ b/include/b4p_debug_menu_state.h @@ -37,7 +37,7 @@ void CB4DebugMenuState__ActionHook(CB4DebugMenuState* _this, EGtStateAction leAc // B4 Functions // -------------------------------- -typedef void (*const CB4DebugMenuState__Action_t)(CB4DebugMenuState* _this, EGtStateAction leAction, void* lpOwner, void* lpActionData, void* lpUserData); +typedef void (*CB4DebugMenuState__Action_t)(CB4DebugMenuState* _this, EGtStateAction leAction, void* lpOwner, void* lpActionData, void* lpUserData); extern CB4DebugMenuState__Action_t CB4DebugMenuState__Action; diff --git a/include/b4p_debug_original_menu_page.h b/include/b4p_debug_original_menu_page.h index ae0e72a..8c02eb8 100644 --- a/include/b4p_debug_original_menu_page.h +++ b/include/b4p_debug_original_menu_page.h @@ -35,6 +35,7 @@ struct CB4DebugOriginalMenuPage { // 0x28 // Declarations // -------------------------------- +void CB4DebugOriginalMenuPage__UpdateHook(CB4DebugOriginalMenuPage* _this); // -------------------------------- // B4 Variables @@ -45,8 +46,8 @@ struct CB4DebugOriginalMenuPage { // 0x28 // B4 Functions // -------------------------------- -typedef void (*const CB4DebugOriginalMenuPage__Prepare_t)(CB4DebugOriginalMenuPage* _this); -typedef void (*const CB4DebugOriginalMenuPage__Update_t)(CB4DebugOriginalMenuPage* _this); +typedef void (*CB4DebugOriginalMenuPage__Prepare_t)(CB4DebugOriginalMenuPage* _this); +typedef void (*CB4DebugOriginalMenuPage__Update_t)(CB4DebugOriginalMenuPage* _this); extern CB4DebugOriginalMenuPage__Prepare_t CB4DebugOriginalMenuPage__Prepare; extern CB4DebugOriginalMenuPage__Update_t CB4DebugOriginalMenuPage__Update; diff --git a/include/b4p_debug_test_menu_entries.h b/include/b4p_debug_test_menu_options.h similarity index 68% rename from include/b4p_debug_test_menu_entries.h rename to include/b4p_debug_test_menu_options.h index c983780..fcb0c62 100644 --- a/include/b4p_debug_test_menu_entries.h +++ b/include/b4p_debug_test_menu_options.h @@ -1,39 +1,27 @@ #ifndef B4P_DEBUG_TEST_MENU_ENTRIES_H_INCLUDED #define B4P_DEBUG_TEST_MENU_ENTRIES_H_INCLUDED -static const char* gapcDebugMenuEntryNames[] = { - "Video Mode", - "Speedometer Unit", - "Test Entry 3", - "Test Entry 4", - "Test Entry 5", - "Test Entry 6 (no options)", - "Test Entry 7 (no options)" -}; - -static CB4DebugVSelectEntry gaDebugTestMenuEntries[sizeof(gapcDebugMenuEntryNames) / sizeof(gapcDebugMenuEntryNames[0])]; - -static const char* gapcDebugMenuNoOptions[] = { +static const char* kapcDebugTestMenuNoOptions[] = { " " }; -static const char* gapcDebugMenuEntryVideoModeOptions[] = { +static const char* kapcDebugTestMenuEntryVideoModeOptions[] = { "NTSC", "480p", "PAL" }; -static const char* gapcDebugMenuEntryOnOffOptions[] = { +static const char* kapcDebugTestMenuEntryOnOffOptions[] = { "On", "Off" }; -static const char* gapcDebugMenuEntrySpeedoUnitOptions[] = { +static const char* kapcDebugTestMenuEntrySpeedoUnitOptions[] = { "MPH", "KPH" }; -static const char* gapcDebugMenuEntry1Options[] = { +static const char* kapcDebugTestMenuEntry1Options[] = { "Entry 1 Test Option 1", "Entry 1 Test Option 2", "Entry 1 Test Option 3", @@ -41,7 +29,7 @@ static const char* gapcDebugMenuEntry1Options[] = { "Entry 1 Test Option 5" }; -static const char* gapcDebugMenuEntry2Options[] = { +static const char* kapcDebugTestMenuEntry2Options[] = { "Entry 2 Test Option 1", "Entry 2 Test Option 2", "Entry 2 Test Option 3", @@ -49,7 +37,7 @@ static const char* gapcDebugMenuEntry2Options[] = { "Entry 2 Test Option 5" }; -static const char* gapcDebugMenuEntry3Options[] = { +static const char* kapcDebugTestMenuEntry3Options[] = { "Entry 3 Test Option 1", "Entry 3 Test Option 2", "Entry 3 Test Option 3", @@ -57,7 +45,7 @@ static const char* gapcDebugMenuEntry3Options[] = { "Entry 3 Test Option 5" }; -static const char* gapcDebugMenuEntry4Options[] = { +static const char* kapcDebugTestMenuEntry4Options[] = { "Entry 4 Test Option 1", "Entry 4 Test Option 2", "Entry 4 Test Option 3", @@ -65,7 +53,7 @@ static const char* gapcDebugMenuEntry4Options[] = { "Entry 4 Test Option 5" }; -static const char* gapcDebugMenuEntry5Options[] = { +static const char* kapcDebugTestMenuEntry5Options[] = { "Entry 5 Test Option 1", "Entry 5 Test Option 2", "Entry 5 Test Option 3", @@ -73,7 +61,7 @@ static const char* gapcDebugMenuEntry5Options[] = { "Entry 5 Test Option 5" }; -static const char* gapcDebugMenuEntry0To100Options[] = { +static const char* kapcDebugTestMenuEntry0To100Options[] = { "0", "1", "2", diff --git a/include/b4p_debug_test_menu_page.h b/include/b4p_debug_test_menu_page.h index 4114ba8..9f368a6 100644 --- a/include/b4p_debug_test_menu_page.h +++ b/include/b4p_debug_test_menu_page.h @@ -1,8 +1,6 @@ #ifndef B4P_DEBUG_TEST_MENU_PAGE_H_INCLUDED #define B4P_DEBUG_TEST_MENU_PAGE_H_INCLUDED -#include -#include #include "b4p_debug_menu_page_base.h" #include "b4p_debug_vselect_option_component.h" diff --git a/include/b4p_debug_vselect_component.h b/include/b4p_debug_vselect_component.h index 7d346f4..cb35585 100644 --- a/include/b4p_debug_vselect_component.h +++ b/include/b4p_debug_vselect_component.h @@ -37,8 +37,8 @@ void CB4DebugVSelectComponent__UpdateHook(CB4DebugVSelectComponent* _this); // B4 Functions // -------------------------------- -typedef void (*const CB4DebugVSelectComponent__Prepare_t)(CB4DebugVSelectComponent* _this, const char** lppcEntriesList, int lnNumEntries); -typedef void (*const CB4DebugVSelectComponent__Update_t)(CB4DebugVSelectComponent* _this); +typedef void (*CB4DebugVSelectComponent__Prepare_t)(CB4DebugVSelectComponent* _this, const char** lppcEntriesList, int lnNumEntries); +typedef void (*CB4DebugVSelectComponent__Update_t)(CB4DebugVSelectComponent* _this); extern CB4DebugVSelectComponent__Prepare_t CB4DebugVSelectComponent__Prepare; extern CB4DebugVSelectComponent__Update_t CB4DebugVSelectComponent__Update; diff --git a/include/b4p_debug_vselect_option_component.h b/include/b4p_debug_vselect_option_component.h index 7ace600..e7f7dad 100644 --- a/include/b4p_debug_vselect_option_component.h +++ b/include/b4p_debug_vselect_option_component.h @@ -49,9 +49,9 @@ void CB4DebugVSelectOptionComponent__UpdateHook(CB4DebugVSelectOptionComponent* // B4 Functions // -------------------------------- -typedef void (*const CB4DebugVSelectOptionComponent__Prepare_t)(CB4DebugVSelectOptionComponent* _this, CB4DebugVSelectEntry* lpEntries, int lnNumEntries); -typedef void (*const CB4DebugVSelectOptionComponent__Update_t)(CB4DebugVSelectOptionComponent* _this); -typedef void (*const CB4DebugVSelectEntry__Prepare_t)(CB4DebugVSelectEntry* _this, const char* lpcEntryName, const char** lppcOptionsList, int lnNumOptions, int lnInitialOptionSelection); +typedef void (*CB4DebugVSelectOptionComponent__Prepare_t)(CB4DebugVSelectOptionComponent* _this, CB4DebugVSelectEntry* lpEntries, int lnNumEntries); +typedef void (*CB4DebugVSelectOptionComponent__Update_t)(CB4DebugVSelectOptionComponent* _this); +typedef void (*CB4DebugVSelectEntry__Prepare_t)(CB4DebugVSelectEntry* _this, const char* lpcEntryName, const char** lppcOptionsList, int lnNumOptions, int lnInitialOptionSelection); extern CB4DebugVSelectOptionComponent__Prepare_t CB4DebugVSelectOptionComponent__Prepare; extern CB4DebugVSelectOptionComponent__Update_t CB4DebugVSelectOptionComponent__Update; diff --git a/include/b4p_input.h b/include/b4p_input.h index df37a1c..df2aa57 100644 --- a/include/b4p_input.h +++ b/include/b4p_input.h @@ -90,8 +90,8 @@ extern void* gInputManager; // B4 Functions // -------------------------------- -typedef float (*const CB4ControllerMapping__GetPadControl_t)(void* _this, EGtPS2DualShockDeviceControl lePadControl, bool lbDebounced, uint8_t ln8Player); -typedef bool (*const CB4InputManager__GetMenuButton_t)(void* _this, EMenuControls leMenuButton, int8_t ln8Player); +typedef float (*CB4ControllerMapping__GetPadControl_t)(void* _this, EGtPS2DualShockDeviceControl lePadControl, bool lbDebounced, uint8_t ln8Player); +typedef bool (*CB4InputManager__GetMenuButton_t)(void* _this, EMenuControls leMenuButton, int8_t ln8Player); extern CB4ControllerMapping__GetPadControl_t CB4ControllerMapping__GetPadControl; extern CB4InputManager__GetMenuButton_t CB4InputManager__GetMenuButton; diff --git a/include/b4p_main_menu_state.h b/include/b4p_main_menu_state.h index a6e0c1a..780447f 100644 --- a/include/b4p_main_menu_state.h +++ b/include/b4p_main_menu_state.h @@ -34,8 +34,8 @@ void CB4MainMenuState__ActionHook(CB4MainMenuState* _this, EGtStateAction leActi // B4 Functions // -------------------------------- -typedef void (*const CB4MainMenuState__Action_t)(CB4MainMenuState* _this, EGtStateAction leAction, void* lpOwner, void* lpActionData, void* lpUserData); -typedef void (*const CB4MainMenuState__InitiateConfirm_t)(CB4MainMenuState* _this, uint64_t lDestinationState); +typedef void (*CB4MainMenuState__Action_t)(CB4MainMenuState* _this, EGtStateAction leAction, void* lpOwner, void* lpActionData, void* lpUserData); +typedef void (*CB4MainMenuState__InitiateConfirm_t)(CB4MainMenuState* _this, uint64_t lDestinationState); extern CB4MainMenuState__Action_t CB4MainMenuState__Action; extern CB4MainMenuState__InitiateConfirm_t CB4MainMenuState__InitiateConfirm; diff --git a/include/b4p_menu_flow_manager.h b/include/b4p_menu_flow_manager.h index 3949aba..dd82f30 100644 --- a/include/b4p_menu_flow_manager.h +++ b/include/b4p_menu_flow_manager.h @@ -60,7 +60,7 @@ extern CB4MenuFlowManager* gMenuFlowManager; // B4 Functions // -------------------------------- -typedef void (*const CB4MenuFlowManager__ApplyEvent_t)(CB4MenuFlowManager* _this, uint32_t lnEventID, void* lpUserData); +typedef void (*CB4MenuFlowManager__ApplyEvent_t)(CB4MenuFlowManager* _this, uint32_t lnEventID, void* lpUserData); extern CB4MenuFlowManager__ApplyEvent_t CB4MenuFlowManager__ApplyEvent; diff --git a/include/b4p_menu_selection_data.h b/include/b4p_menu_selection_data.h index 5b5f5c5..772096c 100644 --- a/include/b4p_menu_selection_data.h +++ b/include/b4p_menu_selection_data.h @@ -33,8 +33,8 @@ struct CB4MenuSelectionData { // 0x4 // B4 Functions // -------------------------------- -typedef bool (*const CB4MenuSelectionData__SelectNext_t)(CB4MenuSelectionData* _this); -typedef bool (*const CB4MenuSelectionData__SelectPrev_t)(CB4MenuSelectionData* _this); +typedef bool (*CB4MenuSelectionData__SelectNext_t)(CB4MenuSelectionData* _this); +typedef bool (*CB4MenuSelectionData__SelectPrev_t)(CB4MenuSelectionData* _this); extern CB4MenuSelectionData__SelectNext_t CB4MenuSelectionData__SelectNext; extern CB4MenuSelectionData__SelectPrev_t CB4MenuSelectionData__SelectPrev; diff --git a/include/b4p_other.h b/include/b4p_other.h index 738d1b6..136ae35 100644 --- a/include/b4p_other.h +++ b/include/b4p_other.h @@ -49,9 +49,9 @@ extern void* gGame; // B4 Functions // -------------------------------- -typedef void (*const CB4GraphicsManager__SetVideoMode_t)(CB4GraphicsManager* _this, EB4VideoMode leVideoMode); -typedef void (*const CB4AptManager__SetScreenSettings_t)(void* _this); -typedef void (*const CB4Game__SetFrontendFrameRate_t)(void* _this, bool lbSetFrontendFrameRate); +typedef void (*CB4GraphicsManager__SetVideoMode_t)(CB4GraphicsManager* _this, EB4VideoMode leVideoMode); +typedef void (*CB4AptManager__SetScreenSettings_t)(void* _this); +typedef void (*CB4Game__SetFrontendFrameRate_t)(void* _this, bool lbSetFrontendFrameRate); extern CB4GraphicsManager__SetVideoMode_t CB4GraphicsManager__SetVideoMode; extern CB4AptManager__SetScreenSettings_t CB4AptManager__SetScreenSettings; diff --git a/include/b4p_sound.h b/include/b4p_sound.h index 81924ce..18643ee 100644 --- a/include/b4p_sound.h +++ b/include/b4p_sound.h @@ -37,7 +37,7 @@ extern void* gHUDSoundManager; // B4 Functions // -------------------------------- -typedef void (*const CB4HUDSoundManager__HandleFESound_t)(void* _this, eSoundFEGeneral leSound); +typedef void (*CB4HUDSoundManager__HandleFESound_t)(void* _this, eSoundFEGeneral leSound); extern CB4HUDSoundManager__HandleFESound_t CB4HUDSoundManager__HandleFESound; diff --git a/include/b4p_state.h b/include/b4p_state.h index a28dc6d..0b92a63 100644 --- a/include/b4p_state.h +++ b/include/b4p_state.h @@ -73,9 +73,9 @@ extern uint64_t* kB4DebugMenuStateID; // B4 Functions // -------------------------------- -typedef CGtState* (*const CGtFSM__GetStateFromID_t)(CGtFSM* _this, uint64_t lStateID); -typedef void (*const CGtFSM__StateEnter_t)(CGtFSM* _this, CGtState* lpOldState, void* lpUserData); -typedef void (*const CGtFSM__StateLeave_t)(CGtFSM* _this, CGtState* lpNewState, void* lpUserData); +typedef CGtState* (*CGtFSM__GetStateFromID_t)(CGtFSM* _this, uint64_t lStateID); +typedef void (*CGtFSM__StateEnter_t)(CGtFSM* _this, CGtState* lpOldState, void* lpUserData); +typedef void (*CGtFSM__StateLeave_t)(CGtFSM* _this, CGtState* lpNewState, void* lpUserData); extern CGtFSM__GetStateFromID_t CGtFSM__GetStateFromID; extern CGtFSM__StateEnter_t CGtFSM__StateEnter; diff --git a/src/b4p_debug_main_menu_page.c b/src/b4p_debug_main_menu_page.c index e69de29..86fc18e 100644 --- a/src/b4p_debug_main_menu_page.c +++ b/src/b4p_debug_main_menu_page.c @@ -0,0 +1,37 @@ +#include "b4p_debug_main_menu_page.h" +#include "b4p_debug_menu_page_manager.h" +#include "b4p_debug_menu_components.h" +#include "b4p_debug_background_component.h" +#include "b4p_debug_vselect_component.h" +#include "b4p_debug_menu_page_base.h" +#include "b4p_input.h" + +static const char* kapcDebugMainMenuEntryNames[] = { + "Test Menu", + "Legacy Menu(with all its flaws)" +}; + +void CB4DebugMainMenuPage__Update(CB4DebugMainMenuPage* _this) +{ + if (CB4InputManager__GetMenuButton(gInputManager, eButtonBack, -1)) + { + CB4DebugMenuPageManager__ImmediateLeadOut2(gDebugMenuPageManager, eMenuFlowEventMenuPageBack); + } + + else if (CB4InputManager__GetMenuButton(gInputManager, eButtonConfirm, -1)) + { + CB4DebugMenuPageManager__ImmediateLeadOut2(gDebugMenuPageManager, eMenuFlowEventMenuPageForward); + } +} + +void CB4DebugMainMenuPage__Release(CB4DebugMainMenuPage* _this) +{ + +} + +void CB4DebugMainMenuPage__Prepare(CB4DebugMainMenuPage* _this) +{ + CB4DebugMenuPageBase__Prepare(&_this->mBase); + CB4DebugBackgroundComponent__Prepare(&gDebugMenuComponents->mBackground); + CB4DebugVSelectComponent__Prepare(&gDebugMenuComponents->mVSelect, kapcDebugMainMenuEntryNames, COUNT_OF(kapcDebugMainMenuEntryNames)); +} diff --git a/src/b4p_debug_menu_page_manager.c b/src/b4p_debug_menu_page_manager.c new file mode 100644 index 0000000..c3865f6 --- /dev/null +++ b/src/b4p_debug_menu_page_manager.c @@ -0,0 +1,29 @@ +#include "b4p_debug_menu_page_manager.h" +#include "b4p_menu_flow_manager.h" +#include "b4p_debug_menu_page_base.h" +#include "b4p_debug_menu_component_base.h" + +void CB4DebugMenuPageManager__ImmediateLeadOut2(CB4DebugMenuPageManager* _this, EB4MenuFlowEvents leEvent) +{ + CB4DebugMenuPageBase* lpCurrentPage; + CB4DebugMenuPageBase__vtable *lpVTable; + CB4DebugMenuComponentBase* lpComponent; + + lpCurrentPage = _this->mpCurrentPage; + lpVTable = lpCurrentPage->__vtable; + lpComponent = _this->mpFirstComponent; + + ((CB4DebugMenuPageBase__Release_t)lpVTable->Release.__pfn)(lpCurrentPage); + _this->mpCurrentPage = (CB4DebugMenuPageBase*)0; + + while (lpComponent) + { + if (lpComponent->mbIsActive) + { + CB4DebugMenuComponentBase__Release(lpComponent); + } + lpComponent = lpComponent->mpNext; + } + + CB4MenuFlowManager__ApplyEvent(gMenuFlowManager, leEvent, (void*)lpCurrentPage); +} diff --git a/src/b4p_debug_menu_pages.c b/src/b4p_debug_menu_pages.c index b63bc32..33d23d5 100644 --- a/src/b4p_debug_menu_pages.c +++ b/src/b4p_debug_menu_pages.c @@ -1,24 +1,53 @@ #include "b4p_debug_menu_pages.h" #include "b4p_debug_test_menu_page.h" +#include "b4p_debug_main_menu_page.h" +#include "b4p_vtable.h" + +CB4DebugMenuPageBase* gapDebugMenuPagesBases[NB_PAGES]; CB4DebugTestMenuPage gDebugTestMenuPage; CB4DebugTestMenuPage__vtable gDebugTestMenuPage__vtable; +CB4DebugMainMenuPage gDebugMainMenuPage; +CB4DebugMainMenuPage__vtable gDebugMainMenuPage__vtable; + +static void InitPagesBases() +{ + gapDebugMenuPagesBases[0] = &gDebugMainMenuPage.mBase; + gapDebugMenuPagesBases[1] = &gDebugTestMenuPage.mBase; + gapDebugMenuPagesBases[2] = &gDebugMenuPages->mDebugMenu.mBase; +} + +static void InitVTable(CB4DebugMenuPageBase* lpPageBase, CB4DebugMenuPageBase__vtable* lpVTable, void* lpfnPrepare, void* lpfnUpdate, void* lpfnRelease, void* lpfnApplyVSelectOption) +{ + lpVTable->Prepare.__delta = 0; + lpVTable->Prepare.__index = 0; + lpVTable->Prepare.__pfn = lpfnPrepare; + + lpVTable->Update.__delta = 0; + lpVTable->Update.__index = 0; + lpVTable->Update.__pfn = lpfnUpdate; + + lpVTable->Release.__delta = 0; + lpVTable->Release.__index = 0; + lpVTable->Release.__pfn = lpfnRelease; + + lpVTable->ApplyVSelectOption.__delta = 0; + lpVTable->ApplyVSelectOption.__index = 0; + lpVTable->ApplyVSelectOption.__pfn = lpfnApplyVSelectOption; + + lpPageBase->__vtable = lpVTable; +} + void CB4DebugMenuPages__InitHook() { CB4DebugMenuPages__Init(); - gDebugTestMenuPage__vtable.__vtable.Update.__delta = 0; - gDebugTestMenuPage__vtable.__vtable.Update.__index = 0; - gDebugTestMenuPage__vtable.__vtable.Update.__pfn = (void*)&CB4DebugTestMenuPage__Update; - - gDebugTestMenuPage__vtable.__vtable.Release.__delta = 0; - gDebugTestMenuPage__vtable.__vtable.Release.__index = 0; - gDebugTestMenuPage__vtable.__vtable.Release.__pfn = (void*)&CB4DebugTestMenuPage__Release; + // Only need to set "Prepare" method for the original debug menu + gDebugMenuPages->mDebugMenu.mBase.__vtable->Prepare.__pfn = CB4DebugOriginalMenuPage__Prepare; - gDebugTestMenuPage__vtable.__vtable.ApplyVSelectOption.__delta = 0; - gDebugTestMenuPage__vtable.__vtable.ApplyVSelectOption.__index = 0; - gDebugTestMenuPage__vtable.__vtable.ApplyVSelectOption.__pfn = (void*)&CB4DebugTestMenuPage__ApplyVSelectOption; + InitPagesBases(); - gDebugTestMenuPage.mBase.__vtable = &gDebugTestMenuPage__vtable; + InitVTable(&gDebugTestMenuPage.mBase, &gDebugTestMenuPage__vtable.__vtable, (void*)&CB4DebugTestMenuPage__Prepare, (void*)&CB4DebugTestMenuPage__Update, (void*)&CB4DebugTestMenuPage__Release, (void*)&CB4DebugTestMenuPage__ApplyVSelectOption); + InitVTable(&gDebugMainMenuPage.mBase, &gDebugMainMenuPage__vtable.__vtable, (void*)&CB4DebugTestMenuPage__Prepare, (void*)&CB4DebugMainMenuPage__Update, (void*)&CB4DebugMainMenuPage__Release, (void*)0); } diff --git a/src/b4p_debug_menu_state.c b/src/b4p_debug_menu_state.c index 1865a13..f0fcabe 100644 --- a/src/b4p_debug_menu_state.c +++ b/src/b4p_debug_menu_state.c @@ -2,6 +2,7 @@ #include "b4p_debug_menu_page_manager.h" #include "b4p_debug_menu_state.h" #include "b4p_debug_test_menu_page.h" +#include "b4p_debug_main_menu_page.h" #include "b4p_debug_menu_components.h" #include "b4p_debug_menu_pages.h" #include "b4p_debug_vselect_option_component.h" @@ -13,27 +14,57 @@ void CB4DebugMenuState__ActionHook(CB4DebugMenuState* _this, EGtStateAction leAction, void* lpOwner, void* lpActionData, void* lpUserData) { CB4DebugMenuPageBase* lpCurrentPage; - ApplyVSelectOption_t lpfnApplyVSelectOption; + CB4DebugMenuPageBase* lpDestinationPage; + CB4DebugMenuPageBase__Prepare_t lpfnPrepare; + CB4DebugMenuPageBase__ApplyVSelectOption_t lpfnApplyVSelectOption; + + lpCurrentPage = gDebugMenuPageManager->mpCurrentPage; + // lpUserData contains the original debug menu base address when we leave it (forward & back events) + if (lpCurrentPage == &gDebugMenuPages->mDebugMenu.mBase || (CB4DebugMenuPageBase*)lpUserData == &gDebugMenuPages->mDebugMenu.mBase) + { + CB4DebugMenuState__Action(_this, leAction, lpOwner, lpActionData, lpUserData); + if (lpCurrentPage == &gDebugMenuPages->mDebugMenu.mBase || (leAction == eGtStateActionEvent && (EB4MenuFlowEvents)lpActionData == eMenuFlowEventMenuPageForward)) + { + return; + } + } if (leAction == eGtStateActionEnter) { - CB4DebugTestMenuPage__Prepare(&gDebugTestMenuPage); + CB4DebugMainMenuPage__Prepare(&gDebugMainMenuPage); CB4HUDSoundManager__HandleFESound(gHUDSoundManager, eSoundFELocked); } else if (leAction == eGtStateActionEvent) { switch ((EB4MenuFlowEvents)lpActionData) { + case eMenuFlowEventMenuPageForward: + // Current entry + 1 because index 0 is main menu + lpDestinationPage = gapDebugMenuPagesBases[gDebugMenuComponents->mVSelect.mSelectionData.mu16CurrentItem + 1]; + + lpfnPrepare = (CB4DebugMenuPageBase__Prepare_t)lpDestinationPage->__vtable->Prepare.__pfn; + lpfnPrepare(lpDestinationPage); + + CB4HUDSoundManager__HandleFESound(gHUDSoundManager, 0x34); + break; + case eMenuFlowEventMenuPageBack: - ChangeState(*kB4MainMenuStateID, kB4DebugMenuStateID); - CB4HUDSoundManager__HandleFESound(gHUDSoundManager, eSoundFELand); + if (((CB4DebugMenuPageBase*)lpUserData) == &gDebugMainMenuPage.mBase) + { + ChangeState(*kB4MainMenuStateID, kB4DebugMenuStateID); + CB4HUDSoundManager__HandleFESound(gHUDSoundManager, eSoundFELand); + } + else + { + CB4DebugMainMenuPage__Prepare(&gDebugMainMenuPage); + CB4HUDSoundManager__HandleFESound(gHUDSoundManager, 0x36); + } break; - case eMenuFlowEventMenuPageDebugButtonEvent: + case eMenuFlowEventMenuPageSelectedOption: if ((EVSelectOptionUpdateType)lpUserData == eVSelectOptionUpdateTypeHorizontal) { - lpCurrentPage = gDebugMenuPageManager->mpCurrentPage; - lpfnApplyVSelectOption = (ApplyVSelectOption_t)(lpCurrentPage->__vtable->ApplyVSelectOption.__pfn); + lpfnApplyVSelectOption = (CB4DebugMenuPageBase__ApplyVSelectOption_t)(lpCurrentPage->__vtable->ApplyVSelectOption.__pfn); if (lpfnApplyVSelectOption) { lpfnApplyVSelectOption(lpCurrentPage); @@ -43,8 +74,10 @@ void CB4DebugMenuState__ActionHook(CB4DebugMenuState* _this, EGtStateAction leAc } } +/* if (leAction != eGtStateActionUpdate) { logger.WriteF("Action: %08X, ActionData: %08X, UserData: %08X", leAction, lpActionData, lpUserData); } +*/ } diff --git a/src/b4p_debug_original_menu_page.c b/src/b4p_debug_original_menu_page.c new file mode 100644 index 0000000..52d48a1 --- /dev/null +++ b/src/b4p_debug_original_menu_page.c @@ -0,0 +1,17 @@ +#include "b4p_debug_original_menu_page.h" +#include "b4p_debug_menu_page_manager.h" +#include "b4p_menu_flow_manager.h" +#include "b4p_input.h" + +void CB4DebugOriginalMenuPage__UpdateHook(CB4DebugOriginalMenuPage* _this) +{ + if (CB4InputManager__GetMenuButton(gInputManager, eButtonBack, -1)) + { + CB4DebugMenuPageManager__ImmediateLeadOut2(gDebugMenuPageManager, eMenuFlowEventMenuPageBack); + } + + else + { + CB4DebugOriginalMenuPage__Update(_this); + } +} diff --git a/src/b4p_debug_test_menu_page.c b/src/b4p_debug_test_menu_page.c index ba47f29..125801c 100644 --- a/src/b4p_debug_test_menu_page.c +++ b/src/b4p_debug_test_menu_page.c @@ -3,13 +3,25 @@ #include "b4p_debug_test_menu_page.h" #include "b4p_debug_menu_page_manager.h" #include "b4p_debug_menu_page_base.h" -#include "b4p_debug_test_menu_entries.h" +#include "b4p_debug_test_menu_options.h" #include "b4p_debug_menu_components.h" #include "b4p_debug_background_component.h" #include "b4p_debug_vselect_option_component.h" #include "b4p_input.h" #include "b4p_other.h" +static const char* kapcDebugTestMenuEntryNames[] = { + "Video Mode", + "Speedometer Unit", + "Test Entry 3", + "Test Entry 4", + "Test Entry 5", + "Test Entry 6 (no options)", + "Test Entry 7 (no options)" +}; + +static CB4DebugVSelectEntry kaDebugTestMenuEntries[COUNT_OF(kapcDebugTestMenuEntryNames)]; + static void ApplyVideoMode(EB4VideoMode leSelectedVideoMode) { if (leSelectedVideoMode != gGraphicsManager->meCurrentVideoMode) @@ -61,7 +73,7 @@ void CB4DebugTestMenuPage__Update(CB4DebugTestMenuPage* _this) { if (CB4InputManager__GetMenuButton(gInputManager, eButtonBack, -1)) { - CB4DebugMenuPageManager__ImmediateLeadOut(gDebugMenuPageManager, eMenuFlowEventMenuPageBack); + CB4DebugMenuPageManager__ImmediateLeadOut2(gDebugMenuPageManager, eMenuFlowEventMenuPageBack); } /* @@ -85,15 +97,15 @@ void CB4DebugTestMenuPage__Prepare(CB4DebugTestMenuPage* _this) if (!lbEntriesPrepared) { lbEntriesPrepared = true; - CB4DebugVSelectEntry__Prepare(&gaDebugTestMenuEntries[0], gapcDebugMenuEntryNames[0], gapcDebugMenuEntryVideoModeOptions, sizeof(gapcDebugMenuEntryVideoModeOptions) / sizeof(gapcDebugMenuEntryVideoModeOptions[0]), gGraphicsManager->meCurrentVideoMode); - CB4DebugVSelectEntry__Prepare(&gaDebugTestMenuEntries[1], gapcDebugMenuEntryNames[1], gapcDebugMenuEntrySpeedoUnitOptions, sizeof(gapcDebugMenuEntrySpeedoUnitOptions) / sizeof(gapcDebugMenuEntrySpeedoUnitOptions[0]), eSpeedoUnitMPH); - CB4DebugVSelectEntry__Prepare(&gaDebugTestMenuEntries[2], gapcDebugMenuEntryNames[2], gapcDebugMenuEntry3Options, sizeof(gapcDebugMenuEntry3Options) / sizeof(gapcDebugMenuEntry3Options[0]), 0); - CB4DebugVSelectEntry__Prepare(&gaDebugTestMenuEntries[3], gapcDebugMenuEntryNames[3], gapcDebugMenuEntry4Options, sizeof(gapcDebugMenuEntry4Options) / sizeof(gapcDebugMenuEntry4Options[0]), 0); - CB4DebugVSelectEntry__Prepare(&gaDebugTestMenuEntries[4], gapcDebugMenuEntryNames[4], gapcDebugMenuEntry5Options, sizeof(gapcDebugMenuEntry5Options) / sizeof(gapcDebugMenuEntry5Options[0]), 0); - CB4DebugVSelectEntry__Prepare(&gaDebugTestMenuEntries[5], gapcDebugMenuEntryNames[5], gapcDebugMenuNoOptions, sizeof(gapcDebugMenuNoOptions) / sizeof(gapcDebugMenuNoOptions[0]), 0); - CB4DebugVSelectEntry__Prepare(&gaDebugTestMenuEntries[6], gapcDebugMenuEntryNames[6], gapcDebugMenuNoOptions, sizeof(gapcDebugMenuNoOptions) / sizeof(gapcDebugMenuNoOptions[0]), 0); + CB4DebugVSelectEntry__Prepare(&kaDebugTestMenuEntries[0], kapcDebugTestMenuEntryNames[0], kapcDebugTestMenuEntryVideoModeOptions, COUNT_OF(kapcDebugTestMenuEntryVideoModeOptions), gGraphicsManager->meCurrentVideoMode); + CB4DebugVSelectEntry__Prepare(&kaDebugTestMenuEntries[1], kapcDebugTestMenuEntryNames[1], kapcDebugTestMenuEntrySpeedoUnitOptions, COUNT_OF(kapcDebugTestMenuEntrySpeedoUnitOptions), eSpeedoUnitMPH); + CB4DebugVSelectEntry__Prepare(&kaDebugTestMenuEntries[2], kapcDebugTestMenuEntryNames[2], kapcDebugTestMenuEntry3Options, COUNT_OF(kapcDebugTestMenuEntry3Options), 0); + CB4DebugVSelectEntry__Prepare(&kaDebugTestMenuEntries[3], kapcDebugTestMenuEntryNames[3], kapcDebugTestMenuEntry4Options, COUNT_OF(kapcDebugTestMenuEntry4Options), 0); + CB4DebugVSelectEntry__Prepare(&kaDebugTestMenuEntries[4], kapcDebugTestMenuEntryNames[4], kapcDebugTestMenuEntry5Options, COUNT_OF(kapcDebugTestMenuEntry5Options), 0); + CB4DebugVSelectEntry__Prepare(&kaDebugTestMenuEntries[5], kapcDebugTestMenuEntryNames[5], kapcDebugTestMenuNoOptions, COUNT_OF(kapcDebugTestMenuNoOptions), 0); + CB4DebugVSelectEntry__Prepare(&kaDebugTestMenuEntries[6], kapcDebugTestMenuEntryNames[6], kapcDebugTestMenuNoOptions, COUNT_OF(kapcDebugTestMenuNoOptions), 0); } CB4DebugBackgroundComponent__Prepare(&gDebugMenuComponents->mBackground); - CB4DebugVSelectOptionComponent__Prepare(&gDebugMenuComponents->mVSelectOption, gaDebugTestMenuEntries, sizeof(gaDebugTestMenuEntries) / sizeof(gaDebugTestMenuEntries[0])); + CB4DebugVSelectOptionComponent__Prepare(&gDebugMenuComponents->mVSelectOption, kaDebugTestMenuEntries, COUNT_OF(kaDebugTestMenuEntries)); } diff --git a/src/b4p_debug_vselect_component.c b/src/b4p_debug_vselect_component.c index 8cf8791..b4cded2 100644 --- a/src/b4p_debug_vselect_component.c +++ b/src/b4p_debug_vselect_component.c @@ -24,7 +24,7 @@ void CB4DebugVSelectComponent__UpdateHook(CB4DebugVSelectComponent* _this) { lbSelectDone = CB4MenuSelectionData__SelectNext(lpSelectionData); } - CB4HUDSoundManager__HandleFESound(gHUDSoundManager, eSoundFEVertMove); + CB4HUDSoundManager__HandleFESound(gHUDSoundManager, 0x31); // Circular selection if (!lbSelectDone) diff --git a/src/b4p_debug_vselect_option_component.c b/src/b4p_debug_vselect_option_component.c index 546ddf6..9ea90b5 100644 --- a/src/b4p_debug_vselect_option_component.c +++ b/src/b4p_debug_vselect_option_component.c @@ -34,7 +34,7 @@ void CB4DebugVSelectOptionComponent__UpdateHook(CB4DebugVSelectOptionComponent* { lbSelectDone = CB4MenuSelectionData__SelectNext(lpSelectionData); } - CB4HUDSoundManager__HandleFESound(gHUDSoundManager, eSoundFEVertMove); + CB4HUDSoundManager__HandleFESound(gHUDSoundManager, 0x31); } else if (lbLeft || lbRight) { @@ -52,7 +52,7 @@ void CB4DebugVSelectOptionComponent__UpdateHook(CB4DebugVSelectOptionComponent* if (lpSelectionData->mu16NumItems > 1) { leUpdateType = eVSelectOptionUpdateTypeHorizontal; - CB4HUDSoundManager__HandleFESound(gHUDSoundManager, eSoundFEOptionsHoriMove); + CB4HUDSoundManager__HandleFESound(gHUDSoundManager, 0x35); } } @@ -68,6 +68,6 @@ void CB4DebugVSelectOptionComponent__UpdateHook(CB4DebugVSelectOptionComponent* lpSelectionData->mu16CurrentItem = 0; } } - CB4MenuFlowManager__ApplyEvent(gMenuFlowManager, eMenuFlowEventMenuPageDebugButtonEvent, (void*)leUpdateType); + CB4MenuFlowManager__ApplyEvent(gMenuFlowManager, eMenuFlowEventMenuPageSelectedOption, (void*)leUpdateType); } } diff --git a/src/b4p_main.c b/src/b4p_main.c index f46cd80..90a4fe5 100644 --- a/src/b4p_main.c +++ b/src/b4p_main.c @@ -2,14 +2,14 @@ #include "log.h" #include "injector.h" #include "b4p_debug_menu_pages.h" +#include "b4p_debug_menu_page_manager.h" #include "b4p_state.h" #include "b4p_main_menu_state.h" +#include "b4p_debug_original_menu_page.h" #include "b4p_debug_menu_state.h" #include "b4p_debug_vselect_component.h" #include "b4p_debug_vselect_option_component.h" -// Now create our own page instead of modifying the current debug one ? - int CompatibleCRCList[] = { 0x28B66C81, 0xD224D348 }; char OSDText[OSDStringNum][OSDStringSize] = { {1} }; @@ -18,11 +18,16 @@ void init() logger.SetBuffer(OSDText, sizeof(OSDText) / sizeof(OSDText[0]), sizeof(OSDText[0])); logger.Write("B4Plugin loaded"); injector.WriteMemory32(0x47F820, (uintptr_t)&CB4DebugMenuPages__InitHook); - injector.WriteMemory32(0x49F894, (uintptr_t)&CGtFSM__StateEnterHook); + // injector.WriteMemory32(0x49F894, (uintptr_t)&CGtFSM__StateEnterHook); injector.WriteMemory32(0x49FB9C, (uintptr_t)&CB4MainMenuState__ActionHook); injector.WriteMemory32(0x49FADC, (uintptr_t)&CB4DebugMenuState__ActionHook); injector.WriteMemory32(0x49F82C, (uintptr_t)&CB4DebugVSelectComponent__UpdateHook); injector.WriteMemory32(0x49F84C, (uintptr_t)&CB4DebugVSelectOptionComponent__UpdateHook); + injector.WriteMemory32(0x49F76C, (uintptr_t)&CB4DebugOriginalMenuPage__UpdateHook); + + // Make the original debug menu use ImmediateLeadOut2 so I can catch the forward event + injector.MakeJAL(0x186CC8, (uintptr_t)&CB4DebugMenuPageManager__ImmediateLeadOut2); + // injector.MakeJAL(0x187A78, ); render string justified call for menu options } diff --git a/src/b4p_main_menu_state.c b/src/b4p_main_menu_state.c index 72d0e0c..36e7f85 100644 --- a/src/b4p_main_menu_state.c +++ b/src/b4p_main_menu_state.c @@ -11,7 +11,6 @@ void CB4MainMenuState__ActionHook(CB4MainMenuState* _this, EGtStateAction leActi && CB4ControllerMapping__GetPadControl(gInputManager, eGtPS2DualShock_Control_Right_Shoulder_2, false, -1) > 0.0 && CB4ControllerMapping__GetPadControl(gInputManager, eGtPS2DualShock_Control_Left_Shoulder_2, false, -1) > 0.0 ) { - // 0x962C720DB0B4C738 = Debug menu state id CB4MainMenuState__InitiateConfirm(_this, *kB4DebugMenuStateID); } } diff --git a/src/b4p_symbols.c b/src/b4p_symbols.c index 2a4d238..8d0242a 100644 --- a/src/b4p_symbols.c +++ b/src/b4p_symbols.c @@ -1,6 +1,7 @@ #include "b4p_debug_background_component.h" #include "b4p_debug_original_menu_page.h" #include "b4p_debug_menu_state.h" +#include "b4p_debug_menu_component_base.h" #include "b4p_debug_menu_components.h" #include "b4p_other.h" #include "b4p_debug_menu_page_base.h" @@ -23,17 +24,10 @@ SYM(CB4DebugBackgroundComponent__Prepare_t, CB4DebugBackgroundComponent__Prepare, 0x187078); // ---------------------------------------------------------------- -// b4p_debug_original_menu_page +// b4p_debug_menu_component_base // ---------------------------------------------------------------- -SYM(CB4DebugOriginalMenuPage__Prepare_t, CB4DebugOriginalMenuPage__Prepare, 0x186768); -SYM(CB4DebugOriginalMenuPage__Update_t, CB4DebugOriginalMenuPage__Update, 0x1869F0); - -// ---------------------------------------------------------------- -// b4p_debug_menu_state -// ---------------------------------------------------------------- - -SYM(CB4DebugMenuState__Action_t, CB4DebugMenuState__Action, 0x192248); +SYM(CB4DebugMenuComponentBase__Release_t, CB4DebugMenuComponentBase__Release, 0x187170); // ---------------------------------------------------------------- // b4p_debug_menu_components @@ -63,6 +57,19 @@ SYM(CB4DebugMenuPages*, gDebugMenuPages, 0x1C10EF0); SYM(CB4DebugMenuPages__Init_t, CB4DebugMenuPages__Init, 0x185FE8); +// ---------------------------------------------------------------- +// b4p_debug_menu_state +// ---------------------------------------------------------------- + +SYM(CB4DebugMenuState__Action_t, CB4DebugMenuState__Action, 0x192248); + +// ---------------------------------------------------------------- +// b4p_debug_original_menu_page +// ---------------------------------------------------------------- + +SYM(CB4DebugOriginalMenuPage__Prepare_t, CB4DebugOriginalMenuPage__Prepare, 0x186768); +SYM(CB4DebugOriginalMenuPage__Update_t, CB4DebugOriginalMenuPage__Update, 0x1869F0); + // ---------------------------------------------------------------- // b4p_debug_vselect_component // ----------------------------------------------------------------