From 85ed12fb61b961ceab8bef51e03d234d16b4a237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C4=B1dvan=20San?= Date: Thu, 22 Oct 2026 00:26:57 +0300 Subject: [PATCH] hbm: split the Home Button Menu library into its three TUs HBM is an RVL_SDK library, so its units live under revolution/HBM/ next to the other SDK units and are tracked by the RVL_SDK progress category (no separate category or lib group). The whole library (0x80071FD8-0x8007E37C, 146 functions, 50 KB) was a single dtk auto unit. Split it where the literal pools, the vtable blocks and the class layout say the translation units end: revolution/HBM/HBMBase.cpp 0x80071FD8-0x8007B888 56 functions HBMCreate/HBMDelete/HBMInit/HBMCalc/ HBMDraw, the sound entry points, homebutton::HomeButton and the empty virtual stubs fn_8007B870-fn_8007B884 revolution/HBM/HBMGui.cpp 0x8007B888-0x8007CF6C 48 functions homebutton::GroupAnmController (ctor fn_8007B888, dtor fn_8007B8A4, do_calc, virtual fn_8007B9EC), FrameController and homebutton::gui revolution/HBM/HBMController.cpp 0x8007CF6C-0x8007E37C 42 functions homebutton::Controller, homebutton::RemoteSpk, and the fn_8007E2A8 menu-result bridge The library name comes from its own version banner, "<< RVL_SDK - HBM release build: May 16 2007 ... >>" at .data 0x801B4730. The file names are descriptive (the DOL has no symbol table); the boundaries are evidence: - Each unit restarts its own .sdata2 literal pool: HBMBase stops at 0x803321E0, where HBMGui emits a fresh 1.0f, and HBMController restarts with its own 1.0f at 0x803321F8. (.rodata, .bss, .sdata, .sbss each have exactly one owning unit per object - checked object by object.) - The GroupAnmController class pins the first boundary: its vtable 0x801B5320 is installed by fn_8007B888, its deleting dtor is fn_8007B8A4 and its virtual method fn_8007B9EC; one class keeps ctor, dtor, vtable and method in one TU, and fn_8007B9EC is provably in the second unit because it emits that unit's own 1.0f instead of reusing HBMBase's. - The controller boundary is the last gui vtable: every function the four gui vtables point at lies below 0x8007CF6C, and the Controller vtable 0x801B5488 is only installed by fn_8007DD48/fn_8007DE00, above it. - The only cross-unit .data objects are two gui vtables (PaneManager 0x801B5398 and Manager 0x801B53EC) that HomeButton's ctor 0x80072A34 also references, which is normal for vtables of member objects. - The library has no .ctors and no exception tables, so there is no __sinit boundary to use here. All seven auto units that covered this range (text, rodata, data, bss, sdata, sbss, sdata2) are gone. HAFE DOL still matches. --- config/HAFE/splits.txt | 23 +++++++++++++++++++++++ configure.py | 5 +++++ src/revolution/HBM/HBMBase.cpp | 24 ++++++++++++++++++++++++ src/revolution/HBM/HBMController.cpp | 20 ++++++++++++++++++++ src/revolution/HBM/HBMGui.cpp | 21 +++++++++++++++++++++ 5 files changed, 93 insertions(+) create mode 100644 src/revolution/HBM/HBMBase.cpp create mode 100644 src/revolution/HBM/HBMController.cpp create mode 100644 src/revolution/HBM/HBMGui.cpp diff --git a/config/HAFE/splits.txt b/config/HAFE/splits.txt index 3c65b94..0ec30e2 100644 --- a/config/HAFE/splits.txt +++ b/config/HAFE/splits.txt @@ -556,6 +556,29 @@ revolution/ARC/arc.c: .data start:0x801B46C0 end:0x801B4730 .sdata start:0x803302F8 end:0x80330308 +revolution/HBM/HBMBase.cpp: + .text start:0x80071FD8 end:0x8007B888 + .rodata start:0x80193DC8 end:0x80194078 + .data start:0x801B4730 end:0x801B5320 + .bss start:0x80288D60 end:0x80288D98 + .sdata start:0x80330308 end:0x803303D0 + .sbss start:0x80330D60 end:0x80330D68 + .sdata2 start:0x80332168 end:0x803321E0 + +revolution/HBM/HBMGui.cpp: + .text start:0x8007B888 end:0x8007CF6C + .data start:0x801B5320 end:0x801B5488 + .sbss start:0x80330D68 end:0x80330D70 + .sdata2 start:0x803321E0 end:0x803321F8 + +revolution/HBM/HBMController.cpp: + .text start:0x8007CF6C end:0x8007E37C + .data start:0x801B5488 end:0x801B5498 + .bss start:0x80288D98 end:0x80288F28 + .sdata start:0x803303D0 end:0x803303D8 + .sbss start:0x80330D70 end:0x80330DA0 + .sdata2 start:0x803321F8 end:0x80332208 + vcmv/vcmv_www.cpp: extab start:0x80006648 end:0x80006698 extabindex start:0x80006B5C end:0x80006BD4 diff --git a/configure.py b/configure.py index 6ae4df5..07074e5 100755 --- a/configure.py +++ b/configure.py @@ -589,6 +589,11 @@ def MatchingFor(*versions): Object(NonMatching, "revolution/GX/GXTexture.c"), Object(Matching, "revolution/GX/GXTransform.c"), + # HBM + Object(NonMatching, "revolution/HBM/HBMBase.cpp"), + Object(NonMatching, "revolution/HBM/HBMGui.cpp"), + Object(NonMatching, "revolution/HBM/HBMController.cpp"), + # IPC Object(NonMatching, "revolution/IPC/ipcclt.c"), Object(Matching, "revolution/IPC/ipcMain.c"), diff --git a/src/revolution/HBM/HBMBase.cpp b/src/revolution/HBM/HBMBase.cpp new file mode 100644 index 0000000..e8240d3 --- /dev/null +++ b/src/revolution/HBM/HBMBase.cpp @@ -0,0 +1,24 @@ +// RVL_SDK HBM (Home Button Menu) - base and menu state machine. +// +// This is the first translation unit of libhbm. It owns the version string +// "<< RVL_SDK - HBM release build: May 16 2007 ... >>" at .data 0x801B4730, +// the C entry points and the homebutton::HomeButton implementation: +// +// HBMCreate / HBMDelete / HBMInit / HBMCalc / HBMDraw / HBMGetSelectBtnNum +// HBMSetAdjustFlag / HBMStartBlackOut / HBMCreateSound / HBMDeleteSound / +// HBMUpdateSound +// homebutton::HomeButton (ctor, set_text, calc_battery, updateTrigPane, +// startLeftEvent, reset_btn, getPaneNo, onEvent) and its sound/GX helpers +// (fn_80072354 ... fn_80076024, fn_8007699C, fn_800777A8, fn_80079448, +// fn_8007B374 initgx, fn_8007B52C, fn_8007B68C, fn_8007B7B0 and the empty +// virtual stubs fn_8007B870-fn_8007B884) +// +// Split evidence: the unit ends where the GroupAnmController class starts +// (see HBMGui.cpp). Its .data block is 0x801B4730-0x801B5320 (the version +// string, the pane/animation name tables and the HomeButton vtable +// 0x801B52E0), its .rodata 0x80193DC8-0x80194078 is the two tables only +// HomeButton code uses, its .bss 0x80288D60-0x80288D98 holds the sound +// archive/player, its .sdata2 pool 0x80332168-0x803321E0 is consumed before +// the gui unit emits its own 1.0f at 0x803321E0 (MWCC emits one pool per TU), +// and its .sbss is the single HBM global at 0x80330D60. +// No .ctors: the HBM objects have no static constructors. diff --git a/src/revolution/HBM/HBMController.cpp b/src/revolution/HBM/HBMController.cpp new file mode 100644 index 0000000..6a89224 --- /dev/null +++ b/src/revolution/HBM/HBMController.cpp @@ -0,0 +1,20 @@ +// RVL_SDK HBM (Home Button Menu) - controller and remote speaker. +// +// Third translation unit of libhbm: +// +// homebutton::Controller (wpadConnectCallback, wpadExtensionCallback, +// soundOnCallback, initCallback, clearCallback, setKpad, getInfoAsync, +// startMotor, stopMotor, isPlayingSoundId, and the WPAD/kpad helpers +// 0x8007D1FC ... 0x8007DDA0) +// homebutton::RemoteSpk (Start, Connect, Play, isPlaying, isPlayingId, +// isPlayReady and the helpers 0x8007DE00 ... 0x8007E2A8) +// fn_8007E2A8 - the menu-result bridge the vcmv (Opera) code calls to enter +// the manual/black-out states; it plays the HBM sound ids through fn_80072354 +// fn_8007E378 - empty stub +// +// Split evidence: the .sdata2 pool restarts with its own 1.0f at 0x803321F8 +// (the gui unit's pool stopped at 0x803321F0), .data 0x801B5488 holds the +// controller table {fn_8007DE00}, .bss 0x80288D98-0x80288F28 holds the WPAD +// status blocks, and .sbss 0x80330D70-0x80330DA0 holds the controller, kpad +// and menu-result globals (the first of them is used from 0x8007D1FC on). +// It has no .rodata. diff --git a/src/revolution/HBM/HBMGui.cpp b/src/revolution/HBM/HBMGui.cpp new file mode 100644 index 0000000..7c41ac2 --- /dev/null +++ b/src/revolution/HBM/HBMGui.cpp @@ -0,0 +1,21 @@ +// RVL_SDK HBM (Home Button Menu) - gui framework and animation controllers. +// +// Second translation unit of libhbm. It starts with homebutton::GroupAnmController +// (ctor fn_8007B888, deleting dtor fn_8007B8A4, do_calc, and the virtual +// method fn_8007B9EC) and continues with the gui framework: +// +// homebutton::FrameController (init, initFrame) +// homebutton::gui::Component, PaneComponent, PaneManager, Manager, +// EventHandler (init, update, onTrig, isVisible, addComponent, getComponent, +// dtors, setEventHandler, setAllComponentTriggerTarget, ...) +// fn_8007BB34 / fn_8007CBB0 / fn_8007CA80 / fn_8007C610 / fn_8007C6B0 +// +// Split evidence: the unit owns the GroupAnmController vtable 0x801B5320. Its +// ctor fn_8007B888 installs that table, its deleting dtor fn_8007B8A4 and its +// virtual method fn_8007B9EC are the table's entries, so ctor, dtor, vtable +// and method are one TU and the unit opens at 0x8007B888. fn_8007B9EC also +// emits this unit's own 1.0f at 0x803321E0 instead of reusing the one at +// 0x8033217C. The rest of .data +// 0x801B5320-0x801B5488 is exactly the four gui vtables (Component, +// PaneComponent, PaneManager, Manager), and the unit owns the single gui +// global in .sbss at 0x80330D68. It has no .bss and no .rodata of its own.