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>
This commit is contained in:
1 parent
d6e1ca7c6c
commit
780767f5e1
161 files changed
+8646
-21919
No files matched your search
@@ -34,8 +34,8 @@ void Menu_KeyConfig::Update()
|
||||
g_manager->_isHotkeysEnabled = (char)this->State == '\0';
|
||||
local_1c = this;
|
||||
if ((this->KeyConfigSprite)._loaded != 0) {
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->KeyConfigSprite)._animState)))->AnimationState::Update();
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->KeyConfigSprite)._overlayAnimState)))->AnimationState::Update();
|
||||
AnimationState::Update(&(this->KeyConfigSprite)._animState);
|
||||
AnimationState::Update(&(this->KeyConfigSprite)._overlayAnimState);
|
||||
}
|
||||
iVar5 = g_menuControllerIndex;
|
||||
local_20 = g_menuControllerIndex;
|
||||
@@ -320,7 +320,7 @@ LAB_008d9290:
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
||||
}
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + iVar5 * 4)) = 0;
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->KeyConfigSprite)._animState)))->AnimationState::AdvanceLayerPosition(iVar5,0.0);
|
||||
AnimationState::AdvanceLayerPosition(&(this->KeyConfigSprite)._animState,iVar5,0.0);
|
||||
}
|
||||
LAB_008d92f5:
|
||||
local_8 = 3;
|
||||
@@ -450,7 +450,7 @@ void Menu_KeyConfig::Render()
|
||||
if (((this->KeyConfigSprite)._animState._animData == (void *)0x0) ||
|
||||
((this->KeyConfigSprite)._animState._isPlaying == 0)) {
|
||||
LAB_008d94f9:
|
||||
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_94.y))))->ANM2::Play(s_Idle,0);
|
||||
ANM2::Play(GHIDRA_CAST<ANM2 *>(local_94.y),s_Idle,0);
|
||||
}
|
||||
else {
|
||||
keyName = (this->KeyConfigSprite)._animState._animData;
|
||||
@@ -543,7 +543,7 @@ LAB_008d94f5:
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
||||
keyName = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>(actionLabels[row]));
|
||||
local_a0 = GHIDRA_CAST<int *>(((float)(rowOffset + -0x41) + fVar4));
|
||||
(GHIDRA_CAST<Font *>((font)))->Font::DrawString(keyName,&rowColor,&fontSettings,x,(float)local_a0);
|
||||
Font::DrawString(font,keyName,&rowColor,&fontSettings,x,(float)local_a0);
|
||||
local_14 = GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8));
|
||||
rowOffsetY = (float)rowOffset;
|
||||
if (controllerIndex == 0) {
|
||||
@@ -557,11 +557,11 @@ LAB_008d97fd:
|
||||
local_d0 = 0;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
||||
keyName = GHIDRA_CAST<uint8_t *>((**(code **)(*device + 0x10))(primaryKey));
|
||||
layerIndex = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(keyName,-1);
|
||||
layerIndex = Font::get_string_width_n(font,keyName,-1);
|
||||
keyTextX = (originX + 400.0) -
|
||||
(float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]);
|
||||
keyName = GHIDRA_CAST<uint8_t *>((**(code **)(*device + 0x10))(primaryKey));
|
||||
(GHIDRA_CAST<Font *>((font)))->Font::DrawString(keyName,&rowColor,&fontSettings,keyTextX,(float)local_a0);
|
||||
Font::DrawString(font,keyName,&rowColor,&fontSettings,keyTextX,(float)local_a0);
|
||||
local_14 = GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8));
|
||||
}
|
||||
else {
|
||||
@@ -593,11 +593,11 @@ LAB_008d9977:
|
||||
local_d0 = 0;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
||||
keyName = GHIDRA_CAST<uint8_t *>((**(code **)(*device + 0x10))(secondaryKey));
|
||||
layerIndex = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(keyName,-1);
|
||||
layerIndex = Font::get_string_width_n(font,keyName,-1);
|
||||
keyTextX = (originX + 300.0) -
|
||||
(float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]);
|
||||
keyName = GHIDRA_CAST<uint8_t *>((**(code **)(*device + 0x10))(secondaryKey));
|
||||
(GHIDRA_CAST<Font *>((font)))->Font::DrawString(keyName,&rowColor,&fontSettings,keyTextX,(float)local_a0);
|
||||
Font::DrawString(font,keyName,&rowColor,&fontSettings,keyTextX,(float)local_a0);
|
||||
local_14 = GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8));
|
||||
}
|
||||
else {
|
||||
@@ -617,7 +617,7 @@ LAB_008d9977:
|
||||
}
|
||||
layerIndex = this->SelectedElement;
|
||||
if (currentRow == layerIndex) {
|
||||
cursorLayer = (GHIDRA_CAST<ANM2 *>((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006);
|
||||
cursorLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006);
|
||||
cursorLayer->_visible = 1;
|
||||
(this->KeyConfigSprite)._flipX = 1;
|
||||
if ((char)this->State == '\0') {
|
||||
@@ -767,7 +767,7 @@ LAB_008d9c3c:
|
||||
currentRow = row;
|
||||
}
|
||||
(this->KeyConfigSprite)._flipX = 0;
|
||||
cursorLayer = (GHIDRA_CAST<ANM2 *>((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006);
|
||||
cursorLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006);
|
||||
cursorLayer->_visible = 0;
|
||||
layerIndex = this->SelectedElement;
|
||||
}
|
||||
@@ -775,7 +775,7 @@ LAB_008d9c3c:
|
||||
rowOffset = rowOffset + rowHeight;
|
||||
} while (row < GHIDRA_INT((GHIDRA_UINT(isNameLess) * 4 + 0xf)));
|
||||
if (layerIndex != 0x13) goto LAB_008d9fde;
|
||||
cursorLayer = (GHIDRA_CAST<ANM2 *>((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006);
|
||||
cursorLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006);
|
||||
cursorPos.x = originX + 75.0;
|
||||
cursorPos.y = originY + 390.0;
|
||||
cursorLayer->_visible = 1;
|
||||
@@ -824,7 +824,7 @@ LAB_008d9fb6:
|
||||
}
|
||||
}
|
||||
}
|
||||
cursorLayer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_94.y))))->ANM2::GetLayer(&DAT_00000006);
|
||||
cursorLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(local_94.y),&DAT_00000006);
|
||||
cursorLayer->_visible = 0;
|
||||
LAB_008d9fde:
|
||||
local_14 = GHIDRA_CAST<char *>(0x4);
|
||||
@@ -1019,7 +1019,7 @@ LAB_008da445:
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
||||
}
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + iVar4 * 4)) = 0;
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->KeyConfigSprite)._animState)))->AnimationState::AdvanceLayerPosition(iVar4,0.0);
|
||||
AnimationState::AdvanceLayerPosition(&(this->KeyConfigSprite)._animState,iVar4,0.0);
|
||||
}
|
||||
LAB_008da4aa:
|
||||
local_8 = 1;
|
||||
@@ -1146,10 +1146,10 @@ LAB_008da5d5:
|
||||
(ppcVar1 = actionLabels + 0x1d, (this->KeyConfigSprite)._animState._isPlaying != 0))))
|
||||
goto LAB_008da609;
|
||||
}
|
||||
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->KeyConfigSprite)))->ANM2::SetAnimation(s_Idle,1);
|
||||
bVar2 = ANM2::SetAnimation(&this->KeyConfigSprite,s_Idle,1);
|
||||
ppcVar1 = GHIDRA_CAST<char **>(puStack_20);
|
||||
if (bVar2 != 0) {
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->KeyConfigSprite)._animState)))->AnimationState::Rewind();
|
||||
AnimationState::Rewind(&(this->KeyConfigSprite)._animState);
|
||||
(this->KeyConfigSprite)._animState._isPlaying = 1;
|
||||
ppcVar1 = GHIDRA_CAST<char **>(puStack_20);
|
||||
}
|
||||
@@ -1213,9 +1213,9 @@ LAB_008da689:
|
||||
((buttonName[0x34] == 0 || ((this->KeyConfigSprite)._animState._isPlaying != 0))))
|
||||
goto LAB_008da6bd;
|
||||
}
|
||||
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->KeyConfigSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("IdleUD"),1);
|
||||
bVar2 = ANM2::SetAnimation(&this->KeyConfigSprite,GHIDRA_CAST<uint8_t *>("IdleUD"),1);
|
||||
if (bVar2 != 0) {
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->KeyConfigSprite)._animState)))->AnimationState::Rewind();
|
||||
AnimationState::Rewind(&(this->KeyConfigSprite)._animState);
|
||||
(this->KeyConfigSprite)._animState._isPlaying = 1;
|
||||
}
|
||||
}
|
||||
@@ -1314,7 +1314,7 @@ LAB_008da6bd:
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
||||
buttonName = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>(actionLabels[row]));
|
||||
local_84 = GHIDRA_CAST<int *>(((float)rowOffsetY + rowBaseY));
|
||||
(GHIDRA_CAST<Font *>((font)))->Font::DrawString(buttonName,&drawColor,&drawParams,x,(float)local_84);
|
||||
Font::DrawString(font,buttonName,&drawColor,&drawParams,x,(float)local_84);
|
||||
drawParams = 0;
|
||||
local_c0 = 0xffff;
|
||||
local_bc = 0;
|
||||
@@ -1324,11 +1324,11 @@ LAB_008da6bd:
|
||||
local_ac = 0;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
||||
buttonName = GHIDRA_CAST<uint8_t *>((**(code **)(*local_9c + 0x10))(primaryButton));
|
||||
layerIndex = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(buttonName,-1);
|
||||
layerIndex = Font::get_string_width_n(font,buttonName,-1);
|
||||
buttonTextX = local_XMM1_Da_745 -
|
||||
(float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]);
|
||||
buttonName = GHIDRA_CAST<uint8_t *>((**(code **)(*local_9c + 0x10))(primaryButton));
|
||||
(GHIDRA_CAST<Font *>((font)))->Font::DrawString(buttonName,&drawColor,&drawParams,buttonTextX,(float)local_84);
|
||||
Font::DrawString(font,buttonName,&drawColor,&drawParams,buttonTextX,(float)local_84);
|
||||
drawParams = 0;
|
||||
local_c0 = 0xffff;
|
||||
local_bc = 0;
|
||||
@@ -1338,15 +1338,15 @@ LAB_008da6bd:
|
||||
local_ac = 0;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
||||
buttonName = GHIDRA_CAST<uint8_t *>((**(code **)(*local_9c + 0x10))(secondaryButton));
|
||||
layerIndex = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(buttonName,-1);
|
||||
layerIndex = Font::get_string_width_n(font,buttonName,-1);
|
||||
buttonTextX = (float)local_a8 -
|
||||
(float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]);
|
||||
buttonName = GHIDRA_CAST<uint8_t *>((**(code **)(*local_9c + 0x10))(secondaryButton));
|
||||
(GHIDRA_CAST<Font *>((font)))->Font::DrawString(buttonName,&drawColor,&drawParams,buttonTextX,(float)local_84);
|
||||
Font::DrawString(font,buttonName,&drawColor,&drawParams,buttonTextX,(float)local_84);
|
||||
local_14 = GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8));
|
||||
layerIndex = this->SelectedElement;
|
||||
if (currentRow == layerIndex) {
|
||||
highlightLayer = (GHIDRA_CAST<ANM2 *>((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006);
|
||||
highlightLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006);
|
||||
highlightLayer->_visible = 1;
|
||||
(this->KeyConfigSprite)._flipX = 1;
|
||||
if ((char)this->State == '\0') {
|
||||
@@ -1496,7 +1496,7 @@ LAB_008daca2:
|
||||
currentRow = row;
|
||||
}
|
||||
(this->KeyConfigSprite)._flipX = 0;
|
||||
highlightLayer = (GHIDRA_CAST<ANM2 *>((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006);
|
||||
highlightLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006);
|
||||
highlightLayer->_visible = 0;
|
||||
layerIndex = this->SelectedElement;
|
||||
}
|
||||
@@ -1505,7 +1505,7 @@ LAB_008daca2:
|
||||
} while (row < 0x14);
|
||||
if (layerIndex != 0x14) goto LAB_008db021;
|
||||
local_a8 = &this->KeyConfigSprite;
|
||||
highlightLayer = (GHIDRA_CAST<ANM2 *>((local_a8)))->ANM2::GetLayer(&DAT_00000006);
|
||||
highlightLayer = ANM2::GetLayer(local_a8,&DAT_00000006);
|
||||
cursorPos.x = originX + 75.0;
|
||||
cursorPos.y = originY + 430.0;
|
||||
highlightLayer->_visible = 1;
|
||||
@@ -1556,7 +1556,7 @@ LAB_008daff9:
|
||||
}
|
||||
}
|
||||
}
|
||||
highlightLayer = (GHIDRA_CAST<ANM2 *>((local_a8)))->ANM2::GetLayer(&DAT_00000006);
|
||||
highlightLayer = ANM2::GetLayer(local_a8,&DAT_00000006);
|
||||
highlightLayer->_visible = 0;
|
||||
LAB_008db021:
|
||||
local_14 = GHIDRA_CAST<char *>(0x4);
|
||||
|
||||
Reference in new issue
Block a user