mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
big d_a_alink pass (#214)
* d_a_alink pass1 wip * more d_a_alink work * remove asm * more daalink work * 20% dol code decompiled * fixed some nonmatchings for building * a few daalink functions and labeling some HIO data
This commit is contained in:
@@ -995,17 +995,17 @@ void J2DTevBlock1::setGX() {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
GXColorS10 color = mTevColor[i];
|
||||
|
||||
GXTevRegID id;
|
||||
int id;
|
||||
if (i == 3) {
|
||||
id = 0;
|
||||
} else {
|
||||
id = i + 1;
|
||||
}
|
||||
GXSetTevColorS10(id, color);
|
||||
GXSetTevColorS10((GXTevRegID)id, color);
|
||||
}
|
||||
|
||||
GXSetNumTevStages(1);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, )
|
||||
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
|
||||
@@ -251,7 +251,7 @@ SECTION_DATA extern void* __vt__10J2DPicture[83 + 1 /* padding */] = {
|
||||
/* 802FC050-802FC118 2F6990 00C8+00 0/0 2/2 0/0 .text __ct__10J2DPictureFv */
|
||||
#ifdef NONMATCHING
|
||||
J2DPicture::J2DPicture()
|
||||
: field_0x10a(), field_0x12c(NULL), mWhite(), mBlack(), mCornerColor(), field_0x148(),
|
||||
: field_0x10a(), mPalette(NULL), mWhite(), mBlack(), mCornerColor(), field_0x148(),
|
||||
field_0x14c() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mTexture[i] = NULL;
|
||||
@@ -276,7 +276,7 @@ asm J2DPicture::J2DPicture() {
|
||||
* __ct__10J2DPictureFP7J2DPaneP20JSURandomInputStreamP10JKRArchive */
|
||||
#ifdef NONMATCHING
|
||||
J2DPicture::J2DPicture(J2DPane* p_pane, JSURandomInputStream* p_stream, JKRArchive* p_archive)
|
||||
: field_0x10a(), field_0x12c(NULL), mWhite(), mBlack(), mCornerColor(), field_0x148(),
|
||||
: field_0x10a(), mPalette(NULL), mWhite(), mBlack(), mCornerColor(), field_0x148(),
|
||||
field_0x14c() {
|
||||
private_readStream(p_pane, p_stream, p_archive);
|
||||
}
|
||||
|
||||
@@ -468,10 +468,10 @@ SECTION_SDATA2 static f32 lit_1830 = 1.0f;
|
||||
// matches with literals
|
||||
#ifdef NONMATCHING
|
||||
void J2DScreen::draw(f32 x, f32 y, J2DGrafContext const* grafCtx) {
|
||||
u32 x, y, width, height;
|
||||
u32 l_x, l_y, width, height;
|
||||
|
||||
if (mScissor) {
|
||||
GXGetScissor(&x, &y, &width, &height);
|
||||
GXGetScissor(&l_x, &l_y, &width, &height);
|
||||
}
|
||||
|
||||
if (grafCtx != NULL) {
|
||||
@@ -483,7 +483,7 @@ void J2DScreen::draw(f32 x, f32 y, J2DGrafContext const* grafCtx) {
|
||||
}
|
||||
|
||||
if (mScissor) {
|
||||
GXSetScissor(x, y, width, height);
|
||||
GXSetScissor(l_x, l_y, width, height);
|
||||
}
|
||||
|
||||
GXSetNumIndStages(0);
|
||||
|
||||
@@ -116,27 +116,15 @@ SECTION_SDATA2 static u8 lit_853[4] = {
|
||||
};
|
||||
|
||||
/* 803283FC-8032842C 322D3C 0030+00 0/0 25/25 285/285 .text init__12J3DFrameCtrlFs */
|
||||
// zero-initialized literal
|
||||
#ifdef NONMATCHING
|
||||
void J3DFrameCtrl::init(s16 pEnd) {
|
||||
void J3DFrameCtrl::init(s16 i_end) {
|
||||
mAttribute = 2;
|
||||
mState = false;
|
||||
mState = 0;
|
||||
mStart = 0;
|
||||
mEnd = pEnd;
|
||||
mEnd = i_end;
|
||||
mLoop = 0;
|
||||
mRate = 1.0f;
|
||||
mFrame = 0.0f;
|
||||
mRate = lit_852;
|
||||
mFrame = FLOAT_LABEL(lit_853);
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void J3DFrameCtrl::init(s16 param_0) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DAnimation/init__12J3DFrameCtrlFs.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80456438-80456440 004A38 0004+04 2/2 0/0 0/0 .sdata2 @973 */
|
||||
@@ -151,14 +139,135 @@ SECTION_SDATA2 static f64 lit_975 = 4503601774854144.0 /* cast s32 to float */;
|
||||
|
||||
/* 8032842C-803289CC 322D6C 05A0+00 0/0 92/92 382/382 .text checkPass__12J3DFrameCtrlFf
|
||||
*/
|
||||
// matches with literals
|
||||
#ifdef NONMATCHING
|
||||
int J3DFrameCtrl::checkPass(f32 pass_frame) {
|
||||
f32 cur_frame = mFrame;
|
||||
f32 next_frame = cur_frame + mRate;
|
||||
|
||||
switch (mAttribute) {
|
||||
case 0:
|
||||
case 1:
|
||||
if (next_frame < mStart) {
|
||||
next_frame = mStart;
|
||||
}
|
||||
|
||||
if (next_frame >= mEnd) {
|
||||
next_frame = mEnd - 0.001f;
|
||||
}
|
||||
|
||||
if (cur_frame <= next_frame) {
|
||||
if (cur_frame <= pass_frame && pass_frame < next_frame) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (next_frame <= pass_frame && pass_frame < cur_frame) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 2:
|
||||
if (cur_frame < mStart) {
|
||||
while (next_frame < mStart) {
|
||||
if (mLoop - mStart <= 0.0f) {
|
||||
break;
|
||||
}
|
||||
next_frame += mLoop - mStart;
|
||||
}
|
||||
|
||||
if (next_frame <= pass_frame && pass_frame < mLoop) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if (mEnd <= cur_frame) {
|
||||
while (next_frame >= mEnd) {
|
||||
if (mEnd - mLoop <= 0.0f) {
|
||||
break;
|
||||
}
|
||||
next_frame -= mEnd - mLoop;
|
||||
}
|
||||
|
||||
if (mLoop <= pass_frame && pass_frame < next_frame) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if (next_frame < mStart) {
|
||||
while (next_frame < mStart) {
|
||||
if (mLoop - mStart <= 0.0f) {
|
||||
break;
|
||||
}
|
||||
next_frame += mLoop - mStart;
|
||||
}
|
||||
|
||||
if ((mStart <= pass_frame && pass_frame < cur_frame) || (next_frame <= pass_frame && pass_frame < mLoop)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if (mEnd <= next_frame) {
|
||||
while (next_frame >= mEnd) {
|
||||
if (mEnd - mLoop <= 0.0f) {
|
||||
break;
|
||||
}
|
||||
|
||||
next_frame -= mEnd - mLoop;
|
||||
}
|
||||
|
||||
if ((cur_frame <= pass_frame && pass_frame < mEnd) || (mLoop <= pass_frame && pass_frame < next_frame)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if (cur_frame <= next_frame) {
|
||||
if (cur_frame <= pass_frame && pass_frame < next_frame) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if (next_frame <= pass_frame && pass_frame < cur_frame) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 3:
|
||||
case 4:
|
||||
if (next_frame >= mEnd) {
|
||||
next_frame = mEnd - 0.001f;
|
||||
}
|
||||
|
||||
if (next_frame < mStart) {
|
||||
next_frame = mStart;
|
||||
}
|
||||
|
||||
if (cur_frame <= next_frame) {
|
||||
if (cur_frame <= pass_frame && pass_frame < next_frame) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (next_frame <= pass_frame && pass_frame < cur_frame) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm int J3DFrameCtrl::checkPass(f32 param_0) {
|
||||
asm int J3DFrameCtrl::checkPass(f32 pass_frame) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DAnimation/checkPass__12J3DFrameCtrlFf.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 803289CC-80328E40 32330C 0474+00 0/0 3/3 0/0 .text update__12J3DFrameCtrlFv */
|
||||
#pragma push
|
||||
@@ -171,6 +280,19 @@ asm void J3DFrameCtrl::update() {
|
||||
#pragma pop
|
||||
|
||||
/* 80328E40-80328E90 323780 0050+00 0/0 3/3 0/0 .text __ct__15J3DAnmTransformFsPfPsPf */
|
||||
// matches with literals
|
||||
#ifdef NONMATCHING
|
||||
J3DAnmTransform::J3DAnmTransform(s16 param_0, f32* param_1, s16* param_2, f32* param_3)
|
||||
: J3DAnmBase(param_0) {
|
||||
field_0xc = param_1;
|
||||
field_0x10 = param_2;
|
||||
field_0x14 = param_3;
|
||||
field_0x18 = 0;
|
||||
field_0x1a = 0;
|
||||
field_0x1c = 0;
|
||||
field_0x1e = 0;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -179,6 +301,7 @@ asm J3DAnmTransform::J3DAnmTransform(s16 param_0, f32* param_1, s16* param_2, f3
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DAnimation/__ct__15J3DAnmTransformFsPfPsPf.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80456448-80456450 004A48 0004+04 4/4 0/0 0/0 .sdata2 @1092 */
|
||||
@@ -359,7 +482,7 @@ asm void J3DAnmTextureSRTKey::calcTransform(f32 param_0, u16 param_1,
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void J3DAnmClusterFull::getWeight(u16 param_0) const {
|
||||
asm f32 J3DAnmClusterFull::getWeight(u16 param_0) const {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DAnimation/getWeight__17J3DAnmClusterFullCFUs.s"
|
||||
}
|
||||
@@ -370,7 +493,7 @@ asm void J3DAnmClusterFull::getWeight(u16 param_0) const {
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void J3DAnmClusterKey::getWeight(u16 param_0) const {
|
||||
asm f32 J3DAnmClusterKey::getWeight(u16 param_0) const {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DAnimation/getWeight__16J3DAnmClusterKeyCFUs.s"
|
||||
}
|
||||
@@ -818,14 +941,9 @@ s32 J3DAnmCluster::getKind() const {
|
||||
}
|
||||
|
||||
/* 8032C11C-8032C124 326A5C 0008+00 1/0 0/0 0/0 .text getWeight__13J3DAnmClusterCFUs */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void J3DAnmCluster::getWeight(u16 param_0) const {
|
||||
nofralloc
|
||||
#include "asm/JSystem/J3DGraphAnimator/J3DAnimation/getWeight__13J3DAnmClusterCFUs.s"
|
||||
f32 J3DAnmCluster::getWeight(u16 param_0) const {
|
||||
return lit_852;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 8032C124-8032C190 326A64 006C+00 1/0 0/0 0/0 .text __dt__17J3DAnmClusterFullFv */
|
||||
#pragma push
|
||||
|
||||
@@ -233,7 +233,7 @@ J3DJoint::J3DJoint() {
|
||||
mChild = NULL;
|
||||
mYounger = NULL;
|
||||
mJntNo = 0;
|
||||
mMtxType = 1;
|
||||
mKind = 1;
|
||||
mScaleCompensate = false;
|
||||
mTransformInfo = j3dDefaultTransformInfo;
|
||||
mBoundingSphereRadius = 0.0f;
|
||||
|
||||
@@ -93,8 +93,8 @@ J3DMaterialTable::~J3DMaterialTable() {}
|
||||
/* 8032F64C-8032F6F8 329F8C 00AC+00 0/0 1/1 5/5 .text
|
||||
* removeMatColorAnimator__16J3DMaterialTableFP11J3DAnmColor */
|
||||
#ifdef NONMATCHING
|
||||
bool J3DMaterialTable::removeMatColorAnimator(J3DAnmColor* pAnmColor) {
|
||||
bool ret = false;
|
||||
int J3DMaterialTable::removeMatColorAnimator(J3DAnmColor* pAnmColor) {
|
||||
int ret = false;
|
||||
u16 updateMatNum = pAnmColor->getUpdateMaterialNum();
|
||||
for (u16 i = 0; i < updateMatNum; i++) {
|
||||
if (pAnmColor->isValidUpdateMaterialID(i)) {
|
||||
|
||||
@@ -585,7 +585,7 @@ void J3DModel::prepareShapePackets() {
|
||||
if (getMtxCalcMode() == 2) {
|
||||
pkt->setBaseMtxPtr(&mInternalView);
|
||||
} else {
|
||||
pkt->setBaseMtxPtr(j3dSys.getViewMtx());
|
||||
pkt->setBaseMtxPtr(&j3dSys.mViewMtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ void JAISound::start_JAISound_(JAISoundID param_0, JGeometry::TVec3<f32> const*
|
||||
params.init();
|
||||
fader.forceIn();
|
||||
audience_ = param_2;
|
||||
num_prepare_steps = 0;
|
||||
prepareCount = 0;
|
||||
mCount = 0;
|
||||
|
||||
if (param_1 == NULL || audience_ == NULL) {
|
||||
|
||||
@@ -480,12 +480,10 @@ void JFWDisplay::waitBlanking(int param_0) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
/* ############################################################################################## */
|
||||
/* 804511D0-804511D4 0006D0 0004+00 1/1 0/0 0/0 .sbss nextTick$2642 */
|
||||
static u8 nextTick[4] ALIGN_DECL(8);
|
||||
|
||||
/* 804511D4-804511D8 0006D4 0004+00 1/1 0/0 0/0 .sbss None */
|
||||
static u8 data_804511D4[4];
|
||||
static OSTime nextTick ALIGN_DECL(8);
|
||||
|
||||
/* 804511D8-804511DC 0006D8 0004+00 1/1 0/0 0/0 .sbss None */
|
||||
static s8 data_804511D8;
|
||||
@@ -497,7 +495,6 @@ static u32 nextCount;
|
||||
static s8 data_804511E0;
|
||||
|
||||
/* 80272CB0-80272DD0 26D5F0 0120+00 2/2 0/0 0/0 .text waitForTick__FUlUs */
|
||||
#ifdef NONMATCHING
|
||||
static void waitForTick(u32 param_0, u16 param_1) {
|
||||
if (param_0 != 0) {
|
||||
if (!data_804511D8) {
|
||||
@@ -531,6 +528,22 @@ static void waitForTick(u32 param_0, u16 param_1) {
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* ############################################################################################## */
|
||||
/* 804511D0-804511D4 0006D0 0004+00 1/1 0/0 0/0 .sbss nextTick$2642 */
|
||||
static u8 nextTick[4] ALIGN_DECL(8);
|
||||
|
||||
/* 804511D4-804511D8 0006D4 0004+00 1/1 0/0 0/0 .sbss None */
|
||||
static u8 data_804511D4[4];
|
||||
|
||||
/* 804511D8-804511DC 0006D8 0004+00 1/1 0/0 0/0 .sbss None */
|
||||
static s8 data_804511D8;
|
||||
|
||||
/* 804511DC-804511E0 0006DC 0004+00 1/1 0/0 0/0 .sbss nextCount$2650 */
|
||||
static u32 nextCount;
|
||||
|
||||
/* 804511E0-804511E8 0006E0 0008+00 1/1 0/0 0/0 .sbss None */
|
||||
static s8 data_804511E0;
|
||||
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
|
||||
@@ -161,7 +161,7 @@ void JFWSystem::init() {
|
||||
if (rootHeap == NULL) {
|
||||
firstInit();
|
||||
}
|
||||
sInitCalled = true;
|
||||
data_804511BC = true;
|
||||
|
||||
JKRAram::create(CSetUpParam::aramAudioBufSize, CSetUpParam::aramGraphBufSize,
|
||||
CSetUpParam::streamPriority, CSetUpParam::decompPriority,
|
||||
|
||||
@@ -89,20 +89,6 @@ JGadget::TNodeLinkList::iterator JGadget::TNodeLinkList::erase(iterator start, i
|
||||
/* 802DCB08-802DCBA8 2D7448 00A0+00 1/1 0/0 0/0 .text
|
||||
* splice__Q27JGadget13TNodeLinkListFQ37JGadget13TNodeLinkList8iteratorRQ27JGadget13TNodeLinkListQ37JGadget13TNodeLinkList8iterator
|
||||
*/
|
||||
#ifdef NONMATCHING
|
||||
void JGadget::TNodeLinkList::splice(iterator myIt, TNodeLinkList& otherList, iterator otherIt) {
|
||||
TLinkListNode* otherNode = otherIt;
|
||||
TLinkListNode* otherNextNode = otherNode->mNext;
|
||||
|
||||
if (myIt == otherIt) {
|
||||
return;
|
||||
}
|
||||
if (myIt.node != otherNextNode) {
|
||||
otherList.Erase(otherNode);
|
||||
Insert(myIt, otherNode);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -113,7 +99,6 @@ asm void JGadget::TNodeLinkList::splice(JGadget::TNodeLinkList::iterator param_0
|
||||
#include "asm/JSystem/JGadget/linklist/func_802DCB08.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802DCBA8-802DCBD4 2D74E8 002C+00 1/1 7/7 0/0 .text
|
||||
* Insert__Q27JGadget13TNodeLinkListFQ37JGadget13TNodeLinkList8iteratorPQ27JGadget13TLinkListNode */
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "JSystem/JKernel/JKRAramStream.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
#include "MSL_C/string.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/ar/ar.h"
|
||||
#include "global.h"
|
||||
@@ -28,7 +29,9 @@ extern "C" void mainRamToAram__7JKRAramFPUcUlUl15JKRExpandSwitchUlP7JKRHeapiPUl(
|
||||
extern "C" void aramToMainRam__7JKRAramFUlPUcUl15JKRExpandSwitchUlP7JKRHeapiPUl();
|
||||
extern "C" static void JKRDecompressFromAramToMainRam__FUlPvUlUlUlPUl();
|
||||
extern "C" static void decompSZS_subroutine__FPUcPUc();
|
||||
static int decompSZS_subroutine(u8* param_0, u8* param_1);
|
||||
extern "C" static void firstSrcData__Fv();
|
||||
static u8* firstSrcData(void);
|
||||
extern "C" static void nextSrcData__FPUc();
|
||||
extern "C" void __sinit_JKRAram_cpp();
|
||||
extern "C" void func_802D2DF0(void* _this);
|
||||
@@ -43,7 +46,6 @@ extern "C" u8 sAramObject__7JKRAram[4];
|
||||
// External References:
|
||||
//
|
||||
|
||||
SECTION_INIT void memcpy();
|
||||
extern "C" void alloc__7JKRHeapFUliP7JKRHeap();
|
||||
extern "C" void alloc__7JKRHeapFUli();
|
||||
extern "C" void free__7JKRHeapFPvP7JKRHeap();
|
||||
@@ -281,7 +283,7 @@ static u32 readCount;
|
||||
static u32 maxDest;
|
||||
|
||||
/* 804513FC-80451400 0008FC 0004+00 1/1 0/0 0/0 .sbss None */
|
||||
static u8 data_804513FC[4];
|
||||
static bool data_804513FC;
|
||||
|
||||
/* 80451400-80451404 000900 0004+00 2/2 0/0 0/0 .sbss tsPtr */
|
||||
static u32* tsPtr;
|
||||
@@ -297,8 +299,7 @@ static u32 tsArea;
|
||||
// doesn't use r13
|
||||
void JKRDecompressFromAramToMainRam(u32 src, void* dst, u32 srcLength, u32 dstLength, u32 offset,
|
||||
u32* resourceSize) {
|
||||
#define s_is_decompress_mutex_initialized lbl_804513FC
|
||||
#define decompMutex lbl_804343C0
|
||||
#define s_is_decompress_mutex_initialized data_804513FC
|
||||
|
||||
// STATIC BEGIN
|
||||
// This code is probably generated by the compiler for a static variable
|
||||
@@ -311,7 +312,7 @@ void JKRDecompressFromAramToMainRam(u32 src, void* dst, u32 srcLength, u32 dstLe
|
||||
// STATIC END
|
||||
|
||||
OSLockMutex(&decompMutex);
|
||||
u32 szpSize = getSZSBufferSize();
|
||||
u32 szpSize = JKRAram::getSZSBufferSize();
|
||||
szpBuf = (u8*)JKRAllocFromSysHeap(szpSize, 0x20);
|
||||
ASSERT(szpBuf != 0);
|
||||
szpEnd = szpBuf + szpSize;
|
||||
@@ -431,7 +432,7 @@ static u8* nextSrcData(u8* current) {
|
||||
transLeft -= transSize;
|
||||
|
||||
if (transLeft == 0) {
|
||||
srcLimit = (u32)(dest + left) + transSize;
|
||||
srcLimit = (dest + left) + transSize;
|
||||
}
|
||||
|
||||
return dest;
|
||||
|
||||
@@ -78,7 +78,7 @@ JKRAramHeap::JKRAramHeap(u32 startAddress, u32 size) {
|
||||
// close match, regalloc problem in the beginning of the while loop
|
||||
#ifdef NONMATCHING
|
||||
JKRAramHeap::~JKRAramHeap() {
|
||||
JSUList<JKRAramBlock>* list = &lbl_8043430C;
|
||||
JSUList<JKRAramBlock>* list = &sAramList;
|
||||
JSUListIterator<JKRAramBlock> iterator = list;
|
||||
|
||||
while (iterator != list->getEnd()) {
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "JSystem/JKernel/JKRAramPiece.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JSupport/JSUFileStream.h"
|
||||
#include "JSystem/JSupport/JSURandomInputStream.h"
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
#include "dol2asm.h"
|
||||
#include "global.h"
|
||||
|
||||
@@ -125,10 +127,10 @@ s32 JKRAramStream::readFromAram(void) {
|
||||
#ifdef NONMATCHING
|
||||
s32 JKRAramStream::writeToAram(JKRAramStreamCommand* command) {
|
||||
u32 size;
|
||||
u32 dstSize = command->mDstLength;
|
||||
u32 dstSize = command->mSize;
|
||||
u32 offset = command->mOffset;
|
||||
u32 writtenLength = 0;
|
||||
u32 destination = command->mDst;
|
||||
u32 destination = command->mAddress;
|
||||
u8* buffer = command->mTransferBuffer;
|
||||
u32 bufferSize = command->mTransferBufferSize;
|
||||
JKRHeap* heap = command->mHeap;
|
||||
@@ -167,13 +169,11 @@ s32 JKRAramStream::writeToAram(JKRAramStreamCommand* command) {
|
||||
heap->dump();
|
||||
}
|
||||
|
||||
panic_f__12JUTExceptionFPCciPCce("JKRAramStream.cpp", 0xac, "%s",
|
||||
":::Cannot alloc memory\n");
|
||||
JUTException::panic_f("JKRAramStream.cpp", 0xac, "%s", ":::Cannot alloc memory\n");
|
||||
}
|
||||
|
||||
if (buffer) {
|
||||
seek__20JSURandomInputStreamFl17JSUStreamSeekFrom((JSURandomInputStream*)command->mStream,
|
||||
offset, 0);
|
||||
((JSURandomInputStream*)command->mStream)->seek(offset, JSUStreamSeekFrom_SET);
|
||||
while (dstSize != 0) {
|
||||
u32 length;
|
||||
if (dstSize > size) {
|
||||
@@ -182,8 +182,7 @@ s32 JKRAramStream::writeToAram(JKRAramStreamCommand* command) {
|
||||
length = dstSize;
|
||||
}
|
||||
|
||||
s32 readLength =
|
||||
read__14JSUInputStreamFPvl((JSUInputStream*)command->mStream, buffer, length);
|
||||
s32 readLength = ((JSURandomInputStream*)command->mStream)->read(buffer, length);
|
||||
if (readLength == 0) {
|
||||
writtenLength = 0;
|
||||
break;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "JSystem/JKernel/JKRDecomp.h"
|
||||
#include "JSystem/JKernel/JKRAramPiece.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "JSystem/JKernel/JKRDvdRipper.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
#include "MSL_C/math.h"
|
||||
#include "MSL_C/string.h"
|
||||
#include "dol2asm.h"
|
||||
#include "global.h"
|
||||
|
||||
@@ -29,7 +31,6 @@ extern "C" extern char const* const JKRDvdArchive__stringBase0;
|
||||
// External References:
|
||||
//
|
||||
|
||||
SECTION_INIT void memset();
|
||||
extern "C" void alloc__7JKRHeapFUliP7JKRHeap();
|
||||
extern "C" void alloc__7JKRHeapFUli();
|
||||
extern "C" void free__7JKRHeapFPvP7JKRHeap();
|
||||
@@ -70,7 +71,6 @@ extern "C" void _restgpr_26();
|
||||
extern "C" void _restgpr_27();
|
||||
extern "C" void _restgpr_28();
|
||||
extern "C" void _restgpr_29();
|
||||
extern "C" void abs();
|
||||
extern "C" u8 sVolumeList__13JKRFileLoader[12];
|
||||
extern "C" u8 sSystemHeap__7JKRHeap[4];
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ void JKRFileCache::removeResourceAll(void) {
|
||||
iterator = mCacheBlockList.getFirst();
|
||||
while (iterator != mCacheBlockList.getEnd()) {
|
||||
JKRFreeToHeap(mParentHeap, iterator->mMemoryPtr);
|
||||
mCacheBlockList.remove(&iterator->mLink);
|
||||
mCacheBlockList.remove(iterator.mLink);
|
||||
JSUListIterator<CCacheBlock> next = iterator++;
|
||||
CCacheBlock* cacheBlock = next.getObject();
|
||||
delete cacheBlock;
|
||||
|
||||
@@ -177,17 +177,7 @@ SECTION_DEAD static char const* const pad_8039D152 = "\0\0\0\0\0";
|
||||
#pragma pop
|
||||
|
||||
/* 804508C0-804508C8 000340 0002+06 1/1 0/0 0/0 .sdata rootPath$2498 */
|
||||
SECTION_SDATA static u8 rootPath[2 + 6 /* padding */] = {
|
||||
0x2F,
|
||||
0x00,
|
||||
/* padding */
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
};
|
||||
SECTION_SDATA static char rootPath[2] = "/";
|
||||
|
||||
/* 802D44C4-802D45A0 2CEE04 00DC+00 1/1 0/0 0/0 .text fetchVolumeName__13JKRFileLoaderFPclPCc */
|
||||
// matches, but lbl_804508C0 is accessed through r13
|
||||
@@ -198,9 +188,9 @@ const char* JKRFileLoader::fetchVolumeName(char* buffer, long bufferSize, const
|
||||
// lbl_804508C0 = JKernel::rootPath$2498 "/"
|
||||
// lbl_803D2D18 = MSL_C::__lower_map
|
||||
|
||||
if (strcmp(path, lbl_8039D150) == 0) {
|
||||
strcpy(buffer, lbl_804508C0);
|
||||
return lbl_804508C0;
|
||||
if (strcmp(path, "/") == 0) {
|
||||
strcpy(buffer, rootPath);
|
||||
return rootPath;
|
||||
}
|
||||
|
||||
path++;
|
||||
@@ -211,7 +201,7 @@ const char* JKRFileLoader::fetchVolumeName(char* buffer, long bufferSize, const
|
||||
if (ch == -1) {
|
||||
lower_char = -1;
|
||||
} else {
|
||||
lower_char = lbl_803D2D18[ch & 0xFF];
|
||||
lower_char = __lower_map[ch & 0xFF];
|
||||
}
|
||||
|
||||
*buffer = lower_char;
|
||||
@@ -223,7 +213,7 @@ const char* JKRFileLoader::fetchVolumeName(char* buffer, long bufferSize, const
|
||||
|
||||
*buffer = '\0';
|
||||
if (*path == '\0') {
|
||||
path = lbl_804508C0;
|
||||
path = rootPath;
|
||||
}
|
||||
|
||||
return path;
|
||||
|
||||
@@ -359,7 +359,7 @@ s32 JKRHeap::changeGroupID(u8 param_1) {
|
||||
*/
|
||||
// "not/nor" instruction in the wrong place
|
||||
#ifdef NONMATCHING
|
||||
s32 JKRHeap::getMaxAllocatableSize(int alignment) {
|
||||
u32 JKRHeap::getMaxAllocatableSize(int alignment) {
|
||||
u32 maxFreeBlock = (u32)getMaxFreeBlock();
|
||||
s32 freeSize = getFreeSize();
|
||||
|
||||
|
||||
@@ -206,10 +206,10 @@ bool JKRMemArchive::open(long entryNum, JKRArchive::EMountDirection mountDirecti
|
||||
mIsOpen = false;
|
||||
mMountDirection = mountDirection;
|
||||
|
||||
if (mMountDirection == JKRArchive::HEAD) {
|
||||
if (mMountDirection == JKRArchive::MOUNT_DIRECTION_HEAD) {
|
||||
u32 loadedSize;
|
||||
mArcHeader = (SArcHeader*)JKRDvdRipper::loadToMainRAM(
|
||||
entryNum, NULL, EXPAND_SWITCH_UNKNOWN1, 0, mHeap, JKRDvdRipper::FORWARD, 0,
|
||||
entryNum, NULL, EXPAND_SWITCH_UNKNOWN1, 0, mHeap, JKRDvdRipper::ALLOC_DIRECTION_FORWARD, 0,
|
||||
&mCompression, &loadedSize);
|
||||
if (mArcHeader) {
|
||||
DCInvalidateRange(mArcHeader, loadedSize);
|
||||
@@ -217,7 +217,7 @@ bool JKRMemArchive::open(long entryNum, JKRArchive::EMountDirection mountDirecti
|
||||
} else {
|
||||
u32 loadedSize;
|
||||
mArcHeader = (SArcHeader*)JKRDvdRipper::loadToMainRAM(
|
||||
entryNum, NULL, EXPAND_SWITCH_UNKNOWN1, 0, mHeap, JKRDvdRipper::BACKWARD, 0,
|
||||
entryNum, NULL, EXPAND_SWITCH_UNKNOWN1, 0, mHeap, JKRDvdRipper::ALLOC_DIRECTION_BACKWARD, 0,
|
||||
&mCompression, &loadedSize);
|
||||
if (mArcHeader) {
|
||||
DCInvalidateRange(mArcHeader, loadedSize);
|
||||
@@ -269,7 +269,7 @@ bool JKRMemArchive::open(void* buffer, u32 bufferSize, JKRMemBreakFlag flag) {
|
||||
(u8*)(mArcHeader->file_data_offset + mArcHeader->header_length + (u32)mArcHeader);
|
||||
mIsOpen = (flag == JKRMEMBREAK_FLAG_UNKNOWN1);
|
||||
mHeap = JKRHeap::findFromRoot(buffer);
|
||||
mCompression = JKRDecomp::NONE;
|
||||
mCompression = COMPRESSION_NONE;
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user