Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG

The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function
defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body.
src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read
from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT,
from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra).
structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-11-19 21:10:23 -05:00
1 parent 2ff2d5d87f
commit 3ce74c6e2d
331 files changed
+485 -7835

No files matched your search

+106
View File
@@ -0,0 +1,106 @@
#include "classes.h"
// 009b7500
void PopupWindow::hide()
{
int fieldOffset;
byte *animNameChar;
uint compareResult;
char *dissapearChar;
int iVar1;
int animNameOffset;
bool isLess;
int soundId;
byte ch;
Manager *manager;
manager = g_manager;
if (*GHIDRA_CAST<int *>(this) != 0) {
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4));
animNameOffset = 0x174;
fieldOffset = 0x174;
if (iVar1 != 1) {
fieldOffset = 0x60;
}
if (*GHIDRA_CAST<int *>((fieldOffset + GHIDRA_INT(this))) != 0) {
fieldOffset = 0x184;
if (iVar1 != 1) {
fieldOffset = 0x70;
}
if (*GHIDRA_CAST<char *>((fieldOffset + GHIDRA_INT(this))) == '\0') {
if (iVar1 != 1) {
animNameOffset = 0x60;
}
animNameChar = *GHIDRA_CAST<byte **>((animNameOffset + GHIDRA_INT(this)));
if (0xf < *GHIDRA_CAST<uint *>((animNameChar + 0x14))) {
animNameChar = *GHIDRA_CAST<byte **>(animNameChar);
}
dissapearChar = "Dissapear";
do {
ch = *animNameChar;
isLess = ch < (byte)*dissapearChar;
if (ch != *dissapearChar) {
LAB_009b75c6:
compareResult = -GHIDRA_UINT(isLess) | 1;
goto LAB_009b75cb;
}
if (ch == 0) break;
ch = animNameChar[1];
isLess = ch < (byte)dissapearChar[1];
if (ch != dissapearChar[1]) goto LAB_009b75c6;
animNameChar = animNameChar + 2;
dissapearChar = dissapearChar + 2;
} while (ch != 0);
compareResult = 0;
LAB_009b75cb:
if (compareResult == 0) {
return;
}
}
else {
if (iVar1 != 1) {
animNameOffset = 0x60;
}
animNameChar = *GHIDRA_CAST<byte **>((animNameOffset + GHIDRA_INT(this)));
if (0xf < *GHIDRA_CAST<uint *>((animNameChar + 0x14))) {
animNameChar = *GHIDRA_CAST<byte **>(animNameChar);
}
dissapearChar = "Dissapear";
do {
ch = *animNameChar;
isLess = ch < (byte)*dissapearChar;
if (ch != *dissapearChar) {
LAB_009b7580:
compareResult = -GHIDRA_UINT(isLess) | 1;
goto LAB_009b7585;
}
if (ch == 0) break;
ch = animNameChar[1];
isLess = ch < (byte)dissapearChar[1];
if (ch != dissapearChar[1]) goto LAB_009b7580;
animNameChar = animNameChar + 2;
dissapearChar = dissapearChar + 2;
} while (ch != 0);
compareResult = 0;
LAB_009b7585:
if (compareResult == 0) {
return;
}
}
}
soundId = 0x12;
seed_fart_sound_override(&soundId);
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(soundId,0.7,2,0,1.0,0.0);
iVar1 = 0x140;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4)) != 1) {
iVar1 = 0x2c;
}
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((iVar1 + GHIDRA_INT(this))))))->ANM2::Play(GHIDRA_CAST<byte *>("Dissapear"),0);
iVar1 = 400;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 4)) != 1) {
iVar1 = 0x7c;
}
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((iVar1 + GHIDRA_INT(this))))))->AnimationState::SetAnimationData((void *)0x0);
}
return;
}