Curation round 3: Lua engine, Manager, sound, menus, cutscenes, rooms, item pools, saves; boots past LuaEngine::Init
Seven agents took over LuaEngine (the mod API registration deferred), the rest of Manager (LoadConfigs, fonts, render surfaces, Update/Render), MusicManager/SFXManager, MenuManager with the title/save/game menus, Cutscene/NightmareScene/ Backdrop, RoomConfig (src/rooms ported and retired) with ItemPool, and PersistentGameData (the original binary save format) with InfoDisplay. An integration pass moved call sites to the new APIs, declared the taken-over free functions, fixed two data.cpp crashes (an empty children array, null attribute strings), and made the generator keep a header's own name where a prototype names another address. Clean build (0 warnings with -Wall -Wextra). build/isaac runs the game's Lua scripts (without the mod API yet) and stops at reload_resource_paths. 901 functions taken over, boot path 204/615. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a7061306fa
commit
ddf913f304
137 files changed
+12684
-50687
No files matched your search
+14
-77
@@ -1999,10 +1999,10 @@ void Level::ChangeRoom(int targetRoomIDX, int dimension)
|
||||
manager = g_manager;
|
||||
piVar5 = GHIDRA_CAST<int *>(SteamInternal_ContextInit(&PTR_FUN_00c5c3a4,uVar4));
|
||||
if ((*piVar5 == 0) || ((manager->_optionsConfig)._enableSteamCloud == 0)) {
|
||||
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::Save();
|
||||
PersistentGameData::Save(persistentData);
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<PersistentGameData *>((persistentData)))->PersistentGameData::SaveToSteamCloud();
|
||||
PersistentGameData::SaveToSteamCloud(persistentData);
|
||||
}
|
||||
}
|
||||
iVar10 = newRoomIdx;
|
||||
@@ -5841,7 +5841,7 @@ LAB_007450e7:
|
||||
(GHIDRA_CAST<Game *>(newSaveState))->_curses = (GHIDRA_CAST<Game *>(newSaveState))->_curses & 0xfffffffe;
|
||||
}
|
||||
(GHIDRA_CAST<HUD *>((&game->_hud)))->HUD::InvalidateCraftingItem(GHIDRA_CAST<Entity_Player *>(0x0));
|
||||
(GHIDRA_CAST<RoomConfig *>((&game->_roomConfig)))->RoomConfig::ClearGeneratedRooms();
|
||||
RoomConfig::ClearGeneratedRooms(&game->_roomConfig);
|
||||
game = g_game;
|
||||
if ((GHIDRA_CAST<Game *>(newSaveState))->_stage == 0xc) {
|
||||
pRStack_48 = GHIDRA_CAST<RoomDescriptor *>(0x1);
|
||||
@@ -5858,7 +5858,7 @@ LAB_007450e7:
|
||||
}
|
||||
iVar5 = uVar4 * 0x2c;
|
||||
if ((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_3c)) + 0x0))))[GHIDRA_INT(local_38) + iVar5 + 0x8c] == '\0') {
|
||||
(GHIDRA_CAST<RoomConfig *>((local_3c)))->RoomConfig::LoadStageBinary(GHIDRA_UINT(pRStack_48),uVar4);
|
||||
RoomConfig::LoadStageBinary(local_3c,GHIDRA_UINT(pRStack_48),uVar4);
|
||||
}
|
||||
else {
|
||||
uVar4 = 0;
|
||||
@@ -5898,7 +5898,7 @@ LAB_00745271:
|
||||
}
|
||||
pRStack_48 = GHIDRA_CAST<RoomDescriptor *>((uVar4 * 0x2c));
|
||||
if (*GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&(pRStack_48->SavedEffects)._end) + GHIDRA_INT(local_38))) == 0) {
|
||||
(GHIDRA_CAST<RoomConfig *>((local_3c)))->RoomConfig::LoadStageBinary(GHIDRA_UINT(pRStack_44),uVar4);
|
||||
RoomConfig::LoadStageBinary(local_3c,GHIDRA_UINT(pRStack_44),uVar4);
|
||||
goto LAB_00745271;
|
||||
}
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_38->_doors) + GHIDRA_INT(&pRStack_48->BossDeathSeed))) != 0) {
|
||||
@@ -5928,7 +5928,7 @@ LAB_007452f7:
|
||||
}
|
||||
local_3c = GHIDRA_CAST<RoomConfig *>((uVar4 * 0x2c));
|
||||
if ((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_3c)) + 0x16c0))))[GHIDRA_INT(pRStack_44)] == '\0') {
|
||||
(GHIDRA_CAST<RoomConfig *>((pRStack_44)))->RoomConfig::LoadStageBinary(0x1d,uVar4);
|
||||
RoomConfig::LoadStageBinary(pRStack_44,0x1d,uVar4);
|
||||
}
|
||||
else {
|
||||
uVar4 = 0;
|
||||
@@ -5965,7 +5965,7 @@ LAB_0074536a:
|
||||
}
|
||||
pRStack_44 = GHIDRA_CAST<RoomConfig *>((uVar4 * 0x2c));
|
||||
if ((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pRStack_44)) + 0x8c))))[GHIDRA_INT(pRVar10)] == '\0') {
|
||||
(GHIDRA_CAST<RoomConfig *>((pRVar10)))->RoomConfig::LoadStageBinary(0,uVar4);
|
||||
RoomConfig::LoadStageBinary(pRVar10,0,uVar4);
|
||||
}
|
||||
else {
|
||||
uVar4 = 0;
|
||||
@@ -5997,7 +5997,7 @@ LAB_0074536a:
|
||||
generate_home(GHIDRA_CAST<Level *>(level));
|
||||
}
|
||||
else {
|
||||
(GHIDRA_CAST<RoomConfig *>((&game->_roomConfig)))->RoomConfig::ResetStageWeights(0,-1);
|
||||
RoomConfig::ResetStageWeights(&game->_roomConfig,0,-1);
|
||||
generate_dungeon(GHIDRA_CAST<Level *>(currentLevel),&curseRng);
|
||||
}
|
||||
}
|
||||
@@ -6611,7 +6611,7 @@ void Level::SetStage(int stageid, int alt)
|
||||
game = g_game;
|
||||
this->_stage = clampedStage;
|
||||
this->_stageType = clampedStageType;
|
||||
(GHIDRA_CAST<NightmareScene *>((&pMVar1->_nightmareScene)))->NightmareScene::record_stage(clampedStage,clampedStageType);
|
||||
NightmareScene::record_stage(&pMVar1->_nightmareScene,clampedStage,clampedStageType);
|
||||
if ((((game->_difficulty == 2) || (game->_difficulty == 3)) || (6 < this->_stage)) ||
|
||||
((this->_stageType != 4 && (this->_stageType != 5)))) {
|
||||
game->_bossRushParTime = 36000;
|
||||
@@ -7195,7 +7195,7 @@ void * Level::get_room_config_from_saved_id(uint32_t *savedId, void *mergeTable)
|
||||
}
|
||||
pRVar2 = RoomConfig::GetRoomByStageTypeAndVariant
|
||||
(&g_game->_roomConfig,uVar1 & 0xffff,type,savedId[2],mode);
|
||||
pRVar2 = (GHIDRA_CAST<RoomConfig *>((&game->_roomConfig)))->RoomConfig::make_generated_room(pRVar2);
|
||||
pRVar2 = RoomConfig::make_generated_room(&game->_roomConfig,pRVar2);
|
||||
return pRVar2;
|
||||
}
|
||||
}
|
||||
@@ -7338,7 +7338,7 @@ void Level::RestoreGameState(GameState *gameState)
|
||||
piVar17 = piVar17 + 1;
|
||||
roomMapDest = roomMapDest + 1;
|
||||
}
|
||||
(GHIDRA_CAST<RoomConfig *>((&g_game->_roomConfig)))->RoomConfig::ClearGeneratedRooms();
|
||||
RoomConfig::ClearGeneratedRooms(&g_game->_roomConfig);
|
||||
roomDataSlot = &this->_roomList[0].Data;
|
||||
uStack_18 = 0x20f;
|
||||
this->_roomCount = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((gameState)) + 0x19c))));
|
||||
@@ -13618,7 +13618,7 @@ void Level::generate_dark_closet()
|
||||
in_ECX->_currentRoomMap = local_450;
|
||||
self = in_ECX;
|
||||
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((game->_roomConfig))) + 0x1b58))) == '\0') {
|
||||
(GHIDRA_CAST<RoomConfig *>((&game->_roomConfig)))->RoomConfig::LoadStageBinary(0x23,0);
|
||||
RoomConfig::LoadStageBinary(&game->_roomConfig,0x23,0);
|
||||
}
|
||||
else {
|
||||
uVar5 = 0;
|
||||
@@ -13855,7 +13855,7 @@ void Level::generate_dark_closet()
|
||||
if (((local_450 == GHIDRA_CAST<RoomConfig_Room *>(0x2)) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_444) + 8)) == 2)) &&
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_444) + 0xc)) == 6)) {
|
||||
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_roomConfig))) + 0x1b58))) == '\0') {
|
||||
(GHIDRA_CAST<RoomConfig *>((&g_game->_roomConfig)))->RoomConfig::LoadStageBinary(0x23,0);
|
||||
RoomConfig::LoadStageBinary(&g_game->_roomConfig,0x23,0);
|
||||
}
|
||||
uVar5 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((game->_roomConfig))) + 0x1b4c))));
|
||||
uVar3 = 0;
|
||||
@@ -14010,7 +14010,7 @@ LAB_00751f76:
|
||||
uVar5 = uVar5 << (bVar2 & 0x1f) ^ uVar5;
|
||||
uVar5 = uVar5 >> ((uint8_t)rngShift3 & 0x1f) ^ uVar5;
|
||||
uStack_6c = uVar5;
|
||||
local_5c[3] = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetFirstItemPoolForCollectible(itemId);
|
||||
local_5c[3] = ItemPool::GetFirstItemPoolForCollectible(&g_game->_itemPool,itemId);
|
||||
saveStateEnd = *(EntitySaveState **)
|
||||
(GHIDRA_INT(local_444) + GHIDRA_INT((self->_roomList + -1)) + 0x78);
|
||||
iVar4 = GHIDRA_INT(local_444) + GHIDRA_INT(self);
|
||||
@@ -14429,69 +14429,6 @@ LAB_007ebbfe:
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 0082c600
|
||||
std_string * Level::GetCurseNameByIdx(std_string *outName, uint32_t curseIdx)
|
||||
{
|
||||
int iVar1;
|
||||
uint8_t *textEnd;
|
||||
uint8_t *text;
|
||||
uint8_t ch;
|
||||
Manager *manager;
|
||||
|
||||
manager = g_manager;
|
||||
if (curseIdx != 0) {
|
||||
iVar1 = this->_roomList[0x27]._doors[7];
|
||||
if (curseIdx < GHIDRA_UINT(((this->_roomList[0x27].DisplayFlags - iVar1) / 0x1c))) {
|
||||
if (*GHIDRA_CAST<int *>((iVar1 + 0x14 + curseIdx * 0x1c)) == 0) {
|
||||
text = &s_empty;
|
||||
}
|
||||
else {
|
||||
text = GHIDRA_CAST<uint8_t *>((iVar1 + 4 + curseIdx * 0x1c));
|
||||
if (0xf < *GHIDRA_CAST<uint32_t *>((iVar1 + 0x18 + curseIdx * 0x1c))) {
|
||||
text = *GHIDRA_CAST<uint8_t **>(text);
|
||||
}
|
||||
iVar1 = *GHIDRA_CAST<int *>(&g_manager->_stringTable);
|
||||
if (*text == 0x23) {
|
||||
curseIdx = curseIdx & 0xffffff;
|
||||
StringTable::get_string
|
||||
(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("Curses"),iVar1,text + 1,
|
||||
GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&curseIdx) + 3)));
|
||||
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(curseIdx)) + 0x3))) == '\0') {
|
||||
curseIdx = curseIdx & 0xffffff;
|
||||
text = StringTable::get_string
|
||||
(&manager->_stringTable,GHIDRA_CAST<uint8_t *>("Curses"),iVar1,text + 1,
|
||||
GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&curseIdx) + 3)));
|
||||
}
|
||||
}
|
||||
}
|
||||
outName->_buf[0] = '\0';
|
||||
outName->_buf[1] = '\0';
|
||||
outName->_buf[2] = '\0';
|
||||
outName->_buf[3] = '\0';
|
||||
outName->_size = 0;
|
||||
outName->_capacity = 0xf;
|
||||
outName->_buf[0] = '\0';
|
||||
textEnd = text;
|
||||
do {
|
||||
ch = *textEnd;
|
||||
textEnd = textEnd + 1;
|
||||
} while (ch != 0);
|
||||
(GHIDRA_CAST<msvc::string *>((outName->_buf)))->msvc::string::assign(text,GHIDRA_INT(textEnd) - GHIDRA_INT((text + 1)));
|
||||
return outName;
|
||||
}
|
||||
}
|
||||
outName->_buf[0] = '\0';
|
||||
outName->_buf[1] = '\0';
|
||||
outName->_buf[2] = '\0';
|
||||
outName->_buf[3] = '\0';
|
||||
outName->_size = 0;
|
||||
outName->_capacity = 0xf;
|
||||
outName->_buf[0] = '\0';
|
||||
outName->_size = 0;
|
||||
outName->_buf[0] = '\0';
|
||||
return outName;
|
||||
}
|
||||
|
||||
// 0085e140
|
||||
Vector * Level::DungeonReturnPosition(Vector *outResult)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user