From f2e4129101d57f7bb692d1053b11ca740b4c3b3b Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Thu, 8 Oct 2026 18:33:05 +0000 Subject: [PATCH] refactor: drop per-unit novtable switches that change no object (worker 94d1c9c8) --- include/math/iplInterporation.h | 2 +- include/scene/memoryCard/iplMemoryCardBase.h | 4 -- tools/decomp-assist/opus-novt.attempts.md | 41 ++++++++++++++++++++ 3 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 tools/decomp-assist/opus-novt.attempts.md diff --git a/include/math/iplInterporation.h b/include/math/iplInterporation.h index 09e9f968..bc2aa686 100644 --- a/include/math/iplInterporation.h +++ b/include/math/iplInterporation.h @@ -105,7 +105,7 @@ namespace ipl { #ifdef IPL_CHANNEL_TITLE_NOVTABLE template - class __declspec(novtable) HermiteIntp : public utility::FrameController { + class HermiteIntp : public utility::FrameController { public: HermiteIntp() {} virtual ~HermiteIntp(); diff --git a/include/scene/memoryCard/iplMemoryCardBase.h b/include/scene/memoryCard/iplMemoryCardBase.h index 15ba2084..1a7bf6ab 100644 --- a/include/scene/memoryCard/iplMemoryCardBase.h +++ b/include/scene/memoryCard/iplMemoryCardBase.h @@ -35,11 +35,7 @@ namespace ipl { MemoryBase* mpBase; // 0x0C }; -#ifdef IPL_CHANNEL_TITLE_NOVTABLE - class __declspec(novtable) MemoryBase { -#else class MemoryBase { -#endif public: class Anm { public: diff --git a/tools/decomp-assist/opus-novt.attempts.md b/tools/decomp-assist/opus-novt.attempts.md new file mode 100644 index 00000000..2477451b --- /dev/null +++ b/tools/decomp-assist/opus-novt.attempts.md @@ -0,0 +1,41 @@ +# opus-novt: per-TU novtable switches + +Method: full `ninja`, then SHA1 of all 1027 `build/43U/src/**/*.o` compared with a +baseline from origin/main ca98b14a, plus the DOL SHA1. A variant is kept only if +no object changes. + +| # | Change | Result | +|---|--------|--------| +| 1 | `LangFile`/`LayoutFile`: out-of-line virtuals for everyone | iplChannelTitle.o, iplSDChannelTitle.o change, DOL changes. Both TUs need weak copies of `~LangFile` (88), `read` (4), `checkData` (8), `isFinished` (8), `isFatalError` (8), `~LayoutFile` (92) and weak `__vt__LangFile`/`__vt__LayoutFile`. | +| 2 | `LangFile`/`LayoutFile`: inline stub virtuals for everyone | iplNand.cpp fails (redefinition of the real bodies); 46 other objects gain weak copies. | +| 3 | `MemoryBase`: drop the `IPL_CHANNEL_TITLE_NOVTABLE` novtable switch | no object changes. **Kept.** | +| 4 | primary `HermiteIntp` under the macro: drop `__declspec(novtable)` | no object changes. **Kept.** | +| 5 | `HermiteIntp` macro block disabled for everyone (`#if 0`) | iplChannelTitle.o, iplSDChannelTitle.o change. | +| 6 | `HermiteIntp` macro block enabled for everyone (`#if 1`) | ~50 objects change. | +| 7 | `gui::Interface` novtable for everyone | ~20 objects change (saveDataEdit, sdButton, setting, dialog window, ...). | +| 8 | `gui::Interface` never novtable | iplGCSaveData.o, iplMemoryCard.o gain an unused UNDEF `__vt__Q23gui9Interface` (code/data bytes same). | +| 9 | `~gui::Interface` always inline | iplGCSaveData.o, iplMemoryCard.o gain a weak 64-byte `~Interface`. | +| 10 | `gui::EventHandler` never novtable | iplGCSaveData.o, iplGCWindow.o, iplMemoryCard.o change, DOL changes. | +| 11 | `gui::EventHandler` always novtable | ~20 objects change. | +| 12 | `ipl::gui::PaneManager` dtor always inline | iplGCSaveData.o, iplMemoryCard.o change, DOL changes. | +| 13 | `MemCardEventListener`: drop its (already unconditional) novtable | iplGCWindow.o changes. Already consistent; left as is. | + +## Result + +Removed the two dead pieces (3, 4). All 1027 objects and the DOL are unchanged. + +Switches that stay, and why: + +- `IPL_CHANNEL_TITLE_NOVTABLE` in `iplNand.h`: the channel-title TUs must emit + weak stub copies of the `LangFile`/`LayoutFile` virtuals, which have real + out-of-line bodies in iplNand.cpp. No single declaration gives both (1, 2). + The macro no longer adds any `novtable`; its name is historical. +- `IPL_CHANNEL_TITLE_NOVTABLE` in `iplInterporation.h`: it selects a different + `HermiteIntp` primary template (FrameController base, out-of-line `init`, + `HermiteIntp` specialization, `dont_instantiate`). The same header also + has `IPL_CHANNEL_SELECT_CPP` / `IPL_SD_CHANNEL_SELECT_CPP` / + `IPL_SD_CHANNEL_TITLE_CPP` variants, so untangling it is a separate job (5, 6). +- `IPL_GC_SAVEDATA_NOVTABLE` / `IPL_MEMORY_CARD_NOVTABLE` / `IPL_GC_WINDOW_NOVTABLE` + in `GUIManager.h` and `iplGuiManager.h`: the memory-card TUs need novtable + `Interface`/`EventHandler` and out-of-line `~Interface`/`~PaneManager`, while + every other GUI user needs the opposite (7-12). -- 2.49.1