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:
1 parent
2ff2d5d87f
commit
3ce74c6e2d
331 files changed
+485
-7835
No files matched your search
@@ -0,0 +1,31 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00946cd0
|
||||
byte Menu_Character_Entry::IsCharacterAvailable(int unused)
|
||||
{
|
||||
byte isUnlocked;
|
||||
void *playerConfig;
|
||||
int playerType;
|
||||
Manager *manager;
|
||||
|
||||
manager = g_manager;
|
||||
playerType = *GHIDRA_CAST<int *>((this + 1));
|
||||
if ((playerType < 0) ||
|
||||
((GHIDRA_INT((g_manager->_entityConfig)._players._end) -
|
||||
GHIDRA_INT((g_manager->_entityConfig)._players._begin)) / 0x148 <= playerType)) {
|
||||
playerConfig = (void *)0x0;
|
||||
}
|
||||
else {
|
||||
playerConfig = (void *)(playerType * 0x148 + GHIDRA_INT((g_manager->_entityConfig)._players._begin));
|
||||
}
|
||||
if (-1 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerConfig) + 0xe8))) {
|
||||
isUnlocked = PersistentGameData::Unlocked
|
||||
(&g_manager->_persistentGameData,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(playerConfig) + 0xe8)));
|
||||
if ((isUnlocked == 0) ||
|
||||
(((playerType == 9 || (playerType == 0x1e)) &&
|
||||
((manager->_persistentGameData)._eventCounters[0x15] == 0)))) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
Reference in new issue
Block a user