Compare commits
11 Commits
agent/w092
...
agent/fix/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d5a629567 | ||
|
|
22e6bbed24 | ||
|
|
f49f337c6b | ||
|
|
c3cad09b66 | ||
|
|
11dd7f505a | ||
|
|
52c9ea4b70 | ||
|
|
eef15925f4 | ||
|
|
46baf56e38 | ||
|
|
23b77a337c | ||
|
|
77cf359837 | ||
|
|
af7146a850 |
@@ -897,13 +897,16 @@ src/scene/setting/iplRakuRakuThread.cpp:
|
||||
.sbss start:0x81698C60 end:0x81698C70
|
||||
|
||||
src/scene/setting/AOSS.c:
|
||||
.bss start:0x810BDEF8 end:0x810BECA0
|
||||
.bss start:0x810BDEF8 end:0x810BE838
|
||||
.text start:0x813FE27C end:0x814021BC
|
||||
.data start:0x81657C48 end:0x81657DB8
|
||||
.sdata2 start:0x81694C78 end:0x81694C80
|
||||
.sdata start:0x81697200 end:0x81697218
|
||||
.sbss start:0x81698C70 end:0x81698C90
|
||||
|
||||
src/scene/setting/AOSSData.c:
|
||||
.bss start:0x810BE838 end:0x810BECA0
|
||||
|
||||
src/scene/setting/ATERM.c:
|
||||
.bss start:0x810BECA0 end:0x810C0C80
|
||||
.text start:0x814021BC end:0x81406CC0
|
||||
|
||||
@@ -93,8 +93,8 @@ sRakuMsgQueue = .bss:0x810BDED4; // type:object size:0x20
|
||||
AOSS_810BDEF8 = .bss:0x810BDEF8; // type:object size:0x20 data:4byte
|
||||
AOSS_810BDF18 = .bss:0x810BDF18; // type:object size:0x6A0
|
||||
AOSS_810BE5B8 = .bss:0x810BE5B8; // type:object size:0x280
|
||||
AOSS_810BE838 = .bss:0x810BE838; // type:object size:0x68
|
||||
AOSS_810BE8A0 = .bss:0x810BE8A0; // type:object size:0x400
|
||||
s_packetState = .bss:0x810BE838; // type:object size:0x68
|
||||
s_crcTable = .bss:0x810BE8A0; // type:object size:0x400
|
||||
gAtermIpConfig = .bss:0x810BECA0; // type:object size:0x7C4 data:4byte
|
||||
gAtermIfConfig = .bss:0x810BF464; // type:object size:0x15E
|
||||
ATERM_810BF5C4 = .bss:0x810BF5C4; // type:object size:0x24
|
||||
@@ -4617,11 +4617,11 @@ updateDialogAnimation__Q33ipl5scene15SDChannelSelectFv = .text:0x813DCAC4; // ty
|
||||
setDialogMessage__Q33ipl5scene15SDChannelSelectFUlUl = .text:0x813DCEF0; // type:function size:0x24
|
||||
isCurrentTitleUsageEnough__Q33ipl5scene15SDChannelSelectCFPCl = .text:0x813DCF14; // type:function size:0xCC
|
||||
getCurrentTitleUsage__Q33ipl5scene15SDChannelSelectCFPlPl = .text:0x813DCFE0; // type:function size:0xCC
|
||||
collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl = .text:0x813DD0AC; // type:function size:0x194
|
||||
collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl = .text:0x813DD240; // type:function size:0x198
|
||||
collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl = .text:0x813DD3D8; // type:function size:0x1F8
|
||||
collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl = .text:0x813DD5D0; // type:function size:0x5A4
|
||||
collectTitlesForMode__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUli = .text:0x813DDB74; // type:function size:0x40
|
||||
collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPlPlPUxPcPUl = .text:0x813DD0AC; // type:function size:0x194
|
||||
collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPlPlPUxPcPUl = .text:0x813DD240; // type:function size:0x198
|
||||
collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPlPlPUxPcPUl = .text:0x813DD3D8; // type:function size:0x1F8
|
||||
collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPlPlPUxPcPUl = .text:0x813DD5D0; // type:function size:0x5A4
|
||||
collectTitlesForMode__Q33ipl5scene15SDChannelSelectFPlPlPUxPcPUli = .text:0x813DDB74; // type:function size:0x40
|
||||
findAdjacentChannel__Q33ipl5scene15SDChannelSelectCFiPiPi = .text:0x813DDBB4; // type:function size:0xB4
|
||||
setCurrentPageAndRefresh__Q33ipl5scene15SDChannelSelectFiiPQ33ipl5scene12SDChannelObj = .text:0x813DDC68; // type:function size:0x18
|
||||
handleFourPageDialog__Q33ipl5scene15SDChannelSelectFv = .text:0x813DDC80; // type:function size:0x58
|
||||
@@ -17727,12 +17727,20 @@ __vt__Q39textinput4util9Animation = .data:0x8165D258; // type:object size:0x24
|
||||
@STRING@GetTextColor__Q34nw4r3lyt7TextBoxCFUl = .data:0x8165D28C; // type:object size:0x41 data:string
|
||||
scT_prdc_Text_00 = .data:0x8165D2D0; // type:object size:0xF data:string
|
||||
scP_prdc_scrl_Left = .data:0x8165D2E0; // type:object size:0x11 data:string
|
||||
scCandidatePaneData = .data:0x8165D2F8; // type:object size:0x68C
|
||||
scPaneNameTable = .data:0x8165D984; // type:object size:0x84
|
||||
scW_predictWindow = .data:0x8165DA08; // type:object size:0x10 data:string
|
||||
scN_predictInput = .data:0x8165DA18; // type:object size:0xF data:string
|
||||
scW_OnOff_Area = .data:0x8165DA28; // type:object size:0xD data:string
|
||||
scN_prdc_Texts = .data:0x8165DA38; // type:object size:0xD data:string
|
||||
scCandidatePaneData = .data:0x8165D2F8; // type:object size:0x680
|
||||
@9934 = .data:0x8165D978; // type:object size:0x9 scope:local data:string
|
||||
@9935 = .data:0x8165D984; // type:object size:0x9 scope:local data:string
|
||||
@9936 = .data:0x8165D990; // type:object size:0xB scope:local data:string
|
||||
@9937 = .data:0x8165D99C; // type:object size:0xB scope:local data:string
|
||||
@9938 = .data:0x8165D9A8; // type:object size:0xA scope:local data:string
|
||||
@9939 = .data:0x8165D9B4; // type:object size:0x11 scope:local data:string
|
||||
@9940 = .data:0x8165D9C8; // type:object size:0x11 scope:local data:string
|
||||
@9941 = .data:0x8165D9DC; // type:object size:0x11 scope:local data:string
|
||||
@9942 = .data:0x8165D9F0; // type:object size:0x11 scope:local data:string
|
||||
@9943 = .data:0x8165DA08; // type:object size:0x10 scope:local data:string
|
||||
@10036 = .data:0x8165DA18; // type:object size:0xF scope:local data:string
|
||||
@10037 = .data:0x8165DA28; // type:object size:0xD scope:local data:string
|
||||
@10041 = .data:0x8165DA38; // type:object size:0xD scope:local data:string
|
||||
@10530 = .data:0x8165DA48; // type:object size:0x1C scope:local
|
||||
@6761 = .data:0x8165DA64; // type:object size:0xF scope:local data:string
|
||||
@6762 = .data:0x8165DA74; // type:object size:0xF scope:local data:string
|
||||
|
||||
15
configure.py
15
configure.py
@@ -678,7 +678,7 @@ config.libs = [
|
||||
Object(Matching, "utility/iplThread.cpp"),
|
||||
Object(Matching, "utility/iplMessageBase.cpp"),
|
||||
Object(Matching, "utility/iplJpegDecoder.cpp"),
|
||||
Object(NonMatching, "utility/iplESMisc.cpp"),
|
||||
Object(Matching, "utility/iplESMisc.cpp"),
|
||||
Object(Matching, "utility/iplCSFlags.cpp"),
|
||||
]
|
||||
),
|
||||
@@ -849,7 +849,7 @@ config.libs = [
|
||||
]
|
||||
),
|
||||
IPLSection("sdChannelSelect", [
|
||||
Object(NonMatching, "scene/sdChannelSelect/iplSDChannelSelect.cpp"),
|
||||
Object(Matching, "scene/sdChannelSelect/iplSDChannelSelect.cpp"),
|
||||
Object(Matching, "scene/sdChannelSelect/iplSDChannelObj.cpp"),
|
||||
]
|
||||
),
|
||||
@@ -879,6 +879,7 @@ config.libs = [
|
||||
Object(NonMatching, "scene/setting/AOSSLink.c"),
|
||||
Object(Matching, "scene/setting/iplRakuRakuThread.cpp"),
|
||||
Object(NonMatching, "scene/setting/AOSS.c", extra_cflags=["-O4,p", "-inline off"]),
|
||||
Object(Matching, "scene/setting/AOSSData.c"),
|
||||
Object(NonMatching, "scene/setting/ATERM.c", extra_cflags=["-O4,p", "-inline on"]),
|
||||
]
|
||||
),
|
||||
@@ -917,7 +918,7 @@ config.libs = [
|
||||
Object(Matching, "keyboard/tiSignWindow.cpp", extra_cflags=["-O4,p"]),
|
||||
Object(NonMatching, "keyboard/tiString.cpp", extra_cflags=["-O4,p"]),
|
||||
Object(NonMatching, "keyboard/tiAtokString.cpp", extra_cflags=["-O4,p"]), # for 4.3J
|
||||
Object(NonMatching, "keyboard/tiZiString.cpp", extra_cflags=["-O4,p"]), # for 4.3U and 4.3E
|
||||
Object(Matching, "keyboard/tiZiString.cpp", extra_cflags=["-O4,p"]), # for 4.3U and 4.3E
|
||||
Object(Matching, "keyboard/tiTextDrawer.cpp", extra_cflags=["-O4,p"]),
|
||||
Object(Matching, "keyboard/tiNw4rManager.cpp", extra_cflags=["-O4,p"]),
|
||||
Object(Matching, "keyboard/tiKeyboard.cpp", extra_cflags=["-O4,p"]),
|
||||
@@ -1057,11 +1058,11 @@ config.libs = [
|
||||
Object(Matching, "nhttp/NHTTP_control.c"),
|
||||
Object(Matching, "nhttp/NHTTP_list.c"),
|
||||
Object(Matching, "nhttp/NHTTP_os_RVL.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_recvbuf.c"),
|
||||
Object(Matching, "nhttp/NHTTP_recvbuf.c", mw_version="GC/3.0a5"),
|
||||
Object(Matching, "nhttp/NHTTP_request.c"),
|
||||
Object(Matching, "nhttp/NHTTP_response.c"),
|
||||
Object(Matching, "nhttp/NHTTP_socket_RVL.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_stdlib_RVL.c"),
|
||||
Object(Matching, "nhttp/NHTTP_stdlib_RVL.c", mw_version="GC/3.0a5"),
|
||||
Object(Matching, "nhttp/NHTTP_thread.c"),
|
||||
Object(Matching, "nhttp/d_nhttp_private.c"),
|
||||
Object(Matching, "nhttp/d_nhttp.c"),
|
||||
@@ -1323,7 +1324,7 @@ config.libs = [
|
||||
Object(Matching, "lyt/lyt_layout.cpp"),
|
||||
Object(Matching, "lyt/lyt_picture.cpp"),
|
||||
Object(Matching, "lyt/lyt_textBox.cpp"),
|
||||
Object(Equivalent, "lyt/lyt_window.cpp"),
|
||||
Object(Matching, "lyt/lyt_window.cpp"),
|
||||
Object(Matching, "lyt/lyt_bounding.cpp"),
|
||||
Object(Matching, "lyt/lyt_material.cpp"),
|
||||
Object(Matching, "lyt/lyt_drawinfo.cpp"),
|
||||
@@ -1854,7 +1855,7 @@ config.libs = [
|
||||
Object(Matching, "fa/kernel/pfk_api.c"),
|
||||
|
||||
Object(Matching, "fa/driver/nand_drv.c"),
|
||||
Object(NonMatching, "fa/driver/sd_drv.c"),
|
||||
Object(Matching, "fa/driver/sd_drv.c"),
|
||||
Object(Matching, "fa/driver/pfd_cmn.c"),
|
||||
Object(Matching, "fa/driver/msc_drv.c"),
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Assembly inventory
|
||||
|
||||
4.3U, 2026-10-05. 167 functions contain 169 assembly
|
||||
bodies/blocks: 162 ORIGINAL functions and 5 PLACEHOLDER functions.
|
||||
4.3U, 2026-10-08. 166 functions contain 168 assembly
|
||||
bodies/blocks: 162 ORIGINAL functions and 4 PLACEHOLDER functions.
|
||||
|
||||
Run `python3 tools/check_asm_inventory.py`. Completion requires exit 0, complete
|
||||
coverage and zero placeholders. The checker also rejects stale/duplicate rows,
|
||||
@@ -186,8 +186,7 @@ found. Historical logs absent from this branch have commit IDs and excerpts in
|
||||
| `src/BS2/BS2Start.c` | `__start` | ORIGINAL | Runs before the C stack and ABI registers exist; constructs the initial stack. |
|
||||
| `src/BS2/BS2Start.c` | `__init_registers` | ORIGINAL | Initializes GPRs, r1, r2, and r13 for the C runtime. |
|
||||
| `src/scene/nakamuraTest/gamespy/common/gsPlatformUtil.c` | `GetTicks` | ORIGINAL | Inactive PS2 branch reads the CP0 Count register with mfc0 $9. |
|
||||
| `src/system/iplChannelManager.cpp` | `getTitleName__Q33ipl7channel7ManagerCFiii` | PLACEHOLDER | Channel-name copying; best C 99.57746%, 71/71 instructions, four address-order differences, [rx17][rx17]. |
|
||||
| `src/system/iplSaveDataManager.cpp` | `Manager::hasChannel` | PLACEHOLDER | Title-slot search; best C 98.87324%, 71/71 instructions, 14 mask/base register differences, [rx30][rx30]. |
|
||||
| `src/system/iplSaveDataManager.cpp` | `Manager::hasChannel` | PLACEHOLDER | Title-slot search; best C 71/71 instructions, 12 mask/base register differences, [sol-ph1](../tools/decomp-assist/sol-ph1.attempts.md). |
|
||||
| `src/system/iplSystem.cpp` | `System::warning_run` | PLACEHOLDER | Scene/render calls; best C 98.66477%, 176/176 instructions, 47 saved-register differences, [rx17][rx17]. |
|
||||
| `src/system/rvl_dec.c` | `Rvl_decode` | ORIGINAL | Direct beq decoder entries preserve r3/r4 and LR; lis/ori builds the format signatures. |
|
||||
| `src/system/rvl_dec.c` | `Rvl_decode_szs` | ORIGINAL | Original SZS decoder convention: nofralloc, r0 retains output length, fixed r3..r10/CTR byte-copy pipeline. |
|
||||
|
||||
@@ -296,45 +296,6 @@ namespace ipl {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_CPP
|
||||
} // namespace math
|
||||
} // namespace ipl
|
||||
#include "math/iplMathTypes.h"
|
||||
namespace ipl {
|
||||
namespace math {
|
||||
template <>
|
||||
class HermiteIntp<VEC3> : public utility::FrameController {
|
||||
public:
|
||||
HermiteIntp() {}
|
||||
virtual ~HermiteIntp();
|
||||
void init(const VEC3& start, const VEC3& end, f32 maxFrame, f32 startTangent, f32 endTangent, int playback = ANIM_TYPE_FORWARD, f32 speed = 1.0f);
|
||||
VEC3 get() const {
|
||||
f32 frame = mFrame;
|
||||
f32 inverseDuration = 1.0f / mMaxFrame;
|
||||
VEC3 result =
|
||||
(mStart * (1.0f + (inverseDuration * (inverseDuration *
|
||||
(inverseDuration * (frame * (2.0f * frame * frame)))) -
|
||||
inverseDuration * (inverseDuration * (3.0f * frame * frame))))) -
|
||||
(mEnd * (inverseDuration * (inverseDuration *
|
||||
(inverseDuration * (frame * (2.0f * frame * frame)))) -
|
||||
inverseDuration * (inverseDuration * (3.0f * frame * frame))));
|
||||
f32 frameSquared = frame * frame;
|
||||
f32 cubic = inverseDuration * (inverseDuration * (frame * frameSquared));
|
||||
f32 tangent = mStartTangent * (frame + (cubic -
|
||||
inverseDuration * (2.0f * frame * frame))) +
|
||||
mEndTangent * (cubic - inverseDuration * frameSquared);
|
||||
result.x += tangent;
|
||||
result.y += tangent;
|
||||
result.z += tangent;
|
||||
return result;
|
||||
}
|
||||
protected:
|
||||
VEC3 mStart;
|
||||
VEC3 mEnd;
|
||||
f32 mStartTangent;
|
||||
f32 mEndTangent;
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace math
|
||||
} // namespace ipl
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace ipl {
|
||||
const controller::Interface* controller);
|
||||
BOOL onEventDerived(const char* paneName, u32 event,
|
||||
controller::Interface* controller);
|
||||
bool collectTitlesByUsage(const s32* firstUsage, const s32* secondUsage,
|
||||
bool collectTitlesByUsage(s32* firstUsage, s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames,
|
||||
u32* titleCount);
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace ipl {
|
||||
int getCenterChannelIndex(const char* paneName) const;
|
||||
nw4r::lyt::Pane* getCenterChannelPane(int index) const;
|
||||
nw4r::lyt::Pane* getChannelPane(int index) const;
|
||||
static math::VEC3 getChannelPanePosition(SDChannelSelect* scene, int index);
|
||||
static nw4r::math::VEC3 getChannelPanePosition(SDChannelSelect* scene, int index);
|
||||
void calcPageAnimations();
|
||||
void processNormalInput();
|
||||
void updateArrowVisibility();
|
||||
@@ -232,16 +232,16 @@ namespace ipl {
|
||||
void setChannelScissor(const SDChannelObj* channel) const;
|
||||
bool isCurrentTitleUsageEnough(const s32* usage) const;
|
||||
void getCurrentTitleUsage(s32* bytes, s32* blocks) const;
|
||||
bool collectTitlesByChannelOrder(const s32* firstUsage, const s32* secondUsage,
|
||||
bool collectTitlesByChannelOrder(s32* firstUsage, s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames,
|
||||
u32* titleCount);
|
||||
bool collectTitlesFromNandUsage(const s32* firstUsage, const s32* secondUsage,
|
||||
bool collectTitlesFromNandUsage(s32* firstUsage, s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames,
|
||||
u32* titleCount);
|
||||
bool collectTitlesBySpecialChannels(const s32* firstUsage, const s32* secondUsage,
|
||||
bool collectTitlesBySpecialChannels(s32* firstUsage, s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames,
|
||||
u32* titleCount);
|
||||
bool collectTitlesForMode(const s32* firstUsage, const s32* secondUsage,
|
||||
bool collectTitlesForMode(s32* firstUsage, s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames,
|
||||
u32* titleCount, int searchMode);
|
||||
bool findAdjacentChannel(int direction, int* page, int* index) const;
|
||||
|
||||
@@ -20,6 +20,19 @@ typedef struct AOSSInitInput {
|
||||
u8 result[0x154];
|
||||
} AOSSInitInput;
|
||||
|
||||
typedef struct AOSSKeyMaterial {
|
||||
u8 nonce[2];
|
||||
u8 address[8];
|
||||
} AOSSKeyMaterial;
|
||||
|
||||
typedef struct AOSSPacketState {
|
||||
AOSSKeyMaterial key;
|
||||
u8 payload[0x5e];
|
||||
} AOSSPacketState;
|
||||
|
||||
extern AOSSPacketState s_packetState;
|
||||
extern u32 s_crcTable[0x100];
|
||||
|
||||
int AOSSi_Init(AOSSInitInput* input);
|
||||
int AOSS_Init_old(AOSSInitInput* input);
|
||||
void* AOSSi_Alloc(u32 size);
|
||||
|
||||
@@ -277,6 +277,9 @@ namespace ipl {
|
||||
/* SEntry */
|
||||
bool hasLoadedBnr(int page, int index) const { return mChannels[page][index].loadedBnr; }
|
||||
int getSceneID(int page, int index) const { return mChannels[page][index].loadedBnr ? mChannels[page][index].info.sceneID : 0; }
|
||||
ESTitleId getEntryTitleID(int page, int index) const {
|
||||
return mChannels[page][index].loadedBnr ? ES_TITLE_ID(mChannels[page][index].info.titleType, mChannels[page][index].info.titleCode) : 0;
|
||||
}
|
||||
|
||||
/* SMetaBlockHeader */
|
||||
u32 getIconRSOIdx(int page, int index) const {
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
#include <nw4r/db/assert.h>
|
||||
#include <nw4r/lyt/window.h>
|
||||
|
||||
#include <nw4r/lyt/common.h>
|
||||
#include <nw4r/lyt/layout.h>
|
||||
#include <nw4r/lyt/resources.h>
|
||||
#include <nw4r/lyt/types.h>
|
||||
|
||||
|
||||
#include <nw4r/math.h>
|
||||
|
||||
#include <new>
|
||||
|
||||
extern "C" const u8 scLytFatalColorR;
|
||||
extern "C" const u8 scLytFatalColorG;
|
||||
extern "C" const u8 scLytFatalColorB;
|
||||
extern "C" const u8 scLytFatalColorA;
|
||||
extern "C" char scLytFatalMsg[] = "Error#004\nAn error has occurred.\nThe system files are corrupted.";
|
||||
extern "C" char scLytFatalMsg[];
|
||||
|
||||
#undef NW4R_ASSERT
|
||||
#define NW4R_GLOBAL_ASSERT(x) \
|
||||
@@ -26,18 +37,6 @@ extern "C" char scLytFatalMsg[] = "Error#004\nAn error has occurred.\nThe system
|
||||
} \
|
||||
}
|
||||
|
||||
#include <nw4r/lyt/window.h>
|
||||
|
||||
#include <nw4r/lyt/common.h>
|
||||
#include <nw4r/lyt/layout.h>
|
||||
#include <nw4r/lyt/resources.h>
|
||||
#include <nw4r/lyt/types.h>
|
||||
|
||||
|
||||
#include <nw4r/math.h>
|
||||
|
||||
#include <new>
|
||||
|
||||
namespace nw4r {
|
||||
namespace lyt {
|
||||
NW4R_UT_GET_DERIVED_RUNTIME_TYPEINFO(Window, Pane);
|
||||
@@ -174,8 +173,22 @@ namespace {
|
||||
flipInfo.coords[VERTEXCOLOR_RB][iy] +
|
||||
polSize.height / ((flipInfo.coords[VERTEXCOLOR_RT][iy] - flipInfo.coords[VERTEXCOLOR_RB][iy]) * tSz[iy]);
|
||||
}
|
||||
|
||||
inline void SetFrameTexOrigin(math::VEC2* texCds, int corner, int ix, int iy, u8 originX, u8 originY) {
|
||||
texCds[corner][ix] = texCds[corner ^ 2][ix] = originX;
|
||||
texCds[corner][iy] = texCds[corner ^ 1][iy] = originY;
|
||||
}
|
||||
|
||||
inline void SetFrameTexExtent(math::VEC2* texCds, const Size& polSize, const Size& texSize, const TextureFlipInfo& flipInfo, int corner, int ix,
|
||||
int iy, u8 originX, u8 originY) {
|
||||
const math::VEC2 tSz(texSize.width, texSize.height);
|
||||
texCds[corner ^ 3][ix] = texCds[corner ^ 1][ix] = originX + polSize.width / ((flipInfo.coords[corner ^ 1][ix] - originX) * tSz[ix]);
|
||||
texCds[corner ^ 3][iy] = texCds[corner ^ 2][iy] = originY + polSize.height / ((flipInfo.coords[corner ^ 2][iy] - originY) * tSz[iy]);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
extern "C" char scLytFatalMsg[] = "Error#004\nAn error has occurred.\nThe system files are corrupted.";
|
||||
|
||||
namespace nw4r {
|
||||
namespace lyt {
|
||||
Window::Window(const res::Window* pBlock, const ResBlockSet& resBlockSet) : Pane(pBlock) {
|
||||
@@ -388,7 +401,17 @@ namespace nw4r {
|
||||
detail::DrawQuad(polPt, polSize, GX_TEXMAP1, texCds, bUseVtxCol ? vtxColors : NULL, alpha); \
|
||||
}
|
||||
|
||||
DRAW_QUAD_FOR_FRAME_1(LT, TEXTUREFLIP_NONE);
|
||||
GetLTFrameSize(&polPt, &polSize, basePt, mSize, frameSize);
|
||||
{
|
||||
TextureFlipInfo& flipInfo = GetTexutreFlipInfo(TEXTUREFLIP_NONE);
|
||||
int iy = flipInfo.idx[FLIPINDEX_Y];
|
||||
int ix = flipInfo.idx[FLIPINDEX_X];
|
||||
const u8 originX = flipInfo.coords[VERTEXCOLOR_LT][ix];
|
||||
const u8 originY = flipInfo.coords[VERTEXCOLOR_LT][iy];
|
||||
SetFrameTexOrigin(*texCds, VERTEXCOLOR_LT, ix, iy, originX, originY);
|
||||
SetFrameTexExtent(*texCds, polSize, texSize, flipInfo, VERTEXCOLOR_LT, ix, iy, originX, originY);
|
||||
}
|
||||
detail::DrawQuad(polPt, polSize, GX_TEXMAP1, texCds, bUseVtxCol ? vtxColors : NULL, alpha);
|
||||
DRAW_QUAD_FOR_FRAME_1(RT, TEXTUREFLIP_H);
|
||||
DRAW_QUAD_FOR_FRAME_1(RB, TEXTUREFLIP_180);
|
||||
DRAW_QUAD_FOR_FRAME_1(LB, TEXTUREFLIP_V);
|
||||
|
||||
@@ -29,13 +29,13 @@ typedef struct PFD_SDDRV_FORMAT_DATA {
|
||||
u32 total_sectors;
|
||||
} PFD_SDDRV_FORMAT_DATA;
|
||||
|
||||
PFD_SDDRV_INFO g_pfd_sddrv_info;
|
||||
PFD_SDDEV_STORAGE g_pfd_sddev;
|
||||
volatile PFD_SDDRV_INFO g_pfd_sddrv_info;
|
||||
PFD_SDDEV_STORAGE g_pfd_sddev ATTRIBUTE_ALIGN(32);
|
||||
u8 g_pfd_sddrv_buf[0x200];
|
||||
|
||||
static FAInsertCallback g_attach_func = 0;
|
||||
static FAEjectCallback g_detach_func = 0;
|
||||
u32 g_event;
|
||||
u32 g_event ATTRIBUTE_ALIGN(32);
|
||||
|
||||
extern u8 pfd_get_media_drv_char(FADisk*, s8*, u32);
|
||||
extern void pdm_disk_notify_media_insert(FADisk*);
|
||||
@@ -243,39 +243,23 @@ static inline void clear_mount_flag(void) {
|
||||
g_pfd_sddrv_info.flags &= ~2;
|
||||
}
|
||||
|
||||
static inline u32 pfd_sddrv_flags(const PFD_SDDRV_INFO* info) {
|
||||
return info->flags;
|
||||
}
|
||||
|
||||
static inline SDDev* pfd_sddrv_device(const PFD_SDDRV_INFO* info) {
|
||||
return info->device;
|
||||
}
|
||||
|
||||
static inline FADisk* pfd_sddrv_disk(const PFD_SDDRV_INFO* info) {
|
||||
return info->disk;
|
||||
}
|
||||
|
||||
static inline s8 pfd_sddrv_drive(const PFD_SDDRV_INFO* info) {
|
||||
return info->drive;
|
||||
}
|
||||
|
||||
s32 pfd_st_inter_callback(s32 status, void* data) {
|
||||
s32 result;
|
||||
|
||||
if ((status & 1) != 1) {
|
||||
return 0;
|
||||
}
|
||||
if (pfd_sddrv_device(&g_pfd_sddrv_info) != 0) {
|
||||
if (g_pfd_sddrv_info.device != 0) {
|
||||
g_event = 2;
|
||||
result = ISD_RegisterDeviceIntrHandler(g_pfd_sddrv_info.device, (SDDevIntrCallback)pfd_st_removal_callback, &g_event);
|
||||
if (result != 0) {
|
||||
OSReport("ERR:Failed to regist intr handler. pfd_st_inter_callback()\n");
|
||||
}
|
||||
}
|
||||
if (pfd_sddrv_disk(&g_pfd_sddrv_info) != 0) {
|
||||
if (g_pfd_sddrv_info.disk != 0) {
|
||||
update_media_drive();
|
||||
pdm_disk_notify_media_insert(g_pfd_sddrv_info.disk);
|
||||
if (pfd_sddrv_drive(&g_pfd_sddrv_info) != 0 && g_attach_func != 0) {
|
||||
if (g_pfd_sddrv_info.drive != 0 && g_attach_func != 0) {
|
||||
g_attach_func(g_pfd_sddrv_info.drive);
|
||||
}
|
||||
}
|
||||
@@ -291,36 +275,39 @@ s32 pfd_st_removal_callback(s32 status, void* data) {
|
||||
return 0;
|
||||
}
|
||||
g_pfd_sddrv_info.media_inserted = 0;
|
||||
if (g_pfd_sddrv_info.media_inserted == 0 && pfd_sddrv_device(&g_pfd_sddrv_info) != 0) {
|
||||
if (g_pfd_sddrv_info.device != 0) {
|
||||
g_event = 1;
|
||||
result = ISD_RegisterDeviceIntrHandler(g_pfd_sddrv_info.device, (SDDevIntrCallback)pfd_st_inter_callback, &g_event);
|
||||
if (result != 0) {
|
||||
OSReport("ERR:Failed to regist intr handler. pfd_st_removal_callback()\n");
|
||||
}
|
||||
}
|
||||
if (pfd_sddrv_disk(&g_pfd_sddrv_info) != 0) {
|
||||
if (g_pfd_sddrv_info.disk != 0) {
|
||||
update_media_drive();
|
||||
pdm_disk_notify_media_eject(g_pfd_sddrv_info.disk);
|
||||
if (pfd_sddrv_drive(&g_pfd_sddrv_info) != 0 && g_detach_func != 0) {
|
||||
if (g_pfd_sddrv_info.drive != 0 && g_detach_func != 0) {
|
||||
g_detach_func(g_pfd_sddrv_info.drive);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma push
|
||||
#pragma ppc_iro_level 0
|
||||
s32 pfd_sddrv_init(FADisk* disk) {
|
||||
s32 sd_result;
|
||||
SDDev* device;
|
||||
u32 status;
|
||||
|
||||
if (disk == 0) {
|
||||
if (disk == NULL) {
|
||||
return -30;
|
||||
}
|
||||
if ((pfd_sddrv_flags(&g_pfd_sddrv_info) & 1) != 0) {
|
||||
if ((g_pfd_sddrv_info.flags & 1) != 0) {
|
||||
OSReport("INFO SD Card driver is already initialize. pfd_sddrv_init()\n");
|
||||
if (disk != g_pfd_sddrv_info.disk) {
|
||||
return -44;
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
if ((g_pfd_sddrv_info.flags & 4) == 0) {
|
||||
g_pfd_sddrv_info.bytes_per_sector = 0x200;
|
||||
@@ -372,6 +359,7 @@ s32 pfd_sddrv_init(FADisk* disk) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
s32 pfd_sddrv_mount(FADisk* disk) {
|
||||
s32 result;
|
||||
@@ -473,7 +461,7 @@ s32 pfd_sddrv_unmount(FADisk* disk) {
|
||||
if (disk == 0) {
|
||||
return -30;
|
||||
}
|
||||
if ((pfd_sddrv_flags(&g_pfd_sddrv_info) & 2) != 0) {
|
||||
if ((g_pfd_sddrv_info.flags & 2) != 0) {
|
||||
clear_mount_flag();
|
||||
}
|
||||
return 0;
|
||||
@@ -485,7 +473,7 @@ s32 pfd_sddrv_finalize(FADisk* disk) {
|
||||
if (disk == 0) {
|
||||
return -30;
|
||||
}
|
||||
if ((pfd_sddrv_flags(&g_pfd_sddrv_info) & 2) != 0) {
|
||||
if ((g_pfd_sddrv_info.flags & 2) != 0) {
|
||||
clear_mount_flag();
|
||||
}
|
||||
if ((g_pfd_sddrv_info.flags & 1) != 0) {
|
||||
@@ -1371,22 +1359,24 @@ s32 pfd_sddrv_store_fat32_bpb_buf(PFD_SDDRV_FORMAT_DATA* format_data, u8* sector
|
||||
|
||||
static s32 pfd_sddrv_store_fat32_reserved_buf(u8* sector_buffer) {
|
||||
PFD_SDDRV_RESERVED_BOOT_SECTOR* reserved_boot_sector;
|
||||
s32 result = -30;
|
||||
|
||||
if (sector_buffer != 0) {
|
||||
pf_memset(sector_buffer, 0, 0x200);
|
||||
reserved_boot_sector = (PFD_SDDRV_RESERVED_BOOT_SECTOR*)sector_buffer;
|
||||
if (((u32)reserved_boot_sector->signature.bytes & 1) != 0) {
|
||||
reserved_boot_sector->signature.bytes[0] = 0x55;
|
||||
reserved_boot_sector->signature.bytes[1] = 0xaa;
|
||||
} else {
|
||||
reserved_boot_sector->signature.value = 0x55aa;
|
||||
}
|
||||
result = 0;
|
||||
pf_memset(sector_buffer, 0, 0x200);
|
||||
reserved_boot_sector = (PFD_SDDRV_RESERVED_BOOT_SECTOR*)sector_buffer;
|
||||
if (((u32)reserved_boot_sector->signature.bytes & 1) != 0) {
|
||||
reserved_boot_sector->signature.bytes[0] = 0x55;
|
||||
reserved_boot_sector->signature.bytes[1] = 0xaa;
|
||||
} else {
|
||||
reserved_boot_sector->signature.value = 0x55aa;
|
||||
}
|
||||
return result;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline s32 pfd_sddrv_write_sector(u32 sector) {
|
||||
return ISD_WriteBlock(g_pfd_sddrv_info.device, sector, g_pfd_sddrv_buf, 1);
|
||||
}
|
||||
|
||||
#pragma push
|
||||
#pragma ppc_iro_level 0
|
||||
s32 pfd_sddrv_build_fat32_mbr_bpb(u32 total_sectors) {
|
||||
PFD_SDDRV_FORMAT_DATA format_data;
|
||||
s32 result;
|
||||
@@ -1408,12 +1398,12 @@ s32 pfd_sddrv_build_fat32_mbr_bpb(u32 total_sectors) {
|
||||
if (g_pfd_sddrv_info.media_ejected != 0) {
|
||||
return -33;
|
||||
}
|
||||
result = ISD_WriteBlock(g_pfd_sddrv_info.device, format_data.partition_start_sector, g_pfd_sddrv_buf, 1);
|
||||
result = pfd_sddrv_write_sector(format_data.partition_start_sector);
|
||||
if (result != 0) {
|
||||
OSReport("ERR Failed to write BPB fields. ISD_WriteBlock()\n");
|
||||
return -36;
|
||||
}
|
||||
result = ISD_WriteBlock(g_pfd_sddrv_info.device, format_data.partition_start_sector + 6, g_pfd_sddrv_buf, 1);
|
||||
result = pfd_sddrv_write_sector(format_data.partition_start_sector + 6);
|
||||
if (result != 0) {
|
||||
OSReport("ERR Failed to write BPB fields. ISD_WriteBlock()\n");
|
||||
return -36;
|
||||
@@ -1429,12 +1419,12 @@ s32 pfd_sddrv_build_fat32_mbr_bpb(u32 total_sectors) {
|
||||
if (g_pfd_sddrv_info.media_ejected != 0) {
|
||||
return -33;
|
||||
}
|
||||
result = ISD_WriteBlock(g_pfd_sddrv_info.device, format_data.partition_start_sector + 1, g_pfd_sddrv_buf, 1);
|
||||
result = pfd_sddrv_write_sector(format_data.partition_start_sector + 1);
|
||||
if (result != 0) {
|
||||
OSReport("ERR Failed to write BPB fields. ISD_WriteBlock()\n");
|
||||
return -36;
|
||||
}
|
||||
result = ISD_WriteBlock(g_pfd_sddrv_info.device, format_data.partition_start_sector + 7, g_pfd_sddrv_buf, 1);
|
||||
result = pfd_sddrv_write_sector(format_data.partition_start_sector + 7);
|
||||
if (result != 0) {
|
||||
OSReport("ERR Failed to write BPB fields. ISD_WriteBlock()\n");
|
||||
return -36;
|
||||
@@ -1451,12 +1441,12 @@ s32 pfd_sddrv_build_fat32_mbr_bpb(u32 total_sectors) {
|
||||
if (g_pfd_sddrv_info.media_ejected != 0) {
|
||||
return -33;
|
||||
}
|
||||
result = ISD_WriteBlock(g_pfd_sddrv_info.device, format_data.partition_start_sector + 2, g_pfd_sddrv_buf, 1);
|
||||
result = pfd_sddrv_write_sector(format_data.partition_start_sector + 2);
|
||||
if (result != 0) {
|
||||
OSReport("ERR Failed to write BPB fields. ISD_WriteBlock()\n");
|
||||
return -36;
|
||||
}
|
||||
result = ISD_WriteBlock(g_pfd_sddrv_info.device, format_data.partition_start_sector + 8, g_pfd_sddrv_buf, 1);
|
||||
result = pfd_sddrv_write_sector(format_data.partition_start_sector + 8);
|
||||
if (result != 0) {
|
||||
OSReport("ERR Failed to write BPB fields. ISD_WriteBlock()\n");
|
||||
return -36;
|
||||
@@ -1472,13 +1462,14 @@ s32 pfd_sddrv_build_fat32_mbr_bpb(u32 total_sectors) {
|
||||
if (g_pfd_sddrv_info.media_ejected != 0) {
|
||||
return -33;
|
||||
}
|
||||
result = ISD_WriteBlock(g_pfd_sddrv_info.device, 0, g_pfd_sddrv_buf, 1);
|
||||
result = pfd_sddrv_write_sector(0);
|
||||
if (result != 0) {
|
||||
OSReport("ERR Failed to write MBR fields. ISD_WriteBlock()\n");
|
||||
return -36;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
s32 pfd_sddrv_full_format(void) {
|
||||
FADiskInfo geometry;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
void* NHTTPi_memcpy(void*, const void*, u32);
|
||||
s32 NHTTPi_SocRecv(void*, NHTTPRequestInfo*, s32, void*, s32, s32);
|
||||
|
||||
#define NHTTPi_TOLOWER(c) ((((c) >= 'A') & ((c) <= 'Z')) ? (c) + ('a' - 'A') : (c))
|
||||
|
||||
static void FindHeaderBlock(const NHTTPResponseInfo* response, s32 position, NHTTPi_HDRBUFLIST** block, s32* offset) {
|
||||
if(position<NHTTP_HDRRECVBUF_INILEN) { *offset=position; *block=NULL; }
|
||||
else {
|
||||
@@ -22,10 +24,6 @@ static int ReadHeaderChar(const NHTTPResponseInfo* response, NHTTPi_HDRBUFLIST**
|
||||
return (*block)->block[(*offset)++];
|
||||
}
|
||||
|
||||
static int LowerCase(int character) {
|
||||
return ((character >= 'A') & (character <= 'Z')) ? character + ('a' - 'A') : character;
|
||||
}
|
||||
|
||||
s32 NHTTPi_findNextLineHdrRecvBuf(const NHTTPResponseInfo* response, s32 position, s32 limit, s32* colon, s32* newlineLength) {
|
||||
NHTTPi_HDRBUFLIST* block;
|
||||
s32 offset;
|
||||
@@ -75,16 +73,48 @@ s32 NHTTPi_skipSpaceHdrRecvBuf(const NHTTPResponseInfo* response, s32 position,
|
||||
s32 NHTTPi_compareTokenN_HdrRecvBuf(const NHTTPResponseInfo* response, s32 position, s32 limit, const char* token, s8 delimiter) {
|
||||
NHTTPi_HDRBUFLIST* block;
|
||||
s32 offset;
|
||||
int character;
|
||||
s32 i;
|
||||
s32 tokenChar;
|
||||
s32 character;
|
||||
|
||||
if (position < limit) {
|
||||
FindHeaderBlock(response, position, &block, &offset);
|
||||
character = ReadHeaderChar(response, &block, &offset);
|
||||
while (LowerCase((s8)character) == LowerCase(*token)) {
|
||||
if (*token == 0 || *token == ' ' || *token == delimiter || position == limit - 1) return 0;
|
||||
character = ReadHeaderChar(response, &block, &offset);
|
||||
++position;
|
||||
++token;
|
||||
|
||||
if (block == NULL) {
|
||||
if (offset < NHTTP_HDRRECVBUF_INILEN) {
|
||||
character = (s8)response->hdrBufFirst[offset++];
|
||||
goto compare_characters;
|
||||
}
|
||||
block = response->hdrBufBlock_p;
|
||||
offset = 0;
|
||||
} else if (offset == NHTTP_HDRRECVBUF_BLOCKLEN) {
|
||||
offset = 0;
|
||||
block = block->next_p;
|
||||
}
|
||||
character = block->block[offset++];
|
||||
|
||||
compare_characters:
|
||||
i = position;
|
||||
while (NHTTPi_TOLOWER((s8)character) == NHTTPi_TOLOWER((s8)*token)) {
|
||||
tokenChar = (s8)*token;
|
||||
if (tokenChar == '\0' || tokenChar == ' ' || tokenChar == delimiter || i == limit - 1) return 0;
|
||||
|
||||
if (block == NULL) {
|
||||
if (offset < NHTTP_HDRRECVBUF_INILEN) {
|
||||
character = (s8)response->hdrBufFirst[offset++];
|
||||
goto advance_token;
|
||||
}
|
||||
block = response->hdrBufBlock_p;
|
||||
offset = 0;
|
||||
} else if (offset == NHTTP_HDRRECVBUF_BLOCKLEN) {
|
||||
offset = 0;
|
||||
block = block->next_p;
|
||||
}
|
||||
character = block->block[offset++];
|
||||
|
||||
advance_token:
|
||||
i++;
|
||||
token++;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <revolution/types.h>
|
||||
#include <string.h>
|
||||
|
||||
#define NHTTPi_TOLOWER(c) ((((c) >= 'A') & ((c) <= 'Z')) ? (c) + ('a' - 'A') : (c))
|
||||
|
||||
void* NHTTPi_memcpy(void* destination, const void* source, u32 size)
|
||||
{
|
||||
return memcpy(destination, source, size);
|
||||
@@ -26,28 +28,33 @@ static int LowerCase(int character)
|
||||
return ((character >= 'A') & (character <= 'Z')) ? character + 32 : character;
|
||||
}
|
||||
|
||||
s32 NHTTPi_strnicmp(const char* left, const char* right, s32 length)
|
||||
s32 NHTTPi_strnicmp(const char* left, const char* right, s32 size)
|
||||
{
|
||||
while (length > 0)
|
||||
char leftChar;
|
||||
char rightChar;
|
||||
|
||||
while (size > 0)
|
||||
{
|
||||
int a = *left++, b = *right++;
|
||||
if (a == 0 || b == 0)
|
||||
leftChar = *left++;
|
||||
rightChar = *right++;
|
||||
|
||||
if (leftChar == '\0' || rightChar == '\0')
|
||||
{
|
||||
if (a == 0 && b == 0)
|
||||
if (leftChar == '\0' && rightChar == '\0')
|
||||
{
|
||||
length = 0;
|
||||
size = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
b = LowerCase(b);
|
||||
a = LowerCase(a);
|
||||
if (a != b)
|
||||
|
||||
if (NHTTPi_TOLOWER(leftChar) != NHTTPi_TOLOWER(rightChar))
|
||||
{
|
||||
break;
|
||||
}
|
||||
--length;
|
||||
size--;
|
||||
}
|
||||
return length;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static BOOL UrlPlain(int character)
|
||||
@@ -237,18 +244,18 @@ s32 NHTTPi_intToStr(char* destination, u32 value)
|
||||
return length + 1;
|
||||
}
|
||||
|
||||
s32 NHTTPi_compareToken(const char* left, const char* right)
|
||||
s32 NHTTPi_compareToken(const char* string, const char* token)
|
||||
{
|
||||
u32 rawLeft;
|
||||
while (LowerCase((s8)(rawLeft = *(const u8*)left)) == LowerCase((s8)*(const u8*)right))
|
||||
while (NHTTPi_TOLOWER(*string) == NHTTPi_TOLOWER(*token))
|
||||
{
|
||||
if ((s8)rawLeft == 0 || (s8)rawLeft == ' ')
|
||||
if (*string == '\0' || *string == ' ')
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
++left;
|
||||
++right;
|
||||
string++;
|
||||
token++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ typedef struct AppLoaderHeader {
|
||||
u8 pad_0x1C[4];
|
||||
} AppLoaderHeader;
|
||||
|
||||
u8 TicketViewsBuf[OSRoundUp32B(sizeof(ESTicketView) * 64)] ALIGN32;
|
||||
static u8 TicketViewsBuf[OSRoundUp32B(sizeof(ESTicketView) * 64)] ALIGN32;
|
||||
ESTicketView *TicketViews = (ESTicketView *)TicketViewsBuf;
|
||||
DVDDiskID UpdateDiskID ALIGN32;
|
||||
OSBootInfo2 bi2 ALIGN32;
|
||||
@@ -39,42 +39,42 @@ AppLoaderHeader AppLoaderHdr ALIGN32;
|
||||
OSBootInfo3 bi3 ALIGN32;
|
||||
u8 GameTOCBuf[OSRoundUp32B(sizeof(DVDGameTOC))] ALIGN32;
|
||||
DVDDriveInfo DriveInfo ALIGN32;
|
||||
DVDDiskID DiskID ALIGN32;
|
||||
DVDPartitionParams PartitionParams ALIGN32;
|
||||
static DVDDiskID DiskID ALIGN32;
|
||||
static DVDPartitionParams PartitionParams ALIGN32;
|
||||
NANDCommandBlock BS2NandBlock;
|
||||
NANDFileInfo BS2CacheFileInfo;
|
||||
DVDCommandBlock CoverBlock;
|
||||
u8 PartitionInfoBuf[OSRoundUp32B(sizeof(DVDPartitionInfo) * 256)] ALIGN32;
|
||||
DVDCommandBlock Block;
|
||||
|
||||
BS2State State = BS2_STT_BEGIN;
|
||||
vu32 DvdReadPending = 0;
|
||||
u32 BannerAllocation = 0;
|
||||
u32 BannerBuffer = 0;
|
||||
u32 BannerAvailable = 0;
|
||||
u32 Allocator = 0;
|
||||
BOOL StartingGame = FALSE;
|
||||
u32 RestartRequested = 0;
|
||||
u32 PartitionOpen = 0;
|
||||
u32 CacheSeekComplete = 0;
|
||||
u32 LoadingTitle = 0;
|
||||
static BS2State State = BS2_STT_BEGIN;
|
||||
static vu32 DvdReadPending = 0;
|
||||
static u32 BannerAllocation = 0;
|
||||
static u32 BannerBuffer = 0;
|
||||
static u32 BannerAvailable = 0;
|
||||
static u32 Allocator = 0;
|
||||
volatile BOOL StartingGame = FALSE;
|
||||
static u32 RestartRequested = 0;
|
||||
static u32 PartitionOpen = 0;
|
||||
static u32 CacheSeekComplete = 0;
|
||||
static u32 LoadingTitle = 0;
|
||||
BOOL FatalErrorFlag = FALSE;
|
||||
BOOL RetryErrorFlag = FALSE;
|
||||
BOOL UpdateErrorFlag = FALSE;
|
||||
BOOL AbortFlag = FALSE;
|
||||
volatile int CacheFailed = 0;
|
||||
volatile int RegionValid = 0;
|
||||
volatile int NandPending = 0;
|
||||
vu32 CancelNand = 0;
|
||||
vu32 LowReadResult = 0;
|
||||
u32 CacheCommandComplete = 0;
|
||||
u32 AudioBufferUnconfigured = 0;
|
||||
u64 ResetTime = 0;
|
||||
u64 SpinupDeadline = 0;
|
||||
static volatile int NandPending = 0;
|
||||
static vu32 CancelNand = 0;
|
||||
static vu32 LowReadResult = 0;
|
||||
static u32 CacheCommandComplete = 0;
|
||||
static u32 AudioBufferUnconfigured = 0;
|
||||
static u64 ResetTime = 0;
|
||||
static u64 SpinupDeadline = 0;
|
||||
u64 CoverPollTime = 0;
|
||||
u32 DriveWasReset = 0;
|
||||
u32 TitleTicketView = 0;
|
||||
u32 CurrentTmd = 0;
|
||||
static u32 TitleTicketView = 0;
|
||||
static u32 CurrentTmd = 0;
|
||||
u32 TitleCode = 0;
|
||||
u32 RequiredIosHigh = 0;
|
||||
u32 RequiredIosLow = 0;
|
||||
@@ -95,13 +95,13 @@ u32 LoaderOffset = 0;
|
||||
vu32 LoaderLength = 0;
|
||||
u32 LoaderAddress = 0;
|
||||
vu32 CacheLength = 0;
|
||||
vu32 BannerLength = 0;
|
||||
vu32 DvdTransferLength = 0;
|
||||
vu32 DvdTransferred = 0;
|
||||
u32 *DvdProgress = 0;
|
||||
u32 LoaderClose = 0;
|
||||
u32 LoaderMain = 0;
|
||||
u32 LoaderInit = 0;
|
||||
static vu32 BannerLength = 0;
|
||||
static vu32 DvdTransferLength = 0;
|
||||
static vu32 DvdTransferred = 0;
|
||||
static u32 *DvdProgress = 0;
|
||||
static u32 LoaderClose = 0;
|
||||
static u32 LoaderMain = 0;
|
||||
static u32 LoaderInit = 0;
|
||||
|
||||
|
||||
void BS2Report(const char *msg, ...) {
|
||||
@@ -243,7 +243,7 @@ BOOL BS2IsDiagDisc() { return (u8)(*(u8 *)OSPhysicalToCached(OS_ADDR_BOOT_INFO)
|
||||
extern vu32 BS2VideoMode;
|
||||
extern vu32 __DVDLayoutFormat;
|
||||
|
||||
asm void Run(u32 entryPoint, void *start, u32 blockCount, u32 argument) {
|
||||
static asm void Run(u32 entryPoint, void *start, u32 blockCount, u32 argument) {
|
||||
// clang-format off
|
||||
#ifdef __MWERKS__
|
||||
nofralloc
|
||||
@@ -491,7 +491,7 @@ BOOL BS2StartLoadingTitle(ESTitleId titleId, ESTicketView *pTicketView) {
|
||||
|
||||
static void callback(u32 result) { LowReadResult = result; }
|
||||
|
||||
ESError BS2ESGetTicketViews(IOSFd *descriptor, ESTitleId titleId, ESTicketView *views, u32 *count) {
|
||||
static ESError BS2ESGetTicketViews(IOSFd *descriptor, ESTitleId titleId, ESTicketView *views, u32 *count) {
|
||||
u8 work[256] ALIGN32;
|
||||
IOSIoVector vectors[4] ALIGN32;
|
||||
ESError result;
|
||||
@@ -529,7 +529,7 @@ ESError BS2ESGetTicketViews(IOSFd *descriptor, ESTitleId titleId, ESTicketView *
|
||||
request[2].length = *count * sizeof(*views);
|
||||
return IOS_Ioctlv(*descriptor, 0x13, 2, 1, request);
|
||||
}
|
||||
void BS2Reboot(void) {
|
||||
static void BS2Reboot(void) {
|
||||
ESTicketView ticket ALIGN32;
|
||||
u8 work[256] ALIGN32;
|
||||
OSStateFlags flags ALIGN32;
|
||||
@@ -834,9 +834,6 @@ void BS2StartGCGame() {
|
||||
static u8 gameCubeLanguages[] = {0, 0, 1, 2, 3, 4, 5};
|
||||
s32 ret;
|
||||
u32 rtc;
|
||||
u32 counterBias;
|
||||
u32 seconds;
|
||||
u32 timerFrequency;
|
||||
u32 soundMode;
|
||||
s8 productVideoMode;
|
||||
u8 progressiveMode;
|
||||
@@ -878,10 +875,7 @@ void BS2StartGCGame() {
|
||||
}
|
||||
|
||||
__OSGetRTC(&rtc);
|
||||
counterBias = SCGetCounterBias();
|
||||
seconds = rtc + counterBias;
|
||||
timerFrequency = OS_BUS_CLOCK >> 2;
|
||||
time = (OSTime)seconds * timerFrequency;
|
||||
time = OS_TIMER_CLOCK * (OSTime)(rtc + SCGetCounterBias());
|
||||
__OSSetTime(time);
|
||||
|
||||
sram = __OSLockSram();
|
||||
@@ -955,7 +949,7 @@ void BS2StartGCGame() {
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CheckDVDCommandStatus(DVDCommandBlock *block) {
|
||||
static BOOL CheckDVDCommandStatus(DVDCommandBlock *block) {
|
||||
if (State == 0x3A) {
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1018,11 +1012,11 @@ BOOL CheckDVDCommandStatus(DVDCommandBlock *block) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void BS2NANDDivideCallback(s32 result, NANDCommandBlock *block);
|
||||
void BS2NANDDivideReadAsync(NANDFileInfo *info, void *buffer, u32 length, NANDCallback callback, NANDCommandBlock *block);
|
||||
void BS2NANDDivideWriteAsync(NANDFileInfo *info, const void *buffer, u32 length, NANDCallback callback, NANDCommandBlock *block);
|
||||
static void BS2NANDDivideCallback(s32 result, NANDCommandBlock *block);
|
||||
static void BS2NANDDivideReadAsync(NANDFileInfo *info, void *buffer, u32 length, NANDCallback callback, NANDCommandBlock *block);
|
||||
static void BS2NANDDivideWriteAsync(NANDFileInfo *info, const void *buffer, u32 length, NANDCallback callback, NANDCommandBlock *block);
|
||||
|
||||
void BS2NANDDivideCallback(s32 result, NANDCommandBlock *block) {
|
||||
static void BS2NANDDivideCallback(s32 result, NANDCommandBlock *block) {
|
||||
s32 ret;
|
||||
|
||||
if (CancelNand != 0) {
|
||||
@@ -1063,7 +1057,7 @@ void BS2NANDDivideCallback(s32 result, NANDCommandBlock *block) {
|
||||
}
|
||||
}
|
||||
|
||||
void BS2NANDDivideReadAsync(NANDFileInfo *info, void *buffer, u32 length, NANDCallback callback, NANDCommandBlock *block) {
|
||||
static void BS2NANDDivideReadAsync(NANDFileInfo *info, void *buffer, u32 length, NANDCallback callback, NANDCommandBlock *block) {
|
||||
NandCompletion = callback;
|
||||
NandOperation = 2;
|
||||
NandLength = length;
|
||||
@@ -1079,7 +1073,7 @@ void BS2NANDDivideReadAsync(NANDFileInfo *info, void *buffer, u32 length, NANDCa
|
||||
}
|
||||
}
|
||||
|
||||
void BS2NANDDivideWriteAsync(NANDFileInfo *info, const void *buffer, u32 length, NANDCallback callback, NANDCommandBlock *block) {
|
||||
static void BS2NANDDivideWriteAsync(NANDFileInfo *info, const void *buffer, u32 length, NANDCallback callback, NANDCommandBlock *block) {
|
||||
NandCompletion = callback;
|
||||
NandOperation = 1;
|
||||
NandLength = length;
|
||||
@@ -1095,7 +1089,7 @@ void BS2NANDDivideWriteAsync(NANDFileInfo *info, const void *buffer, u32 length,
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CheckBS2CommandStatus() {
|
||||
static BOOL CheckBS2CommandStatus() {
|
||||
if (CheckDVDCommandStatus(&Block) == 0) {
|
||||
BS2Report("DVD command is issuing\n");
|
||||
return 0;
|
||||
@@ -1299,7 +1293,7 @@ BOOL CheckBS2CommandStatus() {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void BS2InquiryAsync(void *buffer, s32 length, u32 offset) {
|
||||
static void BS2InquiryAsync(void *buffer, s32 length, u32 offset) {
|
||||
if (BS2BootFromCache) {
|
||||
BS2Report("Unencrypted read from cache.dat\n");
|
||||
NandPending = 1;
|
||||
@@ -1309,7 +1303,7 @@ void BS2InquiryAsync(void *buffer, s32 length, u32 offset) {
|
||||
}
|
||||
}
|
||||
|
||||
void BS2ReadDiskID(void *buffer, s32 length, u32 offset) {
|
||||
static void BS2ReadDiskID(void *buffer, s32 length, u32 offset) {
|
||||
if (BS2BootFromCache) {
|
||||
BS2Report("Read from cache.dat\n");
|
||||
NandPending = 1;
|
||||
|
||||
@@ -62,7 +62,6 @@ namespace textinput {
|
||||
|
||||
struct CandidatePaneData {
|
||||
PaneToAnimation panes[26];
|
||||
char tail[12];
|
||||
};
|
||||
|
||||
extern "C" const CandidatePaneData scCandidatePaneData __attribute__((aligned(8))) = {{
|
||||
@@ -196,22 +195,7 @@ namespace textinput {
|
||||
6,
|
||||
NULL,
|
||||
{&csAninationFile[0], &csAninationFile[8], &csAninationFile[9], &csAninationFile[10], &csAninationFile[11], &csAninationFile[12]}},
|
||||
}, {"P_OffBtn"}};
|
||||
|
||||
extern "C" char scPaneNameTable[132] =
|
||||
"B_OffBtn\0\0\0\0"
|
||||
"P_JPOffBtn\0\0"
|
||||
"P_CNOffBtn\0\0"
|
||||
"P_CNOnBtn\0\0\0"
|
||||
"B_prdc_scrl_Left\0\0\0\0"
|
||||
"P_prdc_scrl_Left\0\0\0\0"
|
||||
"B_prdc_scrl_Rght\0\0\0\0"
|
||||
"P_prdc_scrl_Rght\0\0\0\0"
|
||||
"\0\0\0";
|
||||
extern "C" char scW_predictWindow[16] = "W_predictWindow";
|
||||
extern "C" char scN_predictInput[15] = "N_predictInput";
|
||||
extern "C" char scW_OnOff_Area[13] = "W_OnOff_Area";
|
||||
extern "C" char scN_prdc_Texts[13] = "N_prdc_Texts";
|
||||
}};
|
||||
|
||||
void CandidateBoxCaller::Candidates::addCandidate(const wchar_t* wcString) {
|
||||
wcsncpy(szwcPredicted[mNumCandidate], wcString, ARRAY_LENGTH(szwcPredicted[0]));
|
||||
@@ -383,27 +367,20 @@ namespace textinput {
|
||||
mTextArea.Init();
|
||||
mOnOffButton.Create(this);
|
||||
mOnOffButton.Init();
|
||||
const char* paneNames = scPaneNameTable;
|
||||
const char* leftScrollBoundName = paneNames + 48;
|
||||
const char* leftScrollPaneName = paneNames + 68;
|
||||
mLeftScroll.Create(this, leftScrollPaneName, leftScrollBoundName);
|
||||
const char* rightScrollBoundName = paneNames + 88;
|
||||
const char* rightScrollPaneName = paneNames + 108;
|
||||
mRightScroll.Create(this, rightScrollPaneName, rightScrollBoundName);
|
||||
mLeftScroll.Create(this, "P_prdc_scrl_Left", "B_prdc_scrl_Left");
|
||||
mRightScroll.Create(this, "P_prdc_scrl_Rght", "B_prdc_scrl_Rght");
|
||||
mLeftScroll.Init();
|
||||
mRightScroll.Init();
|
||||
const char* windowName = scW_predictWindow;
|
||||
mTextWindow.Create(this, windowName);
|
||||
mTextWindow.Create(this, "W_predictWindow");
|
||||
init();
|
||||
}
|
||||
|
||||
void LayoutByNW4R::createAnmPane_(MEMAllocator* allocator) {
|
||||
CandidateTextAnmPane* pane;
|
||||
u16 j;
|
||||
const char* forceAddName;
|
||||
u16 i;
|
||||
for (i = 0; i < ARRAY_LENGTH(scCandidatePaneData.panes); i++) {
|
||||
pane = NULL;
|
||||
const PaneToAnimation& p = scCandidatePaneData.panes[i];
|
||||
CandidateTextAnmPane* pane = NULL;
|
||||
switch (p.type) {
|
||||
case KT_ScrollButton: {
|
||||
void* pBtnBuf = MEMAllocFromAllocator(allocator, sizeof(CandidateScrollAnmPane));
|
||||
@@ -430,9 +407,8 @@ namespace textinput {
|
||||
|
||||
nw4r::ut::List_Append(&mAnmPanes, pane);
|
||||
|
||||
const char* forceAddName = p.forceAddName;
|
||||
u32 animationCount = p.count;
|
||||
for (j = 0; j < animationCount; j++) {
|
||||
forceAddName = p.forceAddName;
|
||||
for (u16 j = 0; j < p.count; j++) {
|
||||
const AnimationFile* const& animation = p.pAnims[j];
|
||||
void* pResource = mpMultiArcResourceAccessor->GetResource(0, animation->fileName);
|
||||
AnimTransformPane* transform =
|
||||
@@ -448,7 +424,7 @@ namespace textinput {
|
||||
}
|
||||
|
||||
void LayoutByNW4R::init() {
|
||||
searchAnmPane(scN_predictInput)->changeAnimation(ANM_Normal);
|
||||
searchAnmPane("N_predictInput")->changeAnimation(ANM_Normal);
|
||||
Base::setInvalid(false);
|
||||
setActive(true);
|
||||
setOnOff(false);
|
||||
@@ -461,7 +437,7 @@ namespace textinput {
|
||||
mpLayout->CalculateMtx(mDrawInfo);
|
||||
if (meLanguage == KR) {
|
||||
mTextWindow.SetVisible(false);
|
||||
getPane(scW_OnOff_Area)->SetVisible(false);
|
||||
getPane("W_OnOff_Area")->SetVisible(false);
|
||||
} else if (meLanguage == CN) {
|
||||
setOnOff(true);
|
||||
mTextWindow.SetVisible(true);
|
||||
@@ -471,16 +447,16 @@ namespace textinput {
|
||||
} else {
|
||||
mTextWindow.ChangeAnimation(ANM_Normal);
|
||||
}
|
||||
getPane(scW_OnOff_Area)->SetVisible(false);
|
||||
getPane("W_OnOff_Area")->SetVisible(false);
|
||||
} else {
|
||||
getPane(scW_OnOff_Area)->SetVisible(true);
|
||||
getPane("W_OnOff_Area")->SetVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutByNW4R::draw() {
|
||||
getPane(scN_prdc_Texts)->SetVisible(false);
|
||||
getPane("N_prdc_Texts")->SetVisible(false);
|
||||
nw4rmanager::Layout::draw();
|
||||
getPane(scN_prdc_Texts)->SetVisible(true);
|
||||
getPane("N_prdc_Texts")->SetVisible(true);
|
||||
if (!isInvalid()) {
|
||||
mTextArea.Draw(mDrawInfo);
|
||||
}
|
||||
@@ -490,8 +466,8 @@ namespace textinput {
|
||||
nw4rmanager::Layout::calc();
|
||||
mTextArea.Calc();
|
||||
if (mbAnimOn) {
|
||||
getPane(scN_prdc_Texts)->Animate(0);
|
||||
getPane(scN_prdc_Texts)->CalculateMtx(mDrawInfo);
|
||||
getPane("N_prdc_Texts")->Animate(0);
|
||||
getPane("N_prdc_Texts")->CalculateMtx(mDrawInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,7 +475,7 @@ namespace textinput {
|
||||
Base::setLanguage(language);
|
||||
init();
|
||||
// Maybe inlines, maybe not
|
||||
nw4r::math::VEC3 pos = searchAnmPane(scW_predictWindow)->getPane()->GetTranslate();
|
||||
nw4r::math::VEC3 pos = searchAnmPane("W_predictWindow")->getPane()->GetTranslate();
|
||||
if (meLanguage == CN || meLanguage == KR) {
|
||||
Base::checkValidation();
|
||||
// Potentially an inline
|
||||
@@ -514,7 +490,7 @@ namespace textinput {
|
||||
pos.x = 202.0f;
|
||||
}
|
||||
|
||||
searchAnmPane(scW_predictWindow)->getPane()->SetTranslate(pos);
|
||||
searchAnmPane("W_predictWindow")->getPane()->SetTranslate(pos);
|
||||
if (meLanguage == CN) {
|
||||
mTextArea.ApplyFontScale(1.2f);
|
||||
} else if (meLanguage == KR) {
|
||||
@@ -631,7 +607,7 @@ namespace textinput {
|
||||
current = reinterpret_cast<CandidateBoxCaller::Candidates*>(reinterpret_cast<u8*>(current) + sizeof(current->szwcPredicted[0]));
|
||||
}
|
||||
}
|
||||
gui::PaneComponent* p = mpPaneManager->searchPaneComponent(isOn() ? scB_OnBtn : scPaneNameTable);
|
||||
gui::PaneComponent* p = mpPaneManager->searchPaneComponent(isOn() ? scB_OnBtn : "B_OffBtn");
|
||||
if (p != NULL) {
|
||||
p->lockInitialize(true);
|
||||
}
|
||||
@@ -1009,7 +985,7 @@ namespace textinput {
|
||||
mpBoundingPane[i]->setListener(this);
|
||||
}
|
||||
mpTextAreaPane = mgr->searchPaneComponent("N_prdcTextArea");
|
||||
mpTextsPane = mgr->searchPaneComponent(scN_prdc_Texts);
|
||||
mpTextsPane = mgr->searchPaneComponent("N_prdc_Texts");
|
||||
mSize = mpTextBoxPane[0]->getTextPane()->GetFontSize();
|
||||
mpTextAreaPane->setListener(this);
|
||||
}
|
||||
@@ -1494,7 +1470,7 @@ namespace textinput {
|
||||
if (mgr()->isInScroll() && event != gui::EventHandler::ON_LEFT && event != gui::EventHandler::ON_POINT) {
|
||||
return;
|
||||
}
|
||||
if (!mgr()->searchAnmPane(scW_predictWindow)->isInAnimation() || event == gui::EventHandler::ON_LEFT) {
|
||||
if (!mgr()->searchAnmPane("W_predictWindow")->isInAnimation() || event == gui::EventHandler::ON_LEFT) {
|
||||
if (!mgr()->isInvalid()) {
|
||||
switch (event) {
|
||||
case gui::EventHandler::ON_TRIG:
|
||||
@@ -1645,7 +1621,7 @@ namespace textinput {
|
||||
if (mgr()->isInScroll() && event != gui::EventHandler::ON_LEFT && event != gui::EventHandler::ON_POINT) {
|
||||
return;
|
||||
}
|
||||
if (!mgr()->searchAnmPane(scW_predictWindow)->isInAnimation() || event == gui::EventHandler::ON_LEFT) {
|
||||
if (!mgr()->searchAnmPane("W_predictWindow")->isInAnimation() || event == gui::EventHandler::ON_LEFT) {
|
||||
if (!mgr()->isInvalid()) {
|
||||
switch (event) {
|
||||
case gui::EventHandler::ON_TRIG:
|
||||
@@ -1691,15 +1667,15 @@ namespace textinput {
|
||||
mpOnPictPane = mgr->searchPaneComponent(scP_OnBtn);
|
||||
mpOnBoundPane = mgr->searchPaneComponent(scB_OnBtn);
|
||||
mpOnAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane(scP_OnBtn));
|
||||
mpOffPictPane = mgr->searchPaneComponent(scCandidatePaneData.tail);
|
||||
mpOffBoundPane = mgr->searchPaneComponent(scPaneNameTable);
|
||||
mpOffAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane(scCandidatePaneData.tail));
|
||||
mpOffPictPane = mgr->searchPaneComponent("P_OffBtn");
|
||||
mpOffBoundPane = mgr->searchPaneComponent("B_OffBtn");
|
||||
mpOffAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane("P_OffBtn"));
|
||||
|
||||
layout->getLayout()->GetRootPane()->FindPaneByName(scCandidatePaneData.tail)->GetMaterial()->GetTexture(&mOffTexDefault, 0);
|
||||
layout->getLayout()->GetRootPane()->FindPaneByName(scPaneNameTable + 12)->GetMaterial()->GetTexture(&mOffTexJP, 0);
|
||||
layout->getLayout()->GetRootPane()->FindPaneByName(scPaneNameTable + 24)->GetMaterial()->GetTexture(&mOffTexCN, 0);
|
||||
layout->getLayout()->GetRootPane()->FindPaneByName("P_OffBtn")->GetMaterial()->GetTexture(&mOffTexDefault, 0);
|
||||
layout->getLayout()->GetRootPane()->FindPaneByName("P_JPOffBtn")->GetMaterial()->GetTexture(&mOffTexJP, 0);
|
||||
layout->getLayout()->GetRootPane()->FindPaneByName("P_CNOffBtn")->GetMaterial()->GetTexture(&mOffTexCN, 0);
|
||||
layout->getLayout()->GetRootPane()->FindPaneByName(scP_OnBtn)->GetMaterial()->GetTexture(&mOnTexDefault, 0);
|
||||
layout->getLayout()->GetRootPane()->FindPaneByName(scPaneNameTable + 36)->GetMaterial()->GetTexture(&mOnTexCN, 0);
|
||||
layout->getLayout()->GetRootPane()->FindPaneByName("P_CNOnBtn")->GetMaterial()->GetTexture(&mOnTexCN, 0);
|
||||
|
||||
mpOffBoundPane->setListener(this);
|
||||
mpOnBoundPane->setListener(this);
|
||||
@@ -1755,7 +1731,7 @@ namespace textinput {
|
||||
if (mgr()->isInScroll() && event != gui::EventHandler::ON_LEFT && event != gui::EventHandler::ON_POINT) {
|
||||
return;
|
||||
}
|
||||
if (!mgr()->searchAnmPane(scW_predictWindow)->isInAnimation() || event == gui::EventHandler::ON_LEFT) {
|
||||
if (!mgr()->searchAnmPane("W_predictWindow")->isInAnimation() || event == gui::EventHandler::ON_LEFT) {
|
||||
OnOffAnmPane* p;
|
||||
if (&component == mpOnBoundPane) {
|
||||
p = mpOnAnmPane;
|
||||
|
||||
@@ -295,13 +295,40 @@ confirmLetters:
|
||||
update();
|
||||
}
|
||||
|
||||
static inline void CopyWordSuffix(u16* word, u32 length) {
|
||||
u32 wordLength;
|
||||
u32 copied;
|
||||
wordLength = wcslen((wchar_t*)word) & 0xff;
|
||||
for (copied = 0; copied < length; ++copied) {
|
||||
word[copied] = word[(wordLength - length) + copied];
|
||||
}
|
||||
word[copied] = 0;
|
||||
}
|
||||
|
||||
void WithZi::update() {
|
||||
u16* koreanOutput;
|
||||
u16* keyOutput;
|
||||
wchar_t* candidateOutput;
|
||||
u16* destination;
|
||||
u32 copyLength;
|
||||
u16 keyCharacter;
|
||||
u16* wordOutput;
|
||||
u16* letter;
|
||||
u32 count;
|
||||
s32 elementCount;
|
||||
u16* source;
|
||||
s32 keyIndex;
|
||||
s32 position;
|
||||
s32 candidateLength;
|
||||
u16 character;
|
||||
s32 index;
|
||||
|
||||
if (mbDictionaryOpen == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
mSelectedCandidate = 0;
|
||||
s32 elementCount = static_cast<u16>(setElementBuffer());
|
||||
elementCount = static_cast<u16>(setElementBuffer());
|
||||
mSearch.language = getPredictLanguage();
|
||||
mSearch.subLanguage = 7;
|
||||
mSearch.getMode = 0;
|
||||
@@ -339,24 +366,23 @@ void WithZi::update() {
|
||||
CandidatedWord[0] = L'>';
|
||||
CandidatedWord[1] = 0;
|
||||
mCandidateCount = 1;
|
||||
u16* output = CandidatedWord + 0x40;
|
||||
for (s32 keyIndex = 1; keyIndex < 16; ++keyIndex) {
|
||||
u16 candidate = static_cast<keyboard::cellphonetype::PaneNameToCharCode*>(mpHoldingKey)->wc[keyIndex - 1];
|
||||
if (candidate != 0) {
|
||||
output[0] = candidate;
|
||||
output[1] = 0;
|
||||
keyOutput = CandidatedWord;
|
||||
for (keyIndex = 1; keyIndex < 16; ++keyIndex) {
|
||||
keyCharacter = static_cast<keyboard::cellphonetype::PaneNameToCharCode*>(mpHoldingKey)->wc[keyIndex - 1];
|
||||
if (keyCharacter != 0) {
|
||||
keyOutput[keyIndex * 0x40] = keyCharacter;
|
||||
keyOutput[keyIndex * 0x40 + 1] = 0;
|
||||
++mCandidateCount;
|
||||
}
|
||||
output += 0x40;
|
||||
}
|
||||
EZTXGetCandidates(&mSearch, mpDictionaryWork);
|
||||
}
|
||||
else {
|
||||
memcpy(PredictionBuffer, CandidatesBuffer, 0x200);
|
||||
ChangeDictionaryLanguage(getPredictLanguage());
|
||||
u32 count = EZTXGetCandidates(&mSearch, mpDictionaryWork) & 0xff;
|
||||
count = EZTXGetCandidates(&mSearch, mpDictionaryWork) & 0xff;
|
||||
if (getPredictLanguage() == ZI8_LANG_ZH && count == 0x61) {
|
||||
wchar_t* candidateOutput = reinterpret_cast<wchar_t*>(PredictionBuffer);
|
||||
candidateOutput = reinterpret_cast<wchar_t*>(PredictionBuffer);
|
||||
mSearch.firstCandidate = 0x61;
|
||||
mSearch.candidates = candidateOutput + 0xC2;
|
||||
mSearch.maxCandidates = 199;
|
||||
@@ -369,13 +395,8 @@ void WithZi::update() {
|
||||
}
|
||||
if (getPredictLanguage() == ZI8_LANG_ZH && mbContextChanged != 0 &&
|
||||
(mbContextChanged = 0, mSearch.count == 0)) {
|
||||
u32 length = mCurrentWordLength;
|
||||
u32 wordLength = wcslen((wchar_t*)LatestWord) & 0xff;
|
||||
u32 copied;
|
||||
for (copied = 0; copied < length; ++copied) {
|
||||
LatestWord[copied] = LatestWord[(wordLength - length) + copied];
|
||||
}
|
||||
LatestWord[copied] = 0;
|
||||
copyLength = mCurrentWordLength;
|
||||
CopyWordSuffix(LatestWord, copyLength);
|
||||
mSearch.wordCharCount = wcslen((wchar_t*)LatestWord);
|
||||
count = EZTXGetCandidates(&mSearch, mpDictionaryWork) & 0xff;
|
||||
}
|
||||
@@ -392,28 +413,25 @@ void WithZi::update() {
|
||||
memset(CandidatedWord, 0, 0x1400);
|
||||
mCandidateCount = 0;
|
||||
if (elementCount != 0 || mSearch.wordCharCount != 0) {
|
||||
u16* source = reinterpret_cast<u16*>(mSearch.candidates);
|
||||
u16* destination = CandidatedWord;
|
||||
for (s32 index = 0; index < static_cast<s32>(count); index++) {
|
||||
source = reinterpret_cast<u16*>(mSearch.candidates);
|
||||
destination = CandidatedWord;
|
||||
for (index = 0; index < static_cast<s32>(count); index++) {
|
||||
if (getPredictLanguage() == ZI8_LANG_ZH) {
|
||||
u16* output;
|
||||
s32 length;
|
||||
length = 0;
|
||||
output = destination;
|
||||
candidateLength = 0;
|
||||
wordOutput = destination;
|
||||
for (; *source != L' ' && *source != 0; source++) {
|
||||
*output++ = *source;
|
||||
++length;
|
||||
*wordOutput++ = *source;
|
||||
++candidateLength;
|
||||
}
|
||||
++source;
|
||||
destination[length] = 0;
|
||||
destination[candidateLength] = 0;
|
||||
} else if (mPredictLanguage == PL_11) {
|
||||
*destination = *source++;
|
||||
destination[1] = 0;
|
||||
} else if (getPredictLanguage() == ZI8_LANG_KO) {
|
||||
u16* output = destination;
|
||||
u16 character;
|
||||
koreanOutput = destination;
|
||||
while ((character = *source) >= 0x100) {
|
||||
*output++ = character;
|
||||
*koreanOutput++ = character;
|
||||
++source;
|
||||
}
|
||||
} else if (EZTXCopy(reinterpret_cast<wchar_t*>(destination), &mSearch, index & 0xff, mpDictionaryWork) == 0) {
|
||||
@@ -421,20 +439,18 @@ void WithZi::update() {
|
||||
}
|
||||
++mCandidateCount;
|
||||
{
|
||||
u16* candidate;
|
||||
s32 position;
|
||||
position = 0;
|
||||
for (candidate = destination; *candidate != 0; ++candidate, ++position) {
|
||||
for (letter = destination; *letter != 0; ++letter, ++position) {
|
||||
switch (mLetterMode) {
|
||||
case LM_1:
|
||||
*candidate = util::toWLower(*candidate);
|
||||
*letter = util::toWLower(*letter);
|
||||
break;
|
||||
case LM_2:
|
||||
*candidate = util::toWUpper(*candidate);
|
||||
*letter = util::toWUpper(*letter);
|
||||
break;
|
||||
case LM_0:
|
||||
if (position == 0) *candidate = util::toWUpper(*candidate);
|
||||
else *candidate = util::toWLower(*candidate);
|
||||
if (position == 0) *letter = util::toWUpper(*letter);
|
||||
else *letter = util::toWLower(*letter);
|
||||
break;
|
||||
case LM_3:
|
||||
break;
|
||||
|
||||
@@ -1325,7 +1325,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
bool SDChannelSelect::collectTitlesByUsage(
|
||||
const s32* firstUsage, const s32* secondUsage, ESTitleId* titleIds,
|
||||
s32* firstUsage, s32* secondUsage, ESTitleId* titleIds,
|
||||
char* titleNames, u32* titleCount) {
|
||||
s32 bytes;
|
||||
s32 blocks;
|
||||
@@ -1360,7 +1360,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
bool SDChannelSelect::collectTitlesFromNandUsage(
|
||||
const s32* firstUsage, const s32* secondUsage,
|
||||
s32* firstUsage, s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames, u32* titleCount) {
|
||||
s32 bytes;
|
||||
s32 blocks;
|
||||
@@ -1399,7 +1399,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
bool SDChannelSelect::collectTitlesByChannelOrder(
|
||||
const s32* firstUsage, const s32* secondUsage, ESTitleId* titleIds,
|
||||
s32* firstUsage, s32* secondUsage, ESTitleId* titleIds,
|
||||
char* titleNames, u32* titleCount) {
|
||||
static const int channelOrder[MAX_CHANNEL_INDEX] = {
|
||||
11, 7, 3, 10, 6, 2, 9, 5, 1, 8, 4, 0,
|
||||
@@ -1409,17 +1409,10 @@ namespace ipl {
|
||||
getCurrentTitleUsage(&bytes, &blocks);
|
||||
*titleCount = 0;
|
||||
|
||||
ESTitleId titleId;
|
||||
for (int page = MAX_CHANNEL_PAGE - 1; page >= 0; --page) {
|
||||
for (int order = 0; order < MAX_CHANNEL_INDEX; ++order) {
|
||||
int channelIndex = channelOrder[order];
|
||||
const channel::SEntry& channelInfo =
|
||||
System::getChannelManager()->mChannels[page][channelIndex];
|
||||
if (channelInfo.loadedBnr) {
|
||||
titleId = ES_TITLE_ID(channelInfo.info.titleType, channelInfo.info.titleCode);
|
||||
} else {
|
||||
titleId = 0;
|
||||
}
|
||||
ESTitleId titleId =
|
||||
System::getChannelManager()->getEntryTitleID(page, channelOrder[order]);
|
||||
if (titleId == 0 || titleId == 0x48415A41) {
|
||||
continue;
|
||||
}
|
||||
@@ -1451,7 +1444,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
bool SDChannelSelect::collectTitlesBySpecialChannels(
|
||||
const s32* firstUsage, const s32* secondUsage, ESTitleId* titleIds,
|
||||
s32* firstUsage, s32* secondUsage, ESTitleId* titleIds,
|
||||
char* titleNames, u32* titleCount) {
|
||||
s32 bytes;
|
||||
s32 blocks;
|
||||
@@ -1581,7 +1574,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
bool SDChannelSelect::collectTitlesForMode(
|
||||
const s32* requiredBytes, const s32* requiredBlocks,
|
||||
s32* requiredBytes, s32* requiredBlocks,
|
||||
ESTitleId* titleIds, char* titleNames, u32* titleCount, int searchMode) {
|
||||
switch (searchMode) {
|
||||
case 0:
|
||||
@@ -1908,7 +1901,7 @@ namespace ipl {
|
||||
pageText->SetString(pageNumber, 0);
|
||||
nw4r::lyt::Pane* clockPane = mpLayout->FindPaneByName(mscClockPaneNames[page]);
|
||||
nw4r::math::MTX34 paneMatrix = clockPane->GetGlobalMtx();
|
||||
nw4r::math::VEC3 position(0.0f, 0.0f, 0.0f);
|
||||
math::VEC3 position(0.0f, 0.0f, 0.0f);
|
||||
PSMTXMultVec(paneMatrix, position, position);
|
||||
mpDialogLayout->GetRootPane()->SetTranslate(position);
|
||||
mpDialogLayout->calcMtx();
|
||||
@@ -2705,8 +2698,8 @@ namespace ipl {
|
||||
return mpLayout->FindPaneByName(mscChannelPaneNames[2][index]);
|
||||
}
|
||||
|
||||
math::VEC3 SDChannelSelect::getChannelPanePosition(SDChannelSelect* scene, int index) {
|
||||
math::VEC3 position(0.0f, 0.0f, 0.0f);
|
||||
nw4r::math::VEC3 SDChannelSelect::getChannelPanePosition(SDChannelSelect* scene, int index) {
|
||||
nw4r::math::VEC3 position(0.0f, 0.0f, 0.0f);
|
||||
MTXMultVec(scene->getCenterChannelPane(index)->GetGlobalMtx(), position, position);
|
||||
return position;
|
||||
}
|
||||
|
||||
@@ -167,11 +167,6 @@ typedef struct AOSSKeySchedule {
|
||||
u32 length;
|
||||
} AOSSKeySchedule;
|
||||
|
||||
typedef struct AOSSKeyMaterial {
|
||||
u8 nonce[2];
|
||||
u8 address[8];
|
||||
} AOSSKeyMaterial;
|
||||
|
||||
typedef struct AOSSReceiveBuffer {
|
||||
s32 socket;
|
||||
u32 length;
|
||||
@@ -261,11 +256,6 @@ typedef struct AOSSConfigData {
|
||||
static AOSSRuntimeState s_runtime;
|
||||
static AOSSConfigData s_configData;
|
||||
static u8 s_networkBuffer[0x280];
|
||||
static struct {
|
||||
AOSSKeyMaterial key;
|
||||
u8 payload[0x5e];
|
||||
} s_packetState;
|
||||
static u32 s_crcTable[0x100];
|
||||
|
||||
static s32 s_socket = -1;
|
||||
static char s_manufacturer[] = "MELCO";
|
||||
@@ -2324,16 +2314,16 @@ int AOSSSendDiscoveryRequest(void* packet, AOSSRequestRecords* request, int sock
|
||||
}
|
||||
|
||||
int AOSSSendHelloRequest(void* packet, void* request, int socket) {
|
||||
AOSSHelloPacket* response = (AOSSHelloPacket*)s_responseBuffer;
|
||||
AOSSHelloPayload* payload;
|
||||
AOSSRequestRecords* requestRecords = (AOSSRequestRecords*)request;
|
||||
struct {
|
||||
AOSSSocketAddress destination;
|
||||
AOSSHelloRecord hello;
|
||||
u8 accessPointName[8];
|
||||
AOSSKeySchedule schedule;
|
||||
} construction;
|
||||
u32 checksum;
|
||||
AOSSRequestRecords* requestRecords = (AOSSRequestRecords*)request;
|
||||
u8 accessPointName[8];
|
||||
AOSSHelloRecord hello;
|
||||
AOSSSocketAddress destination;
|
||||
AOSSKeySchedule schedule;
|
||||
int sequence;
|
||||
u32 crc;
|
||||
AOSSHelloPacket* response = (AOSSHelloPacket*)s_responseBuffer;
|
||||
u16 nonce;
|
||||
u32 stateLength;
|
||||
u32 index;
|
||||
@@ -2341,72 +2331,68 @@ int AOSSSendHelloRequest(void* packet, void* request, int socket) {
|
||||
u32 firstByte;
|
||||
u32 secondIndex;
|
||||
u8* state;
|
||||
u32 i;
|
||||
const u8* input;
|
||||
u8 value;
|
||||
u8 swap;
|
||||
s16 responseLength;
|
||||
s16 sendLength;
|
||||
int sequence;
|
||||
int encryptionResult;
|
||||
|
||||
checksum = 0;
|
||||
sequence = 0;
|
||||
memset(&construction.hello, 0, sizeof(construction.hello));
|
||||
memset(&hello, 0, sizeof(hello));
|
||||
memset(response, 0, 0x5dc);
|
||||
payload = &response->payload;
|
||||
construction.hello.data.fields.type = 2;
|
||||
construction.hello.data.fields.reserved01 = 0;
|
||||
construction.hello.data.fields.length = SOHtoNs(4);
|
||||
construction.hello.data.fields.supportedModes = s_runtime.flags;
|
||||
construction.hello.data.fields.supportedModes = SOHtoNl(construction.hello.data.fields.supportedModes);
|
||||
hello.data.fields.type = 2;
|
||||
hello.data.fields.reserved01 = 0;
|
||||
hello.data.fields.length = SOHtoNs(4);
|
||||
hello.data.fields.supportedModes = s_runtime.flags;
|
||||
hello.data.fields.supportedModes = SOHtoNl(hello.data.fields.supportedModes);
|
||||
responseLength = 8;
|
||||
|
||||
if ((s32)s_connectionState == 1) {
|
||||
const u32* crcTable;
|
||||
sequence = 1;
|
||||
checksum = 0xffffffff;
|
||||
crc = 0xffffffff;
|
||||
AOSSInitCrc32Table(0, s_crcTable);
|
||||
crcTable = s_crcTable;
|
||||
{
|
||||
u32 part;
|
||||
for (part = 0; part < 4; part++) {
|
||||
for (index = 0; index < 2; index++) {
|
||||
checksum = (checksum >> 8) ^ crcTable[(checksum ^ construction.hello.data.bytes[part * 2 + index]) & 0xff];
|
||||
}
|
||||
}
|
||||
index = 0;
|
||||
while (index < 8) {
|
||||
crc = (crc >> 8) ^ s_crcTable[(crc ^ hello.data.bytes[index++]) & 0xff];
|
||||
}
|
||||
checksum = (checksum ^ 0xffffffff) & 0xff;
|
||||
checksum = (crc ^ 0xffffffff) & 0xff;
|
||||
|
||||
construction.schedule.bytes = (u8*)AOSSi_Alloc(8);
|
||||
if (construction.schedule.bytes != 0) {
|
||||
schedule.bytes = (u8*)AOSSi_Alloc(8);
|
||||
if (schedule.bytes != 0) {
|
||||
nonce = (u16)rand();
|
||||
memcpy(&payload->encrypted.key.nonce, &nonce, 2);
|
||||
memcpy(s_packetState.key.nonce, payload->encrypted.key.nonceBytes, 2);
|
||||
memcpy(s_packetState.key.address, s_accessPointName, 8);
|
||||
AOSSInitKeySchedule(&construction.schedule, (const u8*)&s_packetState.key, sizeof(s_packetState.key), 8);
|
||||
for (index = 0; index < 8; index++) {
|
||||
state = construction.schedule.bytes;
|
||||
firstIndex = (construction.schedule.i + 1) % construction.schedule.length & 0xff;
|
||||
AOSSInitKeySchedule(&schedule, (const u8*)&s_packetState.key, sizeof(s_packetState.key), 8);
|
||||
input = hello.data.bytes;
|
||||
for (i = 0; i < 8; i++) {
|
||||
state = schedule.bytes;
|
||||
firstIndex = (schedule.i + 1) % schedule.length & 0xff;
|
||||
firstByte = state[firstIndex];
|
||||
secondIndex = (firstByte + construction.schedule.j) % construction.schedule.length & 0xff;
|
||||
secondIndex = (firstByte + schedule.j) % schedule.length & 0xff;
|
||||
swap = state[secondIndex];
|
||||
stateLength = firstByte + swap;
|
||||
construction.schedule.i = firstIndex;
|
||||
construction.schedule.j = secondIndex;
|
||||
schedule.i = firstIndex;
|
||||
schedule.j = secondIndex;
|
||||
state[secondIndex] = (u8)firstByte;
|
||||
state[firstIndex] = swap;
|
||||
value = state[stateLength % construction.schedule.length] ^ construction.hello.data.bytes[index];
|
||||
payload->bytes[index + 4] = value;
|
||||
value = state[stateLength % schedule.length];
|
||||
payload->bytes[i + 4] = value ^ *input++;
|
||||
}
|
||||
AOSSi_Free(construction.schedule.bytes);
|
||||
AOSSi_Free(schedule.bytes);
|
||||
}
|
||||
payload->encrypted.length = SOHtoNs(8);
|
||||
responseLength = 0x0c;
|
||||
} else {
|
||||
memcpy(payload->bytes, &construction.hello, 8);
|
||||
memcpy(payload->bytes, &hello, 8);
|
||||
}
|
||||
|
||||
memcpy(construction.accessPointName, &requestRecords->records[1], 8);
|
||||
encryptionResult = AOSSXorBufferWithKey(construction.accessPointName, 8, s_manufacturer, 6);
|
||||
memcpy(accessPointName, &requestRecords->records[1], 8);
|
||||
encryptionResult = AOSSXorBufferWithKey(accessPointName, 8, s_manufacturer, 6);
|
||||
if (encryptionResult != 0) {
|
||||
s_errorCode = 2;
|
||||
return -1;
|
||||
@@ -2421,17 +2407,17 @@ int AOSSSendHelloRequest(void* packet, void* request, int socket) {
|
||||
response->header.finalSequence = SOHtoNs(sequence);
|
||||
response->header.reserved = checksum;
|
||||
response->header.messageType = 0x11;
|
||||
memcpy(response->header.messageIdentity, construction.accessPointName, 8);
|
||||
memcpy(response->header.messageIdentity, accessPointName, 8);
|
||||
sendLength = (s16)(responseLength + 0x18);
|
||||
memset(&construction.destination, 0, sizeof(construction.destination));
|
||||
construction.destination.family = 2;
|
||||
construction.destination.port = SOHtoNs(0x5790);
|
||||
construction.destination.address = SOHtoNl(s_runtime.ipAddress);
|
||||
memset(&destination, 0, sizeof(destination));
|
||||
destination.family = 2;
|
||||
destination.port = SOHtoNs(0x5790);
|
||||
destination.address = SOHtoNl(s_runtime.ipAddress);
|
||||
if ((s8)s_runtime.active == 0) {
|
||||
construction.destination.address = 0xffffffff;
|
||||
destination.address = 0xffffffff;
|
||||
}
|
||||
construction.destination.length = 8;
|
||||
SOSendTo(socket, response, sendLength, 0, &construction.destination);
|
||||
destination.length = 8;
|
||||
SOSendTo(socket, response, sendLength, 0, &destination);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
4
src/scene/setting/AOSSData.c
Normal file
4
src/scene/setting/AOSSData.c
Normal file
@@ -0,0 +1,4 @@
|
||||
#include "scene/setting/AOSS.h"
|
||||
|
||||
u32 s_crcTable[0x100];
|
||||
AOSSPacketState s_packetState;
|
||||
@@ -16,11 +16,6 @@
|
||||
#include <cstring>
|
||||
#include <cwchar>
|
||||
|
||||
extern "C" void _savegpr_27();
|
||||
extern "C" void _restgpr_27();
|
||||
extern "C" void getLanguage__Q23ipl6SystemFv();
|
||||
extern "C" void getRegion__Q23ipl6SystemFv();
|
||||
|
||||
namespace ipl {
|
||||
namespace channel {
|
||||
u32 Manager::mNumFinished;
|
||||
@@ -469,85 +464,34 @@ namespace ipl {
|
||||
System::getSaveData()->setChanInfo(page1, index1, blankInfo);
|
||||
}
|
||||
|
||||
extern "C" asm void getTitleName__Q33ipl7channel7ManagerCFiii() {
|
||||
nofralloc
|
||||
stwu r1, -0x20(r1)
|
||||
mflr r0
|
||||
stw r0, 0x24(r1)
|
||||
addi r11, r1, 0x20
|
||||
bl _savegpr_27
|
||||
mulli r28, r4, 0x540
|
||||
mr r27, r3
|
||||
mulli r29, r5, 0x70
|
||||
add r0, r3, r28
|
||||
add r31, r0, r29
|
||||
lbz r0, 0x24(r31)
|
||||
cmpwi r0, 0
|
||||
bne getTitleName_L1
|
||||
li r3, 0
|
||||
b getTitleName_L8
|
||||
getTitleName_L1:
|
||||
mulli r30, r6, 0x2a
|
||||
bl getLanguage__Q23ipl6SystemFv
|
||||
mulli r0, r3, 0x54
|
||||
lwz r3, 0x10(r31)
|
||||
add r0, r30, r0
|
||||
add r3, r3, r0
|
||||
lhz r0, 0x5c(r3)
|
||||
cmpwi r0, 0
|
||||
beq getTitleName_L3
|
||||
bl getLanguage__Q23ipl6SystemFv
|
||||
mulli r3, r3, 0x54
|
||||
lwz r0, 0x10(r31)
|
||||
add r0, r0, r3
|
||||
add r3, r0, r30
|
||||
addi r3, r3, 0x5c
|
||||
b getTitleName_L8
|
||||
getTitleName_L3:
|
||||
bl getRegion__Q23ipl6SystemFv
|
||||
lis r5, scLangLookup__Q23ipl7channel@ha
|
||||
add r4, r27, r28
|
||||
slwi r3, r3, 6
|
||||
li r0, 0x10
|
||||
addi r5, r5, scLangLookup__Q23ipl7channel@l
|
||||
add r6, r29, r4
|
||||
add r8, r5, r3
|
||||
li r3, 0
|
||||
mtctr r0
|
||||
getTitleName_L4:
|
||||
lwzx r7, r8, r3
|
||||
lwz r0, 0x10(r6)
|
||||
mulli r5, r7, 0x54
|
||||
add r0, r0, r30
|
||||
add r4, r5, r0
|
||||
lhz r0, 0x5c(r4)
|
||||
cmpwi r0, 0
|
||||
beq getTitleName_L6
|
||||
lwz r0, 0x10(r31)
|
||||
add r0, r0, r5
|
||||
add r3, r0, r30
|
||||
addi r3, r3, 0x5c
|
||||
b getTitleName_L8
|
||||
getTitleName_L6:
|
||||
addis r0, r7, 1
|
||||
cmplwi r0, 0xffff
|
||||
beq getTitleName_L7
|
||||
addi r3, r3, 4
|
||||
bdnz getTitleName_L4
|
||||
getTitleName_L7:
|
||||
lwz r0, 0(r8)
|
||||
lwz r3, 0x10(r31)
|
||||
mulli r0, r0, 0x54
|
||||
add r0, r3, r0
|
||||
add r3, r0, r30
|
||||
addi r3, r3, 0x5c
|
||||
getTitleName_L8:
|
||||
addi r11, r1, 0x20
|
||||
bl _restgpr_27
|
||||
lwz r0, 0x24(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x20
|
||||
blr
|
||||
wchar_t* Manager::getTitleName(int page, int index, int nameIndex) const {
|
||||
u32 language;
|
||||
const u32* languages;
|
||||
|
||||
if (!mChannels[page][index].loadedBnr) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const wchar_t* preferredName = (const wchar_t*)(
|
||||
(const u8*)mChannels[page][index].metaHdr +
|
||||
(nameIndex * (s32)sizeof(mChannels[page][index].metaHdr->names[0][0]) +
|
||||
System::getLanguage() * sizeof(mChannels[page][index].metaHdr->names[0])) +
|
||||
offsetof(SChanMgrMetaHeader, names));
|
||||
if (preferredName[0]) {
|
||||
return mChannels[page][index].metaHdr->names[System::getLanguage()][nameIndex];
|
||||
}
|
||||
|
||||
languages = scLangLookup[System::getRegion()];
|
||||
for (int i = 0; i < 16; i++) {
|
||||
language = languages[i];
|
||||
if (mChannels[page][index].metaHdr->names[(int)language][nameIndex][0]) {
|
||||
return mChannels[page][index].metaHdr->names[language][nameIndex];
|
||||
}
|
||||
if (language == -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return mChannels[page][index].metaHdr->names[languages[0]][nameIndex];
|
||||
}
|
||||
|
||||
BOOL Manager::checkNeedUpdate(int page, int index) const {
|
||||
|
||||
@@ -998,12 +998,24 @@ namespace ipl {
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void verifySavedataZD(EGG::Heap* heap, ESTitleId titleId, NANDFileInfo* fileInfo) {
|
||||
char path[NAND_MAX_PATH];
|
||||
static inline void verifySavedataZD(EGG::Heap* heap, ESTitleId requestedTitleId, NANDFileInfo* fileInfo) {
|
||||
ESTitleId titleId;
|
||||
u32 offset;
|
||||
u32 j;
|
||||
BOOL valid;
|
||||
BOOL fileOpen;
|
||||
u8* firstBlock;
|
||||
u8* secondBlock;
|
||||
BOOL deleteSaveData;
|
||||
s32 ret;
|
||||
u8* saveData = NULL;
|
||||
BOOL fileOpen = FALSE;
|
||||
BOOL deleteSaveData = FALSE;
|
||||
u8* saveData;
|
||||
titleId = requestedTitleId;
|
||||
|
||||
char path[NAND_MAX_PATH];
|
||||
|
||||
saveData = NULL;
|
||||
fileOpen = FALSE;
|
||||
deleteSaveData = FALSE;
|
||||
|
||||
sprintf(path, "/title/%08x/%08x/data/%s", (u32)((titleId & 0x00FFFFFFFFFFFFFFULL) >> 32), (u32)(titleId & 0x00FFFFFFFFFFFFFFULL), "zeldaTp.dat");
|
||||
if (!ESMisc::ChangeUid(titleId)) {
|
||||
@@ -1030,17 +1042,17 @@ namespace ipl {
|
||||
OSReport("%s::%s: File size is not correct: %d\n", __FILE__, __FUNCTION__, ret);
|
||||
deleteSaveData = TRUE;
|
||||
} else {
|
||||
u32 offset = 8;
|
||||
u32 j = 0;
|
||||
BOOL valid = FALSE;
|
||||
offset = 8;
|
||||
valid = FALSE;
|
||||
j = 0;
|
||||
while (j < 3) {
|
||||
u8* block = saveData + offset;
|
||||
if (!checkForNullTermination((char*)block + 0x4e, 8) ||
|
||||
!checkForNullTermination((char*)block + 0x58, 8) ||
|
||||
!checkForNullTermination((char*)block + 0x72, 8) ||
|
||||
!checkForNullTermination((char*)block + 0x8e, 8) ||
|
||||
!checkForNullTermination((char*)block + 0x1b4, 0x11) ||
|
||||
!checkForNullTermination((char*)block + 0x1c5, 0x11)) {
|
||||
firstBlock = saveData + offset;
|
||||
if (!checkForNullTermination((char*)firstBlock + 0x4e, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x58, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x72, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x8e, 8) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x1b4, 0x11) ||
|
||||
!checkForNullTermination((char*)firstBlock + 0x1c5, 0x11)) {
|
||||
goto verify_failed;
|
||||
}
|
||||
j++;
|
||||
@@ -1050,13 +1062,13 @@ namespace ipl {
|
||||
offset = 0x2008;
|
||||
j = 0;
|
||||
while (j < 3) {
|
||||
u8* block = saveData + offset;
|
||||
if (!checkForNullTermination((char*)block + 0x4e, 8) ||
|
||||
!checkForNullTermination((char*)block + 0x58, 8) ||
|
||||
!checkForNullTermination((char*)block + 0x72, 8) ||
|
||||
!checkForNullTermination((char*)block + 0x8e, 8) ||
|
||||
!checkForNullTermination((char*)block + 0x1b4, 0x11) ||
|
||||
!checkForNullTermination((char*)block + 0x1c5, 0x11)) {
|
||||
secondBlock = saveData + offset;
|
||||
if (!checkForNullTermination((char*)secondBlock + 0x4e, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x58, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x72, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x8e, 8) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x1b4, 0x11) ||
|
||||
!checkForNullTermination((char*)secondBlock + 0x1c5, 0x11)) {
|
||||
goto verify_failed;
|
||||
}
|
||||
j++;
|
||||
@@ -1093,8 +1105,11 @@ namespace ipl {
|
||||
}
|
||||
|
||||
static inline s32 DeleteTicketsForce(EGG::Heap* heap, ESTitleId titleId, u8* ticketViews, u32* ticketViewCount) {
|
||||
ESTicketView* ticketViewList = NULL;
|
||||
s32 ret;
|
||||
u32 j;
|
||||
ESTicketView* ticketViewList;
|
||||
ticketViewList = NULL;
|
||||
|
||||
memset(ticketViews, 0, OSRoundUp32B(sizeof(ESTicketView)));
|
||||
ret = ES_GetTicketViews(titleId, NULL, ticketViewCount);
|
||||
if (ret != ES_ERR_OK) {
|
||||
@@ -1110,7 +1125,7 @@ namespace ipl {
|
||||
OSReport("%s::%s: ES_GetTicketViews failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret, titleId);
|
||||
goto cleanup;
|
||||
}
|
||||
for (u32 j = 0; j < *ticketViewCount; j++) {
|
||||
for (j = 0; j < *ticketViewCount; j++) {
|
||||
memcpy(ticketViews, &ticketViewList[j], sizeof(ESTicketView));
|
||||
ret = ES_DeleteTicket((ESTicketView*)ticketViews);
|
||||
if (ret != ES_ERR_OK) {
|
||||
@@ -1126,12 +1141,16 @@ namespace ipl {
|
||||
}
|
||||
|
||||
static inline s32 InitSavedata(EGG::Heap* heap) {
|
||||
u32 i;
|
||||
s32 ret;
|
||||
ESTitleId* titleIds;
|
||||
u8* ticketScratch;
|
||||
u8 ticketViews[OSRoundUp32B(sizeof(ESTicketView))] ALIGN32;
|
||||
NANDFileInfo fileInfo ALIGN32;
|
||||
u32 ticketViewCount;
|
||||
ESTitleId* titleIds = NULL;
|
||||
titleIds = NULL;
|
||||
u32 titleCount = 0;
|
||||
s32 ret = ES_ListTitlesOnCard(NULL, &titleCount);
|
||||
ret = ES_ListTitlesOnCard(NULL, &titleCount);
|
||||
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: Failed to ES_ListTitlesOnCard1: %d\n", __FILE__, __FUNCTION__, ret);
|
||||
@@ -1151,8 +1170,8 @@ namespace ipl {
|
||||
}
|
||||
|
||||
{
|
||||
u8* ticketScratch = ticketViews;
|
||||
for (u32 i = 0; i < titleCount; i++) {
|
||||
ticketScratch = ticketViews;
|
||||
for (i = 0; i < titleCount; i++) {
|
||||
if ((titleIds[i] & 0xFFFFFFFFFFFFFF00ULL) == 0x00010000525A4400ULL) {
|
||||
verifySavedataZD(heap, titleIds[i], &fileInfo);
|
||||
continue;
|
||||
@@ -1177,10 +1196,6 @@ namespace ipl {
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 ESMisc::DeleteUnauthorizedData(EGG::Heap* heap) {
|
||||
return InitSavedata(heap);
|
||||
}
|
||||
|
||||
BOOL checkForNullTermination(char* str, u32 len) {
|
||||
for (u32 i = 0; i < len; i++) {
|
||||
if (*str == 0) {
|
||||
@@ -1191,6 +1206,10 @@ namespace ipl {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
s32 ESMisc::DeleteUnauthorizedData(EGG::Heap* heap) {
|
||||
return InitSavedata(heap);
|
||||
}
|
||||
|
||||
TMDFile::TMDFile(EGG::Heap* heap) : mpHeap(heap), mbFileOpen(FALSE), mFileLength(0) {
|
||||
memset(&mFile, 0, sizeof(mFile));
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ from pathlib import Path
|
||||
|
||||
|
||||
EXPECTED_DOL_SHA1 = "26116613f624061ba99c8d1a299aaa6efa85670d"
|
||||
EXPECTED_TOTAL_UNITS = 1027
|
||||
EXPECTED_TOTAL_UNITS = 1028
|
||||
EXPECTED_TOTAL_CODE = 2995176
|
||||
EXPECTED_TOTAL_DATA = 1832684
|
||||
EXPECTED_TOTAL_FUNCTIONS = 12563
|
||||
|
||||
111
tools/decomp-assist/opus-aoss.attempts.md
Normal file
111
tools/decomp-assist/opus-aoss.attempts.md
Normal file
@@ -0,0 +1,111 @@
|
||||
# opus-aoss: AOSS.c .bss ownership (s_packetState, s_crcTable)
|
||||
|
||||
## Evidence
|
||||
|
||||
Target relocations (pyelftools over build/43U/obj/src/scene/setting/*.o):
|
||||
|
||||
- `AOSS_810BE838` (0x68) and `AOSS_810BE8A0` (0x400) are referenced only by
|
||||
`AOSSDecryptMessage` (0x81400830) and `AOSSSendHelloRequest` (0x81401778).
|
||||
No other object in build/43U/obj references them (grep over every .o).
|
||||
- Those two functions are not contiguous in .text (7 functions between them,
|
||||
4 after), so (a) "split AOSS.c into a CRC/packet TU with its own functions"
|
||||
is ruled out: there is no function tail that moves with the objects.
|
||||
- ATERM.c never references them, so (b) "they are ATERM's" has no support.
|
||||
- (c) common/tentative: MWLD puts SHN_COMMON blocks after all other .bss of the
|
||||
link, but ATERM.c's .bss follows these objects, so they are not commons.
|
||||
|
||||
Addressing-pattern experiments (AOSS.o, -O4,p -inline off), SendHello differing
|
||||
lines out of 273 (odiff.py), every other function checked each time:
|
||||
|
||||
| AOSS.c form of the two objects | SendHello | other effect |
|
||||
|---|---|---|
|
||||
| `static`, defined before the functions (main) | 254 (size 0x43c vs 0x444) | - |
|
||||
| non-static, defined before the functions | 254 | none |
|
||||
| `extern` decl at top, definition at end of AOSS.c | 254 | none |
|
||||
| `extern`, not defined in AOSS.c | 97 (size 0x444) | none |
|
||||
| all five .bss objects `extern` | 97 | HandleAuthReply 0 -> 103 |
|
||||
| s_configData + s_networkBuffer also `extern` | 97 | HandleAuthReply 0 -> 103 |
|
||||
|
||||
Any definition inside AOSS.c (static, global, early, late) makes MWCC share one
|
||||
`...bss.0` base register across s_runtime / s_packetState / s_crcTable in
|
||||
SendHello. The target forms a separate `lis/addi` per object (two for
|
||||
s_runtime alone), which this compiler only produces when the symbol is
|
||||
undefined in the TU. Meanwhile s_runtime, s_configData, s_networkBuffer must
|
||||
stay defined in AOSS.c, or HandleAuthReply loses its exact match. So the two
|
||||
objects are defined in a different TU that the linker places right after
|
||||
AOSS.c, with no .text of its own.
|
||||
|
||||
## Applied split
|
||||
|
||||
- New data-only TU `src/scene/setting/AOSSData.c` (Matching), linked between
|
||||
AOSS.c and ATERM.c; splits.txt `.bss 0x810BE838..0x810BECA0`.
|
||||
- They're tentative definitions, so MWCC emits them in reverse order: the
|
||||
source declares `s_crcTable` and then `s_packetState` (first try in forward
|
||||
order gave the wrong order and a wrong DOL hash).
|
||||
- symbols.txt: `AOSS_810BE838` -> `s_packetState`, `AOSS_810BE8A0` -> `s_crcTable`
|
||||
(needed so the retail AOSS.o asm links against the new definitions).
|
||||
- `AOSSKeyMaterial`, `AOSSPacketState` and the extern declarations moved to
|
||||
include/scene/setting/AOSS.h (only AOSS.c includes it).
|
||||
- Full build: DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; symorder
|
||||
AOSSData ORDER OK. All 17 exact AOSS functions are still exact.
|
||||
|
||||
## SendHello follow-up (254 -> 58)
|
||||
|
||||
| attempt | differing |
|
||||
|---|---|
|
||||
| split only, existing source | 97 |
|
||||
| drop `crcTable` alias local | 97 |
|
||||
| decl order permutations of response/payload/checksum/sequence (24) | best 82 |
|
||||
| flat `for (index < 8)` / int index / pointer / sizeof bound / operand swap | 237 (first iteration constant-folded) |
|
||||
| 2x4 nested loop | 82 |
|
||||
| `index = 0; while (index < 8) ... bytes[index++]` | 58 |
|
||||
| decl permutations on top of the while loop | best 58 |
|
||||
| swap `sequence = 0` / `checksum = 0` | 59 |
|
||||
| `payload = &response->payload` earlier / at declaration | 69 / 82 |
|
||||
|
||||
Remaining in SendHello: checksum r31 vs r30 and payload r30 vs r31 (decl order
|
||||
can't reach it), and the RC4 loop addresses `construction` from its base
|
||||
(r1+0x10, offsets 8/9) where the target holds a pointer to `hello.data.bytes`
|
||||
(r1+0x18, offsets 0/1). The second points at the `construction` carrier struct:
|
||||
the target probably has `hello` as its own local. That's the next lever.
|
||||
|
||||
## Gate (AOSS AOSSData ATERM --quick)
|
||||
|
||||
`GATE FAIL: 1 regressions vs main`. The only one is `AOSS: matched_data 3928 -> 2800`,
|
||||
which is exactly the 1128 bytes now in AOSSData (1128/1128, linked). Global
|
||||
matched data stays 100%, global fuzzy goes 99.88565 -> 99.88798, no forbidden or
|
||||
readability findings, DOL SHA1 OK. AOSS is 17/21 exact (unchanged), ATERM 20/26 (unchanged).
|
||||
|
||||
## Round 2: alternatives to the data-only TU
|
||||
|
||||
| alternative | result |
|
||||
|---|---|
|
||||
| definitions in ATERM.c (AOSSData removed, ATERM .bss split moved to 0x810BE838, `AOSSPacketState s_packetState; u32 s_crcTable[0x100];` placed before `gAtermIpConfig`) | built ATERM.o puts them at .bss offsets 8144/9168, i.e. after every ATERM object (unreferenced in the TU, emitted last in reverse order); target needs offset 0/104. MWCC emits a TU's .bss referenced-first, so ATERM can't own the start of its .bss with objects it never uses. Rejected. |
|
||||
| function-local `static` arrays in SendHello (shadowing the externs) | SendHello 58 -> 231; local statics join the TU's shared `...bss.0` base exactly like file statics. Also ruled out by relocations: AOSSDecryptMessage references both objects directly, so neither function can own them as locals. |
|
||||
| AOSSLink.c / iplRakuRakuThread.cpp | earlier in link order, their .bss sits before AOSS.c's, can't hold 0x810BE838. Not tried. |
|
||||
|
||||
Data-only AOSSData.c remains the only form that gives a separate lis/addi per object.
|
||||
|
||||
## Round 2: AOSSSendHelloRequest 58 -> 0
|
||||
|
||||
| attempt | differing |
|
||||
|---|---|
|
||||
| carrier struct `construction` removed, four plain locals in old order | 84 (hello now addressed at r1+0x18 directly; stack order wrong) |
|
||||
| 24 permutations of the four locals | best 74: `accessPointName, hello, destination, schedule` (schedule position irrelevant); stack layout now matches |
|
||||
| RC4 loop reads `*input++` from `input = hello.data.bytes`, as AOSSDecryptMessage does | 57 |
|
||||
| single-line moves of every declaration (460 builds) | none below 57 |
|
||||
| no `payload` local (`response->payload.` everywhere) | 261, rejected |
|
||||
| mwdbg capture (first two runs crashed in the emulator before the function, third worked): `@2964` = checksum's {0, final} web, a split compiler temp numbered above all locals, so it's colored first and takes r31 before `payload`; `@2966` = the reused `index` split for the RC4 loop, colored before `state` and takes r3 | - |
|
||||
| separate `crc` accumulator for the CRC loop, `checksum = (crc ^ 0xffffffff) & 0xff` | 55 |
|
||||
| + `checksum` declared right after `payload` (move search) | 23 (r30/r31 fixed) |
|
||||
| + RC4 loop gets its own counter `i` instead of reusing `index`, declared after `state` | **0**, size 0x444 = 0x444 |
|
||||
|
||||
AOSS after: 18/21 exact (was 17). AOSSDecryptMessage still 0/321. Unchanged non-exact:
|
||||
AOSS_Init_old 1306/1584, AOSSApplyAuthOptions 22/114, AOSSXorBufferWithKey 34/147. Pool identical.
|
||||
|
||||
## Gate round 2 (AOSS AOSSData ATERM --quick)
|
||||
|
||||
`GATE FAIL: 1 regressions vs main`, again only `AOSS: matched_data 3928 -> 2800` (the 1128 bytes now in
|
||||
AOSSData, 1128/1128). AOSS 18/21 exact (17 -> 18), code 7720 -> 8812/16192, ATERM 20/26 unchanged, pools
|
||||
identical, global matched code 97.12163 -> 97.15810, fuzzy 99.88565 -> 99.88839, data 100%, 0 forbidden, 0
|
||||
readability, DOL SHA1 OK.
|
||||
29
tools/decomp-assist/opus-art.attempts.md
Normal file
29
tools/decomp-assist/opus-art.attempts.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# opus-art: prior-art port attempts (library units)
|
||||
|
||||
| unit | symbol | sources found | result |
|
||||
|------|--------|---------------|--------|
|
||||
| libs/RevoEX/src/nhttp/NHTTP_stdlib_RVL | NHTTPi_strnicmp | yannicksuter/mscharged-decomp src/RVL_SDK/nhttp/NHTTP_stdlib_RVL.c (+ configure note: NHTTP exact under GC/3.0a5 only); InusualZ/mhtri-decomp src/NHTTP/d_nhttp.c (non-matching there) | 2 -> 0. mscharged source alone stays at 2 under 3.0a5.2; our old int-helper source stays at 2 under 3.0a5; mscharged source + `mw_version="GC/3.0a5"` = exact. |
|
||||
| libs/RevoEX/src/nhttp/NHTTP_stdlib_RVL | NHTTPi_compareToken | same | 2 -> 0, same fix. Unit fully exact, flipped to Matching, DOL SHA1 unchanged. Using a `LowerCase()` helper instead of the literal ternaries regresses (2 / 17 differing). |
|
||||
| libs/RevoEX/src/net/aes | AESiEncryptBlock | none (searched AESiEncryptBlock, NETiAESEncryptoBlock, AESiRoundKeyRcon0, NET_AES_BLOCK_MODE_CBC, NETAESCreate: only symbol maps in riptl/wii-symbols and a WiiLink patch header) | no change; GC/3.0a5, 3.0a3.4, 3.0a3 give the same score |
|
||||
| libs/RevoEX/src/net/aes | AESiDecryptBlock | none (same searches) | no change; same compiler sweep |
|
||||
| libs/RVL_SDK/src/kbd/kbd_lib | kbdProcMod | headers only (DarkRTA/rb3 kbd.h, galaxymaster2007/THPConv kbd.h); robojumper/sdk_2009-12-11 has kpr_lib.c but no kbd_lib.c | no change (4 differing); compiler sweep no effect |
|
||||
| libs/RVL_SDK/src/kbd/kbd_lib | kbd_led_handler | same | 3 differing; if/else, `err = 7; if (success == TRUE)`, reordered switch cases give 13-23 (worse); compiler sweep no effect |
|
||||
| libs/RVL_SDK/src/kbd/kbd_lib | KBDSetModState | same | no change (4 differing) |
|
||||
| libs/RVL_SDK/src/fa/driver/sd_drv | pfd_sddrv_init / pfd_sddrv_finalize / pfd_sddrv_build_fat32_mbr_bpb | ACreTeam/cf-decomp has only sd_drv.h (VF variant) and nand_drv.c (nanddrv_init/finalize: different body, saved to _refs/prior) | no portable code; compiler sweep no effect |
|
||||
| libs/RVLMiddleware/TMC_JPEG/src/buffer/idct_block_var | TMCJPEGDEC_IdctBlock_Lumi / _Col | none outside upstream | no change; compiler sweep no effect |
|
||||
| libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8 | TMCJPEGDEC_set_converterRGBA8 / TMCJPEGDEC_converterYUV411toRGBA8 | none outside upstream | no change; compiler sweep no effect |
|
||||
| libs/RVLMiddleware/TMC_JPEG/src/jpegdec/jdec_main | TMCJPEGDEC_err_restart (asm PLACEHOLDER) | none outside upstream | still asm |
|
||||
| libs/RVL_SDK/src/cntcache/cntcache | CNTCACHEClear (asm PLACEHOLDER) | bgsamm/pbr-dtk cntcache.h (header only, saved); pret/pokerevo has asm only | still asm |
|
||||
|
||||
Note for the NHTTP_recvbuf owner: mscharged-decomp builds all of NHTTP with GC/3.0a5 ("retail code keeps the older compiler's constant order and saved-register zeros ... exact under GC/3.0a5 only"). That is what fixed NHTTP_stdlib_RVL here, so NHTTPi_compareTokenN_HdrRecvBuf is worth trying with `mw_version="GC/3.0a5"` and mscharged's NHTTP_recvbuf.c (already in _refs/prior).
|
||||
|
||||
## Round 2: readability
|
||||
- NHTTP_stdlib_RVL: replaced the four inline tolower ternaries with `NHTTPi_TOLOWER(c)` macro. 14/14 exact, pool identical, DOL SHA1 26116613. `LowerCase()` kept (still used by NHTTPi_strToHex).
|
||||
|
||||
## Round 2: NHTTP_recvbuf
|
||||
- mw_version GC/3.0a5 alone: 6/7, compareTokenN still 5/124.
|
||||
- Reference compareTokenN control flow (prior/yannicksuter_mscharged-decomp__NHTTP_recvbuf.c), with NHTTPi_TOLOWER macro: 0/124, 7/7.
|
||||
- Same, without the gotos (if/else reads): 86/128. Rejected; goto form kept.
|
||||
- Locate step through the existing FindHeaderBlock() helper: still 0/124. Kept.
|
||||
- Removed the unused static LowerCase(): still 7/7, pool identical, ctxdiff diffs 0.
|
||||
- Flipped to Matching: DOL SHA1 26116613.
|
||||
62
tools/decomp-assist/opus-bs2.attempts.md
Normal file
62
tools/decomp-assist/opus-bs2.attempts.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# opus-bs2 attempts (BS2Mach 4 non-exact, BS2Update UpdateThread)
|
||||
|
||||
Base 16023905. Start: BS2StartGame 10/393, BS2StartGCGame 9/228, CheckBS2CommandStatus 2/406, BS2Tick 71/1940, UpdateThread 335/913.
|
||||
|
||||
Tooling notes:
|
||||
- mwdbg crashes the emulator (WRITE_UNMAPPED @47e090) whenever `-enc SJIS` is on the command line; drop that flag for tracing (BS2Mach is ASCII). Pass the command via `--args`.
|
||||
- /tmp/var.py belongs to another worker; my scratch lives in /tmp/opusbs2/.
|
||||
|
||||
## Lever 26 IRO off
|
||||
1. `#pragma ppc_iro_level 0` around each of the four BS2Mach functions, one at a time: StartGame 10->10, StartGCGame 9->145, CheckBS2CommandStatus 2->2, BS2Tick 71->71. Rejected.
|
||||
|
||||
## Symbol binding (found via readelf, target LOCAL vs ours GLOBAL)
|
||||
2. Target has 39 BS2Mach symbols LOCAL (State, NandPending, CacheCommandComplete, CacheSeekComplete, Run, CheckBS2CommandStatus, BS2NANDDivide*, LoaderInit/Main/Close, ...). Made them `static`. Bindings now match; no function changed score (codegen identical). Kept as a link-correctness fix.
|
||||
|
||||
## CheckBS2CommandStatus (case 0x12: target `lwz count; stw CacheCommandComplete; slwi`, ours `slwi; stw`)
|
||||
3. NP; CCC; CacheLength += expr -> 4 (store hoisted before count load).
|
||||
4. `sizeof * count` operand order -> 2. 5. `CacheLength = CacheLength + expr` -> 9. 6. `= expr + CacheLength + 32` -> 9. 7. `+= 32 + round` -> 2. 8. `* 8` -> 2. 9. `**(u32 **)&DataToc` -> 2.
|
||||
10. const DVDGameTOC* cast, CCC before -> 4; CCC after -> 2 (lever 27, no effect).
|
||||
11. (u32) cast on sum -> 3. 12. TRUE -> 2. 13. 0x20 -> 2. 14. `*(DVDGameTOC **)&DataToc` -> 2. 15. open-coded round -> 2.
|
||||
16. static inline WriteCacheData(buf,size) helper for case 0x12 -> 241 (size becomes temp; target recomputes in else branch, so no helper).
|
||||
17. mwdbg: the order comes from the pre-RA scheduler (backend-00 -> 01); post-RA scheduler leaves it. Input order has CCC store after the CacheLength store.
|
||||
18. CacheCommandComplete type BOOL/int/s32 -> 2; volatile -> 46.
|
||||
19. With static globals: NP;CCC;CL+= -> 4; CL = CL + (expr) after CCC -> 4.
|
||||
|
||||
## BS2StartGame / BS2StartGCGame shared prologue (`li r0,1` must precede the base `lis` pair)
|
||||
20. mwdbg: B1 holds the bss/data base pairs, li/stw StartingGame and the hoisted `&CoverBlock` addi; height of the bss chain wins over li.
|
||||
21. do-while cover loop -> 10; `for(;;) if break` -> 10; `(&CoverBlock)->state` -> 10; `while (CoverBlock.state)` -> 10; StartingGame = 1 / state != 0 -> 10.
|
||||
22. `DVDGetCommandBlockStatus(&CoverBlock)` call -> 8 (prologue fixed but loop becomes bl; rejected, evidence that the stw needs a successor/priority).
|
||||
23. static inline WaitForCoverCommand() / WaitCommandIdle(block) helpers -> 10/9.
|
||||
24. StartingGame after the loop -> 368 (wrong).
|
||||
25. `volatile BOOL StartingGame` -> StartGame 10->5, StartGCGame 9->4, every other BS2Mach function unchanged (report: 25/29 exact, data 100%). StartingGame is the cross-thread "game is starting" flag read by BS2Tick, like the other volatile flags (CacheFailed, RegionValid, NandPending). KEPT.
|
||||
|
||||
## BS2StartGame DI write (0xCC003024): target addr r4 / value r3, ours addr r3 / value r4 (5 diffs)
|
||||
26. Declaration permutations of diBits/diValue/diAddr (5 orders) -> 5 or 7.
|
||||
27. `__PIRegs[9]` instead of raw pointer, value/bits named -> 5 (same tie). regsim (want diValue=r3): structural, 0/1.
|
||||
28. regsim on three-named form (want diValue=r3,diAddr=r4,diBits=r0): best 1/3, structural. The address is always a lis temp (r196); the value must be a temp numbered after it to be colored first.
|
||||
29. `*diAddr = (*diAddr | 1) | diBits` (u32/vu32, 1U, no parens) -> registers right but `ori 4`+`ori 1` merge into `ori 5`: 24, size -4.
|
||||
30. `diBits | (*diAddr | 1)` -> 7 (ori 1 moves after the or). `(u32)(...) | diBits` -> 7. `diValue = *diAddr | 1` -> 7. `__PIRegs[9] | 1` into named -> 7.
|
||||
|
||||
## BS2StartGCGame 64-bit multiply (target mulhwu(freq r5, seconds r7); ours mulhwu(seconds, freq))
|
||||
31. Declaration permutations of rtc/counterBias/seconds/timerFrequency x two operand orders (48 builds) -> all 8 (freq*sec) / 4; named values are forwarded, decl order irrelevant.
|
||||
32. freq*sec forms: `(OSTime)freq * sec`, `freq * (OSTime)sec`, both cast, `(u64)` (145, size change), OS_TIMER_CLOCK*, `(OS_BUS_CLOCK >> 2)` / `/ 4` inline -> 8: operand order fixes the multiply but evaluation order follows it, so registers swap.
|
||||
33. sec*freq forms: OSSecondsToTicks, `time = rtc + bias; time *= clock`, `time = CLOCK * time` (operands get swapped back to time first!), OSTime-typed seconds and/or timerFrequency -> 4.
|
||||
34. freq computed before seconds statement -> 4/8; `time = freq; time *= sec` -> 9.
|
||||
35. OSTime-typed timerFrequency x four freq*sec forms -> 8.
|
||||
36. Put the SCGetCounterBias() call inside the right operand: `time = OS_TIMER_CLOCK * (OSTime)(rtc + SCGetCounterBias());` -> 0/228 EXACT. The call makes the seconds operand heavier, so it is evaluated first (lower vreg -> r7) while the clock stays the left operand. Also exact: `(OSTime)OS_TIMER_CLOCK * (rtc + SCGetCounterBias())`, `(OSTime)(OS_BUS_CLOCK >> 2) * (...)`. Unused locals counterBias/seconds/timerFrequency removed. Pool identical (91/91), BS2Mach 26/29, data 100%.
|
||||
|
||||
## BS2Tick (71 at start of this round)
|
||||
37. IRO off -> 71 (attempt 1).
|
||||
38. Move `AudioBufferUnconfigured = 1` to each of 10 positions in case 0 -> 71/72. volatile AudioBufferUnconfigured -> 71.
|
||||
39. Definition-level volatile sweep, one global at a time (36 globals): PartitionOpen 71->68, LoadingTitle 71->69, all others same or worse (State 76, ResetTime 91, CoverPollTime 166, CurrentTmd 1314, ...).
|
||||
40. `static vu32 PartitionOpen` + `static vu32 LoadingTitle` -> BS2Tick 66; every other BS2Mach function unchanged (26/29, data 100%). LoadingTitle is set by BS2StartLoadingTitle from the menu thread and polled by BS2Tick; PartitionOpen is likewise a cross-call state flag. KEPT.
|
||||
41. Second single-volatile sweep on top of 40 -> nothing below 66.
|
||||
42. Device-code block (target 0x27d4): target shares one `State = BS2_STT_8` after the if/else; ours duplicates it. Merging fixes the tail but target also re-materializes `lis 0x8000` in each branch, ours reuses the consoleType base -> 8 bytes short, 1703 diffs. Tried consoleType as `(OSBootInfo *)`, `OSPhysicalToCached(0x2C)`, `*(u32 *)0x8000002C`, `OS_ADDR_BOOT_INFO`, `!(...)`, `OSGetConsoleType()` (adds bl), and `*(u16 *)OSPhysicalToCached(0x30E6)` for the store: all 1701-1703. Restored the duplicated State (66).
|
||||
43. `#pragma ppc_iro_level 0` around BS2Tick with merged State -> identical output; IRO evidently does not run on BS2Tick (or StartGame) at all, so the lis sharing comes from the backend.
|
||||
|
||||
## BS2Update
|
||||
44. readelf: target has rc/VersionIOS/VersionMEM2/VersionES/ConsoleType GLOBAL and getSuffix LOCAL (ours the opposite). Fixed the bindings: UpdateThread 335/913 unchanged (codegen identical).
|
||||
45. Logging-call `titleId` via UPDATE_DISC_ENTRIES macro instead of discEntries (target re-materializes `lis 0x8048` there) -> 335. Dropping the discEntries local entirely -> 382. Remaining diff is an extra callee-saved register in target (r14..r31) shifting every allocation; not pursued further this round.
|
||||
|
||||
Final gate (BS2Mach + BS2Update, --quick): GATE PASS, 0 regressions, BS2Mach 26/29 exact (BS2StartGCGame new), BS2Update 9/10.
|
||||
Best non-exact sources: opus-bs2.best.c (BS2Tick 66, volatile PartitionOpen/LoadingTitle), opus-bs2.best.BS2Update.c (binding fixes, UpdateThread 335).
|
||||
33
tools/decomp-assist/opus-fa.attempts.md
Normal file
33
tools/decomp-assist/opus-fa.attempts.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# opus-fa attempts
|
||||
|
||||
## libs/RVL_SDK/src/fa/driver/sd_drv (23/26 -> 26/26, linked)
|
||||
|
||||
### pfd_sddrv_finalize (4 -> 0)
|
||||
- Evidence for volatile: target reloads `flags` straight after testing it (`lwz; rlwinm.; beq; lwz` with no store in between) and keeps the final state stores in source order. The previous rounds faked the reloads with const-pointer accessors.
|
||||
- Fix: `volatile PFD_SDDRV_INFO g_pfd_sddrv_info;` (definition-level, lever 19: the struct is written from the SD insert/remove interrupt callbacks). The fake accessors `pfd_sddrv_flags/device/disk/drive` are removed and the fields read directly. The removal callback loses its `media_inserted == 0 &&` re-check, which only existed to force a reload. Every other function stays exact.
|
||||
|
||||
### pfd_sddrv_init (142 -> 0)
|
||||
- Explicit `return 0;` in the already-initialized branch: 142 -> 26. MWCC then turned `disk != info.disk ? -44 : 0` into a branchless select. The target branches instead.
|
||||
- if/else/eq/goto spellings of the same return: still branchless (26).
|
||||
- `#pragma ppc_iro_level 0` around the function (lever 26): 26 -> 1. Only the null test was left: target `li r0,0; cmplw r3,r0`.
|
||||
- `disk == NULL` (NULL is `((void*)0)`) under IRO 0: 1 -> 0. Without IRO 0, NULL gives cmpwi.
|
||||
- Diagnostic only: optimization_level 1/2/3 and iro 1/2 did not help.
|
||||
|
||||
### pfd_sddrv_build_fat32_mbr_bpb (122 -> 0)
|
||||
- Target leaves an unreachable `bl OSReport` without its argument after the inlined reserved-sector writer, and has no null check of the buffer. A mini test shows this exact remnant comes from an inline helper with no null check that returns 0, compiled under IRO 0.
|
||||
- The reserved-sector helper is now written like its sibling `pfd_sddrv_store_fat32_fsi_buf` (no null check, `return 0`). The only caller passes `g_pfd_sddrv_buf`, so behaviour is unchanged. With IRO 0 around build_fat32: 122 -> 2.
|
||||
- Last 2: the first write loads the sector before the device. A local `partition_start_sector` like the FAT16 builder: 14. `+ 0`, casts: 2. Fix: `static inline s32 pfd_sddrv_write_sector(u32 sector)` wrapping `ISD_WriteBlock(device, sector, g_pfd_sddrv_buf, 1)`, so the argument is evaluated before the device load: 0.
|
||||
|
||||
### Link
|
||||
- Flipped to Matching. The first DOL had `addi r27/r28` swapped in physical_read/write. The cause was `ATTRIBUTE_ALIGN(32)` on `g_pfd_sddrv_buf`, which changes codegen, so it was dropped.
|
||||
- Without a 32-aligned .bss object, every `g_pfd_sddrv_info` access moved by 0x10. The fix is `ATTRIBUTE_ALIGN(32)` on `g_pfd_sddev` (the IPC device storage) and on `g_event` (the IPC event word, which the target places at .sbss+0x20).
|
||||
- DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d OK.
|
||||
|
||||
## libs/RVL_SDK/src/fa/pdm_partition: pdm_part_is_master_boot_sector (start 84 in repo / 21 in opus-vf best -> best 19, not exact)
|
||||
Remaining difference: the byte-load schedule of the inlined LE32 read. The target builds the tree (b2<<16 + b0) + (b3<<24 + b1<<8) and loads b3, b2, b0, b1. Ours loads b3, b2, b1, b0.
|
||||
- mwdbg: our pre-RA scheduler already emits b1 before b0, so b1 has a higher priority. In the target, b1 shares b3's register, which proves its load comes after the b3 shift in the pre-RA order. So the target DAG or the initial order differs, and it is not a register tie.
|
||||
- Mini-file study (/tmp/opus-fa/perm*.py): MWCC reassociates a 4-term add chain into pairs (L0+L2),(L1+L3) in source operand order. No permutation or parenthesization of the 4 terms gives the target pairing together with the target load order. All 120 tried in the real function: best 19 (e.g. `b1<<8 + b0 + b2<<16 + b3<<24`). Saved as opus-fa.best.pdm_partition.c.
|
||||
- Unrolled byte loops (+=, |=, Horner): 43-69. Loads before the zero store: 73 (the zero store is DCE'd). Reusing a local for start/count: 21. Removing the zero store: 73. Count read first: 88.
|
||||
- buf indexing instead of `buf += 16`: 90-91. Partition-entry pointer: 69.
|
||||
- Helper boundaries (local for b0, u8/u32 parameter helper, two u16 halves, pointer to the field): 20-21.
|
||||
- Pragmas (diagnostic): iro 0/1: 37 (25 with pointer loop 2, best 23 over all 120 sum shapes). scheduling off: 77. IRO is not the lever here.
|
||||
96
tools/decomp-assist/opus-game.attempts.md
Normal file
96
tools/decomp-assist/opus-game.attempts.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# opus-game attempts (worktree sol-high, base origin/main 77cf3598)
|
||||
|
||||
Units: iplCardSequence, odh, tiInputForm, tiCandidateBox. Diff counts are odiff.py (differing / total).
|
||||
|
||||
## tiCandidateBox
|
||||
|
||||
### create (278/356, size 0x590 vs 0x580) -> EXACT 0/352
|
||||
Evidence: target addresses every pane-name string directly off the .data base
|
||||
(r30+0x6a8, +0x6b4, +0x6c0, ...). Ours CSE'd `scPaneNameTable` and
|
||||
`&scCandidatePaneData` into sub-bases (+0x28, +0x6b4). In the inlined
|
||||
UIButton::Create the target holds both name args in saved registers instead of
|
||||
rematerializing the address, which is how MWCC treats string-literal args.
|
||||
1. Pass scroll/window names directly, no paneNames locals: 268/353.
|
||||
2. Split scPaneNameTable into separate char arrays: 278/352 (equal size, sub-bases remain).
|
||||
3. Names as string literals (B_OffBtn ... P_prdc_scrl_Rght): literals emitted after the
|
||||
named globals, in the target's order; 287/354.
|
||||
4. Also W_predictWindow, N_predictInput, W_OnOff_Area, N_prdc_Texts and the
|
||||
"P_OffBtn" tail of scCandidatePaneData as literals: 0/352, .data bytes identical.
|
||||
symbols.txt: scCandidatePaneData size 0x68C -> 0x680; scPaneNameTable and the four
|
||||
named strings replaced by local literal labels at the same addresses. Total data
|
||||
unchanged; unit data 100%; DOL SHA1 unchanged.
|
||||
|
||||
### createAnmPane_ (64/216)
|
||||
mwdbg trace + regsim (127/127 reproduced). Named locals colored in reverse
|
||||
declaration order; `animationCount` cannot reach r31 by order (regsim 0/1).
|
||||
1. Loop bound `j < p.count` (count becomes a compiler temp -> r31): 86/216 but count now r31.
|
||||
2. Declare forceAddName, i at top; p, pane in loop; j in for: 41/216. All named locals match;
|
||||
left: animation-address temp r30 vs r23 and the hoisted constant temps shifted by one.
|
||||
3. `p.pAnims[j]` at each use instead of the reference: 149/220 (reloads). Reverted.
|
||||
4. forceAddName declared in the loop: 82/216. Reverted.
|
||||
5. Pointer to slot `const AnimationFile* const* animation = &p.pAnims[j]`: 41 (no change). Reverted.
|
||||
6. `animations = p.pAnims` hoisted, `animations[j]`: 86. Reverted.
|
||||
Retrace after step 2: named locals all match; the only mismatch is the unnamed
|
||||
animation-address temp (ours r30, target r23), numbered after the LICM constant temps.
|
||||
Declaration order cannot move it. Kept steps 1-2 (64 -> 41) in the create commit.
|
||||
|
||||
## tiInputForm (best: opus-game.best.tiInputForm.diff, apply with patch -p0)
|
||||
|
||||
### create (153/356)
|
||||
Register-blind diff showed one structural spot: target evaluates the
|
||||
`getLanguageTextPane() ? textBox : "T_2l_TextBox"` name before loading mpLayout.
|
||||
1. Name hoisted into a local before FindPaneByName: 153 (MWCC still loads mpLayout first).
|
||||
2. Use the existing `selectInputTextName(*this, mpLanguageData)` helper (moved above create):
|
||||
146/356, now register-only (register-blind diff identical). Unit still 219/221, data 100%.
|
||||
3. Drop `count` local (loop bound `button.count`): 179, count not hoisted here. Reverted.
|
||||
mwdbg + regsim on step 2: reproduces 138/138; best 7/10 wanted registers with named
|
||||
locals only and 7/10 even with temps. Structural: target puts LICM constants (li 0, lis
|
||||
vtable) in r20/r21/r31 between named locals. Not fixable by declaration order.
|
||||
|
||||
### calcCursorPos (43/326)
|
||||
FPR tie plus scheduling. scale.x/scale.y FPRs swapped (ours x=f31, target x=f30); the
|
||||
SRA'd fields are numbered by first use.
|
||||
1. GetHeight() instead of bottom-top: 43 (no change).
|
||||
2. Compute `right` before `lineBottom`: 41, scale FPRs match, but schedule order flips
|
||||
(target computes the height product first) and fuzzy drops 93.05 -> 93.03. Not kept.
|
||||
3. Named scaleX/scaleY locals: 235. Reverted.
|
||||
|
||||
## iplCardSequence (best: opus-game.best.iplCardSequence.diff, apply with patch -p0)
|
||||
|
||||
### loadCardFileIcons (436/512, 0x7f4 vs 0x800) -> best 406/512 (91.34% -> 93.34%)
|
||||
Register-blind structural diff lines 41 -> 28.
|
||||
1. `hasTlut = FALSE` initialized with the other counters before the speed loop: 419.
|
||||
2. No-icon branch: store unk_0x01 before `iconImageSize = 0`: 408.
|
||||
3. iconCount declared after the unk_0x02 store: 408 (struct 36).
|
||||
4. `goto closeFile` -> `return result` (target's `bge; b epilogue` pairs, result stays in r3): 406, struct 28.
|
||||
5. Tail `if (result < 0) return result;` instead of closeFile/closeFileSuccess labels: 406 (same, cleaner).
|
||||
Tried without gain: iconCount u32/int, icon u32, `iconOffset[icon + 1]` (worse),
|
||||
NONE-case spellings (array copy with [iconCount - 1], `(&...)[-1]`, `+ iconCount`, paletteSize after pointer).
|
||||
Evidence for the rest: the target never sets paletteSize on the switch default path (r6 is
|
||||
not initialized before the loop; default jumps straight to the iconCount < 7 test), so the
|
||||
original read a stale paletteSize for format 3. Dropping the default assignment gives 404
|
||||
and size 508, but that is an uninitialized read, so not kept. Remaining structure: NONE case
|
||||
pointer formed as sThread + (iconCount + slot/file offset + 0x10000 - 0x6fb4), and
|
||||
iconOffset[iconCount + 1] computed as ((iconCount + 1) << 2) without folding into +4.
|
||||
|
||||
### cardThreadMain (78/301)
|
||||
mwdbg + regsim: reproduces 109/109; 9/9 wanted only with @-temps interleaved, 7/9 with
|
||||
named locals only. One structural spot: the validity reply. Target copies command (mr r4, r19)
|
||||
then rlwimi from validState (r25); ours coalesces the reply with command and inserts the
|
||||
hoisted constant 1 (r29). PCode: `mr r72, r40; rlwimi r72, r71` with r71 the hoisted const;
|
||||
r40 -> r72 coalesced because command dies there.
|
||||
Tried: OR-expression reply (const-folds to ori 0x100: 261), mask-and-or (77), named
|
||||
OSMessage local (78), validState BOOL/u8 (79/78), helper param u8/BOOL, command u8 (78).
|
||||
|
||||
## odh
|
||||
|
||||
### LineConv11 (12/146)
|
||||
mwdbg + regsim: 77/77 reproduced; best 6/10 wanted (pixelSource r29, hi byte r8,
|
||||
pixel r25, RGBA8 pointer r30) -> structural register tie. Plus lfs f7 / lis 0x4330 order.
|
||||
Tried: split pointer add (15), &source[...] (12), operand order of the pointer sum (12),
|
||||
pixel assembled from [0] first (12).
|
||||
|
||||
### huffmanDecoder (171/306)
|
||||
Traced only. Target keeps sourceCursor in a volatile reg (r12) and bitOffset in r31; ours
|
||||
the reverse, from the decomp's reuse of bitIndex/tableIndex/bitCountAndMask for several
|
||||
values. Not attempted further this round.
|
||||
41
tools/decomp-assist/opus-mwdbg.attempts.md
Normal file
41
tools/decomp-assist/opus-mwdbg.attempts.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# opus-mwdbg: unblocking mwdbg for large C++ units, and regsim verdicts (base d9d33ca0)
|
||||
|
||||
These are tool changes only. No source file in this worktree was edited. The tool changes are in `_mwdbg` (see its README section "Emulator limits, sjiswrap, and the socket stub").
|
||||
|
||||
## Why mwdbg stopped (follow-up to opus-ties.attempts.md)
|
||||
|
||||
1. The 1 MB stack overflowed. The emulator now reads `RETROWIN32_MEMORY_MB` and `RETROWIN32_MIN_STACK_MB`, and mwdbg.py sets them to 1024 and 32 by default (`--memory-mb`, `--stack-mb`).
|
||||
2. `ws2_32!send` was missing. I added a builtin ws2_32 that logs every call to `<capture>/socket.log`. With that log, the message turned out to be `(10430) system does not support converting from 'SHIFT-JIS', treating as ASCII`. Afterwards the compiler longjmps through an empty jmp_buf (`WRITE_UNMAPPED @40495a`, esp 0).
|
||||
3. The cause of that message: mwdbg drops `wibo sjiswrap.exe` from the Ninja command, so the compiler read UTF-8 sources directly and could not convert them. retrowin32 now emulates sjiswrap when `RETROWIN32_SJISWRAP=1`, and mwdbg.py turns it on automatically when the Ninja command uses sjiswrap. The emulation re-encodes source files to Shift JIS, makes `GetACP` return 932, has `IsValidCodePage(932)` succeed, and decodes code pages 0 and 932 in MultiByteToWideChar.
|
||||
4. Then iplESMisc failed with `(10151) the file 'nw4r/lyt/textbox.h' cannot be opened`. The file on disk is `textBox.h`, and wibo matches paths case-insensitively. retrowin32 now falls back to a case-insensitive match when the exact path is missing.
|
||||
5. regsim reproduced the iplESMisc capture only 157/161. The capture needed a second pass with a spill candidate, and regsim picked the spill node by maximum degree. MWCC picks by minimum `cost/degree`, with ties going to the later node in scan order. After fixing that, the capture reproduces 161/161, and `examples/pressure` goes from 108/126 to 126/126. None of the other 76 stored runs changed.
|
||||
|
||||
## Validation (data-d4, build/43U objects rebuilt before comparing)
|
||||
|
||||
| capture | regsim | unit.o vs ninja object |
|
||||
|---|---|---|
|
||||
| kbd_lib / kbdProcMod | 156/156 | identical (sha256 6a85c207…) |
|
||||
| iplESMisc / DeleteUnauthorizedData__Q33ipl7utility6ESMiscFPQ23EGG4Heap | 161/161 (2 GPR passes) | identical (8a31efdb…) |
|
||||
| tiZiString / update__Q39textinput8tistring6WithZiFv | 161/161 | identical (da68c526…) |
|
||||
| www_wiisetting / Getter___Q23www10wiisettingFP14WWWJSPluginObjPCcP16WWWJSPluginValue | 312/312 | identical (ff8f136d…) |
|
||||
|
||||
## Verdicts
|
||||
|
||||
Method: `_mwdbg/scratch_opusmwdbg/vmap2.py` builds the want-list. It aligns the scheduled PCode with our object using difflib, because opus-ties.vmap.py's index alignment drifted and left 210 operand mismatches on tiZiString. Each want is keyed by virtual number, since names such as `candidate`, `output` and `i` repeat. A virtual is kept when at least 75% of its uses agree on one target register. `_mwdbg/scratch_opusmwdbg/regsim_locals.py` then anneals over the numbering of real source locals only, leaving `@` temps, parameters and unnamed values in place. For www_wiisetting I enumerated every ordering of its 8 locals instead.
|
||||
|
||||
| function | wants | as built | best with source locals reordered | best with `@` values reordered too | verdict |
|
||||
|---|---|---|---|---|---|
|
||||
| DeleteUnauthorizedData | 64 | 54 | 60 | 64 | structural |
|
||||
| WithZi::update | 98 | 83 | 92 | 98 | structural (callee-saved part fixable by order) |
|
||||
| wiisetting::Getter_ | 159 | 156 | 156 (exhaustive, 8! orders) | not needed | structural |
|
||||
|
||||
- **DeleteUnauthorizedData** is `return InitSavedata(heap);`. Every mismatched value is a local of an inlined function, which is why they all have `@` names.
|
||||
- InitSavedata: v33 `titleIds`, v34 `ret`, v35 `ticketScratch`, v36 `i`.
|
||||
- verifySavedataZD: v37/38 `titleId` parameter (hi/lo), v39/40 `block`, v41 `valid`, v42 `j`, v43 `offset`, v44 `deleteSaveData`, v45 `fileOpen`, v46 `saveData`, v47 `ret`.
|
||||
- DeleteTicketsForce: v49/50 `titleId`, v51 `j`, v52 `ret`, v53 `ticketViewList`.
|
||||
|
||||
Reordering locals inside each inlinee reaches 60/64. That search was exhaustive over InitSavedata × DeleteTicketsForce and annealed over verifySavedataZD. The four misses are `titleId` v37/v38 (wants r19/r20) against `saveData`/`deleteSaveData` (want r30/r31). Reaching 64/64 requires numbering the inlined `titleId` parameter after verifySavedataZD's locals, and declaration order can't do that. A possible lever, still untested: copy `titleId` into a local in verifySavedataZD that is declared last, or change how titleId is passed.
|
||||
- **WithZi::update**: reordering locals fixes the 9 callee-saved mismatches (index, destination, source, length v44, count, elementCount, v64, v70, v175). The order regsim found, lowest number first: index, character, length(v37), position, keyIndex, source, copied, wordLength, elementCount, count, candidate(v34), output(v38), candidate(v47), length(v44), destination, candidateOutput, output(v49), output(v36). It is untested and may conflict with nested scopes.
|
||||
|
||||
Six volatile-register misses remain: copied r4→r5, wordLength r7→r4, @1343 r6→r7, @1338 r5→r4, @1330 r5→r6, v148 r5→r4. @1343/@1341, @1338/@1336 and @1349 are the induction pointers of the 8-way unrolled copy loop, and @1330 is `length-8`. All of these are optimizer temps. They reach 98/98 only when the temps are renumbered, so this is structural, and it needs a loop shape that makes the unroller create its temps in a different order.
|
||||
- **wiisetting::Getter_**: no ordering of the 8 locals (str, val, i ×3, kbLang, staIdx, retVal) improves on 156/159. The misses are `i`(v35) r25→r31, `i`(v38) r25→r26 and temp `@17419`(v42) r26→r25. This confirms opus-ties' result that swapping `strBuf`/`i` changes nothing, so the function is structural.
|
||||
37
tools/decomp-assist/opus-sdcs.attempts.md
Normal file
37
tools/decomp-assist/opus-sdcs.attempts.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# opus-sdcs: iplSDChannelSelect collectTitles* (2026-10-08)
|
||||
|
||||
Start: ByUsage 4/101, FromNandUsage 4/102, ByChannelOrder 7/126, BySpecialChannels 16/361.
|
||||
|
||||
Shared diff: `lwz secondUsage[0]` scheduled above `stw ++*titleCount` in ours, after it in target.
|
||||
- `*titleCount += 1`, `(*titleCount)++`, `titleCount[0]++`, `= *titleCount + 1`: no change (4).
|
||||
- `!(a < b || c < d)`, nested ifs: no change. static inline usage predicate: 40 diffs.
|
||||
- function-scoped IRO 0 / IRO 1: no change.
|
||||
- casts `(s32*)secondUsage`, `const_cast`, `(s32*)(u32)`, local non-const copy (also under IRO 0): no change.
|
||||
- mwdbg on a standalone repro: the load is hoisted before regalloc; loads through a pointer-to-const
|
||||
PARAMETER are treated as unaffected by any store (casts do not remove it). Only a non-const
|
||||
`s32*` parameter keeps source order: repro then matched the target byte for byte.
|
||||
- The `PClPClPUxPcPUl` mangling was decomp-assigned (symbols.txt names were invented), so the
|
||||
params become `s32*` and the 5 symbols are renamed to `FPlPlPUxPcPUl`.
|
||||
=> ByUsage 0, FromNandUsage 0, BySpecialChannels 0, ByChannelOrder 3.
|
||||
|
||||
ByChannelOrder residual: `mulli r0/add r3,r17,r3` vs target `mulli r4/add r0,r17,r3`.
|
||||
- if/else vs ternary, `getChannel`, `hasLoadedBnr`, row pointer, ref/ptr locals, idx/manager locals
|
||||
in either order, inverted branch: 3-8 diffs.
|
||||
- regsim: declaration order cannot reach (0/2), IRO temps @162/@164 for mgr/sum get low vreg numbers.
|
||||
- inline Manager member with getTitleID's body (`getEntryTitleID(page, channelOrder[order])`): exact.
|
||||
|
||||
Result: 129/129 exact, gate PASS.
|
||||
|
||||
## Link (configure.py -> Matching)
|
||||
First link: DOL SHA1 798af348..., .data 0x20 short and two swapped calls.
|
||||
- objdiff missed that `draw` calls `ipl::math::VEC3(f,f,f)` and `getChannelPanePosition` calls
|
||||
`nw4r::math::VEC3(f,f,f)`, because the two weak bodies are identical. Fixed the local in draw
|
||||
and made getChannelPanePosition return `nw4r::math::VEC3` (NRVO builds it in the return slot,
|
||||
and callers only read .x/.y).
|
||||
- Target .data has 0x20 zero bytes (deduped weak vtables) before the anonymous handler vtables.
|
||||
iplChannelSelect emits `HermiteIntp<VEC3>` and `Interporation<VEC3>` weak vtables at the same
|
||||
spot. Dropped the SD-only full `HermiteIntp<VEC3>` specialization in iplInterporation.h so the
|
||||
generic template (with the SD `get()` already there) is used: .data 0xab0, as in the target.
|
||||
- Removing the unreferenced handleDeleteComplete/handleStorageCheckComplete: no DOL change (they
|
||||
get dead-stripped), so I reverted it.
|
||||
Result: DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d, gate PASS, linked code 33828.
|
||||
31
tools/decomp-assist/opus-ties.attempts.md
Normal file
31
tools/decomp-assist/opus-ties.attempts.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# opus-ties: one-function-from-linking triage (base f9ebd2f4)
|
||||
|
||||
Full build at base: DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. Diff counts are from `odiff.py` (differing / total).
|
||||
Result: no new exact function, and no source changes kept.
|
||||
|
||||
| unit | function | diff | class | regsim verdict | result |
|
||||
|---|---|---|---|---|---|
|
||||
| src/utility/iplESMisc | DeleteUnauthorizedData | 74/449 | GPR register-only | n.a. (trace blocked, see below) | unchanged |
|
||||
| src/iplwww/www_wiisetting | Getter_ | 14/609 | GPR register-only (two named loop counters: `i`/`strBuf` in DUMMY_SECURITY_KEY, `i` in EUR 0x3b loop -> r31) | n.a. (trace blocked) | swapping `strBuf`/`i` declarations: no change (14) |
|
||||
| src/keyboard/tiZiString | WithZi::update | 85/446 | GPR register-only plus 2 dependent swaps (163/164, 291/292) | n.a. (trace blocked) | unchanged |
|
||||
| libs/RVL_SDK/src/nup/nup | __nupParseServerInfo | 66/452 | GPR register-only | structural: every named local already matches; all mismatches are @-temps of the inlined `__nupFindTag`/`strlen` (@1858,@1852,@1849,@1807,@1805,@1804,@1798,@1795 + unnamed r114/r120/r128/r134/r140/r150/r158/r166/r170). Best 7/8 needs @-temps interleaved with named locals | swapping `start`/`end` in `__nupFindTag`: no change (66) |
|
||||
| libs/NW4R/src/lyt/lyt_window | Window::DrawFrame | 119/376 | GPR + FPR register | structural: unnamed temp v92 (`lis/addi` table base, wants r21 instead of r31) shifts this/basePt/frameSize/alpha/bUseVtxCol and v95..v124 up by one; regsim best 4/11; FPR diffs also | unchanged |
|
||||
| src/scene/memoryCard/iplMemoryCardManager | _create_icon | 37/100 | scheduling + register (same count) | n.a. | target recomputes `&mFileCell[slot][file].icon` / `.iconTlut` adds after each GX call (keeps row base and index*0x15c in separate registers); ours CSEs the full address. `texObj` local assigned before GXLoadTexObj: 61/101 (worse) |
|
||||
| src/keyboard/tiString | Decolated::inputChar | 73/136 (0x1f8 vs 0x220) | instruction count | n.a. | first diff: mode-3 (`CharacterOutput`) path; target keeps a runtime index (`sthx` at count*2, dead `cmplwi ch,10`, `clrlwi` count), ours folds to constant stores. Not attempted again (see tiString.attempts.md) |
|
||||
| libs/RevoEX/src/nhttp/NHTTP_recvbuf | NHTTPi_compareTokenN_HdrRecvBuf | 5/124 | scheduling only (same registers) | n.a. | loop-preheader order: target `li 0x41, li 0x5a, extsb delim, addi limit-1, li 0`, ours `extsb, addi, li 0x41, li 0, li 0x5a`. Tried: for(;;)+break 63, swap LowerCase operands 40, `<= 'Z'` first 34, constants on the left 5, if/return form 40, `inline` 5, macro 5, s8 param 5 |
|
||||
| libs/RVLMiddleware/TMC_JPEG/.../Texture_MCUtoY8U8V8 | TMCJPEGDEC_set_converterY8U8V8 | 195/196 (0x30c vs 0x310) | instruction count | n.a. | target materializes `work->convBuf` (`addi r4,r3,0x1858`) at entry and adds row offsets to it; ours folds into each offset. Already covered by tex1/g5/fz15; IRO and pragma sweep (irosweep --all): no hit |
|
||||
| libs/RVLMiddleware/TMC_JPEG/.../Texture_MCUtoRGB565 | TMCJPEGDEC_set_converterRGB565 | 169/170 (0x2a4 vs 0x2a8) | instruction count | n.a. | same as Y8U8V8 (convBuf base kept at entry); irosweep --all: no hit |
|
||||
| libs/RVL_SDK/src/fa/pdm_partition | pdm_part_is_master_boot_sector | 84/86 (0x158 vs 0x150) | scheduling + register pressure (extra saved r29 -> frame 0x40) | n.a. | byte loads of `read_partition_u32` scheduled differently, so one more live value; perm8/perm8d already tried 4950 permutations. irosweep --all: no hit |
|
||||
|
||||
## mwdbg on the three blocked units
|
||||
|
||||
`mwdbg.py` fails before reaching the function for iplESMisc, tiZiString and www_wiisetting (also with the stock tool):
|
||||
|
||||
1. Stock retrowin32: `WRITE_UNMAPPED @47e090` / `READ_UNMAPPED @46da46` with esp near 0xf18. The emulated compiler overflows its 1 MB stack (the PE's SizeOfStackReserve is 0x100000).
|
||||
2. A private copy (`/tmp/ot/rw32`) with the stack raised to 32 MB and memory to 1 GB (`win32/src/pe/loader.rs` stack_size max(32<<20); `machine_unicorn.rs` MemImpl::new(1024<<20)) gets further. The compiler then calls its `UCBReportMessage` callback, which goes through `ws2_32!send` (ordinal 19, the call at 0x42c8b1), and retrowin32 has no ws2_32 shim.
|
||||
3. The message is not the iplTree.h "return value expected" warning. Adding `-w off`, or an include override that fixes the warning, compiles silently under wibo but still hits `send` under the emulator.
|
||||
|
||||
The shared `_mwdbg` tool was not modified. To unblock these units, the next step is either a ws2_32 `send` shim that writes to stderr (to read the message) or a fix for whatever emulator difference triggers it.
|
||||
|
||||
nup and lyt_window traced fine; regsim reproduced 162/162 and 197/197.
|
||||
`tools/decomp-assist/opus-ties.vmap.py <capdir> <unit> <symbol>` maps each traced virtual register to our physical register and the target's, by aligning backend-04 with after-color PCode and the two objects. That gives the `--want` list.
|
||||
86
tools/decomp-assist/opus-ties.vmap.py
Normal file
86
tools/decomp-assist/opus-ties.vmap.py
Normal file
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env python3
|
||||
"""vmap.py <capdir> <unit> <symbol> [--project DIR]: map each GPR virtual to (our phys, target phys)."""
|
||||
import json, re, sys, collections
|
||||
sys.path.insert(0, '/home/cole/projects/tests')
|
||||
from capstone import Cs, CS_ARCH_PPC, CS_MODE_32, CS_MODE_BIG_ENDIAN
|
||||
from elftools.elf.elffile import ELFFile
|
||||
cap, unit, sym = sys.argv[1:4]
|
||||
proj = '/mnt/drive2/projects/wii-ipl-workers/data-d4'
|
||||
if '--project' in sys.argv: proj = sys.argv[sys.argv.index('--project') + 1]
|
||||
|
||||
def fn_insns(path):
|
||||
with open(path, 'rb') as f:
|
||||
e = ELFFile(f)
|
||||
st = e.get_section_by_name('.symtab')
|
||||
s = [x for x in st.iter_symbols() if x.name == sym][0]
|
||||
sec = e.get_section(s['st_shndx'])
|
||||
data = sec.data()[s['st_value']:s['st_value'] + s['st_size']]
|
||||
md = Cs(CS_ARCH_PPC, CS_MODE_32 + CS_MODE_BIG_ENDIAN)
|
||||
out = []
|
||||
for i in range(0, len(data), 4):
|
||||
l = list(md.disasm(data[i:i+4], i))
|
||||
out.append((l[0].mnemonic, re.findall(r'\br(\d+)\b', l[0].op_str)) if l else ('?', []))
|
||||
return out
|
||||
|
||||
ours = fn_insns(f'{proj}/build/43U/src/{unit}.o')
|
||||
targ = fn_insns(f'{proj}/build/43U/obj/{unit}.o')
|
||||
assert len(ours) == len(targ), (len(ours), len(targ))
|
||||
|
||||
def gprs(ins):
|
||||
return [o['reg'] for o in ins['operands'] if o.get('kind') == 0 and o.get('reg_class') == 4]
|
||||
|
||||
bc = json.load(open(f'{cap}/regalloc-gpr-pass-1-before-color.json'))
|
||||
ac = json.load(open(f'{cap}/regalloc-gpr-pass-1-after-color.json'))
|
||||
# use last successful pass if present
|
||||
import glob
|
||||
passes = sorted(glob.glob(f'{cap}/regalloc-gpr-pass-*-before-color.json'))
|
||||
bc = json.load(open(passes[-1])); ac = json.load(open(passes[-1].replace('before', 'after')))
|
||||
b4 = json.load(open(f'{cap}/backend-04-after-scheduling.json'))
|
||||
names = {}
|
||||
for line in open(passes[-1].replace('before-color.json', 'all.txt')):
|
||||
m = re.match(r'r(\d+) -> r(\d+) (\S*)', line)
|
||||
if m: names[int(m.group(1))] = m.group(3)
|
||||
# per block: list of (key, virtual regs) from after-color/before-color
|
||||
blk = {}
|
||||
for B, A in zip(bc, ac):
|
||||
lst = []
|
||||
for ib, ia in zip(B['instructions'], A['instructions']):
|
||||
lst.append([ia['mnemonic'], gprs(ia), gprs(ib), False])
|
||||
blk[A['index']] = lst
|
||||
seq = [] # final instruction order: list of virtual-reg lists (or None)
|
||||
for B in b4:
|
||||
pool = blk.get(B['index'], [])
|
||||
for ins in B['instructions']:
|
||||
key = (ins['mnemonic'], gprs(ins))
|
||||
hit = None
|
||||
for c in pool:
|
||||
if not c[3] and c[0] == key[0] and c[1] == key[1]:
|
||||
hit = c; break
|
||||
if hit:
|
||||
hit[3] = True; seq.append((ins['mnemonic'], hit[2], key[1]))
|
||||
else:
|
||||
seq.append((ins['mnemonic'], None, key[1]))
|
||||
# align seq with ours by mnemonic order
|
||||
res = collections.defaultdict(lambda: collections.Counter())
|
||||
ourp = {}
|
||||
j = 0
|
||||
mis = 0
|
||||
for mn, virt, phys in seq:
|
||||
if j >= len(ours): break
|
||||
# skip pcode pseudo instructions that don't emit
|
||||
if virt is None and mn.lower() not in [o[0].rstrip('.') for o in ours[j:j+1]]:
|
||||
pass
|
||||
o = ours[j]; t = targ[j]; j += 1
|
||||
if virt is None: continue
|
||||
# register operands only compare if counts match
|
||||
if [int(x) for x in o[1]] != phys[:len(o[1])] and [int(x) for x in o[1]] != phys:
|
||||
mis += 1; continue
|
||||
for k, v in enumerate(virt[:len(o[1])]):
|
||||
if v >= 32 and k < len(t[1]):
|
||||
res[v][int(t[1][k])] += 1
|
||||
ourp[v] = int(o[1][k])
|
||||
print(f'# aligned {len(seq)} pcode vs {len(ours)} insns, operand mismatches {mis}')
|
||||
for v in sorted(res):
|
||||
tgt = res[v].most_common()
|
||||
flag = '' if len(tgt) == 1 and tgt[0][0] == ourp[v] else ' *'
|
||||
print(f'r{v} {names.get(v, "?")} ours=r{ourp[v]} target={",".join(f"r{r}x{c}" for r, c in tgt)}{flag}')
|
||||
28
tools/decomp-assist/opus-vf.attempts.md
Normal file
28
tools/decomp-assist/opus-vf.attempts.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# opus-vf attempts (lead: yannicksuter/mscharged-decomp)
|
||||
|
||||
Refs saved to /mnt/drive2/projects/wii-ipl-workers/_refs/prior/yannicksuter_mscharged-decomp__{sd_drv.c,sd_drv.h,pdm_partition.c,pdm_partition.h,lyt_window.cpp}.
|
||||
|
||||
## libs/NW4R/src/lyt/lyt_window (20/21, DrawFrame 119/376 differing, Equivalent)
|
||||
1. Ported their HBM DrawFrame shape: LT quad expanded with GetTexutreFlipInfo(NONE) + inline SetFrameTexOrigin/SetFrameTexExtent (kept our GetTextureNum early-out). DrawFrame 0/376; all 21 functions exact, no mw_version change needed.
|
||||
2. Flipped to Matching: DOL wrong. .data order flipInfos/scLytFatalMsg swapped -> moved scLytFatalMsg definition below the anonymous namespace (extern decl at top). Order fixed.
|
||||
3. DOL still off by 4 bytes: Get/SetVtxColorElement inlines (lyt/common.h) used the local NW4R_ASSERT redefinition (scLytFatalMsg) instead of the header's own weak @STRING@ literal. Moved the lyt includes above the macro redefinition. DOL 26116613... OK.
|
||||
|
||||
## libs/RVL_SDK/src/fa/driver/sd_drv (23/26)
|
||||
- Their src/RVL_SDK/vf/sd_drv.c is a 5-line stub (VFi_InitSDWrok only). No prior art for pfd_sddrv_init/finalize/build_fat32_mbr_bpb.
|
||||
- mw_version="GC/3.0a5": object byte-identical to 3.0a5.2 (md5 ccd9f660...). No change. Not pursued further (no lead).
|
||||
|
||||
## libs/RVL_SDK/src/fa/pdm_partition (19/20, pdm_part_is_master_boot_sector 84/86)
|
||||
- Their pdm_partition.c is the newer VF version (VFipdm_mbr_get_mbr_part_table); no pdm_part_is_master_boot_sector. Dead lead.
|
||||
- mw_version="GC/3.0a5": object byte-identical (md5 a1dd0b38...). No change.
|
||||
- Hand attempts on the function:
|
||||
1. read_partition_u32 = b0 + b1<<8 + b2<<16 + b3<<24 (plain sum): 25/84 (size now right).
|
||||
2. loop 2 pointer order swapped: 25. `*p_count + *p_start`: 23. p_count++ first: 27. for-header increments: 25.
|
||||
3. loop 2 as start[index] + count[index]: 21/84 (best).
|
||||
4. sum trees ((b2<<16)+b0)+((b3<<24)+(b1<<8)): 84/86; reversed sum: 85/86; casts / unsigned int / no casts / b0+b2+b1+b3: 21; OR form: 78-82.
|
||||
5. pointer p=buf+offset, MBR_WORD macro, buf+4 for count, &buf[454]: all 21. Accumulating local: 43.
|
||||
6. store count before start: 88. int index: 28. all 120 local declaration orders: best 21.
|
||||
7. loop 1 with arrays: 24. inverted if/else: 60.
|
||||
Remaining: 21 instructions in the inlined byte-assembly schedule (target loads b3,b2,b0 then b1; ours b3,b2,b1,b0). Best copy: tools/decomp-assist/opus-vf.best.pdm_partition.c.
|
||||
|
||||
## Step 3
|
||||
All other fa/ (RVLSDKLib "fa") and vf/ Objects are Matching; nothing else to try.
|
||||
307
tools/decomp-assist/opus-vf.best.pdm_partition.c
Normal file
307
tools/decomp-assist/opus-vf.best.pdm_partition.c
Normal file
@@ -0,0 +1,307 @@
|
||||
#include <private/fa/pdm.h>
|
||||
#include <revolution/types.h>
|
||||
#define MBR_WORD(buf, offset) \
|
||||
((pf_u32)(buf)[offset] + ((pf_u32)(buf)[(offset) + 1] << 8) + \
|
||||
((pf_u32)(buf)[(offset) + 2] << 16) + ((pf_u32)(buf)[(offset) + 3] << 24))
|
||||
static inline pf_u16 read_boot_u16(pf_u8* buf, pf_u32 offset) {
|
||||
if ((pf_u32)&buf[offset] & 1) { return (buf[offset + 1] << 8) | buf[offset]; }
|
||||
return PF_SWAP_16(*(pf_u16*)&buf[(offset + 1) & ~1]);
|
||||
}
|
||||
|
||||
static inline pf_u32 read_partition_u32(const pf_u8* buf, pf_u32 offset) {
|
||||
return buf[offset] + ((pf_u32)buf[offset + 1] << 8) + ((pf_u32)buf[offset + 2] << 16) + ((pf_u32)buf[offset + 3] << 24);
|
||||
}
|
||||
|
||||
pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mbr) {
|
||||
pf_u32* p_start;
|
||||
pf_u32* p_count;
|
||||
pf_s16 index;
|
||||
pf_u32 start[4];
|
||||
pf_u32 count[4];
|
||||
*p_is_mbr = 0;
|
||||
if (buf[510] != 0x55 || buf[511] != 0xAA) { return 2; }
|
||||
p_start = start;
|
||||
p_count = count;
|
||||
for (index = 0; index < 4; index++) {
|
||||
*p_start = 0;
|
||||
*p_start = read_partition_u32(buf, 454);
|
||||
*p_count = read_partition_u32(buf, 458);
|
||||
if (*p_start != 0 && *p_count != 0) {
|
||||
if (index == 0) { *p_is_mbr = 1; }
|
||||
} else {
|
||||
if (index == 0) { return 2; }
|
||||
}
|
||||
p_start++;
|
||||
p_count++;
|
||||
buf += 16;
|
||||
}
|
||||
for (index = 0; index < 4; index++) {
|
||||
if (start[index] + count[index] > total) {
|
||||
if (index == 0) { *p_is_mbr = 0; }
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
pf_bool pdm_part_is_boot_sector(pf_u8* buf) {
|
||||
pf_u16 byte_per_sector;
|
||||
pf_u16 sector_per_cluster;
|
||||
pf_u8 media;
|
||||
pf_bool is_boot;
|
||||
|
||||
is_boot = PF_TRUE;
|
||||
if ((buf[0x00] != 0xEB || buf[0x2] != 0x90) && buf[0x0] != 0xE9) {
|
||||
is_boot = PF_FALSE;
|
||||
}
|
||||
if (buf[0x1FE] != 0x55 || buf[0x1FF] != 0xAA) {
|
||||
is_boot = PF_FALSE;
|
||||
}
|
||||
byte_per_sector = read_boot_u16(buf, 0xB);
|
||||
if (byte_per_sector != 0x200 && byte_per_sector != 0x400 && byte_per_sector != 0x800 && byte_per_sector != 0x1000) {
|
||||
is_boot = PF_FALSE;
|
||||
}
|
||||
sector_per_cluster = buf[0xD];
|
||||
if (sector_per_cluster != 1 && sector_per_cluster != 2 && sector_per_cluster != 4 && sector_per_cluster != 8 && sector_per_cluster != 0x10 &&
|
||||
sector_per_cluster != 0x20 && sector_per_cluster != 0x40 && sector_per_cluster != 0x80) {
|
||||
is_boot = PF_FALSE;
|
||||
}
|
||||
media = buf[0x15];
|
||||
if (media != 0xF0 && media != 0xF8 && media != 0xF9 && media != 0xFA && media != 0xFB && media != 0xFC && media != 0xFD && media != 0xFE &&
|
||||
media != 0xFF) {
|
||||
is_boot = PF_FALSE;
|
||||
}
|
||||
return is_boot;
|
||||
}
|
||||
|
||||
static inline pf_u32 read_relative_start_sector(pf_u32 base, const pf_u8* buf, pf_u32 offset) {
|
||||
return base + (buf[offset] + ((unsigned int)buf[offset + 1] << 8) +
|
||||
((unsigned int)buf[offset + 2] << 16) + ((unsigned int)buf[offset + 3] << 24));
|
||||
}
|
||||
|
||||
pf_s32 pdm_part_get_start_sector(PDM_PARTITION* p_part) {
|
||||
pf_u32 requested = p_part->part_id;
|
||||
pf_u32 start[4];
|
||||
pf_u32 count[4];
|
||||
pf_u32 part_index = 0;
|
||||
pf_u32 sector;
|
||||
pf_u32 base;
|
||||
pf_u16 index;
|
||||
pf_u16 extended_index;
|
||||
pf_u32 length;
|
||||
pf_bool is_mbr;
|
||||
pf_u32 success;
|
||||
pf_s32 err;
|
||||
pf_u8 buf[512] __attribute__((aligned(32)));
|
||||
p_part->start_sector = 0;
|
||||
p_part->total_sector = p_part->p_disk->disk_info.total_sectors;
|
||||
err = pdm_disk_physical_read(p_part->p_disk, buf, 0, 1, 512, &success);
|
||||
if (err != 0) { return err; }
|
||||
pdm_part_is_master_boot_sector(buf, p_part->p_disk->disk_info.total_sectors, &is_mbr);
|
||||
if (is_mbr) {
|
||||
start[0] = MBR_WORD(buf, 454);
|
||||
start[1] = MBR_WORD(buf, 470);
|
||||
start[2] = MBR_WORD(buf, 486);
|
||||
start[3] = MBR_WORD(buf, 502);
|
||||
count[0] = MBR_WORD(buf, 458);
|
||||
count[1] = MBR_WORD(buf, 474);
|
||||
count[2] = MBR_WORD(buf, 490);
|
||||
count[3] = MBR_WORD(buf, 506);
|
||||
part_index = 0;
|
||||
for (index = 0; index < 4; index++) {
|
||||
sector = start[index];
|
||||
length = count[index];
|
||||
if (sector == 0 || length == 0) { return 7; }
|
||||
err = pdm_disk_physical_read(p_part->p_disk, buf, sector, 1, 512, &success);
|
||||
if (err != 0) { return err; }
|
||||
pdm_part_is_master_boot_sector(buf, p_part->p_disk->disk_info.total_sectors, &is_mbr);
|
||||
if (is_mbr) {
|
||||
base = start[index];
|
||||
sector = base;
|
||||
for (extended_index = 0; extended_index < 2; extended_index++) {
|
||||
if (extended_index == 0) {
|
||||
sector = read_relative_start_sector(sector, buf, 454);
|
||||
length = MBR_WORD(buf, 458);
|
||||
err = pdm_disk_physical_read(p_part->p_disk, buf, sector, 1, 512, &success);
|
||||
if (err != 0) { return err; }
|
||||
if (requested == part_index) { p_part->start_sector = sector; p_part->total_sector = length; return 0; }
|
||||
part_index++;
|
||||
} else {
|
||||
sector = read_relative_start_sector(base, buf, 470);
|
||||
length = MBR_WORD(buf, 474);
|
||||
if (sector == 0 || length == 0) { break; }
|
||||
err = pdm_disk_physical_read(p_part->p_disk, buf, sector, 1, 512, &success);
|
||||
if (err != 0) { return err; }
|
||||
pdm_part_is_master_boot_sector(buf, p_part->p_disk->disk_info.total_sectors, &is_mbr);
|
||||
if (!is_mbr) { break; }
|
||||
extended_index = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (requested == part_index) { p_part->start_sector = sector; p_part->total_sector = length; break; }
|
||||
part_index++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (requested >= 2) { return 7; }
|
||||
p_part->start_sector = part_index;
|
||||
p_part->total_sector = p_part->p_disk->disk_info.total_sectors;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static inline pf_u32 partition_physical_sector(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) {
|
||||
pf_u16 media_bps;
|
||||
pf_u32 ratio;
|
||||
pf_u32 start;
|
||||
pdm_disk_get_media_bps(p_part->p_disk, &media_bps);
|
||||
if (bps == media_bps) { return sector + p_part->start_sector; }
|
||||
start = p_part->start_sector;
|
||||
ratio = media_bps >> 9;
|
||||
if (ratio == 2) { start <<= 1; }
|
||||
else if (ratio == 4) { start <<= 2; }
|
||||
else if (ratio == 8) { start <<= 3; }
|
||||
ratio = (pf_u16)bps >> 9;
|
||||
if (ratio == 2) { start >>= 1; }
|
||||
else if (ratio == 4) { start >>= 2; }
|
||||
else if (ratio == 8) { start >>= 3; }
|
||||
return sector + start;
|
||||
}
|
||||
pf_u32 pdm_part_chg_ltop(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) NO_INLINE {
|
||||
return partition_physical_sector(p_part, sector, bps);
|
||||
}
|
||||
pf_s32 pdm_part_get_partition(PDM_DISK* p_disk, pf_u32 id, PDM_PARTITION** pp_part) {
|
||||
pf_s32 err;
|
||||
pf_u16 index;
|
||||
*pp_part = PF_NULL;
|
||||
if (pdm_disk_set.num_partition >= PDM_DRIVE_COUNT) { return 10; }
|
||||
for (index = 0; index < PDM_DRIVE_COUNT; index++) {
|
||||
if (!(pdm_disk_set.partition[index].status & 1)) { break; }
|
||||
}
|
||||
if (index == PDM_DRIVE_COUNT) { return 10; }
|
||||
err = pdm_disk_set_disk(p_disk, &pdm_disk_set.partition[index]);
|
||||
if (err != 0) { return err; }
|
||||
pdm_disk_set.num_partition++;
|
||||
pdm_disk_set.partition[index].status |= 1;
|
||||
pdm_disk_set.partition[index].p_disk = p_disk;
|
||||
pdm_disk_set.partition[index].part_id = id;
|
||||
*pp_part = &pdm_disk_set.partition[index];
|
||||
return 0;
|
||||
}
|
||||
pf_s32 pdm_part_release_partition(PDM_PARTITION* p_part) {
|
||||
p_part->status &= ~1;
|
||||
pdm_disk_set.num_partition--;
|
||||
return 0;
|
||||
}
|
||||
pf_bool pdm_part_is_attached_partition(PDM_PARTITION* p_part) { return (p_part->status >> 2) & 1; }
|
||||
void pdm_part_set_driver_error_code(PDM_PARTITION* p_part, pf_s32 err) { p_part->driver_last_error = err; }
|
||||
pf_s32 pdm_part_get_driver_error_code(PDM_PARTITION* p_part) { return p_part->driver_last_error; }
|
||||
pf_s32 pdm_part_get_media_attribute(PDM_PARTITION* p_part, PDM_DISK_INFO* p_info) {
|
||||
pf_s32 err = pdm_disk_get_media_attribute(p_part->p_disk, p_info);
|
||||
if (err != 0) { return err; }
|
||||
return 0;
|
||||
}
|
||||
pf_s32 pdm_part_init(PDM_PARTITION* p_part) {
|
||||
pf_s32 err;
|
||||
if (!(p_part->status & 4)) {
|
||||
err = pdm_disk_set_disk(p_part->p_disk, p_part);
|
||||
if (err != 0) { return err; }
|
||||
err = pdm_disk_init(p_part->p_disk);
|
||||
if (err != 0) { return err; }
|
||||
} else { return 11; }
|
||||
p_part->status |= 4;
|
||||
return 0;
|
||||
}
|
||||
pf_s32 pdm_part_mount(PDM_PARTITION* p_part) {
|
||||
pf_s32 err;
|
||||
if (!(p_part->status & 8)) {
|
||||
err = pdm_disk_set_disk(p_part->p_disk, p_part);
|
||||
if (err != 0) { return err; }
|
||||
err = pdm_disk_mount(p_part->p_disk);
|
||||
if (err != 0) { return err; }
|
||||
err = pdm_part_get_start_sector(p_part);
|
||||
if (err != 0) { pdm_disk_unmount(p_part->p_disk, 0); return err; }
|
||||
} else { return 12; }
|
||||
p_part->status &= ~2;
|
||||
p_part->status |= 8;
|
||||
return 0;
|
||||
}
|
||||
pf_s32 pdm_part_format(PDM_PARTITION* p_part, const pf_u8* param) {
|
||||
pf_s32 err;
|
||||
err = pdm_disk_set_disk(p_part->p_disk, p_part);
|
||||
if (err != 0) { return err; }
|
||||
err = pdm_disk_format(p_part->p_disk, param);
|
||||
if (err != 0) { return err; }
|
||||
return 0;
|
||||
}
|
||||
pf_s32 pdm_part_logical_read(PDM_PARTITION* p_part, pf_u8* buf, pf_u32 sector, pf_u32 count, pf_u32 bps, pf_u32* p_success) {
|
||||
pf_s32 err;
|
||||
pf_u32 physical_sector;
|
||||
if ((p_part->status & 8) != 8 || (p_part->status & 2) == 2) { return 15; }
|
||||
err = pdm_disk_set_disk(p_part->p_disk, p_part);
|
||||
if (err != 0) { return err; }
|
||||
if (p_part->total_sector <= sector) { return 18; }
|
||||
if (p_part->total_sector < sector + count) { count -= (sector + count) - p_part->total_sector; }
|
||||
physical_sector = pdm_part_chg_ltop(p_part, sector, bps);
|
||||
err = pdm_disk_physical_read(p_part->p_disk, buf, physical_sector, count, bps, p_success);
|
||||
if (err != 0) { return err; }
|
||||
return 0;
|
||||
}
|
||||
pf_s32 pdm_part_logical_write(PDM_PARTITION* p_part, const pf_u8* buf, pf_u32 sector, pf_u32 count, pf_u32 bps, pf_u32* p_success) {
|
||||
pf_s32 err;
|
||||
pf_u32 physical_sector;
|
||||
if ((p_part->status & 8) != 8 || (p_part->status & 2) == 2) { return 15; }
|
||||
err = pdm_disk_set_disk(p_part->p_disk, p_part);
|
||||
if (err != 0) { return err; }
|
||||
if (p_part->total_sector <= sector) { return 18; }
|
||||
if (p_part->total_sector < sector + count) { count -= (sector + count) - p_part->total_sector; }
|
||||
physical_sector = pdm_part_chg_ltop(p_part, sector, bps);
|
||||
err = pdm_disk_physical_write(p_part->p_disk, buf, physical_sector, count, bps, p_success);
|
||||
if (err != 0) { return err; }
|
||||
return 0;
|
||||
}
|
||||
pf_s32 pdm_part_unmount(PDM_PARTITION* p_part, pf_u32 mode) {
|
||||
pf_s32 err;
|
||||
pf_s32 result = 0;
|
||||
if (p_part->status & 8) {
|
||||
err = pdm_disk_set_disk(p_part->p_disk, p_part);
|
||||
if (err != 0) { return err; }
|
||||
err = pdm_disk_unmount(p_part->p_disk, mode);
|
||||
if (err != 0) { result = err; }
|
||||
} else { result = 14; }
|
||||
if (result == 0 || mode == 1) { p_part->status &= ~2; p_part->status &= ~8; }
|
||||
return result;
|
||||
}
|
||||
pf_s32 pdm_part_finalize(PDM_PARTITION* p_part) {
|
||||
pf_s32 err;
|
||||
if (p_part->status & 4) {
|
||||
err = pdm_disk_set_disk(p_part->p_disk, p_part);
|
||||
if (err != 0) { return err; }
|
||||
err = pdm_disk_finalize(p_part->p_disk);
|
||||
if (err != 0) { return err; }
|
||||
} else { return 13; }
|
||||
p_part->status &= ~4;
|
||||
return 0;
|
||||
}
|
||||
pf_s32 pdm_part_register_callback(PDM_PARTITION* p_part, PDM_CALLBACK* callbacks) {
|
||||
p_part->callbacks.insert = callbacks->insert;
|
||||
p_part->callbacks.eject = callbacks->eject;
|
||||
return 0;
|
||||
}
|
||||
pf_s32 pdm_part_unregister_callback(PDM_PARTITION* p_part) {
|
||||
p_part->callbacks.insert = PF_NULL;
|
||||
p_part->callbacks.eject = PF_NULL;
|
||||
return 0;
|
||||
}
|
||||
void pdm_part_set_change_media_state(PDM_DISK* p_disk, pf_bool is_inserted) {
|
||||
pf_u16 index;
|
||||
for (index = 0; index < PDM_DRIVE_COUNT; index++) {
|
||||
if ((pdm_disk_set.partition[index].status & 1) && pdm_disk_set.partition[index].p_disk == p_disk) {
|
||||
PDM_PARTITION* p_part = &pdm_disk_set.partition[index];
|
||||
p_part->status |= 2;
|
||||
if (is_inserted == 0 && pdm_disk_set.partition[index].callbacks.eject != PF_NULL) {
|
||||
pdm_disk_set.partition[index].callbacks.eject(p_part);
|
||||
} else if (pdm_disk_set.partition[index].callbacks.insert != PF_NULL) {
|
||||
pdm_disk_set.partition[index].callbacks.insert(p_part);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
264
tools/decomp-assist/sol-ph1.attempts.md
Normal file
264
tools/decomp-assist/sol-ph1.attempts.md
Normal file
@@ -0,0 +1,264 @@
|
||||
# sol-ph1 attempts
|
||||
|
||||
Worktree data-d6; branch agent/w1008/data-d6-h; initial HEAD f49f337c.
|
||||
Initial requested object build passed. Existing untracked rx63 evidence left untouched.
|
||||
Only zero differing instructions with equal size qualify. No pushes, PRs, rebases or other-worktree edits.
|
||||
Read prior opus-sdm, opus-iro, rx2b, rx36 and rx63 notes; target Ghidra exports and levers 25-29.
|
||||
|
||||
- has-00-seed: {"tag": "has-00-seed", "diffs": 54, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Reproduce h52 with titleCode declared in primary-type block.
|
||||
- title-00-seed: {"tag": "title-00-seed", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Reproduce signed predicate best C.
|
||||
- has-01-h52: {"tag": "has-01-h52", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Use target-proven 64-bit region comparison, avoids byte extraction hoist.
|
||||
- title-01-helper-0: {"tag": "title-01-helper-0", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-name lookup inside real inline helper; metadata pointer/ref, argument ordering, const and language call boundaries.
|
||||
- title-01-helper-1: {"tag": "title-01-helper-1", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-name lookup inside real inline helper; metadata pointer/ref, argument ordering, const and language call boundaries.
|
||||
- title-01-helper-2: {"tag": "title-01-helper-2", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-name lookup inside real inline helper; metadata pointer/ref, argument ordering, const and language call boundaries.
|
||||
- title-01-helper-3: {"tag": "title-01-helper-3", "diffs": 67, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-name lookup inside real inline helper; metadata pointer/ref, argument ordering, const and language call boundaries.
|
||||
- title-01-helper-4: {"tag": "title-01-helper-4", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-name lookup inside real inline helper; metadata pointer/ref, argument ordering, const and language call boundaries.
|
||||
- title-01-helper-5: {"tag": "title-01-helper-5", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-name lookup inside real inline helper; metadata pointer/ref, argument ordering, const and language call boundaries.
|
||||
- title-01-helper-6: {"tag": "title-01-helper-6", "diffs": 67, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-name lookup inside real inline helper; metadata pointer/ref, argument ordering, const and language call boundaries.
|
||||
- title-01-helper-7: {"tag": "title-01-helper-7", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-name lookup inside real inline helper; metadata pointer/ref, argument ordering, const and language call boundaries.
|
||||
- title-02-index-0: {"tag": "title-02-index-0", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Equivalent multidimensional-array addressing grouped by selected name/language.
|
||||
- title-02-index-1: {"tag": "title-02-index-1", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Equivalent multidimensional-array addressing grouped by selected name/language.
|
||||
- title-02-index-2: {"tag": "title-02-index-2", "diffs": 67, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Equivalent multidimensional-array addressing grouped by selected name/language.
|
||||
- title-02-index-3: {"tag": "title-02-index-3", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Equivalent multidimensional-array addressing grouped by selected name/language.
|
||||
- title-02-index-4: {"tag": "title-02-index-4", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Equivalent multidimensional-array addressing grouped by selected name/language.
|
||||
- title-02-index-5: {"tag": "title-02-index-5", "diffs": 67, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Equivalent multidimensional-array addressing grouped by selected name/language.
|
||||
- title-03-entry-helper-0: {"tag": "title-03-entry-helper-0", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Entry-based preferred-name helper delays metadata pointer read until after language call.
|
||||
- title-03-entry-helper-1: {"tag": "title-03-entry-helper-1", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Entry-based preferred-name helper delays metadata pointer read until after language call.
|
||||
- title-03-entry-helper-2: {"tag": "title-03-entry-helper-2", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Entry-based preferred-name helper delays metadata pointer read until after language call.
|
||||
- title-03-entry-helper-3: {"tag": "title-03-entry-helper-3", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Entry-based preferred-name helper delays metadata pointer read until after language call.
|
||||
- title-03-entry-helper-4: {"tag": "title-03-entry-helper-4", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Entry-based preferred-name helper delays metadata pointer read until after language call.
|
||||
- title-03-entry-helper-5: {"tag": "title-03-entry-helper-5", "diffs": 69, "insns": [77, 71], "sizes": [308, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Entry-based preferred-name helper delays metadata pointer read until after language call.
|
||||
- title-03-entry-helper-6: {"tag": "title-03-entry-helper-6", "diffs": 67, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Entry-based preferred-name helper delays metadata pointer read until after language call.
|
||||
- title-03-entry-helper-7: {"tag": "title-03-entry-helper-7", "diffs": 69, "insns": [77, 71], "sizes": [308, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Entry-based preferred-name helper delays metadata pointer read until after language call.
|
||||
- title-04-c89-0: {"tag": "title-04-c89-0", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Initial-language/name/entry locals declared at top; separate initialization.
|
||||
- title-04-c89-1: {"tag": "title-04-c89-1", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Initial-language/name/entry locals declared at top; separate initialization.
|
||||
- title-04-c89-2: {"tag": "title-04-c89-2", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Initial-language/name/entry locals declared at top; separate initialization.
|
||||
- title-04-c89-3: {"tag": "title-04-c89-3", "diffs": 69, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Initial-language/name/entry locals declared at top; separate initialization.
|
||||
- title-04-c89-4: {"tag": "title-04-c89-4", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Initial-language/name/entry locals declared at top; separate initialization.
|
||||
- title-04-c89-5: {"tag": "title-04-c89-5", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Initial-language/name/entry locals declared at top; separate initialization.
|
||||
- title-04-c89-6: {"tag": "title-04-c89-6", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Initial-language/name/entry locals declared at top; separate initialization.
|
||||
- title-04-c89-7: {"tag": "title-04-c89-7", "diffs": 65, "insns": [77, 71], "sizes": [308, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Initial-language/name/entry locals declared at top; separate initialization.
|
||||
- title-04-c89-8: {"tag": "title-04-c89-8", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Initial-language/name/entry locals declared at top; separate initialization.
|
||||
- title-04-c89-9: {"tag": "title-04-c89-9", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Initial-language/name/entry locals declared at top; separate initialization.
|
||||
- title-05-byte-group-0: {"tag": "title-05-byte-group-0", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Flatten named name array with explicit element/byte stride grouping; no fixed metadata offset.
|
||||
- title-05-byte-group-1: {"tag": "title-05-byte-group-1", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Flatten named name array with explicit element/byte stride grouping; no fixed metadata offset.
|
||||
- title-05-byte-group-2: {"tag": "title-05-byte-group-2", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Flatten named name array with explicit element/byte stride grouping; no fixed metadata offset.
|
||||
- title-05-byte-group-3: {"tag": "title-05-byte-group-3", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Flatten named name array with explicit element/byte stride grouping; no fixed metadata offset.
|
||||
- title-05-byte-group-4: {"tag": "title-05-byte-group-4", "diffs": 67, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Flatten named name array with explicit element/byte stride grouping; no fixed metadata offset.
|
||||
- title-05-byte-group-5: {"tag": "title-05-byte-group-5", "diffs": 67, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Flatten named name array with explicit element/byte stride grouping; no fixed metadata offset.
|
||||
- title-05-byte-group-6: {"tag": "title-05-byte-group-6", "diffs": 67, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Flatten named name array with explicit element/byte stride grouping; no fixed metadata offset.
|
||||
- title-05-byte-group-7: {"tag": "title-05-byte-group-7", "diffs": 67, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Flatten named name array with explicit element/byte stride grouping; no fixed metadata offset.
|
||||
- has-02-c89-0: {"tag": "has-02-c89-0", "diffs": 22, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; All real locals at function top with separate initialization; order follows mask/loop/title roles.
|
||||
- has-02-c89-1: {"tag": "has-02-c89-1", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; All real locals at function top with separate initialization; order follows mask/loop/title roles.
|
||||
- has-02-c89-2: {"tag": "has-02-c89-2", "diffs": 19, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; All real locals at function top with separate initialization; order follows mask/loop/title roles.
|
||||
- has-02-c89-3: {"tag": "has-02-c89-3", "diffs": 19, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; All real locals at function top with separate initialization; order follows mask/loop/title roles.
|
||||
- has-02-c89-4: {"tag": "has-02-c89-4", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; All real locals at function top with separate initialization; order follows mask/loop/title roles.
|
||||
- has-02-c89-5: {"tag": "has-02-c89-5", "diffs": 18, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; All real locals at function top with separate initialization; order follows mask/loop/title roles.
|
||||
- has-02-c89-6: {"tag": "has-02-c89-6", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; All real locals at function top with separate initialization; order follows mask/loop/title roles.
|
||||
- has-02-c89-7: {"tag": "has-02-c89-7", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; All real locals at function top with separate initialization; order follows mask/loop/title roles.
|
||||
- has-03-mask-helper-0: {"tag": "has-03-mask-helper-0", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Construct full 64-bit title matching mask in real inline helper.
|
||||
- has-03-mask-helper-1: {"tag": "has-03-mask-helper-1", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Construct full 64-bit title matching mask in real inline helper.
|
||||
- has-03-mask-helper-2: {"tag": "has-03-mask-helper-2", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Construct full 64-bit title matching mask in real inline helper.
|
||||
- has-03-mask-helper-3: {"tag": "has-03-mask-helper-3", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Construct full 64-bit title matching mask in real inline helper.
|
||||
- has-03-mask-helper-4: {"tag": "has-03-mask-helper-4", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Construct full 64-bit title matching mask in real inline helper.
|
||||
- has-03-mask-helper-5: {"tag": "has-03-mask-helper-5", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Construct full 64-bit title matching mask in real inline helper.
|
||||
- has-04-slot-helper-0: {"tag": "has-04-slot-helper-0", "diffs": 25, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real title construction, region stripping or region predicate helper.
|
||||
- has-04-slot-helper-1: {"tag": "has-04-slot-helper-1", "diffs": 25, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real title construction, region stripping or region predicate helper.
|
||||
- has-04-slot-helper-2: {"tag": "has-04-slot-helper-2", "diffs": 25, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real title construction, region stripping or region predicate helper.
|
||||
- has-04-slot-helper-3: {"tag": "has-04-slot-helper-3", "diffs": 22, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real title construction, region stripping or region predicate helper.
|
||||
- has-04-slot-helper-4: {"tag": "has-04-slot-helper-4", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real title construction, region stripping or region predicate helper.
|
||||
- has-04-slot-helper-5: {"tag": "has-04-slot-helper-5", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real title construction, region stripping or region predicate helper.
|
||||
- has-05-access-0: {"tag": "has-05-access-0", "diffs": 59, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Row/slot pointers, parameter copy, or page-scoped index with separate initialization.
|
||||
- has-05-access-1: {"tag": "has-05-access-1", "diffs": 59, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Row/slot pointers, parameter copy, or page-scoped index with separate initialization.
|
||||
- has-05-access-2: {"tag": "has-05-access-2", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Row/slot pointers, parameter copy, or page-scoped index with separate initialization.
|
||||
- has-05-access-3: {"tag": "has-05-access-3", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Row/slot pointers, parameter copy, or page-scoped index with separate initialization.
|
||||
- title-06-member-0: {"tag": "title-06-member-0", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata/channel-entry inline name accessor; pointer dereference stays inside member.
|
||||
- title-06-member-1: {"tag": "title-06-member-1", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata/channel-entry inline name accessor; pointer dereference stays inside member.
|
||||
- title-06-member-2: {"tag": "title-06-member-2", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata/channel-entry inline name accessor; pointer dereference stays inside member.
|
||||
- title-06-member-3: {"tag": "title-06-member-3", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata/channel-entry inline name accessor; pointer dereference stays inside member.
|
||||
- title-06-member-4: {"tag": "title-06-member-4", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata/channel-entry inline name accessor; pointer dereference stays inside member.
|
||||
- title-06-member-5: {"tag": "title-06-member-5", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata/channel-entry inline name accessor; pointer dereference stays inside member.
|
||||
- title-06-member-6: {"tag": "title-06-member-6", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata/channel-entry inline name accessor; pointer dereference stays inside member.
|
||||
- title-06-member-7: {"tag": "title-06-member-7", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata/channel-entry inline name accessor; pointer dereference stays inside member.
|
||||
- title-07-language-cast-0: {"tag": "title-07-language-cast-0", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-language index signedness changes address association without a named local.
|
||||
- title-07-language-cast-1: {"tag": "title-07-language-cast-1", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-language index signedness changes address association without a named local.
|
||||
- title-07-language-cast-2: {"tag": "title-07-language-cast-2", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-language index signedness changes address association without a named local.
|
||||
- title-07-language-cast-3: {"tag": "title-07-language-cast-3", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-language index signedness changes address association without a named local.
|
||||
- title-07-language-cast-4: {"tag": "title-07-language-cast-4", "diffs": 56, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-language index signedness changes address association without a named local.
|
||||
- title-07-language-cast-5: {"tag": "title-07-language-cast-5", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preferred-language index signedness changes address association without a named local.
|
||||
- has-06-accessor-0: {"tag": "has-06-accessor-0", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real const manager accessor or slot title-ID accessor, rather than temporary view types.
|
||||
- has-06-accessor-1: {"tag": "has-06-accessor-1", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real const manager accessor or slot title-ID accessor, rather than temporary view types.
|
||||
- has-06-accessor-2: {"tag": "has-06-accessor-2", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real const manager accessor or slot title-ID accessor, rather than temporary view types.
|
||||
- has-06-accessor-3: {"tag": "has-06-accessor-3", "diffs": 25, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real const manager accessor or slot title-ID accessor, rather than temporary view types.
|
||||
- has-06-accessor-4: {"tag": "has-06-accessor-4", "diffs": 22, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real const manager accessor or slot title-ID accessor, rather than temporary view types.
|
||||
- has-06-accessor-5: {"tag": "has-06-accessor-5", "diffs": 25, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real const manager accessor or slot title-ID accessor, rather than temporary view types.
|
||||
- has-07-match-shape-0: {"tag": "has-07-match-shape-0", "diffs": 63, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real inline masked-title comparator, or separate high/low mask construction.
|
||||
- has-07-match-shape-1: {"tag": "has-07-match-shape-1", "diffs": 63, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real inline masked-title comparator, or separate high/low mask construction.
|
||||
- has-07-match-shape-2: {"tag": "has-07-match-shape-2", "diffs": 63, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real inline masked-title comparator, or separate high/low mask construction.
|
||||
- has-07-match-shape-3: {"tag": "has-07-match-shape-3", "diffs": 69, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real inline masked-title comparator, or separate high/low mask construction.
|
||||
- has-07-match-shape-4: {"tag": "has-07-match-shape-4", "diffs": 54, "insns": [77, 71], "sizes": [308, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real inline masked-title comparator, or separate high/low mask construction.
|
||||
- has-07-match-shape-5: {"tag": "has-07-match-shape-5", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real inline masked-title comparator, or separate high/low mask construction.
|
||||
- has-07-match-shape-6: {"tag": "has-07-match-shape-6", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real inline masked-title comparator, or separate high/low mask construction.
|
||||
- has-07-match-shape-7: {"tag": "has-07-match-shape-7", "diffs": 66, "insns": [69, 71], "sizes": [276, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real inline masked-title comparator, or separate high/low mask construction.
|
||||
- has-07-match-shape-8: {"tag": "has-07-match-shape-8", "diffs": 67, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real inline masked-title comparator, or separate high/low mask construction.
|
||||
- has-07-match-shape-9: {"tag": "has-07-match-shape-9", "diffs": 65, "insns": [69, 71], "sizes": [276, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Real inline masked-title comparator, or separate high/low mask construction.
|
||||
- has-08-loop-0: {"tag": "has-08-loop-0", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Equivalent counted-loop spelling/bounds local or 64-bit title construction.
|
||||
- has-08-loop-1: {"tag": "has-08-loop-1", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Equivalent counted-loop spelling/bounds local or 64-bit title construction.
|
||||
- has-08-loop-2: {"tag": "has-08-loop-2", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Equivalent counted-loop spelling/bounds local or 64-bit title construction.
|
||||
- has-08-loop-3: {"tag": "has-08-loop-3", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Equivalent counted-loop spelling/bounds local or 64-bit title construction.
|
||||
- has-08-loop-4: {"tag": "has-08-loop-4", "diffs": 13, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Equivalent counted-loop spelling/bounds local or 64-bit title construction.
|
||||
- has-08-loop-5: {"tag": "has-08-loop-5", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Equivalent counted-loop spelling/bounds local or 64-bit title construction.
|
||||
- has-08-loop-6: {"tag": "has-08-loop-6", "diffs": 12, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Equivalent counted-loop spelling/bounds local or 64-bit title construction.
|
||||
- has-08-loop-7: {"tag": "has-08-loop-7", "diffs": 61, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 3 (mine=3 base=3)"}; Equivalent counted-loop spelling/bounds local or 64-bit title construction.
|
||||
- title-08-signed-byte-0: {"tag": "title-08-signed-byte-0", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Signed byte-stride arithmetic retains CSE with the original signed name-index multiplication; explicit offset local variants.
|
||||
- title-08-signed-byte-1: {"tag": "title-08-signed-byte-1", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Signed byte-stride arithmetic retains CSE with the original signed name-index multiplication; explicit offset local variants.
|
||||
- title-08-signed-byte-2: {"tag": "title-08-signed-byte-2", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Signed byte-stride arithmetic retains CSE with the original signed name-index multiplication; explicit offset local variants.
|
||||
- title-08-signed-byte-3: {"tag": "title-08-signed-byte-3", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Signed byte-stride arithmetic retains CSE with the original signed name-index multiplication; explicit offset local variants.
|
||||
- title-08-signed-byte-4: {"tag": "title-08-signed-byte-4", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Signed byte-stride arithmetic retains CSE with the original signed name-index multiplication; explicit offset local variants.
|
||||
- title-08-signed-byte-5: {"tag": "title-08-signed-byte-5", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Signed byte-stride arithmetic retains CSE with the original signed name-index multiplication; explicit offset local variants.
|
||||
- title-08-signed-byte-6: {"tag": "title-08-signed-byte-6", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Signed byte-stride arithmetic retains CSE with the original signed name-index multiplication; explicit offset local variants.
|
||||
- title-08-signed-byte-7: {"tag": "title-08-signed-byte-7", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Signed byte-stride arithmetic retains CSE with the original signed name-index multiplication; explicit offset local variants.
|
||||
- title-08-signed-byte-8: {"tag": "title-08-signed-byte-8", "diffs": 47, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Signed byte-stride arithmetic retains CSE with the original signed name-index multiplication; explicit offset local variants.
|
||||
- title-08-signed-byte-9: {"tag": "title-08-signed-byte-9", "diffs": 47, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Signed byte-stride arithmetic retains CSE with the original signed name-index multiplication; explicit offset local variants.
|
||||
|
||||
## Allocator evidence
|
||||
|
||||
hasChannel capture: `/mnt/drive2/projects/wii-ipl-workers/_mwdbg/runs/hasChannel__Q33ipl8savedata7ManagerCFUxPiPi-20261008-204333`. Simulator reproduces 53/53 virtual registers. Baseline full-mask low/high are r46/r47 -> r9/r0; target r10/r9. Row-base r45 -> r10; target r0. Region-mask constants r58/r59 -> r10/r4; target r4/r0. All other target assignments agree.
|
||||
|
||||
The shared vmap2 helper emitted numeric --want entries, but installed regsim only accepted names. A temporary copy `/tmp/sol-ph1-regsim.py` added numeric identifiers. With all 29 mapped operands wanted, it found 29/29 after reordering named nodes including compiler-generated temporaries. That is a diagnostic possible coloring, not an implementable local-declaration recipe: @17329/@17332 are generated full-mask/row-base temporaries. Inline accessors, C89 declarations, parameter copies and comparison helpers did not realize that numbering. Tool source was untouched.
|
||||
|
||||
getTitleName debugger attempt was queued behind the shared debugger lock for more than 100 seconds. Only this worker own queued process was terminated before it started compiling; no other process was touched. Target Ghidra and odiff evidence were available locally. The four baseline differences at instructions 17-20 come from C forming metadata + language stride before adding name stride; target combines name + language strides before metadata. The signed-byte-4 trial reduced this to one difference and is under further investigation. The fallback loop and all returns match.
|
||||
- title-09-one-add-0: {"tag": "title-09-one-add-0", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preserve signed name byte stride and unsigned language byte stride; reverse pointer-add operands or use conventional casts.
|
||||
- title-09-one-add-1: {"tag": "title-09-one-add-1", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preserve signed name byte stride and unsigned language byte stride; reverse pointer-add operands or use conventional casts.
|
||||
- title-09-one-add-2: {"tag": "title-09-one-add-2", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preserve signed name byte stride and unsigned language byte stride; reverse pointer-add operands or use conventional casts.
|
||||
- title-09-one-add-3: {"tag": "title-09-one-add-3", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preserve signed name byte stride and unsigned language byte stride; reverse pointer-add operands or use conventional casts.
|
||||
- title-09-one-add-4: {"tag": "title-09-one-add-4", "diffs": 5, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preserve signed name byte stride and unsigned language byte stride; reverse pointer-add operands or use conventional casts.
|
||||
- title-09-one-add-5: {"tag": "title-09-one-add-5", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preserve signed name byte stride and unsigned language byte stride; reverse pointer-add operands or use conventional casts.
|
||||
- title-09-one-add-6: {"tag": "title-09-one-add-6", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preserve signed name byte stride and unsigned language byte stride; reverse pointer-add operands or use conventional casts.
|
||||
- title-09-one-add-7: {"tag": "title-09-one-add-7", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preserve signed name byte stride and unsigned language byte stride; reverse pointer-add operands or use conventional casts.
|
||||
- title-09-one-add-8: {"tag": "title-09-one-add-8", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preserve signed name byte stride and unsigned language byte stride; reverse pointer-add operands or use conventional casts.
|
||||
- title-09-one-add-9: {"tag": "title-09-one-add-9", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Preserve signed name byte stride and unsigned language byte stride; reverse pointer-add operands or use conventional casts.
|
||||
- title-10-one-local-0: {"tag": "title-10-one-local-0", "diffs": 9, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-1: {"tag": "title-10-one-local-1", "diffs": 59, "insns": [73, 71], "sizes": [292, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-2: {"tag": "title-10-one-local-2", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-3: {"tag": "title-10-one-local-3", "diffs": 7, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-4: {"tag": "title-10-one-local-4", "diffs": 59, "insns": [73, 71], "sizes": [292, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-5: {"tag": "title-10-one-local-5", "diffs": 59, "insns": [73, 71], "sizes": [292, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-6: {"tag": "title-10-one-local-6", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-7: {"tag": "title-10-one-local-7", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-8: {"tag": "title-10-one-local-8", "diffs": 56, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-9: {"tag": "title-10-one-local-9", "diffs": 56, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-10: {"tag": "title-10-one-local-10", "diffs": 56, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-11: {"tag": "title-10-one-local-11", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-12: {"tag": "title-10-one-local-12", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-10-one-local-13: {"tag": "title-10-one-local-13", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named pointer/combined stride local or byte-array indexing preserves the single grouped address expression.
|
||||
- title-11-one-helper-0: {"tag": "title-11-one-helper-0", "diffs": 53, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-1: {"tag": "title-11-one-helper-1", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-2: {"tag": "title-11-one-helper-2", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-3: {"tag": "title-11-one-helper-3", "diffs": 63, "insns": [73, 71], "sizes": [292, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-4: {"tag": "title-11-one-helper-4", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-5: {"tag": "title-11-one-helper-5", "diffs": 53, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-6: {"tag": "title-11-one-helper-6", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-7: {"tag": "title-11-one-helper-7", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-8: {"tag": "title-11-one-helper-8", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-9: {"tag": "title-11-one-helper-9", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-10: {"tag": "title-11-one-helper-10", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-11-one-helper-11: {"tag": "title-11-one-helper-11", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Real metadata-name predicate or serialized-name byte-stride helper using mixed signed name/unsigned language arithmetic.
|
||||
- title-12-layout-0: {"tag": "title-12-layout-0", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Diagnostic explicit serialized field layout or integer-address addition; retain only if readable source review passes.
|
||||
- title-12-layout-1: {"tag": "title-12-layout-1", "diffs": 3, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Diagnostic explicit serialized field layout or integer-address addition; retain only if readable source review passes.
|
||||
- title-12-layout-2: {"tag": "title-12-layout-2", "diffs": 1, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Diagnostic explicit serialized field layout or integer-address addition; retain only if readable source review passes.
|
||||
- title-12-layout-3: {"tag": "title-12-layout-3", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Diagnostic explicit serialized field layout or integer-address addition; retain only if readable source review passes.
|
||||
- title-13-cast-0: {"tag": "title-13-cast-0", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Pointer element/cast spelling, constness or signed-name-to-unsigned-offset conversion on the one-difference expression.
|
||||
- title-14-clean-0: {"tag": "title-14-clean-0", "diffs": 2, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Readable preferred-name pointer or named array dimension constants; preserve byte-identical grouped offsets.
|
||||
- title-14-clean-1: {"tag": "title-14-clean-1", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Readable preferred-name pointer or named array dimension constants; preserve byte-identical grouped offsets.
|
||||
- title-14-clean-2: {"tag": "title-14-clean-2", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Readable preferred-name pointer or named array dimension constants; preserve byte-identical grouped offsets.
|
||||
- title-14-clean-3: {"tag": "title-14-clean-3", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Readable preferred-name pointer or named array dimension constants; preserve byte-identical grouped offsets.
|
||||
- title-14-clean-4: {"tag": "title-14-clean-4", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Readable preferred-name pointer or named array dimension constants; preserve byte-identical grouped offsets.
|
||||
- title-14-clean-5: {"tag": "title-14-clean-5", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Readable preferred-name pointer or named array dimension constants; preserve byte-identical grouped offsets.
|
||||
- title-14-clean-6: {"tag": "title-14-clean-6", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Readable preferred-name pointer or named array dimension constants; preserve byte-identical grouped offsets.
|
||||
- title-14-clean-7: {"tag": "title-14-clean-7", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Readable preferred-name pointer or named array dimension constants; preserve byte-identical grouped offsets.
|
||||
- title-14-clean-8: {"tag": "title-14-clean-8", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Readable preferred-name pointer or named array dimension constants; preserve byte-identical grouped offsets.
|
||||
- title-14-clean-9: {"tag": "title-14-clean-9", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Readable preferred-name pointer or named array dimension constants; preserve byte-identical grouped offsets.
|
||||
- title-15-final-readable: {"tag": "title-15-final-readable", "diffs": 0, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; Named preferred-name pointer with sizeof/offsetof of actual metadata fields, no numeric byte offsets or casts in the condition.
|
||||
|
||||
## Candidate retained
|
||||
|
||||
getTitleName: baseline C 4/71 -> 1/71 with signed name byte stride and unsigned language byte stride. Addressing the metadata header plus combined strides, then adding offsetof(SChanMgrMetaHeader, names), removed the final operand-order difference. Exact 0/71, 284/284 bytes. A real preferredName pointer local allowed conventional readable C casts while keeping exact output. Array extents and field offset come directly from the existing metadata declaration; no numeric layout constants, extra storage, dummy values, assembly or pragmas added. The lookup uses the same first character and returns the same original language/name pointer.
|
||||
|
||||
hasChannel: 50 compiled trials; best remains 12/71, 284/284 bytes. Saved `/mnt/drive2/projects/wii-ipl-workers/_luna-runs/best/sol-ph1.iplSaveDataManager.diff`; original asm restored byte-for-byte. No non-exact C retained. All temporary header accessors restored. Existing rx63 untracked files were left untouched.
|
||||
|
||||
Removed the getTitleName placeholder inventory row and decremented function/block/placeholder counts by one; refreshed the retained hasChannel evidence to the measured 12-difference C. Removed four asm-only external declarations from iplChannelManager.cpp.
|
||||
|
||||
## Final verification
|
||||
|
||||
Second getTitleName debugger run completed from an immutable `/tmp/sol-ph1-title-capture.cpp` at the one-difference candidate. Capture: `/mnt/drive2/projects/wii-ipl-workers/_mwdbg/runs/getTitleName__Q33ipl7channel7ManagerCFiii-20261008-205431`; sizes 284/284; only instruction 20 differs, `add r3,r0,r3` versus target `add r3,r3,r0`. The subsequent offsetof-after-strides form fixed the emitted operand order.
|
||||
|
||||
Inventory checker: expected FAIL solely for four remaining placeholders; coverage/counts are 166 functions, 168 bodies/blocks, 162 ORIGINAL, 4 PLACEHOLDER. No stale/duplicate/missing rows. getTitleName row is gone; hasChannel asm remains inventoried.
|
||||
|
||||
Final quick gate: PASS, full 43U build passed, DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`. Zero regressions, zero net forbidden additions, zero readability warnings.
|
||||
|
||||
- iplChannelManager: 74/74 exact functions before and after; code 12552/12552, data 1080/1080, linked code 12552. Every owned section is 100%. getTitleName C++ replaces one retail-asm placeholder, 0/71 instructions differing, size 284/284.
|
||||
- iplSaveDataManager: 35/35 exact functions before and after; code 7172/7172, data 968/968, linked code 7172. Every owned section is 100%. Original asm hasChannel remains unchanged.
|
||||
- Gate output: `/tmp/sol-ph1-gate.txt`; inventory output: `/tmp/sol-ph1-inventory.txt`. Live gate report: `build/43U/report.json`.
|
||||
|
||||
After final formatting and removal of asm-only declarations: rebuilt `build/43U/ok` passed. Fresh odiff 0/71, size 284/284; ctxdiff diffs 0 with 71/71 instructions. Pools identical 9/9 and 3/3. DOL SHA1 remains correct. Fresh full objdiff report `/tmp/sol-ph1-finalreport.json` gives exact-name getTitleName fuzzy_match_percent 100.0, size 284.
|
||||
|
||||
GATE PASS
|
||||
|
||||
## Readability revision, HEAD 11bde428
|
||||
|
||||
Replace the rejected byte-offset lookup with ordinary typed indexing or a real accessor. Keep the asm inventory removal and all other functions exact. Each entry records a fresh object build, pool check, instruction diff, and sizes.
|
||||
|
||||
- readable-direct: {"tag": "direct", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->names[System::getLanguage()][nameIndex];
|
||||
- readable-row: {"tag": "row", "diffs": 64, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t (*row)[META_CHANNEL_NAME_LENGTH + 1] = mChannels[page][index].metaHdr->names[System::getLanguage()]; const wchar_t* preferredName = row[nameIndex];
|
||||
- readable-row-language: {"tag": "row-language", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; int preferredLanguage = System::getLanguage(); const wchar_t (*row)[META_CHANNEL_NAME_LENGTH + 1] = mChannels[page][index].metaHdr->names[preferredLanguage]; const wchar_t* preferredName = row[nameIndex];
|
||||
- readable-table: {"tag": "table", "diffs": 9, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; typedef wchar_t NameTable[SC_LANG_MAX][NAME_INDEX_MAX][META_CHANNEL_NAME_LENGTH + 1]; const NameTable* names = &mChannels[page][index].metaHdr->names; const wchar_t* preferredName = (*names)[System::getLanguage()][nameIndex];
|
||||
- readable-table-after-language: {"tag": "table-after-language", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; typedef wchar_t NameTable[SC_LANG_MAX][NAME_INDEX_MAX][META_CHANNEL_NAME_LENGTH + 1]; int preferredLanguage = System::getLanguage(); const NameTable* names = &mChannels[page][index].metaHdr->names; const wchar_t* preferredName = (*names)[preferredLanguage][nameIndex];
|
||||
- readable-table-ref: {"tag": "table-ref", "diffs": 9, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t (&names)[SC_LANG_MAX][NAME_INDEX_MAX][META_CHANNEL_NAME_LENGTH + 1] = mChannels[page][index].metaHdr->names; const wchar_t* preferredName = names[System::getLanguage()][nameIndex];
|
||||
- readable-table-language-ref: {"tag": "table-language-ref", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; int preferredLanguage = System::getLanguage(); const wchar_t (&names)[SC_LANG_MAX][NAME_INDEX_MAX][META_CHANNEL_NAME_LENGTH + 1] = mChannels[page][index].metaHdr->names; const wchar_t* preferredName = names[preferredLanguage][nameIndex];
|
||||
- readable-meta: {"tag": "meta", "diffs": 8, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const SChanMgrMetaHeader* meta = mChannels[page][index].metaHdr; const wchar_t* preferredName = meta->names[System::getLanguage()][nameIndex];
|
||||
- readable-meta-after-language: {"tag": "meta-after-language", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; int preferredLanguage = System::getLanguage(); const SChanMgrMetaHeader* meta = mChannels[page][index].metaHdr; const wchar_t* preferredName = meta->names[preferredLanguage][nameIndex];
|
||||
- readable-unsigned-language: {"tag": "unsigned-language", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; u32 preferredLanguage = System::getLanguage(); const wchar_t* preferredName = mChannels[page][index].metaHdr->names[preferredLanguage][nameIndex];
|
||||
- readable-row-add: {"tag": "row-add", "diffs": 64, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t (*row)[META_CHANNEL_NAME_LENGTH + 1] = mChannels[page][index].metaHdr->names[System::getLanguage()]; const wchar_t* preferredName = *(nameIndex + row);
|
||||
- readable-table-add: {"tag": "table-add", "diffs": 9, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t (*names)[NAME_INDEX_MAX][META_CHANNEL_NAME_LENGTH + 1] = mChannels[page][index].metaHdr->names; const wchar_t* preferredName = (*(System::getLanguage() + names))[nameIndex];
|
||||
|
||||
- readable-member-const-name-first: {"tag": "member-const-name-first", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->getName(nameIndex, System::getLanguage());
|
||||
- readable-member-const-lang-first: {"tag": "member-const-lang-first", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->getName(System::getLanguage(), nameIndex);
|
||||
- readable-member-name-ref: {"tag": "member-name-ref", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->getName(nameIndex, System::getLanguage());
|
||||
- readable-member-preferred: {"tag": "member-preferred", "compile": "FAIL"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->getName(nameIndex);
|
||||
- readable-member-unsigned-name: {"tag": "member-unsigned-name", "diffs": 68, "insns": [76, 71], "sizes": [304, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->getName(nameIndex, System::getLanguage());
|
||||
- readable-member-row: {"tag": "member-row", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->getNames(System::getLanguage())[nameIndex];
|
||||
- readable-entry-preferred: {"tag": "entry-preferred", "compile": "FAIL"}; const wchar_t* preferredName = mChannels[page][index].getName(nameIndex);
|
||||
- readable-entry-ref-name-first: {"tag": "entry-ref-name-first", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].getName(nameIndex, System::getLanguage());
|
||||
- readable-entry-ref-lang-first: {"tag": "entry-ref-lang-first", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].getName(System::getLanguage(), nameIndex);
|
||||
- readable-reuse-language: {"tag": "reuse-language", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; language = System::getLanguage(); const wchar_t* preferredName = mChannels[page][index].metaHdr->names[language][nameIndex];
|
||||
- readable-reuse-signed-language: {"tag": "reuse-signed-language", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; language = System::getLanguage(); const wchar_t* preferredName = mChannels[page][index].metaHdr->names[(int)language][nameIndex];
|
||||
- readable-row-ref: {"tag": "row-ref", "diffs": 64, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t (&row)[NAME_INDEX_MAX][META_CHANNEL_NAME_LENGTH + 1] = mChannels[page][index].metaHdr->names[System::getLanguage()]; const wchar_t* preferredName = row[nameIndex];
|
||||
- readable-meta-reference: {"tag": "meta-reference", "diffs": 7, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const SChanMgrMetaHeader& meta = *mChannels[page][index].metaHdr; const wchar_t* preferredName = meta.names[System::getLanguage()][nameIndex];
|
||||
- readable-all-entry: {"tag": "all-entry", "compile": "FAIL"}; const wchar_t* preferredName = channel.metaHdr->names[System::getLanguage()][nameIndex];
|
||||
- readable-predicate-direct: {"tag": "predicate-direct", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"};
|
||||
- readable-reuse-predicate-direct: {"tag": "reuse-predicate-direct", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; language = System::getLanguage();
|
||||
- readable-array-name-ref: {"tag": "array-name-ref", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t (&preferredName)[META_CHANNEL_NAME_LENGTH + 1] = mChannels[page][index].metaHdr->names[System::getLanguage()][nameIndex];
|
||||
- readable-unsigned-name: {"tag": "unsigned-name", "diffs": 65, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->names[System::getLanguage()][(u32)nameIndex];
|
||||
|
||||
- readable-member-preferred-cpp: {"tag": "member-preferred-cpp", "diffs": 13, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->getName(nameIndex);
|
||||
- readable-entry-preferred-cpp: {"tag": "entry-preferred-cpp", "diffs": 4, "insns": [71, 71], "sizes": [284, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].getName(nameIndex);
|
||||
- readable-entry-scoped: {"tag": "entry-scoped", "diffs": 70, "insns": [67, 71], "sizes": [268, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = channel.metaHdr->names[System::getLanguage()][nameIndex];
|
||||
- readable-all-accessor-int-wchar_tptr: {"tag": "all-accessor-int-wchar_tptr", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->names[System::getLanguage()][nameIndex];
|
||||
- readable-all-accessor-u32-wchar_tptr: {"tag": "all-accessor-u32-wchar_tptr", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = mChannels[page][index].metaHdr->names[System::getLanguage()][nameIndex];
|
||||
- readable-typed-flat-group: {"tag": "typed-flat-group", "diffs": 67, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = &mChannels[page][index].metaHdr->names[0][0][0] + (nameIndex * (META_CHANNEL_NAME_LENGTH + 1) + System::getLanguage() * NAME_INDEX_MAX * (META_CHANNEL_NAME_LENGTH + 1));
|
||||
- readable-typed-flat-reversed: {"tag": "typed-flat-reversed", "diffs": 67, "insns": [75, 71], "sizes": [300, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t* preferredName = (nameIndex * (META_CHANNEL_NAME_LENGTH + 1) + System::getLanguage() * NAME_INDEX_MAX * (META_CHANNEL_NAME_LENGTH + 1)) + &mChannels[page][index].metaHdr->names[0][0][0];
|
||||
- readable-row-signed-language: {"tag": "row-signed-language", "diffs": 64, "insns": [72, 71], "sizes": [288, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; const wchar_t (*row)[META_CHANNEL_NAME_LENGTH + 1] = mChannels[page][index].metaHdr->names[(int)System::getLanguage()]; const wchar_t* preferredName = row[nameIndex];
|
||||
- readable-meta-reuse-language: {"tag": "meta-reuse-language", "diffs": 66, "insns": [74, 71], "sizes": [296, 284], "pool": "POOL IDENTICAL up to 9 (mine=9 base=9)"}; language = System::getLanguage(); const SChanMgrMetaHeader* meta = mChannels[page][index].metaHdr; const wchar_t* preferredName = meta->names[language][nameIndex];
|
||||
|
||||
### Readability revision outcome
|
||||
|
||||
39 trials; 36 compiled candidates; none exact. All successful builds retained identical pools, 9/9. Best normal array lookup remains 4/71 differing instructions, equal 284-byte size. Pointer-to-table, row, metadata, language local, shared language local, name reference, metadata accessor and entry accessor forms were tested. Inline accessor parameter ordering, signedness, reference returns, current-language accessors defined in the C++ file, and accessor use in all returns did not fix the association.
|
||||
|
||||
Best normal lookup: `const wchar_t* preferredName = mChannels[page][index].metaHdr->names[System::getLanguage()][nameIndex];`. Differences are instructions 17-20: language multiply destination r3 instead of r0, metadata load destination r0 instead of r3, base-plus-language before name offset, and resulting final add operands. Best source diff: `/tmp/sol-ph1-getTitleName-readable-best.diff`. Each full instruction diff is `/tmp/sol-ph1-readable-<tag>.txt`.
|
||||
|
||||
Restored the HEAD 11bde428 source and header exactly. The existing 0/71 byte-offset candidate and its asm inventory removal remain pending the orchestrator decision; this round found no accepted readable replacement. Header accessor experiments leave no changes in other units. Pre-existing untracked rx63 evidence remains untouched.
|
||||
|
||||
### Gate on restored exact candidate
|
||||
|
||||
Requested `gate.py src/system/iplChannelManager --quick`: GATE PASS. Full 43U build passed; DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`. Unit unchanged at 74/74 instruction-exact functions, 12552/12552 code bytes, 1080/1080 data bytes, and all owned sections 100%. Zero regressions, net forbidden additions, and automatic readability warnings. The automated scan does not overturn the orchestrator rejection of the retained byte-offset expression. Fresh odiff 0/71, size 284/284; ctxdiff diffs 0, instructions 71/71; pool identical 9/9. Gate output `/tmp/sol-ph1-readable-gate.txt`. Commit only this log; no readable source candidate was accepted.
|
||||
360
tools/decomp-assist/sol-ties.attempts.md
Normal file
360
tools/decomp-assist/sol-ties.attempts.md
Normal file
@@ -0,0 +1,360 @@
|
||||
# sol-ties attempts
|
||||
|
||||
Base 23b77a33, branch agent/w1008/rx1. No source edits initially.
|
||||
Baseline: update 85/446, DeleteUnauthorizedData 74/449, equal sizes.
|
||||
Both string pools identical. Tracer requires output beneath _mwdbg; first local-output attempt rejected before compilation.
|
||||
|
||||
ZI1 lift declarations in reverse requested virtual order: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI2 u32 LatestWord[copied] = LatestWord[copied + (wordLength - copyLength)];: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI3 u32 *(LatestWord + copied) = *(LatestWord + wordLength - copyLength + copied);: 215 differing. src size 0x700 base size 0x6f8
|
||||
|
||||
ZI4 u32 LatestWord[copied] = LatestWord[wordLength + copied - copyLength];: 233 differing. src size 0x744 base size 0x6f8
|
||||
|
||||
ZI5 u32 LatestWord[copied] = LatestWord[copied - copyLength + wordLength];: 232 differing. src size 0x748 base size 0x6f8
|
||||
|
||||
ZI6 s32 LatestWord[copied] = LatestWord[copied + (wordLength - copyLength)];: 216 differing. src size 0x6dc base size 0x6f8
|
||||
|
||||
ZI7 s32 *(LatestWord + copied) = *(LatestWord + wordLength - copyLength + copied);: 216 differing. src size 0x6c0 base size 0x6f8
|
||||
|
||||
ZI8 s32 LatestWord[copied] = LatestWord[wordLength + copied - copyLength];: 232 differing. src size 0x740 base size 0x6f8
|
||||
|
||||
ZI9 s32 LatestWord[copied] = LatestWord[copied - copyLength + wordLength];: 226 differing. src size 0x71c base size 0x6f8
|
||||
|
||||
ZI10 u16 LatestWord[copied] = LatestWord[copied + (wordLength - copyLength)];: 215 differing. src size 0x65c base size 0x6f8
|
||||
|
||||
ZI11 u16 *(LatestWord + copied) = *(LatestWord + wordLength - copyLength + copied);: 215 differing. src size 0x65c base size 0x6f8
|
||||
|
||||
ZI12 u16 LatestWord[copied] = LatestWord[wordLength + copied - copyLength];: 217 differing. src size 0x660 base size 0x6f8
|
||||
|
||||
ZI13 u16 LatestWord[copied] = LatestWord[copied - copyLength + wordLength];: 217 differing. src size 0x660 base size 0x6f8
|
||||
|
||||
ZI14 int LatestWord[copied] = LatestWord[copied + (wordLength - copyLength)];: 216 differing. src size 0x6dc base size 0x6f8
|
||||
|
||||
ZI15 int *(LatestWord + copied) = *(LatestWord + wordLength - copyLength + copied);: 216 differing. src size 0x6c0 base size 0x6f8
|
||||
|
||||
ZI16 int LatestWord[copied] = LatestWord[wordLength + copied - copyLength];: 232 differing. src size 0x740 base size 0x6f8
|
||||
|
||||
ZI17 int LatestWord[copied] = LatestWord[copied - copyLength + wordLength];: 226 differing. src size 0x71c base size 0x6f8
|
||||
|
||||
ZI18 copied != copyLength copied++: 216 differing. src size 0x6c0 base size 0x6f8
|
||||
|
||||
ZI19 copied != copyLength copied += 1: 216 differing. src size 0x6c0 base size 0x6f8
|
||||
|
||||
ZI20 copied != copyLength copied = copied + 1: 216 differing. src size 0x6c0 base size 0x6f8
|
||||
|
||||
ZI21 copyLength > copied copied++: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI22 copyLength > copied copied += 1: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI23 copyLength > copied copied = copied + 1: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI24 pointer copy before ++source; ++destination; ++copied: 299 differing. src size 0x6d4 base size 0x6f8
|
||||
|
||||
ZI25 pointer copy before ++copied; ++destination; ++source: 299 differing. src size 0x6d4 base size 0x6f8
|
||||
|
||||
ZI26 pointer copy before ++destination; ++source; ++copied: 299 differing. src size 0x6d4 base size 0x6f8
|
||||
|
||||
ZI27 pointer copy after ++source; ++destination; ++copied: 299 differing. src size 0x6d4 base size 0x6f8
|
||||
|
||||
ZI28 pointer copy after ++copied; ++destination; ++source: 299 differing. src size 0x6d4 base size 0x6f8
|
||||
|
||||
ZI29 pointer copy after ++destination; ++source; ++copied: 299 differing. src size 0x6d4 base size 0x6f8
|
||||
|
||||
ZI30 element type (wchar_t*)LatestWord: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI31 element type (unsigned short*)LatestWord: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI32 swap wordLength copied: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI33 swap copyLength wordLength: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI34 swap copied copyLength: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI35 while copy: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI36 precompute offset: 201 differing. src size 0x6f4 base size 0x6f8
|
||||
|
||||
ZI37 source base indexing: 216 differing. src size 0x6f0 base size 0x6f8
|
||||
|
||||
ZI38 typed character temporary u16: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI39 typed character temporary wchar_t: 32 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI40 inline suffix helper u16* word, u32 length, u32 wordLength u32: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI41 inline suffix helper u16* word, u32 length, u32 wordLength void: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI42 inline suffix helper u16* word, u32 wordLength, u32 length u32: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI43 inline suffix helper u16* word, u32 wordLength, u32 length void: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI44 parameter order ('u16* word', 'u32 length', 'u32 wordLength'): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI45 parameter order ('u16* word', 'u32 wordLength', 'u32 length'): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI46 parameter order ('u32 length', 'u16* word', 'u32 wordLength'): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI47 parameter order ('u32 length', 'u32 wordLength', 'u16* word'): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI48 parameter order ('u32 wordLength', 'u16* word', 'u32 length'): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI49 parameter order ('u32 wordLength', 'u32 length', 'u16* word'): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI50 helper copies ('wordLength',): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI51 helper copies ('length',): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI52 helper copies ('word',): 214 differing. src size 0x6f4 base size 0x6f8
|
||||
|
||||
ZI53 helper copies ('wordLength', 'length'): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI54 helper copies ('length', 'wordLength'): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI55 helper copies ('word', 'wordLength', 'length'): 218 differing. src size 0x6f4 base size 0x6f8
|
||||
|
||||
ZI56 helper copies ('length', 'word', 'wordLength'): 218 differing. src size 0x6f4 base size 0x6f8
|
||||
|
||||
ZI57 source/destination helper source[copied] order 0: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI58 source/destination helper source[copied] order 1: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI59 source/destination helper *(source + copied) order 0: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI60 source/destination helper *(source + copied) order 1: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI61 source/destination helper source[offset + copied] order 0: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI62 source/destination helper source[offset + copied] order 1: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI63 source/destination helper const source[copied] order 0: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI64 source/destination helper const source[copied] order 1: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI65 source/destination helper const *(source + copied) order 0: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI66 source/destination helper const *(source + copied) order 1: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI67 source/destination helper const source[offset + copied] order 0: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI68 source/destination helper const source[offset + copied] order 1: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ES1 titleId received by value and copied into last local: 116 differing. src size 0x704 base size 0x704
|
||||
|
||||
ZI69 helper offset before wordLength - length: 186 differing. src size 0x6f4 base size 0x6f8
|
||||
|
||||
ZI70 helper offset before wordLength + -length: 186 differing. src size 0x6f4 base size 0x6f8
|
||||
|
||||
ZI71 helper offset after wordLength - length: 186 differing. src size 0x6f4 base size 0x6f8
|
||||
|
||||
ZI72 helper offset after wordLength + -length: 186 differing. src size 0x6f4 base size 0x6f8
|
||||
|
||||
ZI73 helper expression word[copied + (wordLength - length)]: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI74 helper expression word[wordLength + copied - length]: 232 differing. src size 0x744 base size 0x6f8
|
||||
|
||||
ZI75 helper expression *(word + (wordLength - length) + copied): 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI76 helper loop u32 remaining = length;: 216 differing. src size 0x6c4 base size 0x6f8
|
||||
|
||||
ZI77 helper loop u32 copied = 0;: 19 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ES2 reverse paired desired locals: 34 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES3 forward paired desired locals: 158 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES4 reverse paired desired by ref: 403 differing. src size 0x70c base size 0x704
|
||||
|
||||
ES5 forward paired desired by ref: 412 differing. src size 0x70c base size 0x704
|
||||
|
||||
ES6 reverse paired desired by pointer: 34 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES7 forward paired desired by pointer: 158 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES8 InitSavedata declarations ('titleIds', 'ret', 'ticketScratch', 'i'): 34 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES9 Init declarations ('titleIds', 'ret', 'ticketScratch', 'i') and ticket order: 20 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES10 InitSavedata declarations ('titleIds', 'ret', 'i', 'ticketScratch'): 30 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES11 Init declarations ('titleIds', 'ret', 'i', 'ticketScratch') and ticket order: 16 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES12 InitSavedata declarations ('titleIds', 'ticketScratch', 'ret', 'i'): 39 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES13 Init declarations ('titleIds', 'ticketScratch', 'ret', 'i') and ticket order: 25 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES14 InitSavedata declarations ('titleIds', 'ticketScratch', 'i', 'ret'): 39 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES15 Init declarations ('titleIds', 'ticketScratch', 'i', 'ret') and ticket order: 25 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES16 InitSavedata declarations ('titleIds', 'i', 'ret', 'ticketScratch'): 35 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES17 Init declarations ('titleIds', 'i', 'ret', 'ticketScratch') and ticket order: 21 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES18 InitSavedata declarations ('titleIds', 'i', 'ticketScratch', 'ret'): 39 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES19 Init declarations ('titleIds', 'i', 'ticketScratch', 'ret') and ticket order: 25 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES20 InitSavedata declarations ('ret', 'titleIds', 'ticketScratch', 'i'): 39 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES21 Init declarations ('ret', 'titleIds', 'ticketScratch', 'i') and ticket order: 25 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES22 InitSavedata declarations ('ret', 'titleIds', 'i', 'ticketScratch'): 35 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES23 Init declarations ('ret', 'titleIds', 'i', 'ticketScratch') and ticket order: 21 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES24 InitSavedata declarations ('ret', 'ticketScratch', 'titleIds', 'i'): 28 differing. src size 0x704 base size 0x704
|
||||
|
||||
ZI78 helper computes word length, local order 0 u16* word, u32 length: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI79 helper computes word length, local order 0 u32 length, u16* word: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI80 helper computes word length, local order 1 u16* word, u32 length: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI81 helper computes word length, local order 1 u32 length, u16* word: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ES25 Init declarations ('ret', 'ticketScratch', 'titleIds', 'i') and ticket order: 14 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES26 InitSavedata declarations ('ret', 'ticketScratch', 'i', 'titleIds'): 39 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES27 Init declarations ('ret', 'ticketScratch', 'i', 'titleIds') and ticket order: 25 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES28 InitSavedata declarations ('ret', 'i', 'titleIds', 'ticketScratch'): 24 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES29 Init declarations ('ret', 'i', 'titleIds', 'ticketScratch') and ticket order: 10 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES30 InitSavedata declarations ('ret', 'i', 'ticketScratch', 'titleIds'): 39 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES31 Init declarations ('ret', 'i', 'ticketScratch', 'titleIds') and ticket order: 25 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES32 InitSavedata declarations ('ticketScratch', 'titleIds', 'ret', 'i'): 39 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES33 Init declarations ('ticketScratch', 'titleIds', 'ret', 'i') and ticket order: 25 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES34 InitSavedata declarations ('ticketScratch', 'titleIds', 'i', 'ret'): 39 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES35 Init declarations ('ticketScratch', 'titleIds', 'i', 'ret') and ticket order: 25 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES36 InitSavedata declarations ('ticketScratch', 'ret', 'titleIds', 'i'): 23 differing. src size 0x704 base size 0x704
|
||||
|
||||
ZI82 key copy loop iteration ++keyIndex, keyOutput += 0x40: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI83 key copy loop iteration keyOutput += 0x40, ++keyIndex: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI84 key copy loop body index then output: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ES37 Init declarations ('ticketScratch', 'ret', 'titleIds', 'i') and ticket order: 9 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES38 InitSavedata declarations ('ticketScratch', 'ret', 'i', 'titleIds'): 34 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES39 Init declarations ('ticketScratch', 'ret', 'i', 'titleIds') and ticket order: 20 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES40 InitSavedata declarations ('ticketScratch', 'i', 'titleIds', 'ret'): 28 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES41 Init declarations ('ticketScratch', 'i', 'titleIds', 'ret') and ticket order: 14 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES42 InitSavedata declarations ('ticketScratch', 'i', 'ret', 'titleIds'): 39 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES43 Init declarations ('ticketScratch', 'i', 'ret', 'titleIds') and ticket order: 25 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES44 InitSavedata declarations ('i', 'titleIds', 'ret', 'ticketScratch'): 32 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES45 Init declarations ('i', 'titleIds', 'ret', 'ticketScratch') and ticket order: 18 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES46 InitSavedata declarations ('i', 'titleIds', 'ticketScratch', 'ret'): 36 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES47 Init declarations ('i', 'titleIds', 'ticketScratch', 'ret') and ticket order: 22 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES48 InitSavedata declarations ('i', 'ret', 'titleIds', 'ticketScratch'): 16 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES49 Init declarations ('i', 'ret', 'titleIds', 'ticketScratch') and ticket order: 2 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES50 InitSavedata declarations ('i', 'ret', 'ticketScratch', 'titleIds'): 31 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES51 Init declarations ('i', 'ret', 'ticketScratch', 'titleIds') and ticket order: 17 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES52 InitSavedata declarations ('i', 'ticketScratch', 'titleIds', 'ret'): 25 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES53 Init declarations ('i', 'ticketScratch', 'titleIds', 'ret') and ticket order: 11 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES54 InitSavedata declarations ('i', 'ticketScratch', 'ret', 'titleIds'): 36 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES55 Init declarations ('i', 'ticketScratch', 'ret', 'titleIds') and ticket order: 22 differing. src size 0x704 base size 0x704
|
||||
|
||||
ES56 initialize valid before j: 0 differing. src size 0x704 base size 0x704
|
||||
|
||||
ZI85 key source expression *(static_cast<keyboard::cellphonetype::PaneNameToCharCode*>(mpHoldingKey)->wc + keyIndex - 1): 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI86 key source expression static_cast<keyboard::cellphonetype::PaneNameToCharCode*>(mpHoldingKey)->wc[-1 + keyIndex]: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI87 key source expression (static_cast<keyboard::cellphonetype::PaneNameToCharCode*>(mpHoldingKey)->wc - 1)[keyIndex]: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI88 key source expression static_cast<keyboard::cellphonetype::PaneNameToCharCode*>(mpHoldingKey)->wc[keyIndex + -1]: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI89 swap keyOutput declaration with keyIndex: 15 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI90 swap keyOutput declaration with keyCharacter: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI91 swap keyOutput declaration with koreanOutput: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI92 swap keyOutput declaration with index: 35 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI93 swap keyOutput declaration with source: 30 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI94 swap keyOutput declaration with elementCount: 44 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI95 key destination increment keyOutput = keyOutput + 0x40: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI96 key destination increment keyOutput = 0x40 + keyOutput: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI97 key destination increment keyOutput += 64: 2 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
ZI98 preincrement key destination: 347 differing. src size 0x6f4 base size 0x6f8
|
||||
|
||||
ZI99 key destination base plus indexed offset: 353 differing. src size 0x6f4 base size 0x6f8
|
||||
|
||||
ZI100 key destination indexed by keyIndex: 0 differing. src size 0x6f8 base size 0x6f8
|
||||
|
||||
Both requested functions reached zero differing with equal size. ZI100 also indexes the key output by keyIndex, removing the final induction-update scheduling pair. ES56 initializes valid before j, removing its final scheduling pair. No configure status change yet; unit-wide checks follow.
|
||||
|
||||
Unit-wide objdiff after the exact source edits: tiZiString 29/29 functions, 5504/5504 code, 7680/7680 data, every section 100%; iplESMisc 31/31 functions, 11200/11200 code, 4416/4416 data, every section 100%. Pools identical; ctxdiff update 446/446 instructions, diffs 0; DeleteUnauthorizedData 449/449 instructions, diffs 0. Both configure entries changed to Matching.
|
||||
|
||||
Initial full gate failed despite all owned code/data exact: DOL a9c0db300b393a94c498af7a6ef5a710f804edcb. Isolating configure entries showed tiZiString linking preserves the failure hash; both NonMatching restore the target hash. dtk dol diff proved checkForNullTermination and DeleteUnauthorizedData were emitted in reverse object order. Reordered these two definitions to symbols.txt order without changing their bodies.
|
||||
|
||||
Final gate after definition-order repair:
|
||||
|
||||
```text
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/keyboard/tiZiString] pool: IDENTICAL
|
||||
[src/keyboard/tiZiString] objdiff: code 5504/5504 data 7680/7680 functions 29/29 fuzzy 100.0000 linked code 5504
|
||||
[src/keyboard/tiZiString] instruction-exact functions: 29/29
|
||||
[src/keyboard/tiZiString] section .bss size 7296 match 100.0
|
||||
[src/keyboard/tiZiString] section .data size 328 match 100.0
|
||||
[src/keyboard/tiZiString] section .rodata size 56 match 100.0
|
||||
[src/keyboard/tiZiString] section .text size 5504 match 100.0
|
||||
[src/keyboard/tiZiString] baseline: code 3720/5504 data 7680 functions 28 fuzzy 99.4717
|
||||
[src/utility/iplESMisc] pool: IDENTICAL
|
||||
[src/utility/iplESMisc] objdiff: code 11200/11200 data 4416/4416 functions 31/31 fuzzy 100.0000 linked code 11200
|
||||
[src/utility/iplESMisc] instruction-exact functions: 31/31
|
||||
[src/utility/iplESMisc] section .data size 4384 match 100.0
|
||||
[src/utility/iplESMisc] section .sdata size 32 match 100.0
|
||||
[src/utility/iplESMisc] section .text size 11200 match 100.0
|
||||
[src/utility/iplESMisc] baseline: code 9404/11200 data 4416 functions 30 fuzzy 99.8625
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 97.29338 -> 97.41291
|
||||
global fuzzy_match_percent: 99.88914 -> 99.89063
|
||||
global complete_code_percent: 88.00925 -> 88.56695
|
||||
global matched_data_percent: 100.00000 -> 100.00000
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
note: config touched: configure.py (orchestrator reviews every config/symbols change)
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
Final ctxdiff: update 446/446, diffs 0; DeleteUnauthorizedData 449/449, diffs 0. Both exact and linked.
|
||||
|
||||
Allocator captures: baseline tiZiString `_mwdbg/runs/update__Q39textinput8tistring6WithZiFv-20261008-193010`; ordered locals `...-20261008-193122`; baseline iplESMisc `_mwdbg/runs/DeleteUnauthorizedData__Q33ipl7utility6ESMiscFPQ23EGG4Heap-20261008-193201`; titleId-copy `...-20261008-193510`. Baseline regsim reproduces 161/161. Paired titleId constrained simulation found 64/64 wants. Generated trial scripts, reports and raw logs are retained locally under build/sol-ties.
|
||||
|
||||
ES exact implementation and its Matching entry committed as 0b3c7842. tiZiString exact implementation and its Matching entry follow in a separate commit. The final gate above covers the combined tree.
|
||||
@@ -182,12 +182,10 @@ class WorkflowGuardTests(unittest.TestCase):
|
||||
failures = check_report(report)
|
||||
self.assertFalse(any("enc_dummy section .sbss" in failure for failure in failures))
|
||||
|
||||
@unittest.skipUnless(
|
||||
(Path(__file__).resolve().parents[1] / "build/43U/report.json").is_file(),
|
||||
"generated 43U report is not available",
|
||||
)
|
||||
def test_complete_report_schema_passes(self):
|
||||
def complete_report(self):
|
||||
report_path = Path(__file__).resolve().parents[1] / "build/43U/report.json"
|
||||
if not report_path.is_file():
|
||||
self.skipTest("generated 43U report is not available")
|
||||
report = copy.deepcopy(json.loads(report_path.read_text(encoding="utf-8")))
|
||||
|
||||
def fill(measures):
|
||||
@@ -230,7 +228,36 @@ class WorkflowGuardTests(unittest.TestCase):
|
||||
function["fuzzy_match_percent"] = 100.0
|
||||
for category in report["categories"]:
|
||||
fill(category["measures"])
|
||||
self.assertEqual(check_report(report), [])
|
||||
return report
|
||||
|
||||
def test_complete_report_schema_passes(self):
|
||||
self.assertEqual(check_report(self.complete_report()), [])
|
||||
|
||||
def test_missing_or_extra_unit_fails(self):
|
||||
for total_units in (1027, 1029):
|
||||
with self.subTest(total_units=total_units):
|
||||
report = self.complete_report()
|
||||
if total_units == 1027:
|
||||
report["units"].pop()
|
||||
else:
|
||||
extra = copy.deepcopy(report["units"][-1])
|
||||
extra["name"] += "/extra"
|
||||
report["units"].append(extra)
|
||||
failures = check_report(report)
|
||||
self.assertIn(f"unit report length: {total_units}", failures)
|
||||
self.assertIn(f"unit aggregate total_units: {total_units} != 1028", failures)
|
||||
|
||||
def test_wrong_unit_totals_fail(self):
|
||||
for total_units in (1027, 1029):
|
||||
with self.subTest(total_units=total_units):
|
||||
report = self.complete_report()
|
||||
delta = total_units - 1028
|
||||
for field in ("total_units", "complete_units"):
|
||||
report["measures"][field] = total_units
|
||||
report["categories"][0]["measures"][field] += delta
|
||||
failures = check_report(report)
|
||||
self.assertIn(f"overall total_units: {total_units} != 1028", failures)
|
||||
self.assertIn(f"category total_units: {total_units} != 1028", failures)
|
||||
|
||||
@unittest.skipUnless(
|
||||
(Path(__file__).resolve().parents[1] / "build/43U/report.json").is_file(),
|
||||
|
||||
Reference in New Issue
Block a user