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>
56 lines
1.6 KiB
C++
56 lines
1.6 KiB
C++
#include "classes.h"
|
|
|
|
// 00a73100
|
|
void CommandThread::post_command(void *command)
|
|
{
|
|
undefined4 commandCopy [2];
|
|
undefined4 *callbacksEnd;
|
|
undefined4 *callbacksCapacity;
|
|
undefined4 local_28;
|
|
undefined4 local_24;
|
|
undefined1 *callbackEntry;
|
|
int local_1c;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b1394d;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(this) + 0x1c)) & 1) == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Command thread is not initialized\n"));
|
|
}
|
|
commandCopy[0] = *GHIDRA_CAST<undefined4 *>(command);
|
|
FUN_00915d70(GHIDRA_INT(command) + 4);
|
|
local_28 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(command) + 0x10));
|
|
local_24 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(command) + 0x14));
|
|
local_8 = 0;
|
|
callbackEntry = &LAB_00a733c0;
|
|
local_1c = 0;
|
|
if (callbacksEnd == callbacksCapacity) {
|
|
std::vector<8byte>::_Emplace_reallocate(callbacksEnd,&callbackEntry);
|
|
}
|
|
else {
|
|
*callbacksEnd = &LAB_00a733c0;
|
|
callbacksEnd[1] = 0;
|
|
callbacksEnd = callbacksEnd + 2;
|
|
}
|
|
local_1c = GHIDRA_INT(this) >> 0x1f;
|
|
callbackEntry = this;
|
|
if (callbacksEnd == callbacksCapacity) {
|
|
std::vector<8byte>::_Emplace_reallocate(callbacksEnd,&callbackEntry);
|
|
}
|
|
else {
|
|
*callbacksEnd = this;
|
|
callbacksEnd[1] = local_1c;
|
|
callbacksEnd = callbacksEnd + 2;
|
|
}
|
|
FUN_00a2a5a0(commandCopy);
|
|
local_28 = 0;
|
|
local_24 = 0;
|
|
std::vector<Vector>::_Tidy();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|