From f38b962a5844502889ec00a98d0c9ed2a1151695 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Thu, 17 Sep 2026 10:05:55 -0400 Subject: demo d_file_error OK, fmap/fmap2 work, misc (#1208) * d_file_error OK, use J2DPane inlines everywhere * d_menu_fmap demo work * fmap and fmap2 work * fix demo regression with ternary fakematch * inline cleanup, f_pc_profile OK for demo * fix min/max bss order * lstair almost for demo --- src/JSystem/JKernel/JKRExpHeap.cpp | 17 +++++++++-------- src/JSystem/JKernel/JKRStdHeap.cpp | 6 ++++-- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'src/JSystem/JKernel') diff --git a/src/JSystem/JKernel/JKRExpHeap.cpp b/src/JSystem/JKernel/JKRExpHeap.cpp index a47d561a..89a53732 100644 --- a/src/JSystem/JKernel/JKRExpHeap.cpp +++ b/src/JSystem/JKernel/JKRExpHeap.cpp @@ -358,7 +358,7 @@ void JKRExpHeap::do_freeAll() { JKRHeap::callAllDisposer(); mHeadFreeList = (CMemBlock*)getStartAddr(); mTailFreeList = mHeadFreeList; - mHeadFreeList->initiate(NULL, NULL, getSize() - 0x10, 0, 0); + mHeadFreeList->initiate(NULL, NULL, getHeapSize() - 0x10, 0, 0); mHeadUsedList = NULL; mTailUsedList = NULL; unlock(); @@ -1009,12 +1009,13 @@ static void dummy2() { void JKRExpHeap::state_register(TState* p, u32 param_1) const { JUT_ASSERT(VERSION_SELECT(2271, 2420, 2423, 2423), p != NULL); JUT_ASSERT(VERSION_SELECT(2272, 2421, 2424, 2424), p->getHeap() == this); - p->mId = param_1; + + getState_(p); + setState_u32ID_(p, param_1); if (param_1 <= 0xff) { - p->mUsedSize = getUsedSize(param_1); + setState_uUsedSize_(p, getUsedSize(param_1)); } else { - s32 freeSize = const_cast(this)->getTotalFreeSize(); - p->mUsedSize = getSize() - freeSize; + setState_uUsedSize_(p, getUsedSize_(const_cast(this))); } u32 checkCode = 0; @@ -1028,18 +1029,18 @@ void JKRExpHeap::state_register(TState* p, u32 param_1) const { checkCode += (u32)block * 3; } } - p->mCheckCode = checkCode; + setState_u32CheckCode_(p, checkCode); } /* 802B31D4-802B327C .text state_compare__10JKRExpHeapCFRCQ27JKRHeap6TStateRCQ27JKRHeap6TState */ bool JKRExpHeap::state_compare(const JKRHeap::TState& r1, const JKRHeap::TState& r2) const { JUT_ASSERT(VERSION_SELECT(2319, 2468, 2471, 2471), r1.getHeap() == r2.getHeap()); bool result = true; - if (r1.mCheckCode != r2.mCheckCode) { + if (r1.getCheckCode() != r2.getCheckCode()) { result = false; } - if (r1.mUsedSize != r2.mUsedSize) { + if (r1.getUsedSize() != r2.getUsedSize()) { result = false; } diff --git a/src/JSystem/JKernel/JKRStdHeap.cpp b/src/JSystem/JKernel/JKRStdHeap.cpp index 03ea37bb..91ee6233 100644 --- a/src/JSystem/JKernel/JKRStdHeap.cpp +++ b/src/JSystem/JKernel/JKRStdHeap.cpp @@ -125,6 +125,8 @@ void* JKRStdHeap::do_getMaxFreeBlock() { void JKRStdHeap::state_register(JKRHeap::TState* p, u32 id) const { JUT_ASSERT(370, p != NULL); JUT_ASSERT(371, p->getHeap() == this); + + getState_(p); setState_u32ID_(p, id); setState_uUsedSize_(p, 0); setState_u32CheckCode_(p, 0); @@ -134,11 +136,11 @@ void JKRStdHeap::state_register(JKRHeap::TState* p, u32 id) const { bool JKRStdHeap::state_compare(const JKRHeap::TState& r1, const JKRHeap::TState& r2) const { JUT_ASSERT(394, r1.getHeap() == r2.getHeap()); bool result = true; - if (r1.mCheckCode != r2.mCheckCode) { + if (r1.getCheckCode() != r2.getCheckCode()) { result = false; } - if (r1.mUsedSize != r2.mUsedSize) { + if (r1.getUsedSize() != r2.getUsedSize()) { result = false; } -- cgit v1.2.3