Files
isaac-port/generated-src/menu_cutscenes.cpp
T
shweetandClaude Opus 5.5 ddf913f304 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>
2026-11-20 00:53:08 -05:00

319 lines
14 KiB
C++

#include "classes.h"
// 008ced40
void Menu_Cutscenes::Update()
{
int layerId;
char isActionTriggered;
uint32_t cutsceneID;
int animData;
int *in_ECX;
Manager *menuManager;
void *historyEnd;
int local_8;
int animData;
Manager *manager;
MenuManager *menuManager;
if (((g_manager->_framecount & 1) == 0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(in_ECX) + 0x119)) != '\0')) {
AnimationState::Update(GHIDRA_CAST<AnimationState *>((in_ECX + 0x10)));
AnimationState::Update(GHIDRA_CAST<AnimationState *>((in_ECX + 0x18)));
}
local_8 = 0xe;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_8,0,0);
if (isActionTriggered == '\0') {
local_8 = 0xf;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_8,0,0);
menuManager = g_menuManager;
if (isActionTriggered == '\0') {
local_8 = 0x16;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0);
if (isActionTriggered == '\0') {
local_8 = 0x17;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0);
if (isActionTriggered == '\0') {
local_8 = 0x14;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0);
if (isActionTriggered == '\0') {
local_8 = 0x15;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0);
if ((isActionTriggered != '\0') &&
((animData = *in_ECX, animData == 0 || ((0x31 < animData && (animData % 10 == 0)))))) {
animData = *GHIDRA_CAST<int *>((&DAT_00b23f50 + in_ECX[1] * 4));
goto LAB_008cefaa;
}
}
else {
animData = *in_ECX;
if ((animData == 0) || ((0x31 < animData && (animData % 10 == 0)))) {
animData = *GHIDRA_CAST<int *>((&DAT_00b23ef0 + in_ECX[1] * 4));
LAB_008cefaa:
in_ECX[1] = animData;
}
}
}
else {
animData = *in_ECX;
if ((animData == 0) || ((0x31 < animData && (animData % 10 == 0)))) {
in_ECX[1] = (in_ECX[1] + 1) % 0x18;
}
}
}
else {
animData = *in_ECX;
if ((animData == 0) || ((0x31 < animData && (animData % 10 == 0)))) {
in_ECX[1] = (in_ECX[1] + 0x17) % 0x18;
}
}
}
else {
historyEnd = (g_menuManager->_menuStateHistory)._end;
if (1 < GHIDRA_UINT((GHIDRA_INT(historyEnd) - GHIDRA_INT((g_menuManager->_menuStateHistory)._begin) >> 2))) {
historyEnd = (void *)(GHIDRA_INT(historyEnd) + -4);
(g_menuManager->_menuStateHistory)._end = historyEnd;
}
MenuManager::SetState(menuManager,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(historyEnd) + -4)),0);
}
}
else {
cutsceneID = FUN_008cec30();
manager = g_manager;
if ((g_manager->_persistentGameData)._cutsceneCounters[cutsceneID] < 1) {
local_8 = 0xbb;
seed_fart_sound_override(&local_8);
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(local_8,1.0,2,0,1.0,0.0);
}
else {
Manager::ShowCutscene(menuManager,cutsceneID,0,1);
}
}
local_8 = 0x16;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0);
if (isActionTriggered == '\0') {
local_8 = 0x17;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0);
if (isActionTriggered == '\0') {
local_8 = 0x14;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0);
if (isActionTriggered == '\0') {
local_8 = 0x15;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_8,0,0);
if (isActionTriggered == '\0') {
*in_ECX = 0;
goto LAB_008cf05f;
}
}
}
}
*in_ECX = *in_ECX + 1;
LAB_008cf05f:
animData = in_ECX[1];
if (in_ECX[0x11] != 0) {
if ((*GHIDRA_CAST<int *>((in_ECX[0x10] + 0x80)) < 0x1a) &&
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
*GHIDRA_CAST<int *>((in_ECX[0x10] + 0x80)) < 0x1a)) {
return;
}
animData = in_ECX[0x11];
layerId = *GHIDRA_CAST<int *>((animData + 0x9c));
if (((animData == 0) || (layerId < 0)) || (*GHIDRA_CAST<int *>((animData + 0x1c)) <= layerId)) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
}
*GHIDRA_CAST<uint32_t *>((in_ECX[0x12] + layerId * 4)) = 0;
AnimationState::AdvanceLayerPosition(GHIDRA_CAST<AnimationState *>((in_ECX + 0x10)),layerId,(float)animData);
}
return;
}
// 008cf0e0
void Menu_Cutscenes::Render()
{
uint8_t *layerName;
LayerState *layer;
int iVar1;
int layerFrames;
int in_ECX;
AnimationState *lastAnimState;
int animLayerIndex;
uint32_t *puVar2;
uint32_t defaultColor [8];
uint32_t local_48;
uint32_t uStack_44;
uint32_t local_40;
uint32_t lockedColor [8];
uint32_t local_1c;
uint32_t uStack_18;
uint32_t local_14;
Vector drawPos;
uint32_t *layerNameCursor;
ANM2 *anm2;
puVar2 = &DAT_00b23fb0;
drawPos.x = (g_menuManager->_ViewPosition).x + *GHIDRA_CAST<float *>((in_ECX + 8));
drawPos.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST<float *>((in_ECX + 0xc));
do {
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>((in_ECX + 0x10)),GHIDRA_CAST<uint8_t *>(*puVar2));
puVar2 = puVar2 + 1;
layer->_visible = 0;
} while (GHIDRA_INT(puVar2) < 0xb24010);
if (*GHIDRA_CAST<char *>((in_ECX + 0x119)) != '\0') {
if (*GHIDRA_CAST<char *>((in_ECX + 0x80)) == '\0') {
AnimationState::Render(GHIDRA_CAST<AnimationState *>((in_ECX + 0x40)),&drawPos,&g_vectorZero,&g_vectorZero)
;
lastAnimState = GHIDRA_CAST<AnimationState *>((in_ECX + 0x60));
}
else {
AnimationState::Render(GHIDRA_CAST<AnimationState *>((in_ECX + 0x60)),&drawPos,&g_vectorZero,&g_vectorZero)
;
lastAnimState = GHIDRA_CAST<AnimationState *>((in_ECX + 0x40));
}
AnimationState::Render(lastAnimState,&drawPos,&g_vectorZero,&g_vectorZero);
}
layerNameCursor = &DAT_00b23fb0;
do {
layerName = GHIDRA_CAST<uint8_t *>(*layerNameCursor);
iVar1 = FUN_008cec30();
if ((g_manager->_persistentGameData)._cutsceneCounters[iVar1] < 1) {
puVar2 = GHIDRA_CAST<uint32_t *>((in_ECX + 0xb8));
local_1c = 0;
uStack_18 = 0;
local_14 = 0;
if (puVar2 != lockedColor) {
*GHIDRA_CAST<uint32_t *>((in_ECX + 200)) = 0;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xcc)) = 0;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xd0)) = 0;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xd4)) = 0;
*GHIDRA_CAST<uint64_t *>((in_ECX + 0xd8)) = 0;
*puVar2 = 0x3f800000;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xbc)) = 0x3f800000;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xc0)) = 0x3f800000;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xc4)) = 0x3f000000;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xe0)) = 0;
}
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>((in_ECX + 0x10)),layerName);
layer->_visible = 1;
if (*GHIDRA_CAST<char *>((in_ECX + 0x119)) != '\0') {
if (*GHIDRA_CAST<char *>((in_ECX + 0x80)) == '\0') {
iVar1 = *GHIDRA_CAST<int *>((in_ECX + 0x44));
if ((((iVar1 != 0) && (-1 < GHIDRA_INT(layerName))) &&
(GHIDRA_INT(layerName) < (*GHIDRA_CAST<ANM2 **>((in_ECX + 0x40)))->_layerCount)) &&
(animLayerIndex = *GHIDRA_CAST<int *>((iVar1 + 0x38 + GHIDRA_INT(layerName) * 4)), -1 < animLayerIndex)) {
AnimationLayer::RenderFrame
(GHIDRA_CAST<AnimationLayer *>((animLayerIndex * 0x10 + *GHIDRA_CAST<int *>((iVar1 + 0x18)))),&drawPos,
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 0x48)) + animLayerIndex * 4)),&g_vectorZero,
&g_vectorZero,*GHIDRA_CAST<ANM2 **>((in_ECX + 0x40)));
}
iVar1 = *GHIDRA_CAST<int *>((in_ECX + 100));
if (((iVar1 != 0) && (-1 < GHIDRA_INT(layerName))) &&
((anm2 = *GHIDRA_CAST<ANM2 **>((in_ECX + 0x60)), GHIDRA_INT(layerName) < anm2->_layerCount &&
(animLayerIndex = *GHIDRA_CAST<int *>((iVar1 + 0x38 + GHIDRA_INT(layerName) * 4)), -1 < animLayerIndex))))
{
layerFrames = *GHIDRA_CAST<int *>((in_ECX + 0x68));
goto LAB_008cf3fe;
}
}
else {
iVar1 = *GHIDRA_CAST<int *>((in_ECX + 100));
if (((iVar1 != 0) && (-1 < GHIDRA_INT(layerName))) &&
((GHIDRA_INT(layerName) < (*GHIDRA_CAST<ANM2 **>((in_ECX + 0x60)))->_layerCount &&
(animLayerIndex = *GHIDRA_CAST<int *>((iVar1 + 0x38 + GHIDRA_INT(layerName) * 4)), -1 < animLayerIndex))))
{
AnimationLayer::RenderFrame
(GHIDRA_CAST<AnimationLayer *>((animLayerIndex * 0x10 + *GHIDRA_CAST<int *>((iVar1 + 0x18)))),&drawPos,
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 0x68)) + animLayerIndex * 4)),&g_vectorZero,
&g_vectorZero,*GHIDRA_CAST<ANM2 **>((in_ECX + 0x60)));
}
iVar1 = *GHIDRA_CAST<int *>((in_ECX + 0x44));
if ((((iVar1 != 0) && (-1 < GHIDRA_INT(layerName))) &&
(anm2 = *GHIDRA_CAST<ANM2 **>((in_ECX + 0x40)), GHIDRA_INT(layerName) < anm2->_layerCount)) &&
(animLayerIndex = *GHIDRA_CAST<int *>((iVar1 + 0x38 + GHIDRA_INT(layerName) * 4)), -1 < animLayerIndex)) {
layerFrames = *GHIDRA_CAST<int *>((in_ECX + 0x48));
LAB_008cf3fe:
AnimationLayer::RenderFrame
(GHIDRA_CAST<AnimationLayer *>((animLayerIndex * 0x10 + *GHIDRA_CAST<int *>((iVar1 + 0x18)))),&drawPos,
*GHIDRA_CAST<int *>((layerFrames + animLayerIndex * 4)),&g_vectorZero,&g_vectorZero,anm2);
}
}
}
local_48 = 0;
uStack_44 = 0;
local_40 = 0;
if (puVar2 != defaultColor) {
*GHIDRA_CAST<uint32_t *>((in_ECX + 200)) = 0;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xcc)) = 0;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xd0)) = 0;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xd4)) = 0;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xd8)) = 0;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xdc)) = 0;
*puVar2 = 0x3f800000;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xbc)) = 0x3f800000;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xc0)) = 0x3f800000;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xc4)) = 0x3f800000;
*GHIDRA_CAST<uint32_t *>((in_ECX + 0xe0)) = 0;
}
}
else {
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>((in_ECX + 0x10)),layerName);
layer->_visible = 1;
if (*GHIDRA_CAST<char *>((in_ECX + 0x119)) != '\0') {
if (*GHIDRA_CAST<char *>((in_ECX + 0x80)) == '\0') {
iVar1 = *GHIDRA_CAST<int *>((in_ECX + 0x44));
if (((iVar1 != 0) && (-1 < GHIDRA_INT(layerName))) &&
((GHIDRA_INT(layerName) < (*GHIDRA_CAST<ANM2 **>((in_ECX + 0x40)))->_layerCount &&
(animLayerIndex = *GHIDRA_CAST<int *>((iVar1 + 0x38 + GHIDRA_INT(layerName) * 4)), -1 < animLayerIndex))))
{
AnimationLayer::RenderFrame
(GHIDRA_CAST<AnimationLayer *>((animLayerIndex * 0x10 + *GHIDRA_CAST<int *>((iVar1 + 0x18)))),&drawPos,
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 0x48)) + animLayerIndex * 4)),&g_vectorZero,
&g_vectorZero,*GHIDRA_CAST<ANM2 **>((in_ECX + 0x40)));
}
iVar1 = *GHIDRA_CAST<int *>((in_ECX + 100));
if (((iVar1 != 0) && (-1 < GHIDRA_INT(layerName))) &&
((anm2 = *GHIDRA_CAST<ANM2 **>((in_ECX + 0x60)), GHIDRA_INT(layerName) < anm2->_layerCount &&
(animLayerIndex = *GHIDRA_CAST<int *>((iVar1 + 0x38 + GHIDRA_INT(layerName) * 4)), -1 < animLayerIndex))))
{
layerFrames = *GHIDRA_CAST<int *>((in_ECX + 0x68));
goto LAB_008cf2a5;
}
}
else {
iVar1 = *GHIDRA_CAST<int *>((in_ECX + 100));
if ((((iVar1 != 0) && (-1 < GHIDRA_INT(layerName))) &&
(GHIDRA_INT(layerName) < (*GHIDRA_CAST<ANM2 **>((in_ECX + 0x60)))->_layerCount)) &&
(animLayerIndex = *GHIDRA_CAST<int *>((iVar1 + 0x38 + GHIDRA_INT(layerName) * 4)), -1 < animLayerIndex)) {
AnimationLayer::RenderFrame
(GHIDRA_CAST<AnimationLayer *>((animLayerIndex * 0x10 + *GHIDRA_CAST<int *>((iVar1 + 0x18)))),&drawPos,
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 0x68)) + animLayerIndex * 4)),&g_vectorZero,
&g_vectorZero,*GHIDRA_CAST<ANM2 **>((in_ECX + 0x60)));
}
iVar1 = *GHIDRA_CAST<int *>((in_ECX + 0x44));
if (((iVar1 != 0) && (-1 < GHIDRA_INT(layerName))) &&
((anm2 = *GHIDRA_CAST<ANM2 **>((in_ECX + 0x40)), GHIDRA_INT(layerName) < anm2->_layerCount &&
(animLayerIndex = *GHIDRA_CAST<int *>((iVar1 + 0x38 + GHIDRA_INT(layerName) * 4)), -1 < animLayerIndex))))
{
layerFrames = *GHIDRA_CAST<int *>((in_ECX + 0x48));
LAB_008cf2a5:
AnimationLayer::RenderFrame
(GHIDRA_CAST<AnimationLayer *>((animLayerIndex * 0x10 + *GHIDRA_CAST<int *>((iVar1 + 0x18)))),&drawPos,
*GHIDRA_CAST<int *>((layerFrames + animLayerIndex * 4)),&g_vectorZero,&g_vectorZero,anm2);
}
}
}
}
layerNameCursor = layerNameCursor + 1;
if (0xb2400f < GHIDRA_INT(layerNameCursor)) {
return;
}
} while( true );
}