Files
isaac-port/generated-src/mod.cpp
T
shweetandClaude Opus 5.5 780767f5e1 Curation round 2, wave A: anm2 (Anm2Ed JSON), text, config as idiomatic classes; SDL3 platform opens a window
- anm2.h/.cpp take over ANM2, AnimationState, LayerState, AnmCache and the frame data. They read Anm2Ed's JSON documents
  with simdjson and play them as the game does (interpolation baked at load). src/anm2/ and msvc.h are retired.
- font, formatted_text, string_table and rich_text take over the text classes. FormattedText::parse is still bit-exact
  against its assembly.
- options_config and challenge_params take over OptionsConfig, ChallengeParams and the .ini helpers. The tests include
  Save's exact bytes.
- platform.h/.cpp and main.cpp run IsaacMain on SDL3: the window and GL context open, and the run stops at the first
  built-in shader (FUN_00a13fa0).
- source_tree.py: a taken-over parent stays bytes, taken-over methods are not re-emitted as a namespace, and every
  address in a (a, b, c to d) list on a comment counts as taken over.
- log.h: reconstruction_missing() for a taken-over class's methods that are not written yet.
206 functions taken over, boot path 89/615. The full build waits for wave B: item_config, entity_config and mod_manager
still use the old APIs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 23:04:54 -05:00

105 lines
4.2 KiB
C++

#include "classes.h"
// 008f9cb0
void Mod::load_menu_sprites()
{
uint8_t bVar1;
uint64_t qVar2;
uint8_t *pbVar3;
std_string *path;
uint8_t *pbVar4;
void *in_ECX;
void *pvVar5;
uint32_t uVar6;
uint64_t *allocCounter;
uint32_t pathTableOffset;
ANM2 *sprite;
std_string contentPath;
std_string relativePath;
uint32_t local_14;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xff;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0xffffff;
puStack_c = &LAB_00b07ba5;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_INT(&relativePath) + 0x28U;
ExceptionList = &local_10;
sprite = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(in_ECX) + 0x100));
pathTableOffset = 0;
do {
pbVar4 = *GHIDRA_CAST<uint8_t **>((GHIDRA_INT(&PTR_s_gfx_CharacterMenu_anm2_00b240c0) + pathTableOffset));
if (pbVar4 != GHIDRA_CAST<uint8_t *>(0x0)) {
relativePath._size = 0;
relativePath._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(relativePath._buf)) + 0x0))) = (void *)0x0;
pbVar3 = pbVar4;
do {
bVar1 = *pbVar3;
pbVar3 = pbVar3 + 1;
} while (bVar1 != 0);
(GHIDRA_CAST<msvc::string *>((relativePath._buf)))->msvc::string::assign(pbVar4,GHIDRA_INT(pbVar3) - GHIDRA_INT((pbVar4 + 1)));
local_8 = 0;
GetContentPath(in_ECX,&contentPath,&relativePath);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
if (0xf < relativePath._capacity) {
uVar6 = relativePath._capacity + 1;
pvVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)relativePath._buf)) + 0x0)));
if (0xfff < uVar6) {
pvVar5 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(relativePath._buf)) + 0x0))) + -4);
uVar6 = relativePath._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(relativePath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar5))))) goto LAB_008f9e44;
}
operator_delete(pvVar5,uVar6);
}
path = &contentPath;
if (0xf < contentPath._capacity) {
path = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(contentPath._buf))) + 0x0)));
}
pbVar4 = FileSystem::ResolvePath(GHIDRA_CAST<uint8_t *>(path));
if (pbVar4 != GHIDRA_CAST<uint8_t *>(0x0)) {
if (g_mainHeap == (void *)0x0) {
allocCounter = &g_allocatedBytesNoHeap;
}
else {
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar6 = *GHIDRA_CAST<uint32_t *>((pbVar4 + -4));
qVar2 = *allocCounter;
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar6;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar2) < uVar6));
free(pbVar4 + -4);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
}
if (pbVar4 != GHIDRA_CAST<uint8_t *>(0x0)) {
ANM2::Load(sprite,&contentPath,1);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xff;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0xffffff;
if (0xf < contentPath._capacity) {
uVar6 = contentPath._capacity + 1;
pvVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)contentPath._buf)) + 0x0)));
if (0xfff < uVar6) {
pvVar5 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) + -4);
uVar6 = contentPath._capacity + 0x24;
if (0x1f < ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(contentPath._buf)) + 0x0))) - GHIDRA_INT(pvVar5)) - 4U) {
LAB_008f9e44:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar5,uVar6);
}
}
pathTableOffset = pathTableOffset + 4;
sprite = sprite + 1;
if (0x33 < pathTableOffset) {
ExceptionList = local_10;
return;
}
} while( true );
}