mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-30 07:34:37 -04:00
copy dolsdk2004 to tp / b_bh + e_mb done (#2299)
* move dolsdk2004 over * cleanup some temp work * finish and cleanup gf * b_bh done * d_a_e_mb done
This commit is contained in:
@@ -101,14 +101,14 @@ void J2DGrafContext::setColor(JUtility::TColor colorTL, JUtility::TColor colorTR
|
||||
mColorBR = colorBR;
|
||||
mColorBL = colorBL;
|
||||
field_0xb0.mType = GX_BM_BLEND;
|
||||
field_0xb0.mSrcFactor = GX_BL_SRC_ALPHA;
|
||||
field_0xb0.mDstFactor = GX_BL_INV_SRC_ALPHA;
|
||||
field_0xb0.mSrcFactor = GX_BL_SRCALPHA;
|
||||
field_0xb0.mDstFactor = GX_BL_INVSRCALPHA;
|
||||
mLinePart.mType = GX_BM_BLEND;
|
||||
mLinePart.mSrcFactor = GX_BL_SRC_ALPHA;
|
||||
mLinePart.mDstFactor = GX_BL_INV_SRC_ALPHA;
|
||||
mLinePart.mSrcFactor = GX_BL_SRCALPHA;
|
||||
mLinePart.mDstFactor = GX_BL_INVSRCALPHA;
|
||||
mBoxPart.mType = GX_BM_BLEND;
|
||||
mBoxPart.mSrcFactor = GX_BL_SRC_ALPHA;
|
||||
mBoxPart.mDstFactor = GX_BL_INV_SRC_ALPHA;
|
||||
mBoxPart.mSrcFactor = GX_BL_SRCALPHA;
|
||||
mBoxPart.mDstFactor = GX_BL_INVSRCALPHA;
|
||||
if ((mColorTL & 0xFF) != 0xFF) {
|
||||
return;
|
||||
}
|
||||
@@ -202,4 +202,4 @@ void J2DGrafContext::line(JGeometry::TVec2<f32> start, JGeometry::TVec2<f32> end
|
||||
void J2DGrafContext::lineTo(JGeometry::TVec2<f32> pos) {
|
||||
this->line(mPrevPos, pos);
|
||||
mPrevPos = pos;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,10 +398,10 @@ void J2DTevBlock1::setGX() {
|
||||
}
|
||||
GXSetTevSwapMode(GX_TEVSTAGE0, GXTevSwapSel(mTevStage[0].getRasSel()), GXTevSwapSel(mTevStage[0].getTexSel()));
|
||||
for (int i = 0; i < 4; i++) {
|
||||
GXSetTevSwapModeTable(GXTevSwapSel(i), GXTevColor(mTevSwapModeTable[i].getR()),
|
||||
GXTevColor(mTevSwapModeTable[i].getG()),
|
||||
GXTevColor(mTevSwapModeTable[i].getB()),
|
||||
GXTevColor(mTevSwapModeTable[i].getA()));
|
||||
GXSetTevSwapModeTable(GXTevSwapSel(i), GXTevColorChan(mTevSwapModeTable[i].getR()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getG()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getB()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getA()));
|
||||
}
|
||||
mIndTevStage->load(0);
|
||||
}
|
||||
@@ -636,7 +636,7 @@ bool J2DTevBlock2::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
const ResTIMG* timg = mTexture[param_0 == 0]->getTexInfo();
|
||||
if (timg != NULL && timg->indexTexture) {
|
||||
int tlutname = mTexture[param_0 == 0]->getTlutName();
|
||||
u8 tlut_no = tlutname - (tlutname >= GX_MAX_TLUT ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
u8 tlut_no = tlutname - (tlutname >= GX_BIGTLUT0 ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
|
||||
if (tlut_no == 0) {
|
||||
tlutid = 1;
|
||||
@@ -845,10 +845,10 @@ void J2DTevBlock2::setGX() {
|
||||
GXSetTevSwapMode(GXTevStageID(i), GXTevSwapSel(mTevStage[i].getRasSel()), GXTevSwapSel(mTevStage[i].getTexSel()));
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
GXSetTevSwapModeTable(GXTevSwapSel(i), GXTevColor(mTevSwapModeTable[i].getR()),
|
||||
GXTevColor(mTevSwapModeTable[i].getG()),
|
||||
GXTevColor(mTevSwapModeTable[i].getB()),
|
||||
GXTevColor(mTevSwapModeTable[i].getA()));
|
||||
GXSetTevSwapModeTable(GXTevSwapSel(i), GXTevColorChan(mTevSwapModeTable[i].getR()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getG()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getB()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getA()));
|
||||
}
|
||||
for (u8 i = 0; i < mTevStageNum; i++) {
|
||||
mIndTevStage[i].load(i);
|
||||
@@ -977,7 +977,7 @@ bool J2DTevBlock4::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette*
|
||||
continue;
|
||||
}
|
||||
int tlutName = mTexture[i]->getTlutName();
|
||||
u8 tlut_no = tlutName - (tlutName >= GX_MAX_TLUT ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
u8 tlut_no = tlutName - (tlutName >= GX_BIGTLUT0 ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
if (tlut_no < 4) {
|
||||
local_44 |= 1 << tlut_no;
|
||||
}
|
||||
@@ -1095,7 +1095,7 @@ bool J2DTevBlock4::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
const ResTIMG* timg = mTexture[i]->getTexInfo();
|
||||
if (timg != NULL && timg->indexTexture) {
|
||||
int tlutname = mTexture[i]->getTlutName();
|
||||
u8 tlut_no = tlutname - (tlutname >= GX_MAX_TLUT ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
u8 tlut_no = tlutname - (tlutname >= GX_BIGTLUT0 ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
|
||||
if (tlut_no < 4) {
|
||||
used_tlut |= 1 << tlut_no;
|
||||
@@ -1312,10 +1312,10 @@ void J2DTevBlock4::setGX() {
|
||||
GXSetTevSwapMode(GXTevStageID(i), GXTevSwapSel(mTevStage[i].getRasSel()), GXTevSwapSel(mTevStage[i].getTexSel()));
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
GXSetTevSwapModeTable(GXTevSwapSel(i), GXTevColor(mTevSwapModeTable[i].getR()),
|
||||
GXTevColor(mTevSwapModeTable[i].getG()),
|
||||
GXTevColor(mTevSwapModeTable[i].getB()),
|
||||
GXTevColor(mTevSwapModeTable[i].getA()));
|
||||
GXSetTevSwapModeTable(GXTevSwapSel(i), GXTevColorChan(mTevSwapModeTable[i].getR()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getG()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getB()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getA()));
|
||||
}
|
||||
for (u8 i = 0; i < mTevStageNum; i++) {
|
||||
mIndTevStage[i].load(i);
|
||||
@@ -1413,7 +1413,7 @@ bool J2DTevBlock8::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette*
|
||||
continue;
|
||||
}
|
||||
int tlutName = mTexture[i]->getTlutName();
|
||||
u8 tlut_no = tlutName - (tlutName >= GX_MAX_TLUT ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
u8 tlut_no = tlutName - (tlutName >= GX_BIGTLUT0 ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
if (tlut_no < 8) {
|
||||
local_44 |= 1 << tlut_no;
|
||||
}
|
||||
@@ -1531,7 +1531,7 @@ bool J2DTevBlock8::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
const ResTIMG* timg = mTexture[i]->getTexInfo();
|
||||
if (timg != NULL && timg->indexTexture) {
|
||||
int tlutname = mTexture[i]->getTlutName();
|
||||
u8 tlut_no = tlutname - (tlutname >= GX_MAX_TLUT ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
u8 tlut_no = tlutname - (tlutname >= GX_BIGTLUT0 ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
|
||||
if (tlut_no < 8) {
|
||||
used_tlut |= 1 << tlut_no;
|
||||
@@ -1743,10 +1743,10 @@ void J2DTevBlock8::setGX() {
|
||||
GXSetTevSwapMode(GXTevStageID(i), GXTevSwapSel(mTevStage[i].getRasSel()), GXTevSwapSel(mTevStage[i].getTexSel()));
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
GXSetTevSwapModeTable(GXTevSwapSel(i), GXTevColor(mTevSwapModeTable[i].getR()),
|
||||
GXTevColor(mTevSwapModeTable[i].getG()),
|
||||
GXTevColor(mTevSwapModeTable[i].getB()),
|
||||
GXTevColor(mTevSwapModeTable[i].getA()));
|
||||
GXSetTevSwapModeTable(GXTevSwapSel(i), GXTevColorChan(mTevSwapModeTable[i].getR()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getG()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getB()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getA()));
|
||||
}
|
||||
for (u8 i = 0; i < mTevStageNum; i++) {
|
||||
mIndTevStage[i].load(i);
|
||||
@@ -1844,7 +1844,7 @@ bool J2DTevBlock16::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette
|
||||
continue;
|
||||
}
|
||||
int tlutName = mTexture[i]->getTlutName();
|
||||
u8 tlut_no = tlutName - (tlutName >= GX_MAX_TLUT ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
u8 tlut_no = tlutName - (tlutName >= GX_BIGTLUT0 ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
if (tlut_no < 8) {
|
||||
local_44 |= 1 << tlut_no;
|
||||
}
|
||||
@@ -1962,7 +1962,7 @@ bool J2DTevBlock16::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
const ResTIMG* timg = mTexture[i]->getTexInfo();
|
||||
if (timg != NULL && timg->indexTexture) {
|
||||
int tlutname = mTexture[i]->getTlutName();
|
||||
u8 tlut_no = tlutname - (tlutname >= GX_MAX_TLUT ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
u8 tlut_no = tlutname - (tlutname >= GX_BIGTLUT0 ? GX_BIGTLUT0 : GX_TLUT0);
|
||||
|
||||
if (tlut_no < 8) {
|
||||
used_tlut |= 1 << tlut_no;
|
||||
@@ -2174,10 +2174,10 @@ void J2DTevBlock16::setGX() {
|
||||
GXSetTevSwapMode(GXTevStageID(i), GXTevSwapSel(mTevStage[i].getRasSel()), GXTevSwapSel(mTevStage[i].getTexSel()));
|
||||
}
|
||||
for (int i = 0; i < 4; i++) {
|
||||
GXSetTevSwapModeTable(GXTevSwapSel(i), GXTevColor(mTevSwapModeTable[i].getR()),
|
||||
GXTevColor(mTevSwapModeTable[i].getG()),
|
||||
GXTevColor(mTevSwapModeTable[i].getB()),
|
||||
GXTevColor(mTevSwapModeTable[i].getA()));
|
||||
GXSetTevSwapModeTable(GXTevSwapSel(i), GXTevColorChan(mTevSwapModeTable[i].getR()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getG()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getB()),
|
||||
GXTevColorChan(mTevSwapModeTable[i].getA()));
|
||||
}
|
||||
for (u8 i = 0; i < mTevStageNum; i++) {
|
||||
mIndTevStage[i].load(i);
|
||||
|
||||
@@ -1086,7 +1086,7 @@ void J2DPicture::setTevMode() {
|
||||
}
|
||||
|
||||
GXSetNumTevStages(u8(i));
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_SET);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
|
||||
for (i = 0; i < mTextureNum; i++) {
|
||||
GXSetTexCoordGen(GXTexCoordID(i), GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||
@@ -1333,7 +1333,7 @@ u8 J2DPicture::getUsableTlut(u8 param_0) {
|
||||
|
||||
if (img != NULL && img->indexTexture != 0) {
|
||||
int name = mTexture[i]->getTlutName();
|
||||
int var_r0 = name >= GX_MAX_TLUT ? GX_MAX_TLUT : GX_TLUT0;
|
||||
int var_r0 = name >= GX_BIGTLUT0 ? GX_BIGTLUT0 : GX_TLUT0;
|
||||
|
||||
u8 temp_r0 = name - var_r0;
|
||||
if (temp_r0 < 2) {
|
||||
@@ -1481,4 +1481,4 @@ bool J2DPicture::isUsed(ResFONT const* param_0) {
|
||||
/* 802FF65C-802FF660 2F9F9C 0004+00 1/0 0/0 0/0 .text rewriteAlpha__10J2DPictureFv */
|
||||
void J2DPicture::rewriteAlpha() {
|
||||
/* empty function */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ void J2DScreen::drawSelf(f32 param_0, f32 param_1, Mtx* param_2) {
|
||||
JUtility::TColor sp8(alpha | ((u32)color & 0xFFFFFF00));
|
||||
color = sp8;
|
||||
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_SET);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ void J2DIndTevStage::load(u8 tevStage) {
|
||||
|
||||
/* 802EA098-802EA0CC 2E49D8 0034+00 0/0 1/1 0/0 .text load__12J2DIndTexMtxFUc */
|
||||
void J2DIndTexMtx::load(u8 indTexMtx) {
|
||||
GXSetIndTexMtx((GXIndTexMtxID)(GX_ITM_0 + indTexMtx), (f32*)mIndTexMtxInfo.mMtx,
|
||||
GXSetIndTexMtx((GXIndTexMtxID)(GX_ITM_0 + indTexMtx), mIndTexMtxInfo.mMtx,
|
||||
mIndTexMtxInfo.mScaleExp);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ extern const J2DTevSwapModeTableInfo j2dDefaultTevSwapModeTable = {
|
||||
GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA};
|
||||
|
||||
/* 804561A0-804561A4 0047A0 0004+00 0/0 3/3 0/0 .sdata2 j2dDefaultBlendInfo */
|
||||
extern const J2DBlendInfo j2dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA,
|
||||
extern const J2DBlendInfo j2dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA,
|
||||
GX_LO_NOOP};
|
||||
|
||||
/* 804561A4-804561A8 0047A4 0004+00 0/0 1/1 0/0 .sdata2 None */
|
||||
|
||||
@@ -430,7 +430,7 @@ void J2DWindow::drawContents(JGeometry::TBox2<f32> const& param_0) {
|
||||
{
|
||||
GXSetBlendMode(GX_BM_NONE, GX_BL_ONE, GX_BL_ZERO, GX_LO_SET);
|
||||
} else {
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_SET);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
}
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
@@ -573,7 +573,7 @@ void J2DWindow::setTevMode(JUTTexture* param_0, JUtility::TColor param_1,
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV);
|
||||
GXSetNumTevStages(1);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_SET);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
} else {
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColor(GX_TEVREG0, param_1);
|
||||
@@ -595,7 +595,7 @@ void J2DWindow::setTevMode(JUTTexture* param_0, JUtility::TColor param_1,
|
||||
GXSetNumTevStages(2);
|
||||
}
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_SET);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
}
|
||||
|
||||
/* 802FBE60-802FBEDC 2F67A0 007C+00 1/0 0/0 0/0 .text getFrameTexture__9J2DWindowCFUcUc
|
||||
@@ -676,4 +676,4 @@ bool J2DWindow::isUsed(ResFONT const* param_0) {
|
||||
/* 802FC04C-802FC050 2F698C 0004+00 1/0 0/0 0/0 .text rewriteAlpha__9J2DWindowFv */
|
||||
void J2DWindow::rewriteAlpha() {
|
||||
/* empty function */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -552,9 +552,9 @@ void J3DSkinDeform::deformVtxPos_S16(J3DVertexBuffer* param_0, J3DMtxBuffer* par
|
||||
void* transformedVtxPos = param_0->getTransformedVtxPos(0);
|
||||
for (int i = 0; i < vtxNum; i++) {
|
||||
Mtx* anmMtx = anmMtxs[jointTree->getDrawMtxFlag(mPosData[i])];
|
||||
J3DPSMulMtxVec(anmMtx[jointTree->getDrawMtxIndex(mPosData[i])], ((SVec*)currentVtxPos) + i, ((SVec*)transformedVtxPos) + i);
|
||||
J3DPSMulMtxVec(anmMtx[jointTree->getDrawMtxIndex(mPosData[i])], ((S16Vec*)currentVtxPos) + i, ((S16Vec*)transformedVtxPos) + i);
|
||||
}
|
||||
DCStoreRange(param_0->getTransformedVtxPos(0), param_0->getVertexData()->getVtxNum() * sizeof(SVec));
|
||||
DCStoreRange(param_0->getTransformedVtxPos(0), param_0->getVertexData()->getVtxNum() * sizeof(S16Vec));
|
||||
param_0->setCurrentVtxPos(transformedVtxPos);
|
||||
}
|
||||
|
||||
@@ -584,9 +584,9 @@ void J3DSkinDeform::deformVtxNrm_S16(J3DVertexBuffer* param_0) const {
|
||||
void* currentVtxNrm = param_0->getCurrentVtxNrm();
|
||||
void* transformedVtxNrm = param_0->getTransformedVtxNrm(0);
|
||||
for (int i = 0; i < nrmNum; i++) {
|
||||
J3DPSMulMtxVec(mNrmMtx[mNrmData[i]], ((SVec*)currentVtxNrm) + i, ((SVec*)transformedVtxNrm) + i);
|
||||
J3DPSMulMtxVec(mNrmMtx[mNrmData[i]], ((S16Vec*)currentVtxNrm) + i, ((S16Vec*)transformedVtxNrm) + i);
|
||||
}
|
||||
DCStoreRange(param_0->getTransformedVtxNrm(0), param_0->getVertexData()->getNrmNum() * sizeof(SVec));
|
||||
DCStoreRange(param_0->getTransformedVtxNrm(0), param_0->getVertexData()->getNrmNum() * sizeof(S16Vec));
|
||||
param_0->setCurrentVtxNrm(transformedVtxNrm);
|
||||
}
|
||||
|
||||
|
||||
@@ -96,89 +96,89 @@ void J3DGDSetVtxAttrFmtv(GXVtxFmt fmt, GXVtxAttrFmtList const* fmtList, bool par
|
||||
u32 tex7_cnt = GX_TEX_ST;
|
||||
u32 tex7_type = GX_F32;
|
||||
u32 tex7_shift = 0;
|
||||
for (; fmtList->mAttrib != GX_VA_NULL; fmtList++) {
|
||||
switch (fmtList->mAttrib) {
|
||||
for (; fmtList->attr != GX_VA_NULL; fmtList++) {
|
||||
switch (fmtList->attr) {
|
||||
case GX_VA_POS:
|
||||
pos_cnt = fmtList->mCompCnt;
|
||||
pos_type = fmtList->mCompType;
|
||||
pos_shift = fmtList->mCompShift;
|
||||
pos_cnt = fmtList->cnt;
|
||||
pos_type = fmtList->type;
|
||||
pos_shift = fmtList->frac;
|
||||
break;
|
||||
case GX_VA_NRM:
|
||||
case GX_VA_NBT:
|
||||
nrm_type = fmtList->mCompType;
|
||||
if (fmtList->mCompCnt == GX_NRM_NBT3) {
|
||||
nrm_type = fmtList->type;
|
||||
if (fmtList->cnt == GX_NRM_NBT3) {
|
||||
nrm_cnt = GX_NRM_NBT;
|
||||
local_34 = 1;
|
||||
} else {
|
||||
if (param_2) {
|
||||
nrm_cnt = GX_NRM_NBT;
|
||||
} else {
|
||||
nrm_cnt = fmtList->mCompCnt;
|
||||
nrm_cnt = fmtList->cnt;
|
||||
}
|
||||
local_34 = 0;
|
||||
}
|
||||
break;
|
||||
case GX_VA_CLR0:
|
||||
clr0_cnt = fmtList->mCompCnt;
|
||||
clr0_type = fmtList->mCompType;
|
||||
clr0_cnt = fmtList->cnt;
|
||||
clr0_type = fmtList->type;
|
||||
break;
|
||||
case GX_VA_CLR1:
|
||||
clr1_cnt = fmtList->mCompCnt;
|
||||
clr1_type = fmtList->mCompType;
|
||||
clr1_cnt = fmtList->cnt;
|
||||
clr1_type = fmtList->type;
|
||||
break;
|
||||
case GX_VA_TEX0:
|
||||
tex0_cnt = fmtList->mCompCnt;
|
||||
tex0_type = fmtList->mCompType;
|
||||
tex0_shift = fmtList->mCompShift;
|
||||
tex0_cnt = fmtList->cnt;
|
||||
tex0_type = fmtList->type;
|
||||
tex0_shift = fmtList->frac;
|
||||
break;
|
||||
case GX_VA_TEX1:
|
||||
tex1_cnt = fmtList->mCompCnt;
|
||||
tex1_type = fmtList->mCompType;
|
||||
tex1_shift = fmtList->mCompShift;
|
||||
tex1_cnt = fmtList->cnt;
|
||||
tex1_type = fmtList->type;
|
||||
tex1_shift = fmtList->frac;
|
||||
break;
|
||||
case GX_VA_TEX2:
|
||||
tex2_cnt = fmtList->mCompCnt;
|
||||
tex2_type = fmtList->mCompType;
|
||||
tex2_shift = fmtList->mCompShift;
|
||||
tex2_cnt = fmtList->cnt;
|
||||
tex2_type = fmtList->type;
|
||||
tex2_shift = fmtList->frac;
|
||||
break;
|
||||
case GX_VA_TEX3:
|
||||
tex3_cnt = fmtList->mCompCnt;
|
||||
tex3_type = fmtList->mCompType;
|
||||
tex3_shift = fmtList->mCompShift;
|
||||
tex3_cnt = fmtList->cnt;
|
||||
tex3_type = fmtList->type;
|
||||
tex3_shift = fmtList->frac;
|
||||
break;
|
||||
case GX_VA_TEX4:
|
||||
tex4_cnt = fmtList->mCompCnt;
|
||||
tex4_type = fmtList->mCompType;
|
||||
tex4_shift = fmtList->mCompShift;
|
||||
tex4_cnt = fmtList->cnt;
|
||||
tex4_type = fmtList->type;
|
||||
tex4_shift = fmtList->frac;
|
||||
break;
|
||||
case GX_VA_TEX5:
|
||||
tex5_cnt = fmtList->mCompCnt;
|
||||
tex5_type = fmtList->mCompType;
|
||||
tex5_shift = fmtList->mCompShift;
|
||||
tex5_cnt = fmtList->cnt;
|
||||
tex5_type = fmtList->type;
|
||||
tex5_shift = fmtList->frac;
|
||||
break;
|
||||
case GX_VA_TEX6:
|
||||
tex6_cnt = fmtList->mCompCnt;
|
||||
tex6_type = fmtList->mCompType;
|
||||
tex6_shift = fmtList->mCompShift;
|
||||
tex6_cnt = fmtList->cnt;
|
||||
tex6_type = fmtList->type;
|
||||
tex6_shift = fmtList->frac;
|
||||
break;
|
||||
case GX_VA_TEX7:
|
||||
tex7_cnt = fmtList->mCompCnt;
|
||||
tex7_type = fmtList->mCompType;
|
||||
tex7_shift = fmtList->mCompShift;
|
||||
tex7_cnt = fmtList->cnt;
|
||||
tex7_type = fmtList->type;
|
||||
tex7_shift = fmtList->frac;
|
||||
break;
|
||||
}
|
||||
}
|
||||
GDOverflowCheck(0x12);
|
||||
J3DGDWriteCPCmd(GX_CP_REG_VAT_GRP0 + fmt,
|
||||
J3DGDWriteCPCmd(CP_REG_VAT_GRP0_ID + fmt,
|
||||
pos_cnt | pos_type << 1 | pos_shift << 4 | nrm_cnt << 9 | nrm_type << 0xa |
|
||||
clr0_cnt << 0xd | clr0_type << 0xe | clr1_cnt << 0x11 | clr1_type << 0x12 |
|
||||
tex0_cnt << 0x15 | tex0_type << 0x16 | tex0_shift << 0x19 | 0x40000000 |
|
||||
local_34 << 0x1f);
|
||||
J3DGDWriteCPCmd(GX_CP_REG_VAT_GRP1 + fmt,
|
||||
J3DGDWriteCPCmd(CP_REG_VAT_GRP1_ID + fmt,
|
||||
tex1_cnt | tex1_type << 1 | tex1_shift << 4 | tex2_cnt << 9 | tex2_type << 0xa |
|
||||
tex2_shift << 0xd | tex3_cnt << 0x12 | tex3_type << 0x13 |
|
||||
tex3_shift << 0x16 | tex4_cnt << 0x1b | tex4_type << 0x1c | 0x80000000);
|
||||
J3DGDWriteCPCmd(GX_CP_REG_VAT_GRP2 + fmt,
|
||||
J3DGDWriteCPCmd(CP_REG_VAT_GRP2_ID + fmt,
|
||||
tex4_shift | tex5_cnt << 5 | tex5_type << 6 | tex5_shift << 9 |
|
||||
tex6_cnt << 0xe | tex6_type << 0xf | tex6_shift << 0x12 | tex7_cnt << 0x17 |
|
||||
tex7_type << 0x18 | tex7_shift << 0x1b);
|
||||
@@ -482,14 +482,14 @@ void J3DGDSetIndTexOrder(u32 count, GXTexCoordID coord0, GXTexMapID map0, GXTexC
|
||||
void J3DGDSetTevOrder(GXTevStageID stage, GXTexCoordID coord0, GXTexMapID map0,
|
||||
GXChannelID channel0, GXTexCoordID coord1, GXTexMapID map1,
|
||||
GXChannelID channel1) {
|
||||
coord0 = coord0 >= GX_MAXCOORD ? GX_TEXCOORD0 : coord0;
|
||||
coord1 = coord1 >= GX_MAXCOORD ? GX_TEXCOORD0 : coord1;
|
||||
coord0 = coord0 >= GX_MAX_TEXCOORD ? GX_TEXCOORD0 : coord0;
|
||||
coord1 = coord1 >= GX_MAX_TEXCOORD ? GX_TEXCOORD0 : coord1;
|
||||
GDOverflowCheck(5);
|
||||
static u8 c2r[] = {0, 1, 0, 1, 0, 1, 7, 5, 6, 0, 0, 0, 0, 0, 0, 7};
|
||||
J3DGDWriteBPCmd((map0 & 7) | coord0 << 3 |
|
||||
(map0 != GX_TEXMAP_NULL && !(map0 & GX_TEXMAP_DISABLE)) << 6 |
|
||||
(map0 != GX_TEXMAP_NULL && !(map0 & GX_TEX_DISABLE)) << 6 |
|
||||
c2r[channel0 & 0xf] << 7 | (map1 & 7) << 0xc | coord1 << 0xf |
|
||||
(map1 != GX_TEXMAP_NULL && !(map1 & GX_TEXMAP_DISABLE)) << 0x12 |
|
||||
(map1 != GX_TEXMAP_NULL && !(map1 & GX_TEX_DISABLE)) << 0x12 |
|
||||
c2r[channel1 & 0xf] << 0x13 | (stage / 2 + GX_BP_REG_RAS1_TREF0) << 0x18);
|
||||
}
|
||||
|
||||
@@ -552,8 +552,8 @@ void J3DGDSetFog(GXFogType fogType, f32 param_1, f32 param_2, f32 nearZ, f32 far
|
||||
void J3DGDSetFogRangeAdj(u8 param_0, u16 param_1, GXFogAdjTable* table) {
|
||||
if (param_0 != 0) {
|
||||
for (int i = 0; i < 0xa; i += 2) {
|
||||
J3DGDWriteBPCmd((i / 2 + GX_BP_REG_FOGRANGEK0) << 0x18 | table->fogVals[i + 1] << 0xc |
|
||||
table->fogVals[i]);
|
||||
J3DGDWriteBPCmd((i / 2 + GX_BP_REG_FOGRANGEK0) << 0x18 | table->r[i + 1] << 0xc |
|
||||
table->r[i]);
|
||||
}
|
||||
}
|
||||
u32 cmd = GX_BP_REG_FOGRANGE << 0x18 | (param_1 + 0x156) | param_0 << 0xa;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/os.h"
|
||||
#include "string.h"
|
||||
#include "global.h"
|
||||
|
||||
inline void loadMatColors(const J3DGXColor* color) {
|
||||
J3DGDWriteXFCmdHdr(0x100C, 2);
|
||||
@@ -408,25 +409,25 @@ void J3DColorBlockLightOff::patch() {
|
||||
/* 80318F00-803190AC 313840 01AC+00 2/0 0/0 0/0 .text patchMatColor__21J3DColorBlockLightOffFv */
|
||||
void J3DColorBlockLightOff::patchMatColor() {
|
||||
GDSetCurrOffset(mMatColorOffset);
|
||||
u8* start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
GDOverflowCheck(SizeOfLoadMatColors);
|
||||
loadMatColors(mMatColor);
|
||||
u8* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 803190AC-803194E8 3139EC 043C+00 2/0 0/0 0/0 .text patchLight__21J3DColorBlockLightOffFv */
|
||||
void J3DColorBlockLightOff::patchLight() {
|
||||
GDSetCurrOffset(mColorChanOffset);
|
||||
u8* start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
GDOverflowCheck(SizeOfLoadColorChans);
|
||||
J3DGDWriteXFCmdHdr(0x100e, 4);
|
||||
mColorChan[0].load();
|
||||
mColorChan[1].load();
|
||||
mColorChan[2].load();
|
||||
mColorChan[3].load();
|
||||
u8* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 803194E8-80319534 313E28 004C+00 1/0 0/0 0/0 .text patch__20J3DColorBlockLightOnFv */
|
||||
@@ -438,17 +439,17 @@ void J3DColorBlockLightOn::patch() {
|
||||
/* 80319534-803196E0 313E74 01AC+00 1/0 0/0 0/0 .text patchMatColor__20J3DColorBlockLightOnFv */
|
||||
void J3DColorBlockLightOn::patchMatColor() {
|
||||
GDSetCurrOffset(mMatColorOffset);
|
||||
u8* start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
GDOverflowCheck(SizeOfLoadMatColors);
|
||||
loadMatColors(mMatColor);
|
||||
u8* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 803196E0-80319B4C 314020 046C+00 1/0 0/0 0/0 .text patchLight__20J3DColorBlockLightOnFv */
|
||||
void J3DColorBlockLightOn::patchLight() {
|
||||
GDSetCurrOffset(mColorChanOffset);
|
||||
u8* start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
GDOverflowCheck(SizeOfLoadColorChans);
|
||||
J3DGDWriteXFCmdHdr(0x100e, 4);
|
||||
mColorChan[0].load();
|
||||
@@ -460,8 +461,8 @@ void J3DColorBlockLightOn::patchLight() {
|
||||
mLight[i]->load(i);
|
||||
}
|
||||
}
|
||||
u8* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 80319B4C-80319BB4 31448C 0068+00 2/0 0/0 0/0 .text diff__21J3DColorBlockLightOffFUl */
|
||||
@@ -563,40 +564,40 @@ void J3DTexGenBlockBasic::load() {
|
||||
/* 8031AA88-8031AB18 3153C8 0090+00 1/0 0/0 0/0 .text patch__21J3DTexGenBlockPatchedFv */
|
||||
void J3DTexGenBlockPatched::patch() {
|
||||
GDSetCurrOffset(mTexMtxOffset);
|
||||
u8* start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
for (u32 i = 0; i < 8; i++) {
|
||||
if (mTexMtx[i]) {
|
||||
mTexMtx[i]->load(i);
|
||||
}
|
||||
}
|
||||
u8* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031AB18-8031ABC0 315458 00A8+00 1/0 0/0 0/0 .text patch__15J3DTexGenBlock4Fv */
|
||||
void J3DTexGenBlock4::patch() {
|
||||
GDSetCurrOffset(mTexMtxOffset);
|
||||
u8* start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
for (u32 i = 0; i < 4; i++) {
|
||||
if (mTexMtx[i] && mTexCoord[i].getTexGenMtx() != GX_IDENTITY) {
|
||||
mTexMtx[i]->load(i);
|
||||
}
|
||||
}
|
||||
u8* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031ABC0-8031AC68 315500 00A8+00 1/0 0/0 0/0 .text patch__19J3DTexGenBlockBasicFv */
|
||||
void J3DTexGenBlockBasic::patch() {
|
||||
GDSetCurrOffset(mTexMtxOffset);
|
||||
u8* start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
for (u32 i = 0; i < 8; i++) {
|
||||
if (mTexMtx[i] && mTexCoord[i].getTexGenMtx() != GX_IDENTITY) {
|
||||
mTexMtx[i]->load(i);
|
||||
}
|
||||
}
|
||||
u8* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031AC68-8031ACD0 3155A8 0068+00 3/0 0/0 0/0 .text diff__21J3DTexGenBlockPatchedFUl */
|
||||
@@ -693,8 +694,8 @@ void J3DTevBlock2::load() {
|
||||
GXTevKAlphaSel(mTevKAlphaSel[0]),
|
||||
GXTevKColorSel(mTevKColorSel[1]),
|
||||
GXTevKAlphaSel(mTevKAlphaSel[1]),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getR()),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getG())
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getR()),
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getG())
|
||||
);
|
||||
J3DGDSetTevKonstantSel_SwapModeTable(
|
||||
GXTevStageID(i + 2),
|
||||
@@ -702,8 +703,8 @@ void J3DTevBlock2::load() {
|
||||
GXTevKAlphaSel(mTevKAlphaSel[0]),
|
||||
GXTevKColorSel(mTevKColorSel[1]),
|
||||
GXTevKAlphaSel(mTevKAlphaSel[1]),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getB()),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getA())
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getB()),
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getA())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -754,8 +755,8 @@ void J3DTevBlock4::load() {
|
||||
GXTevKAlphaSel(mTevKAlphaSel[0]),
|
||||
GXTevKColorSel(mTevKColorSel[1]),
|
||||
GXTevKAlphaSel(mTevKAlphaSel[1]),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getR()),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getG())
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getR()),
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getG())
|
||||
);
|
||||
J3DGDSetTevKonstantSel_SwapModeTable(
|
||||
GXTevStageID(i + 2),
|
||||
@@ -763,8 +764,8 @@ void J3DTevBlock4::load() {
|
||||
GXTevKAlphaSel(mTevKAlphaSel[2]),
|
||||
GXTevKColorSel(mTevKColorSel[3]),
|
||||
GXTevKAlphaSel(mTevKAlphaSel[3]),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getB()),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getA())
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getB()),
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getA())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -815,8 +816,8 @@ void J3DTevBlock16::load() {
|
||||
GXTevKAlphaSel(mTevKAlphaSel[i]),
|
||||
GXTevKColorSel(mTevKColorSel[i + 1]),
|
||||
GXTevKAlphaSel(mTevKAlphaSel[i + 1]),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getR()),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getG())
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getR()),
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getG())
|
||||
);
|
||||
J3DGDSetTevKonstantSel_SwapModeTable(
|
||||
GXTevStageID(i + 2),
|
||||
@@ -824,8 +825,8 @@ void J3DTevBlock16::load() {
|
||||
GXTevKAlphaSel(mTevKAlphaSel[i + 2]),
|
||||
GXTevKColorSel(mTevKColorSel[i + 3]),
|
||||
GXTevKAlphaSel(mTevKAlphaSel[i + 3]),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getB()),
|
||||
GXTevColor(mTevSwapModeTable[i / 4].getA())
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getB()),
|
||||
GXTevColorChan(mTevSwapModeTable[i / 4].getA())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -835,7 +836,7 @@ void J3DTevBlock16::load() {
|
||||
*/
|
||||
void J3DTevBlockPatched::patchTexNo() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8* start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
for (u32 i = 0; i < 8; i++) {
|
||||
if (mTexNo[i] != 0xffff) {
|
||||
@@ -843,15 +844,15 @@ void J3DTevBlockPatched::patchTexNo() {
|
||||
}
|
||||
}
|
||||
|
||||
u8* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031BFE0-8031C0AC 316920 00CC+00 1/0 0/0 0/0 .text patchTevReg__18J3DTevBlockPatchedFv
|
||||
*/
|
||||
void J3DTevBlockPatched::patchTevReg() {
|
||||
GDSetCurrOffset(mTevRegOffset);
|
||||
u8 *pStart = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
for (u32 i = 0; i < ARRAY_SIZE(mTevColor) - 1; i++) {
|
||||
J3DGDSetTevColorS10((GXTevRegID)(i + 1), mTevColor[i]);
|
||||
@@ -860,15 +861,15 @@ void J3DTevBlockPatched::patchTevReg() {
|
||||
J3DGDSetTevKColor((GXTevKColorID)i, mTevKColor[i]);
|
||||
}
|
||||
|
||||
u8 *pEnd = GDGetCurrPointer();
|
||||
DCStoreRange(pStart, pEnd - pStart);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031C0AC-8031C228 3169EC 017C+00 1/0 0/0 0/0 .text
|
||||
* patchTexNoAndTexCoordScale__18J3DTevBlockPatchedFv */
|
||||
void J3DTevBlockPatched::patchTexNoAndTexCoordScale() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8 *start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
u8 tevStageNum = mTevStageNum;
|
||||
for (u32 i = 0; i < 8; i++) {
|
||||
@@ -897,8 +898,8 @@ void J3DTevBlockPatched::patchTexNoAndTexCoordScale() {
|
||||
);
|
||||
}
|
||||
|
||||
u8 *end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031C228-8031C274 316B68 004C+00 1/0 0/0 0/0 .text patch__18J3DTevBlockPatchedFv */
|
||||
@@ -910,14 +911,14 @@ void J3DTevBlockPatched::patch() {
|
||||
/* 8031C274-8031C2E4 316BB4 0070+00 1/0 0/0 0/0 .text patchTexNo__12J3DTevBlock1Fv */
|
||||
void J3DTevBlock1::patchTexNo() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8 *pStart = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
if (mTexNo[0] != 0xFFFF) {
|
||||
loadTexNo(0, mTexNo[0]);
|
||||
}
|
||||
|
||||
u8 *pEnd = GDGetCurrPointer();
|
||||
DCStoreRange(pStart, pEnd - pStart);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031C2E4-8031C2E8 316C24 0004+00 1/0 0/0 0/0 .text patchTevReg__12J3DTevBlock1Fv */
|
||||
@@ -928,7 +929,7 @@ void J3DTevBlock1::patchTevReg() {
|
||||
*/
|
||||
void J3DTevBlock1::patchTexNoAndTexCoordScale() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8 *start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
if (mTexNo[0] != 0xffff) {
|
||||
loadTexNo(0, mTexNo[0]);
|
||||
@@ -948,8 +949,8 @@ void J3DTevBlock1::patchTexNoAndTexCoordScale() {
|
||||
J3DSys::sTexCoordScaleTable[mTevOrder[0].getTevOrderInfo().mTexMap & 7]
|
||||
);
|
||||
|
||||
u8 *end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031C3CC-8031C3F8 316D0C 002C+00 1/0 0/0 0/0 .text patch__12J3DTevBlock1Fv */
|
||||
@@ -960,7 +961,7 @@ void J3DTevBlock1::patch() {
|
||||
/* 8031C3F8-8031C48C 316D38 0094+00 1/0 0/0 0/0 .text patchTexNo__12J3DTevBlock2Fv */
|
||||
void J3DTevBlock2::patchTexNo() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8 *start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
for (u32 i = 0; i < 2; i++) {
|
||||
if (mTexNo[i] != 0xffff) {
|
||||
@@ -968,14 +969,14 @@ void J3DTevBlock2::patchTexNo() {
|
||||
}
|
||||
}
|
||||
|
||||
u8 *end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031C48C-8031C558 316DCC 00CC+00 1/0 0/0 0/0 .text patchTevReg__12J3DTevBlock2Fv */
|
||||
void J3DTevBlock2::patchTevReg() {
|
||||
GDSetCurrOffset(mTevRegOffset);
|
||||
u8 *pStart = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
for (u32 i = 0; i < ARRAY_SIZE(mTevColor) - 1; i++) {
|
||||
J3DGDSetTevColorS10((GXTevRegID)(i + 1), mTevColor[i]);
|
||||
@@ -984,15 +985,15 @@ void J3DTevBlock2::patchTevReg() {
|
||||
J3DGDSetTevKColor((GXTevKColorID)i, mTevKColor[i]);
|
||||
}
|
||||
|
||||
u8 *pEnd = GDGetCurrPointer();
|
||||
DCStoreRange(pStart, pEnd - pStart);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031C558-8031C6A8 316E98 0150+00 1/0 0/0 0/0 .text patchTexNoAndTexCoordScale__12J3DTevBlock2Fv
|
||||
*/
|
||||
void J3DTevBlock2::patchTexNoAndTexCoordScale() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8 *start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
for (u32 i = 0; i < 2; i++) {
|
||||
if (mTexNo[i] != 0xffff) {
|
||||
@@ -1018,8 +1019,8 @@ void J3DTevBlock2::patchTexNoAndTexCoordScale() {
|
||||
J3DSys::sTexCoordScaleTable[mTevOrder[1].getTevOrderInfo().mTexMap & 7]
|
||||
);
|
||||
|
||||
u8 *end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031C6A8-8031C6F4 316FE8 004C+00 1/0 0/0 0/0 .text patch__12J3DTevBlock2Fv */
|
||||
@@ -1031,7 +1032,7 @@ void J3DTevBlock2::patch() {
|
||||
/* 8031C6F4-8031C788 317034 0094+00 1/0 0/0 0/0 .text patchTexNo__12J3DTevBlock4Fv */
|
||||
void J3DTevBlock4::patchTexNo() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8 *start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
for (u32 i = 0; i < 4; i++) {
|
||||
if (mTexNo[i] != 0xffff) {
|
||||
@@ -1039,14 +1040,14 @@ void J3DTevBlock4::patchTexNo() {
|
||||
}
|
||||
}
|
||||
|
||||
u8 *end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031C788-8031C854 3170C8 00CC+00 1/0 0/0 0/0 .text patchTevReg__12J3DTevBlock4Fv */
|
||||
void J3DTevBlock4::patchTevReg() {
|
||||
GDSetCurrOffset(mTevRegOffset);
|
||||
u8 *pStart = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
for (u32 i = 0; i < ARRAY_SIZE(mTevColor) - 1; i++) {
|
||||
J3DGDSetTevColorS10((GXTevRegID)(i + 1), mTevColor[i]);
|
||||
@@ -1055,15 +1056,15 @@ void J3DTevBlock4::patchTevReg() {
|
||||
J3DGDSetTevKColor((GXTevKColorID)i, mTevKColor[i]);
|
||||
}
|
||||
|
||||
u8 *pEnd = GDGetCurrPointer();
|
||||
DCStoreRange(pStart, pEnd - pStart);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031C854-8031C9D0 317194 017C+00 1/0 0/0 0/0 .text patchTexNoAndTexCoordScale__12J3DTevBlock4Fv
|
||||
*/
|
||||
void J3DTevBlock4::patchTexNoAndTexCoordScale() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8 *start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
u8 tevStageNum = mTevStageNum;
|
||||
for (u32 i = 0; i < 4; i++) {
|
||||
@@ -1092,8 +1093,8 @@ void J3DTevBlock4::patchTexNoAndTexCoordScale() {
|
||||
);
|
||||
}
|
||||
|
||||
u8 *end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
/* 8031C9D0-8031CA1C 317310 004C+00 1/0 0/0 0/0 .text patch__12J3DTevBlock4Fv */
|
||||
void J3DTevBlock4::patch() {
|
||||
@@ -1104,7 +1105,7 @@ void J3DTevBlock4::patch() {
|
||||
/* 8031CA1C-8031CAB0 31735C 0094+00 1/0 0/0 0/0 .text patchTexNo__13J3DTevBlock16Fv */
|
||||
void J3DTevBlock16::patchTexNo() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8 *start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
for (u32 i = 0; i < 8; i++) {
|
||||
if (mTexNo[i] != 0xffff) {
|
||||
@@ -1112,14 +1113,14 @@ void J3DTevBlock16::patchTexNo() {
|
||||
}
|
||||
}
|
||||
|
||||
u8 *end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031CAB0-8031CB7C 3173F0 00CC+00 1/0 0/0 0/0 .text patchTevReg__13J3DTevBlock16Fv */
|
||||
void J3DTevBlock16::patchTevReg() {
|
||||
GDSetCurrOffset(mTevRegOffset);
|
||||
u8 *pStart = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
for (u32 i = 0; i < ARRAY_SIZE(mTevColor) - 1; i++) {
|
||||
J3DGDSetTevColorS10((GXTevRegID)(i + 1), mTevColor[i]);
|
||||
@@ -1128,15 +1129,15 @@ void J3DTevBlock16::patchTevReg() {
|
||||
J3DGDSetTevKColor((GXTevKColorID)i, mTevKColor[i]);
|
||||
}
|
||||
|
||||
u8 *pEnd = GDGetCurrPointer();
|
||||
DCStoreRange(pStart, pEnd - pStart);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031CB7C-8031CCF8 3174BC 017C+00 1/0 0/0 0/0 .text
|
||||
* patchTexNoAndTexCoordScale__13J3DTevBlock16Fv */
|
||||
void J3DTevBlock16::patchTexNoAndTexCoordScale() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8 *start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
u8 tevStageNum = mTevStageNum;
|
||||
for (u32 i = 0; i < 8; i++) {
|
||||
@@ -1165,8 +1166,8 @@ void J3DTevBlock16::patchTexNoAndTexCoordScale() {
|
||||
);
|
||||
}
|
||||
|
||||
u8 *end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
|
||||
@@ -1428,7 +1429,7 @@ void J3DTevBlock16::diffTexCoordScale() {
|
||||
/* 8031DED0-8031DFB4 318810 00E4+00 1/0 0/0 0/0 .text ptrToIndex__13J3DTevBlock16Fv */
|
||||
void J3DTevBlock16::ptrToIndex() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8* pStart = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
u32 offs = 0;
|
||||
for (u32 i = 0; i < 8; i++) {
|
||||
@@ -1442,15 +1443,15 @@ void J3DTevBlock16::ptrToIndex() {
|
||||
}
|
||||
}
|
||||
|
||||
u8 *pEnd = GDGetCurrPointer();
|
||||
DCStoreRange(pStart, pEnd - pStart);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031DFB4-8031E098 3188F4 00E4+00 1/0 0/0 0/0 .text ptrToIndex__18J3DTevBlockPatchedFv
|
||||
*/
|
||||
void J3DTevBlockPatched::ptrToIndex() {
|
||||
GDSetCurrOffset(mTexNoOffset);
|
||||
u8* pStart = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
u32 offs = 0;
|
||||
for (u32 i = 0; i < 8; i++) {
|
||||
@@ -1464,17 +1465,17 @@ void J3DTevBlockPatched::ptrToIndex() {
|
||||
}
|
||||
}
|
||||
|
||||
u8 *pEnd = GDGetCurrPointer();
|
||||
DCStoreRange(pStart, pEnd - pStart);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031E098-8031E12C 3189D8 0094+00 5/5 1/1 0/0 .text indexToPtr_private__11J3DTevBlockFUl */
|
||||
void J3DTevBlock::indexToPtr_private(u32 offs) {
|
||||
GDSetCurrOffset(offs);
|
||||
u8* pStart = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
|
||||
for (u32 i = 0; ; i++) {
|
||||
u8* pDL = GDGetCurrPointer();
|
||||
void* pDL = GDGetCurrPointer();
|
||||
if (!isTexNoReg(pDL)) {
|
||||
break;
|
||||
}
|
||||
@@ -1483,8 +1484,8 @@ void J3DTevBlock::indexToPtr_private(u32 offs) {
|
||||
loadTexNo(i, texNoReg);
|
||||
}
|
||||
|
||||
u8 *pEnd = GDGetCurrPointer();
|
||||
DCStoreRange(pStart, pEnd - pStart);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031E12C-8031E328 318A6C 01FC+00 1/0 0/0 0/0 .text load__15J3DIndBlockFullFv */
|
||||
@@ -1570,7 +1571,7 @@ void J3DPEBlockTexEdge::load() {
|
||||
void J3DPEBlockXlu::load() {
|
||||
GDOverflowCheck(0x1e);
|
||||
J3DGDSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND,GX_ALWAYS, 0);
|
||||
J3DGDSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_COPY);
|
||||
J3DGDSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_COPY);
|
||||
J3DGDSetZMode(1, GX_LEQUAL, 0);
|
||||
J3DGDSetZCompLoc(1);
|
||||
}
|
||||
@@ -1611,10 +1612,10 @@ void J3DPEBlockFull::load() {
|
||||
void J3DPEBlockFull::patch() {
|
||||
GDSetCurrOffset(mFogOffset);
|
||||
GDOverflowCheck(0x37);
|
||||
u8* start = GDGetCurrPointer();
|
||||
void* start = GDGetCurrPointer();
|
||||
mFog.load();
|
||||
u8* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, end - start);
|
||||
void* end = GDGetCurrPointer();
|
||||
DCStoreRange(start, (u32)end - (u32)start);
|
||||
}
|
||||
|
||||
/* 8031F940-8031F9B8 31A280 0078+00 1/0 0/0 0/0 .text diffFog__14J3DPEBlockFullFv */
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
#include "JSystem/J3DGraphBase/J3DDrawBuffer.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMaterial.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include "dolphin/os/OSInterrupt.h"
|
||||
#include <dolphin/os.h>
|
||||
#include <dolphin/os.h>
|
||||
#include "string.h"
|
||||
#include "global.h"
|
||||
|
||||
J3DError J3DDisplayListObj::newDisplayList(u32 capacity) {
|
||||
mCapacity = ALIGN_NEXT(capacity, 0x20);
|
||||
@@ -400,4 +401,4 @@ void J3DPacket::draw() {}
|
||||
int J3DMatPacket::entry(J3DDrawBuffer* i_buffer) {
|
||||
sortFunc func = J3DDrawBuffer::sortFuncTable[i_buffer->mSortType];
|
||||
return (i_buffer->*func)(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ u32 J3DShape::countBumpMtxNum() const {
|
||||
|
||||
/* 80314E98-80314EB0 30F7D8 0018+00 1/1 0/0 0/0 .text J3DLoadCPCmd__FUcUl */
|
||||
void J3DLoadCPCmd(u8 cmd, u32 param) {
|
||||
GXWGFifo.u8 = GX_CMD_LOAD_CP_REG;
|
||||
GXWGFifo.u8 = GX_LOAD_CP_REG;
|
||||
GXWGFifo.u8 = cmd;
|
||||
GXWGFifo.u32 = param;
|
||||
}
|
||||
@@ -160,31 +160,31 @@ void J3DShape::makeVtxArrayCmd() {
|
||||
array[i] = 0;
|
||||
}
|
||||
|
||||
for (; vtxAttr->mAttrib != GX_VA_NULL; vtxAttr++) {
|
||||
switch (vtxAttr->mAttrib) {
|
||||
for (; vtxAttr->attr != GX_VA_NULL; vtxAttr++) {
|
||||
switch (vtxAttr->attr) {
|
||||
case GX_VA_POS: {
|
||||
if (vtxAttr->mCompType == GX_F32)
|
||||
stride[vtxAttr->mAttrib - GX_VA_POS] = 0x0C;
|
||||
if (vtxAttr->type == GX_F32)
|
||||
stride[vtxAttr->attr - GX_VA_POS] = 0x0C;
|
||||
else
|
||||
stride[vtxAttr->mAttrib - GX_VA_POS] = 0x06;
|
||||
array[vtxAttr->mAttrib - GX_VA_POS] = mVertexData->getVtxPosArray();
|
||||
mVertexData->setVtxPosFrac(vtxAttr->mCompShift);
|
||||
mVertexData->setVtxPosType((GXCompType)vtxAttr->mCompType);
|
||||
stride[vtxAttr->attr - GX_VA_POS] = 0x06;
|
||||
array[vtxAttr->attr - GX_VA_POS] = mVertexData->getVtxPosArray();
|
||||
mVertexData->setVtxPosFrac(vtxAttr->frac);
|
||||
mVertexData->setVtxPosType((GXCompType)vtxAttr->type);
|
||||
} break;
|
||||
case GX_VA_NRM: {
|
||||
if (vtxAttr->mCompType == GX_F32)
|
||||
stride[vtxAttr->mAttrib - GX_VA_POS] = 0x0C;
|
||||
if (vtxAttr->type == GX_F32)
|
||||
stride[vtxAttr->attr - GX_VA_POS] = 0x0C;
|
||||
else
|
||||
stride[vtxAttr->mAttrib - GX_VA_POS] = 0x06;
|
||||
array[vtxAttr->mAttrib - GX_VA_POS] = mVertexData->getVtxNrmArray();
|
||||
mVertexData->setVtxNrmFrac(vtxAttr->mCompShift);
|
||||
mVertexData->setVtxNrmType((GXCompType)vtxAttr->mCompType);
|
||||
stride[vtxAttr->attr - GX_VA_POS] = 0x06;
|
||||
array[vtxAttr->attr - GX_VA_POS] = mVertexData->getVtxNrmArray();
|
||||
mVertexData->setVtxNrmFrac(vtxAttr->frac);
|
||||
mVertexData->setVtxNrmType((GXCompType)vtxAttr->type);
|
||||
} break;
|
||||
case GX_VA_CLR0:
|
||||
case GX_VA_CLR1: {
|
||||
stride[vtxAttr->mAttrib - GX_VA_POS] = 0x04;
|
||||
array[vtxAttr->mAttrib - GX_VA_POS] =
|
||||
mVertexData->getVtxColorArray(vtxAttr->mAttrib - GX_VA_CLR0);
|
||||
stride[vtxAttr->attr - GX_VA_POS] = 0x04;
|
||||
array[vtxAttr->attr - GX_VA_POS] =
|
||||
mVertexData->getVtxColorArray(vtxAttr->attr - GX_VA_CLR0);
|
||||
} break;
|
||||
case GX_VA_TEX0:
|
||||
case GX_VA_TEX1:
|
||||
@@ -194,12 +194,12 @@ void J3DShape::makeVtxArrayCmd() {
|
||||
case GX_VA_TEX5:
|
||||
case GX_VA_TEX6:
|
||||
case GX_VA_TEX7: {
|
||||
if (vtxAttr->mCompType == GX_F32)
|
||||
stride[vtxAttr->mAttrib - GX_VA_POS] = 0x08;
|
||||
if (vtxAttr->type == GX_F32)
|
||||
stride[vtxAttr->attr - GX_VA_POS] = 0x08;
|
||||
else
|
||||
stride[vtxAttr->mAttrib - GX_VA_POS] = 0x04;
|
||||
array[vtxAttr->mAttrib - GX_VA_POS] =
|
||||
mVertexData->getVtxTexCoordArray(vtxAttr->mAttrib - GX_VA_TEX0);
|
||||
stride[vtxAttr->attr - GX_VA_POS] = 0x04;
|
||||
array[vtxAttr->attr - GX_VA_POS] =
|
||||
mVertexData->getVtxTexCoordArray(vtxAttr->attr - GX_VA_TEX0);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
@@ -351,4 +351,4 @@ void J3DShape::simpleDrawCache() const {
|
||||
for (u16 n = getMtxGroupNum(), i = 0; i < n; i++)
|
||||
if (getShapeDraw(i) != NULL)
|
||||
getShapeDraw(i)->draw();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "string.h"
|
||||
#include "dolphin/gx.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include <dolphin/os.h>
|
||||
#include "global.h"
|
||||
|
||||
//
|
||||
|
||||
@@ -31,9 +31,9 @@ void J3DShapeMtx::resetMtxLoadCache() {
|
||||
/* 803130E4-80313128 30DA24 0044+00 1/0 0/0 0/0 .text loadMtxIndx_PNGP__11J3DShapeMtxCFiUs */
|
||||
void J3DShapeMtx::loadMtxIndx_PNGP(int slot, u16 indx) const {
|
||||
// inlined J3DFifoLoadPosMtxIndx
|
||||
J3DFifoLoadIndx(GX_CMD_LOAD_INDX_A, indx, 0xB000 | ((u16)(slot * 0x0C)));
|
||||
J3DFifoLoadIndx(GX_LOAD_INDX_A, indx, 0xB000 | ((u16)(slot * 0x0C)));
|
||||
// inlined J3DFifoLoadNrmMtxIndx3x3
|
||||
J3DFifoLoadIndx(GX_CMD_LOAD_INDX_B, indx, 0x8000 | ((u16)((slot * 0x09) + 0x400)));
|
||||
J3DFifoLoadIndx(GX_LOAD_INDX_B, indx, 0x8000 | ((u16)((slot * 0x09) + 0x400)));
|
||||
}
|
||||
|
||||
/* 80313128-80313188 30DA68 0060+00 1/0 0/0 0/0 .text loadMtxIndx_PCPU__11J3DShapeMtxCFiUs */
|
||||
|
||||
@@ -61,7 +61,7 @@ J3DFogInfo& J3DFogInfo::operator=(J3DFogInfo const& param_0) {
|
||||
mFarZ = param_0.mFarZ;
|
||||
mColor = param_0.mColor;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
mFogAdjTable.fogVals[i] = param_0.mFogAdjTable.fogVals[i];
|
||||
mFogAdjTable.r[i] = param_0.mFogAdjTable.r[i];
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -72,4 +72,4 @@ J3DNBTScaleInfo& J3DNBTScaleInfo::operator=(J3DNBTScaleInfo const& param_0) {
|
||||
mbHasScale = param_0.mbHasScale;
|
||||
mScale = param_0.mScale;
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "JSystem/J3DGraphBase/J3DSys.h"
|
||||
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/gx/GXPixel.h"
|
||||
#include <dolphin/gx.h>
|
||||
#include "dolphin/os.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "global.h"
|
||||
@@ -84,12 +84,12 @@ J3DSys::J3DSys() {
|
||||
|
||||
/* 8030FEC0-8030FEE4 30A800 0024+00 0/0 1/1 0/0 .text loadPosMtxIndx__6J3DSysCFiUs */
|
||||
void J3DSys::loadPosMtxIndx(int addr, u16 indx) const {
|
||||
J3DFifoLoadIndx(GX_CMD_LOAD_INDX_A, indx, 0xB000 | ((u16)(addr * 0x0C)));
|
||||
J3DFifoLoadIndx(GX_LOAD_INDX_A, indx, 0xB000 | ((u16)(addr * 0x0C)));
|
||||
}
|
||||
|
||||
/* 8030FEE4-8030FF0C 30A824 0028+00 0/0 1/1 0/0 .text loadNrmMtxIndx__6J3DSysCFiUs */
|
||||
void J3DSys::loadNrmMtxIndx(int addr, u16 indx) const {
|
||||
J3DFifoLoadIndx(GX_CMD_LOAD_INDX_B, indx, 0x8000 | ((u16)((addr * 0x09) + 0x400)));
|
||||
J3DFifoLoadIndx(GX_LOAD_INDX_B, indx, 0x8000 | ((u16)((addr * 0x09) + 0x400)));
|
||||
}
|
||||
|
||||
/* 8030FF0C-803100BC 30A84C 01B0+00 1/1 0/0 0/0 .text setTexCacheRegion__6J3DSysF15_GXTexCacheSize
|
||||
@@ -149,7 +149,7 @@ void J3DSys::drawInit() {
|
||||
GXSetClipMode(GX_CLIP_ENABLE);
|
||||
GXSetColorUpdate(GX_TRUE);
|
||||
GXSetDither(GX_TRUE);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_NOOP);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_NOOP);
|
||||
GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_AND, GX_ALWAYS, 0);
|
||||
GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
|
||||
GXSetZCompLoc(GX_TRUE);
|
||||
@@ -196,7 +196,7 @@ void J3DSys::drawInit() {
|
||||
|
||||
u8 i;
|
||||
for (i = 0; i < 3; i++)
|
||||
GXSetIndTexMtx((GXIndTexMtxID)(GX_ITM_0 + i), (f32*)indTexMtx, 1);
|
||||
GXSetIndTexMtx((GXIndTexMtxID)(GX_ITM_0 + i), indTexMtx, 1);
|
||||
|
||||
GXSetChanMatColor(GX_COLOR0A0, j3dDefaultColInfo);
|
||||
GXSetChanMatColor(GX_COLOR1A1, j3dDefaultColInfo);
|
||||
@@ -378,14 +378,14 @@ void J3DSys::reinitIndStages() {
|
||||
GXSetIndTexCoordScale(GX_INDTEXSTAGE1, GX_ITS_1, GX_ITS_1);
|
||||
GXSetIndTexCoordScale(GX_INDTEXSTAGE2, GX_ITS_1, GX_ITS_1);
|
||||
GXSetIndTexCoordScale(GX_INDTEXSTAGE3, GX_ITS_1, GX_ITS_1);
|
||||
GXSetIndTexMtx(GX_ITM_0, (f32*)IndMtx, 1);
|
||||
GXSetIndTexMtx(GX_ITM_1, (f32*)IndMtx, 1);
|
||||
GXSetIndTexMtx(GX_ITM_2, (f32*)IndMtx, 1);
|
||||
GXSetIndTexMtx(GX_ITM_0, IndMtx, 1);
|
||||
GXSetIndTexMtx(GX_ITM_1, IndMtx, 1);
|
||||
GXSetIndTexMtx(GX_ITM_2, IndMtx, 1);
|
||||
}
|
||||
|
||||
/* 80310E3C-80310ED0 30B77C 0094+00 1/1 0/0 0/0 .text reinitPixelProc__6J3DSysFv */
|
||||
void J3DSys::reinitPixelProc() {
|
||||
GXSetBlendMode(GX_BM_NONE, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_CLEAR);
|
||||
GXSetBlendMode(GX_BM_NONE, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_CLEAR);
|
||||
GXSetColorUpdate(GX_TRUE);
|
||||
GXSetAlphaUpdate(GX_FALSE);
|
||||
GXSetDither(GX_TRUE);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
|
||||
#include "JSystem/J3DGraphBase/J3DSys.h"
|
||||
#include "JSystem/J3DGraphBase/J3DTransform.h"
|
||||
#include "global.h"
|
||||
|
||||
static void J3DGDLoadTexMtxImm(f32 (*)[4], u32, _GXTexMtxType);
|
||||
static void J3DGDLoadPostTexMtxImm(f32 (*)[4], u32);
|
||||
@@ -548,7 +549,7 @@ extern J3DTevSwapModeInfo const j3dDefaultTevSwapMode = {
|
||||
extern const J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable = {0x00, 0x01, 0x02, 0x03};
|
||||
|
||||
/* 804563EC-804563F0 0049EC 0004+00 0/0 3/3 0/0 .sdata2 j3dDefaultBlendInfo */
|
||||
extern const J3DBlendInfo j3dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_NOOP};
|
||||
extern const J3DBlendInfo j3dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_NOOP};
|
||||
|
||||
/* 804563F0-804563F8 0049F0 0008+00 0/0 3/3 0/0 .sdata2 j3dDefaultColorChanInfo */
|
||||
extern const J3DColorChanInfo j3dDefaultColorChanInfo = {
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
#include "JSystem/J3DGraphBase/J3DSys.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "string.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include <dolphin/os.h>
|
||||
#include "global.h"
|
||||
|
||||
/* 80310EF8-80310F78 30B838 0080+00 0/0 1/1 0/0 .text __ct__13J3DVertexDataFv */
|
||||
J3DVertexData::J3DVertexData() {
|
||||
@@ -241,4 +242,4 @@ J3DDrawMtxData::J3DDrawMtxData() {
|
||||
}
|
||||
|
||||
/* 803115F4-80311630 30BF34 003C+00 0/0 2/2 0/0 .text __dt__14J3DDrawMtxDataFv */
|
||||
J3DDrawMtxData::~J3DDrawMtxData() {}
|
||||
J3DDrawMtxData::~J3DDrawMtxData() {}
|
||||
|
||||
@@ -263,9 +263,9 @@ void J3DModelLoader::readInformation(J3DModelInfoBlock const* i_block, u32 i_fla
|
||||
|
||||
/* 803351A4-803351D0 32FAE4 002C+00 1/1 0/0 0/0 .text getFmtType__FP17_GXVtxAttrFmtList7_GXAttr */
|
||||
static _GXCompType getFmtType(_GXVtxAttrFmtList* i_fmtList, _GXAttr i_attr) {
|
||||
for (; i_fmtList->mAttrib != GX_VA_NULL; i_fmtList++) {
|
||||
if (i_fmtList->mAttrib == i_attr) {
|
||||
return i_fmtList->mCompType;
|
||||
for (; i_fmtList->attr != GX_VA_NULL; i_fmtList++) {
|
||||
if (i_fmtList->attr == i_attr) {
|
||||
return i_fmtList->type;
|
||||
}
|
||||
}
|
||||
return GX_F32;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "JSystem/J3DGraphAnimator/J3DModelData.h"
|
||||
#include "JSystem/JSupport/JSupport.h"
|
||||
#include "dolphin/os.h"
|
||||
#include "global.h"
|
||||
|
||||
|
||||
/* 80336794-803367D4 3310D4 0040+00 0/0 3/0 0/0 .text countMaterialNum__14J3DModelLoaderFPCv */
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JSupport/JSupport.h"
|
||||
#include "dolphin/os.h"
|
||||
#include "global.h"
|
||||
|
||||
/* 80337350-80337400 331C90 00B0+00 0/0 2/2 0/0 .text __ct__15J3DShapeFactoryFRC13J3DShapeBlock */
|
||||
J3DShapeFactory::J3DShapeFactory(J3DShapeBlock const& block) {
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/ai.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include "dolphin/os/OSTime.h"
|
||||
#include <dolphin/os.h>
|
||||
#include <dolphin/os.h>
|
||||
|
||||
/* 80431C58-80431C68 05E978 000C+04 2/2 0/0 0/0 .bss sDmaDacBuffer__9JASDriver */
|
||||
s16* JASDriver::sDmaDacBuffer[3];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
|
||||
#include "JSystem/JAudio2/JASCalc.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include <dolphin/os.h>
|
||||
#include "math.h"
|
||||
#include "limits.h"
|
||||
|
||||
@@ -329,4 +329,4 @@ s16 JASCalc::clamp(s32 x) {
|
||||
if (x >= std::numeric_limits<s16>::max())
|
||||
return std::numeric_limits<s16>::max();
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "JSystem/JAudio2/osdsp_task.h"
|
||||
#include "JSystem/JAudio2/JASCriticalSection.h"
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include <dolphin/os.h>
|
||||
|
||||
/* 804512E8-804512EC 0007E8 0004+00 5/5 0/0 0/0 .sbss CH_BUF__6JASDsp */
|
||||
JASDsp::TChannel* JASDsp::CH_BUF;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "JSystem/JAudio2/JASDriverIF.h"
|
||||
#include "JSystem/JAudio2/JASAiCtrl.h"
|
||||
#include "JSystem/JAudio2/JASDSPInterface.h"
|
||||
#include "dolphin/os/OSThread.h"
|
||||
#include <dolphin/os.h>
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
@@ -99,4 +99,4 @@ void JASDriver::DSPSyncCallback() {
|
||||
/* 8029E2F8-8029E320 298C38 0028+00 0/0 1/1 0/0 .text updateDacCallback__9JASDriverFv */
|
||||
void JASDriver::updateDacCallback() {
|
||||
sUpdateDacCallback.callback();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ JASHeap::JASHeap(JASDisposer* disposer) : mTree(this) {
|
||||
void JASHeap::initRootHeap(void* param_0, u32 param_1) {
|
||||
JUT_ASSERT(97, ! isAllocated());
|
||||
JASMutexLock lock(&mMutex);
|
||||
mBase = (u8*)OSRoundUpPtr(param_0, 0x20);
|
||||
mBase = (u8*)OSRoundUp32B(param_0);
|
||||
field_0x40 = NULL;
|
||||
mSize = param_1 - (u32(mBase) - u32(param_0));
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "JSystem/JKernel/JKRThread.h"
|
||||
#include "dolphin/os/OSRtc.h"
|
||||
#include <dolphin/os.h>
|
||||
|
||||
/* 802A4AD0-802A4B28 29F410 0058+00 0/0 1/1 0/0 .text __ct__18JAU_JASInitializerFv */
|
||||
JAU_JASInitializer::JAU_JASInitializer() {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "JSystem/JAudio2/dsptask.h"
|
||||
#include "JSystem/JAudio2/osdsp.h"
|
||||
#include "global.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
@@ -531,7 +532,7 @@ static u8 jdsp[7936] ALIGN_DECL(32) = {
|
||||
};
|
||||
|
||||
/* 80431F80-80431FE0 05ECA0 0050+10 1/1 0/0 0/0 .bss audio_task */
|
||||
static STRUCT_DSP_TASK audio_task ALIGN_DECL(32);
|
||||
static DSPTaskInfo audio_task ALIGN_DECL(32);
|
||||
|
||||
/* 80431FE0-80433FE0 05ED00 2000+00 1/1 0/0 0/0 .bss AUDIO_YIELD_BUFFER */
|
||||
static u8 AUDIO_YIELD_BUFFER[8192] ALIGN_DECL(32);
|
||||
@@ -539,19 +540,19 @@ static u8 AUDIO_YIELD_BUFFER[8192] ALIGN_DECL(32);
|
||||
/* 8029E720-8029E7CC 299060 00AC+00 0/0 1/1 0/0 .text DspBoot__FPFPv_v */
|
||||
void DspBoot(void (*param_0)(void*)) {
|
||||
DspInitWork();
|
||||
audio_task.info.priority = 0xf0;
|
||||
audio_task.info.iram_mmem_addr = (u16*)(jdsp + 0x80000000);
|
||||
audio_task.info.iram_length = sizeof(jdsp);
|
||||
audio_task.info.iram_addr = 0;
|
||||
audio_task.info.dram_mmem_addr = (u16*)(AUDIO_YIELD_BUFFER + 0x80000000);
|
||||
audio_task.info.dram_length = sizeof(AUDIO_YIELD_BUFFER);
|
||||
audio_task.info.dram_addr = 0;
|
||||
audio_task.info.dsp_init_vector = 0;
|
||||
audio_task.info.dsp_resume_vector = 0x10;
|
||||
audio_task.info.init_cb = DspHandShake;
|
||||
audio_task.info.res_cb = NULL;
|
||||
audio_task.info.done_cb = NULL;
|
||||
audio_task.info.req_cb = param_0;
|
||||
audio_task.priority = 0xf0;
|
||||
audio_task.iram_mmem_addr = (u16*)(jdsp + 0x80000000);
|
||||
audio_task.iram_length = sizeof(jdsp);
|
||||
audio_task.iram_addr = 0;
|
||||
audio_task.dram_mmem_addr = (u16*)(AUDIO_YIELD_BUFFER + 0x80000000);
|
||||
audio_task.dram_length = sizeof(AUDIO_YIELD_BUFFER);
|
||||
audio_task.dram_addr = 0;
|
||||
audio_task.dsp_init_vector = 0;
|
||||
audio_task.dsp_resume_vector = 0x10;
|
||||
audio_task.init_cb = DspHandShake;
|
||||
audio_task.res_cb = NULL;
|
||||
audio_task.done_cb = NULL;
|
||||
audio_task.req_cb = param_0;
|
||||
DSPInit();
|
||||
DSPAddPriorTask(&audio_task);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
#include "JSystem/JAudio2/osdsp.h"
|
||||
#include "JSystem/JAudio2/osdsp_task.h"
|
||||
#include "dolphin/os.h"
|
||||
#include "dolphin/dsp/dsp_task.h"
|
||||
#include <dolphin/dsp.h>
|
||||
|
||||
extern "C" void __DSP_insert_task(DSPTaskInfo*);
|
||||
extern "C" void __DSP_boot_task(DSPTaskInfo*);
|
||||
|
||||
/* 8029EA00-8029EA84 299340 0084+00 0/0 1/1 0/0 .text DSPAddTask */
|
||||
DSPTaskInfo* DSPAddTask(DSPTaskInfo* task) {
|
||||
@@ -32,8 +35,8 @@ void DSPAddPriorTask(STRUCT_DSP_TASK* task) {
|
||||
}
|
||||
BOOL status = OSDisableInterrupts();
|
||||
DSP_prior_task = (DSPTaskInfo*)task;
|
||||
task->info.state = 0;
|
||||
task->info.flags = 1;
|
||||
task->state = 0;
|
||||
task->flags = 1;
|
||||
__DSP_boot_task((DSPTaskInfo*)task);
|
||||
OSRestoreInterrupts(status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,13 @@
|
||||
|
||||
#include "JSystem/JAudio2/osdsp_task.h"
|
||||
#include "JSystem/JAudio2/dspproc.h"
|
||||
#include "dolphin/dsp/dsp_task.h"
|
||||
#include "dolphin/os/OSContext.h"
|
||||
#include <dolphin/dsp.h>
|
||||
#include <dolphin/os.h>
|
||||
|
||||
extern DSPTaskInfo* __DSP_first_task;
|
||||
extern DSPTaskInfo* __DSP_curr_task;
|
||||
extern "C" void __DSP_exec_task(DSPTaskInfo*, DSPTaskInfo*);
|
||||
extern "C" void __DSP_remove_task(DSPTaskInfo* task);
|
||||
|
||||
static void Dsp_Update_Request();
|
||||
|
||||
@@ -20,7 +25,7 @@ static u8 struct_80451309;
|
||||
DSPTaskInfo* DSP_prior_task;
|
||||
|
||||
/* 8029EB20-8029EE24 299460 0304+00 0/0 1/1 0/0 .text __DSPHandler */
|
||||
void __DSPHandler(__OSInterrupt interrupt, OSContext* context) {
|
||||
extern "C" void __DSPHandler(__OSInterrupt interrupt, OSContext* context) {
|
||||
OSContext funcContext;
|
||||
__DSPRegs[5] = ((u16)(__DSPRegs[5]) & ~0x28) | 0x80;
|
||||
OSClearContext(&funcContext);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "JSystem/JUtility/JUTDbPrint.h"
|
||||
#include "JSystem/JUtility/JUTProcBar.h"
|
||||
#include "dolphin/gx.h"
|
||||
#include <dolphin/vi.h>
|
||||
#include "global.h"
|
||||
|
||||
/* 80272040-802720F8 26C980 00B8+00 1/1 0/0 0/0 .text ctor_subroutine__10JFWDisplayFb */
|
||||
void JFWDisplay::ctor_subroutine(bool enableAlpha) {
|
||||
@@ -616,4 +618,4 @@ static void diagnoseGpHang() {
|
||||
} else {
|
||||
OSReport("GP is in unknown state.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ void JFWSystem::init() {
|
||||
systemConsole = JUTConsole::create(60, 200, NULL);
|
||||
systemConsole->setFont(systemFont);
|
||||
|
||||
if (CSetUpParam::renderMode->efb_height < 300) {
|
||||
if (CSetUpParam::renderMode->efbHeight < 300) {
|
||||
systemConsole->setFontSize(systemFont->getWidth() * 0.85f, systemFont->getHeight() * 0.5f);
|
||||
systemConsole->setPosition(20, 25);
|
||||
} else {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
#include "dolphin/ar.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include "dolphin/os/OSInterrupt.h"
|
||||
#include <dolphin/os.h>
|
||||
#include <dolphin/os.h>
|
||||
#include "string.h"
|
||||
|
||||
static u8* firstSrcData();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "JSystem/JKernel/JKRAramHeap.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "global.h"
|
||||
#include <limits.h>
|
||||
|
||||
/* 8043430C-80434318 06102C 000C+00 8/8 0/0 0/0 .bss sAramList__11JKRAramHeap */
|
||||
JSUList<JKRAramBlock> JKRAramHeap::sAramList;
|
||||
@@ -47,7 +48,7 @@ JKRAramBlock* JKRAramHeap::alloc(u32 size, JKRAramHeap::EAllocMode allocationMod
|
||||
/* 802D3034-802D30BC 2CD974 0088+00 1/1 0/0 0/0 .text allocFromHead__11JKRAramHeapFUl */
|
||||
JKRAramBlock* JKRAramHeap::allocFromHead(u32 size) {
|
||||
u32 alignedSize = ALIGN_NEXT(size, 0x20);
|
||||
u32 bestFreeSize = UINT32_MAX;
|
||||
u32 bestFreeSize = UINT_MAX;
|
||||
JKRAramBlock* bestBlock = NULL;
|
||||
|
||||
JSUList<JKRAramBlock>* list = &sAramList;
|
||||
@@ -139,4 +140,4 @@ void JKRAramHeap::dump(void) {
|
||||
for (; iterator != list->getEnd(); ++iterator) {}
|
||||
|
||||
unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "JSystem/JKernel/JKRDecomp.h"
|
||||
#include "JSystem/JKernel/JKRAramPiece.h"
|
||||
#include "global.h"
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804514B0-804514B8 0009B0 0004+04 1/1 0/0 0/0 .sbss sDecompObject__9JKRDecomp */
|
||||
@@ -299,4 +300,4 @@ JKRDecompCommand::JKRDecompCommand() {
|
||||
}
|
||||
|
||||
/* 802DBDC0-802DBDFC 2D6700 003C+00 1/1 0/0 0/0 .text __dt__16JKRDecompCommandFv */
|
||||
JKRDecompCommand::~JKRDecompCommand() {}
|
||||
JKRDecompCommand::~JKRDecompCommand() {}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include "JSystem/JKernel/JKRDecomp.h"
|
||||
#include "JSystem/JKernel/JKRDvdFile.h"
|
||||
#include "JSystem/JSupport/JSUFileStream.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include "dolphin/os/OSInterrupt.h"
|
||||
#include <dolphin/os.h>
|
||||
#include <dolphin/os.h>
|
||||
#include "dolphin/vi.h"
|
||||
#include "global.h"
|
||||
#include "string.h"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include "JSystem/JKernel/JKRDecomp.h"
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
#include "string.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include "dolphin/os/OSInterrupt.h"
|
||||
#include <dolphin/os.h>
|
||||
#include <dolphin/os.h>
|
||||
#include "dolphin/vi.h"
|
||||
|
||||
static int JKRDecompressFromDVD(JKRDvdFile*, void*, u32, u32, u32, u32, u32*);
|
||||
@@ -560,4 +560,4 @@ static u8* nextSrcData(u8* src) {
|
||||
/* 802DA7D4-802DA7DC -00001 0008+00 0/0 0/0 0/0 .text isErrorRetry__12JKRDvdRipperFv */
|
||||
u8 JKRDvdRipper::isErrorRetry() {
|
||||
return errorRetry;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,8 +272,8 @@ u32 JKRFileCache::getResSize(const void* resource) const {
|
||||
|
||||
/* 802D52A0-802D531C 2CFBE0 007C+00 1/0 0/0 0/0 .text countFile__12JKRFileCacheCFPCc */
|
||||
u32 JKRFileCache::countFile(const char* path) const {
|
||||
DVDDirectory dir;
|
||||
DVDDirectoryEntry dirEntry;
|
||||
DVDDir dir;
|
||||
DVDDirEntry dirEntry;
|
||||
|
||||
u32 count = 0;
|
||||
char* name = getDvdPathName(path);
|
||||
@@ -334,14 +334,14 @@ JKRFileCache::CCacheBlock* JKRFileCache::findCacheBlock(u32 fileID) const {
|
||||
|
||||
/* 802D5410-802D551C 2CFD50 010C+00 2/2 0/0 0/0 .text findFile__12JKRFileCacheCFPcPCc */
|
||||
bool JKRFileCache::findFile(char* path, const char* fileName) const {
|
||||
DVDDirectory dir;
|
||||
DVDDirectoryEntry dirEntry;
|
||||
DVDDir dir;
|
||||
DVDDirEntry dirEntry;
|
||||
|
||||
bool result = false;
|
||||
u32 pathLength = strlen(path);
|
||||
if (DVDOpenDir(path, &dir)) {
|
||||
while (DVDReadDir(&dir, &dirEntry)) {
|
||||
if (dirEntry.is_directory) {
|
||||
if (dirEntry.isDir) {
|
||||
char* endOfPath = path + pathLength;
|
||||
*endOfPath = '/';
|
||||
strcpy(path + pathLength + 1, dirEntry.name);
|
||||
@@ -428,4 +428,4 @@ u32 JKRFileCache::readFsResource(void* dst, u32 dstLength, const char* path) {
|
||||
*/
|
||||
u32 JKRFileCache::readNameResource(void* dst, u32 dstLength, u32 type, const char* path) {
|
||||
return readResource(dst, dstLength, type, path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,13 +47,13 @@ JKRDvdFinder::~JKRDvdFinder() {
|
||||
/* 802D4874-802D4910 2CF1B4 009C+00 1/0 0/0 0/0 .text findNextFile__12JKRDvdFinderFv */
|
||||
bool JKRDvdFinder::findNextFile(void) {
|
||||
if (mIsAvailable) {
|
||||
DVDDirectoryEntry directoryEntry;
|
||||
DVDDirEntry directoryEntry;
|
||||
mIsAvailable = DVDReadDir(&mDvdDirectory, &directoryEntry);
|
||||
|
||||
if (mIsAvailable) {
|
||||
mIsFileOrDirectory = directoryEntry.is_directory != 0;
|
||||
mIsFileOrDirectory = directoryEntry.isDir != 0;
|
||||
mEntryName = directoryEntry.name;
|
||||
mEntryFileIndex = directoryEntry.entry_number;
|
||||
mEntryFileIndex = directoryEntry.entryNum;
|
||||
mEntryId = 0;
|
||||
|
||||
// only matches with enum
|
||||
@@ -67,4 +67,4 @@ bool JKRDvdFinder::findNextFile(void) {
|
||||
}
|
||||
|
||||
return mIsAvailable;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
|
||||
bool data_804508B0 = 1;
|
||||
|
||||
/* 80451370-80451374 000870 0004+00 3/3 44/44 0/0 .sbss sSystemHeap__7JKRHeap */
|
||||
JKRHeap* JKRHeap::sSystemHeap;
|
||||
|
||||
@@ -104,13 +106,13 @@ bool JKRHeap::initArena(char** memory, u32* size, int maxHeaps) {
|
||||
ram_start = (void*)ALIGN_NEXT((u32)arenaStart, 0x20);
|
||||
ram_end = (void*)ALIGN_PREV((u32)arenaHi, 0x20);
|
||||
|
||||
GLOBAL_MEMORY* codeStart = (GLOBAL_MEMORY*)OSPhysicalToCached(0);
|
||||
OSBootInfo* codeStart = (OSBootInfo*)OSPhysicalToCached(0);
|
||||
mCodeStart = codeStart;
|
||||
mCodeEnd = ram_start;
|
||||
|
||||
mUserRamStart = ram_start;
|
||||
mUserRamEnd = ram_end;
|
||||
mMemorySize = codeStart->memory_size;
|
||||
mMemorySize = codeStart->memorySize;
|
||||
|
||||
OSSetArenaLo(ram_end);
|
||||
OSSetArenaHi(ram_end);
|
||||
@@ -507,4 +509,4 @@ s32 JKRHeap::do_changeGroupID(u8 param_0) {
|
||||
/* 802CEDAC-802CEDB4 2C96EC 0008+00 1/0 1/0 0/0 .text do_getCurrentGroupId__7JKRHeapFv */
|
||||
u8 JKRHeap::do_getCurrentGroupId() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTConsole.h"
|
||||
#include "global.h"
|
||||
|
||||
/* 802D0A24-802D0AD0 2CB364 00AC+00 0/0 4/4 1/1 .text create__12JKRSolidHeapFUlP7JKRHeapb
|
||||
*/
|
||||
@@ -294,4 +295,4 @@ void* JKRSolidHeap::do_getMaxFreeBlock(void) {
|
||||
/* 802D12A4-802D12C4 2CBBE4 0020+00 1/0 0/0 0/0 .text do_getTotalFreeSize__12JKRSolidHeapFv */
|
||||
s32 JKRSolidHeap::do_getTotalFreeSize(void) {
|
||||
return getFreeSize();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "JSystem/JUtility/JUTConsole.h"
|
||||
#include "stdio.h"
|
||||
#include "dol2asm.h"
|
||||
#include "global.h"
|
||||
|
||||
/* 8043428C-80434298 060FAC 000C+00 5/6 0/0 0/0 .bss sThreadList__9JKRThread */
|
||||
JSUList<JKRThread> JKRThread::sThreadList(0);
|
||||
@@ -52,8 +53,8 @@ JKRThread::JKRThread(JKRHeap* heap, u32 stack_size, int message_count, int param
|
||||
JKRThread::JKRThread(OSThread* thread, int message_count) : mThreadListLink(this) {
|
||||
mHeap = NULL;
|
||||
mThreadRecord = thread;
|
||||
mStackSize = (u32)thread->stack_end - (u32)thread->stack_base;
|
||||
mStackMemory = thread->stack_base;
|
||||
mStackSize = (u32)thread->stackEnd - (u32)thread->stackBase;
|
||||
mStackMemory = thread->stackBase;
|
||||
|
||||
setCommon_mesgQueue(JKRHeap::getSystemHeap(), message_count);
|
||||
}
|
||||
@@ -325,4 +326,4 @@ JSUList<JKRTask> JKRTask::sTaskList;
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
u8 JKRTask::sEndMesgQueue[32];
|
||||
#pragma pop
|
||||
#pragma pop
|
||||
|
||||
@@ -1352,16 +1352,16 @@ GXBlendMode JPABaseShape::st_bm[3] = {
|
||||
|
||||
/* 803C436C-803C4394 02148C 0028+00 0/1 0/0 0/0 .data st_bf__12JPABaseShape */
|
||||
GXBlendFactor JPABaseShape::st_bf[10] = {
|
||||
GX_BL_ZERO, GX_BL_ONE, GX_BL_SRC_COLOR, GX_BL_INV_SRC_COLOR,
|
||||
GX_BL_SRC_COLOR, GX_BL_INV_SRC_COLOR, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA,
|
||||
GX_BL_DST_ALPHA, GX_BL_INV_DST_ALPHA,
|
||||
GX_BL_ZERO, GX_BL_ONE, GX_BL_SRCCLR, GX_BL_INVSRCCLR,
|
||||
GX_BL_SRCCLR, GX_BL_INVSRCCLR, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA,
|
||||
GX_BL_DSTALPHA, GX_BL_INVDSTALPHA,
|
||||
};
|
||||
|
||||
/* 803C4394-803C43D4 0214B4 0040+00 0/1 0/0 0/0 .data st_lo__12JPABaseShape */
|
||||
GXLogicOp JPABaseShape::st_lo[16] = {
|
||||
GX_LO_CLEAR, GX_LO_SET, GX_LO_COPY, GX_LO_INV_COPY, GX_LO_NOOP, GX_LO_INV,
|
||||
GX_LO_CLEAR, GX_LO_SET, GX_LO_COPY, GX_LO_INVCOPY, GX_LO_NOOP, GX_LO_INV,
|
||||
GX_LO_AND, GX_LO_NAND, GX_LO_OR, GX_LO_NOR, GX_LO_XOR, GX_LO_EQUIV,
|
||||
GX_LO_REV_AND, GX_LO_INV_AND, GX_LO_REV_OR, GX_LO_INV_OR,
|
||||
GX_LO_REVAND, GX_LO_INVAND, GX_LO_REVOR, GX_LO_INVOR,
|
||||
};
|
||||
|
||||
/* 803C43D4-803C43F4 0214F4 0020+00 0/1 0/0 0/0 .data st_c__12JPABaseShape */
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "JSystem/JParticle/JPAResourceManager.h"
|
||||
#include "dolphin/gx.h"
|
||||
#include "global.h"
|
||||
|
||||
/* 80274010-80274080 26E950 0070+00 0/0 1/1 0/0 .text __ct__11JPAResourceFv */
|
||||
JPAResource::JPAResource() {
|
||||
@@ -957,8 +958,7 @@ void JPAResource::setPTev() {
|
||||
if (mpExTexShape->isUseIndirect()) {
|
||||
GXSetIndTexOrder(GX_INDTEXSTAGE0, GX_TEXCOORD1, GX_TEXMAP2);
|
||||
GXSetIndTexCoordScale(GX_INDTEXSTAGE0, GX_ITS_1, GX_ITS_1);
|
||||
GXSetIndTexMtx(GX_ITM_0, (f32*)mpExTexShape->getIndTexMtx(),
|
||||
mpExTexShape->getExpScale());
|
||||
GXSetIndTexMtx(GX_ITM_0, (f32(*)[3])mpExTexShape->getIndTexMtx(), mpExTexShape->getExpScale());
|
||||
GXSetTevIndirect(GX_TEVSTAGE0, GX_INDTEXSTAGE0, GX_ITF_8, GX_ITB_STU, GX_ITM_0,
|
||||
GX_ITW_OFF, GX_ITW_OFF, 0, 0, GX_ITBA_OFF);
|
||||
ind_stages++;
|
||||
|
||||
@@ -375,4 +375,4 @@ void JStudio_JAudio2::TAdaptor_sound::endSound_fadeOut_(u32 u32FadeTime) {
|
||||
JUT_ASSERT(654, (u32FadeTime>0)||!opJAISoundHandle_);
|
||||
field_0x120 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "JSystem/JUtility/JUTDbPrint.h"
|
||||
#include "JSystem/JUtility/JUTDirectPrint.h"
|
||||
#include "stdio.h"
|
||||
#include <dolphin/vi.h>
|
||||
|
||||
/* 804508F8-80450900 000378 0008+00 0/0 3/3 0/0 .sdata None */
|
||||
bool sAssertVisible = true;
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTDirectPrint.h"
|
||||
#include "JSystem/JUtility/JUTVideo.h"
|
||||
#include <dolphin/vi.h>
|
||||
#include <stdio.h>
|
||||
#include "global.h"
|
||||
|
||||
/* 80451570-80451574 000A70 0004+00 4/4 7/7 0/0 .sbss sManager__17JUTConsoleManager */
|
||||
JUTConsoleManager* JUTConsoleManager::sManager;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//
|
||||
|
||||
#include "JSystem/JUtility/JUTDirectFile.h"
|
||||
#include "dolphin/os/OSInterrupt.h"
|
||||
#include <dolphin/os.h>
|
||||
#include "global.h"
|
||||
|
||||
//
|
||||
@@ -34,7 +34,7 @@ int JUTDirectFile::fetch32byte() {
|
||||
return -1;
|
||||
} else {
|
||||
interrupts = OSEnableInterrupts();
|
||||
while (DVDGetCommandBlockStatus(&mFileInfo.block)) {
|
||||
while (DVDGetCommandBlockStatus(&mFileInfo.cb)) {
|
||||
;
|
||||
}
|
||||
OSRestoreInterrupts(interrupts);
|
||||
@@ -181,4 +181,4 @@ int JUTDirectFile::fgets(void* buf, int len) {
|
||||
}
|
||||
|
||||
return readCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
#include "JSystem/JUtility/JUTDirectPrint.h"
|
||||
#include "stdio.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include <dolphin/os.h>
|
||||
#include "global.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
@@ -265,4 +266,4 @@ void JUTDirectPrint::setCharColor(u8 r, u8 g, u8 b) {
|
||||
mCharColor_Cr = Cr;
|
||||
mCharColor_Cr2 = (Cr >> 1) & 0x7fff;
|
||||
mCharColor_Cr4 = (Cr >> 2) & 0x3fff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,20 +43,20 @@ const char* JUTException::sCpuExpName[17] = {
|
||||
JUTException* JUTException::sErrorManager;
|
||||
|
||||
/* 8045150C-80451510 000A0C 0004+00 4/4 0/0 0/0 .sbss sPreUserCallback__12JUTException */
|
||||
OSErrorHandler JUTException::sPreUserCallback;
|
||||
JUTExceptionUserCallback JUTException::sPreUserCallback;
|
||||
|
||||
/* 80451510-80451514 000A10 0004+00 3/3 0/0 0/0 .sbss sPostUserCallback__12JUTException
|
||||
*/
|
||||
OSErrorHandler JUTException::sPostUserCallback;
|
||||
JUTExceptionUserCallback JUTException::sPostUserCallback;
|
||||
|
||||
/* 802E1D5C-802E1E40 2DC69C 00E4+00 1/1 0/0 0/0 .text __ct__12JUTExceptionFP14JUTDirectPrint */
|
||||
JUTException::JUTException(JUTDirectPrint* directPrint)
|
||||
: JKRThread(0x1C00, 0x10, 0), mDirectPrint(directPrint) {
|
||||
OSSetErrorHandler(EXCEPTION_DSI, errorHandler);
|
||||
OSSetErrorHandler(EXCEPTION_ISI, errorHandler);
|
||||
OSSetErrorHandler(EXCEPTION_PROGRAM, errorHandler);
|
||||
OSSetErrorHandler(EXCEPTION_ALIGNMENT, errorHandler);
|
||||
OSSetErrorHandler(EXCEPTION_MEMORY_PROTECTION, errorHandler);
|
||||
OSSetErrorHandler(__OS_EXCEPTION_DSI, (OSErrorHandler)errorHandler);
|
||||
OSSetErrorHandler(__OS_EXCEPTION_ISI, (OSErrorHandler)errorHandler);
|
||||
OSSetErrorHandler(__OS_EXCEPTION_PROGRAM, (OSErrorHandler)errorHandler);
|
||||
OSSetErrorHandler(__OS_EXCEPTION_ALIGNMENT, (OSErrorHandler)errorHandler);
|
||||
OSSetErrorHandler(__OS_EXCEPTION_MEMORY_PROTECTION, (OSErrorHandler)errorHandler);
|
||||
setFPException(0);
|
||||
|
||||
sPreUserCallback = NULL;
|
||||
@@ -87,7 +87,7 @@ JUTException* JUTException::create(JUTDirectPrint* directPrint) {
|
||||
OSMessage JUTException::sMessageBuffer[1] = {0};
|
||||
|
||||
struct CallbackObject {
|
||||
/* 0x00 */ OSErrorHandler callback;
|
||||
/* 0x00 */ JUTExceptionUserCallback callback;
|
||||
/* 0x04 */ u16 error;
|
||||
/* 0x06 */ u16 pad_0x06;
|
||||
/* 0x08 */ OSContext* context;
|
||||
@@ -106,7 +106,7 @@ void* JUTException::run() {
|
||||
VISetPreRetraceCallback(NULL);
|
||||
VISetPostRetraceCallback(NULL);
|
||||
CallbackObject* cb = (CallbackObject*)message;
|
||||
OSErrorHandler callback = cb->callback;
|
||||
JUTExceptionUserCallback callback = cb->callback;
|
||||
u16 error = cb->error;
|
||||
OSContext* context = cb->context;
|
||||
int r24 = cb->param_3;
|
||||
@@ -156,7 +156,7 @@ void JUTException::errorHandler(OSError error, OSContext* context, u32 param_3,
|
||||
fpscr = context->fpscr;
|
||||
OSFillFPUContext(context);
|
||||
OSSetErrorHandler(error, NULL);
|
||||
if (error == OS_ERROR_MEMORY_PROTECTION) {
|
||||
if (error == __OS_EXCEPTION_MEMORY_PROTECTION) {
|
||||
OSProtectRange(0, NULL, 0, 3);
|
||||
OSProtectRange(1, NULL, 0, 3);
|
||||
OSProtectRange(2, NULL, 0, 3);
|
||||
@@ -226,9 +226,9 @@ void JUTException::panic_f(char const* file, int line, char const* format, ...)
|
||||
void JUTException::setFPException(u32 fpscr_enable_bits) {
|
||||
__OSFpscrEnableBits = fpscr_enable_bits;
|
||||
if (fpscr_enable_bits) {
|
||||
OSSetErrorHandler(EXCEPTION_FLOATING_POINT_EXCEPTION, errorHandler);
|
||||
OSSetErrorHandler(__OS_EXCEPTION_FLOATING_POINT_EXCEPTION, (OSErrorHandler)errorHandler);
|
||||
} else {
|
||||
OSSetErrorHandler(EXCEPTION_FLOATING_POINT_EXCEPTION, NULL);
|
||||
OSSetErrorHandler(__OS_EXCEPTION_FLOATING_POINT_EXCEPTION, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,13 +362,13 @@ void JUTException::showMainInfo(u16 error, OSContext* context, u32 dsisr, u32 da
|
||||
return;
|
||||
}
|
||||
|
||||
if (error < (OS_ERROR_MACHINE_CHECK | OS_ERROR_FLOATING_POINT_EXCEPTION)) {
|
||||
if (error < (OS_ERROR_MACHINE_CHECK | __OS_EXCEPTION_FLOATING_POINT_EXCEPTION)) {
|
||||
sConsole->print_f("CONTEXT:%08XH (%s EXCEPTION)\n", context, sCpuExpName[error]);
|
||||
} else {
|
||||
sConsole->print_f("CONTEXT:%08XH\n", context);
|
||||
}
|
||||
|
||||
if (error == OS_ERROR_FLOATING_POINT_EXCEPTION) {
|
||||
if (error == __OS_EXCEPTION_FLOATING_POINT_EXCEPTION) {
|
||||
u32 flags = fpscr & (((fpscr & 0xf8) << 0x16) | 0x1f80700);
|
||||
if ((flags & 0x20000000) != 0) {
|
||||
sConsole->print_f(" FPE: Invalid operation\n");
|
||||
@@ -659,7 +659,7 @@ void JUTException::printContext(OSError error, OSContext* context, u32 dsisr, u3
|
||||
return;
|
||||
}
|
||||
|
||||
if (error < (OS_ERROR_MACHINE_CHECK | OS_ERROR_FLOATING_POINT_EXCEPTION)) {
|
||||
if (error < (OS_ERROR_MACHINE_CHECK | __OS_EXCEPTION_FLOATING_POINT_EXCEPTION)) {
|
||||
sConsole->print_f("******** EXCEPTION OCCURRED! ********\nFrameMemory:%XH\n",
|
||||
getFrameMemory());
|
||||
} else {
|
||||
@@ -821,8 +821,8 @@ void JUTException::waitTime(s32 timeout_ms) {
|
||||
void JUTException::createFB() {
|
||||
_GXRenderModeObj* renderMode = &GXNtsc480Int;
|
||||
void* end = (void*)OSGetArenaHi();
|
||||
u16 width = ALIGN_NEXT(renderMode->fb_width, 16);
|
||||
u16 height = renderMode->xfb_height;
|
||||
u16 width = ALIGN_NEXT(renderMode->fbWidth, 16);
|
||||
u16 height = renderMode->xfbHeight;
|
||||
u32 pixel_count = width * height;
|
||||
u32 size = pixel_count * 2;
|
||||
|
||||
@@ -830,7 +830,7 @@ void JUTException::createFB() {
|
||||
void* object = (void*)ALIGN_PREV((s32)begin - sizeof(JUTExternalFB), 32);
|
||||
new (object) JUTExternalFB(renderMode, GX_GM_1_7, begin, size);
|
||||
|
||||
mDirectPrint->changeFrameBuffer(begin, renderMode->fb_width, renderMode->efb_height);
|
||||
mDirectPrint->changeFrameBuffer(begin, renderMode->fbWidth, renderMode->efbHeight);
|
||||
VIConfigure(renderMode);
|
||||
VISetNextFrameBuffer(begin);
|
||||
VISetBlack(FALSE);
|
||||
@@ -848,16 +848,16 @@ void JUTException::createFB() {
|
||||
|
||||
/* 802E3AEC-802E3AFC 2DE42C 0010+00 0/0 1/1 0/0 .text
|
||||
* setPreUserCallback__12JUTExceptionFPFUsP9OSContextUlUl_v */
|
||||
OSErrorHandler JUTException::setPreUserCallback(OSErrorHandler callback) {
|
||||
OSErrorHandler previous = sPreUserCallback;
|
||||
JUTExceptionUserCallback JUTException::setPreUserCallback(JUTExceptionUserCallback callback) {
|
||||
JUTExceptionUserCallback previous = sPreUserCallback;
|
||||
sPreUserCallback = callback;
|
||||
return previous;
|
||||
}
|
||||
|
||||
/* 802E3AFC-802E3B0C 2DE43C 0010+00 0/0 1/1 0/0 .text
|
||||
* setPostUserCallback__12JUTExceptionFPFUsP9OSContextUlUl_v */
|
||||
OSErrorHandler JUTException::setPostUserCallback(OSErrorHandler callback) {
|
||||
OSErrorHandler previous = sPostUserCallback;
|
||||
JUTExceptionUserCallback JUTException::setPostUserCallback(JUTExceptionUserCallback callback) {
|
||||
JUTExceptionUserCallback previous = sPostUserCallback;
|
||||
sPostUserCallback = callback;
|
||||
return previous;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <dolphin.h>
|
||||
#include "global.h"
|
||||
|
||||
/* 8039DA20-803A1B80 02A080 4160+00 0/0 1/0 0/0 .rodata JUTResFONT_Ascfont_fix12 */
|
||||
extern u8 const JUTResFONT_Ascfont_fix12[16736] ALIGN_DECL(32) = {
|
||||
|
||||
@@ -113,13 +113,13 @@ u32 JUTGamePad::read() {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
bittest = PAD_CHAN0_BIT >> i;
|
||||
|
||||
if (mPadStatus[i].error == 0) {
|
||||
if (mPadStatus[i].err == 0) {
|
||||
u32 stick_status;
|
||||
stick_status = mPadMStick[i].update(mPadStatus[i].stick_x, mPadStatus[i].stick_y, sStickMode, EMainStick, mPadButton[i].mButton) << 0x18;
|
||||
stick_status |= (mPadSStick[i].update(mPadStatus[i].substick_x, mPadStatus[i].substick_y, sStickMode, ESubStick, mPadButton[i].mButton) << 0x10);
|
||||
stick_status = mPadMStick[i].update(mPadStatus[i].stickX, mPadStatus[i].stickY, sStickMode, EMainStick, mPadButton[i].mButton) << 0x18;
|
||||
stick_status |= (mPadSStick[i].update(mPadStatus[i].substickX, mPadStatus[i].substickY, sStickMode, ESubStick, mPadButton[i].mButton) << 0x10);
|
||||
|
||||
mPadButton[i].update(&mPadStatus[i], stick_status);
|
||||
} else if (mPadStatus[i].error == -1) {
|
||||
} else if (mPadStatus[i].err == -1) {
|
||||
mPadMStick[i].update(0, 0, sStickMode, EMainStick, 0);
|
||||
mPadSStick[i].update(0, 0, sStickMode, ESubStick, 0);
|
||||
mPadButton[i].update(NULL, 0);
|
||||
@@ -140,9 +140,9 @@ u32 JUTGamePad::read() {
|
||||
pad->getPadReplay()->getStatus(&status);
|
||||
|
||||
u32 stick_status;
|
||||
stick_status = pad->mMainStick.update(status.stick_x, status.stick_y, sStickMode,
|
||||
stick_status = pad->mMainStick.update(status.stickX, status.stickY, sStickMode,
|
||||
EMainStick, pad->mButton.mButton) << 0x18;
|
||||
stick_status |= pad->mSubStick.update(status.substick_x, status.substick_y, sStickMode,
|
||||
stick_status |= pad->mSubStick.update(status.substickX, status.substickY, sStickMode,
|
||||
ESubStick, pad->mButton.mButton) << 0x10;
|
||||
|
||||
pad->mButton.update(&status, stick_status);
|
||||
@@ -155,7 +155,7 @@ u32 JUTGamePad::read() {
|
||||
|
||||
if (pad->getPadRecord() != NULL && pad->getPadRecord()->isActive()) {
|
||||
int port = pad->mPortNum;
|
||||
if (port >= 0 && mPadStatus[port].error == 0) {
|
||||
if (port >= 0 && mPadStatus[port].err == 0) {
|
||||
pad->getPadRecord()->write(&mPadStatus[port]);
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ u32 JUTGamePad::read() {
|
||||
/* 802E0BBC-802E0C6C 2DB4FC 00B0+00 1/1 0/0 0/0 .text assign__10JUTGamePadFv */
|
||||
void JUTGamePad::assign() {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (mPadStatus[i].error == 0 && mPadAssign[i] == 0) {
|
||||
if (mPadStatus[i].err == 0 && mPadAssign[i] == 0) {
|
||||
mPortNum = i;
|
||||
mPadAssign[i] = 1;
|
||||
mPadButton[i].setRepeat(mButton.mRepeatMask, mButton.mRepeatDelay, mButton.mRepeatRate);
|
||||
@@ -243,7 +243,7 @@ void JUTGamePad::update() {
|
||||
mButton = mPadButton[mPortNum];
|
||||
mMainStick = mPadMStick[mPortNum];
|
||||
mSubStick = mPadSStick[mPortNum];
|
||||
mErrorStatus = mPadStatus[mPortNum].error;
|
||||
mErrorStatus = mPadStatus[mPortNum].err;
|
||||
}
|
||||
|
||||
if (field_0xa8 == 0 || C3ButtonReset::sResetPattern != (mButton.mButton & C3ButtonReset::sResetMaskPattern)) {
|
||||
@@ -369,10 +369,10 @@ void JUTGamePad::CButton::update(const PADStatus* padStatus, u32 stickStatus) {
|
||||
mRepeat |= (mRepeatMask ^ 0xFFFFFFFF) & mTrigger;
|
||||
|
||||
if (padStatus != NULL) {
|
||||
mAnalogA = padStatus->analog_a;
|
||||
mAnalogB = padStatus->analog_b;
|
||||
mAnalogL = padStatus->trigger_left;
|
||||
mAnalogR = padStatus->trigger_right;
|
||||
mAnalogA = padStatus->analogA;
|
||||
mAnalogB = padStatus->analogB;
|
||||
mAnalogL = padStatus->triggerLeft;
|
||||
mAnalogR = padStatus->triggerRight;
|
||||
} else {
|
||||
mAnalogA = 0;
|
||||
mAnalogB = 0;
|
||||
|
||||
@@ -124,7 +124,7 @@ void JUTProcBar::draw() {
|
||||
void JUTProcBar::drawProcessBar() {
|
||||
if (mVisible) {
|
||||
int frameDuration = 16666; // duration in miliseconds? for how long a frame takes,
|
||||
if (JUTVideo::getManager() && ((JUTVideo::getManager()->getRenderMode()->vi_tv_mode >> 2) &
|
||||
if (JUTVideo::getManager() && ((JUTVideo::getManager()->getRenderMode()->viTVmode >> 2) &
|
||||
0x0f) == 1) // possibly a define
|
||||
frameDuration = 20000; // duration for PAL
|
||||
|
||||
@@ -324,4 +324,4 @@ void JUTProcBar::drawHeapBar() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ void JUTResFont::setGX() {
|
||||
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE,
|
||||
GX_AF_NONE);
|
||||
GXSetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_SET);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_RGBA4, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBX8, 15);
|
||||
@@ -220,7 +220,7 @@ void JUTResFont::setGX(JUtility::TColor col1, JUtility::TColor col2) {
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_APREV, GX_CA_RASA, GX_CA_ZERO);
|
||||
GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_SET);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_RGBA4, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBX8, 15);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "JSystem/JUtility/JUTDirectPrint.h"
|
||||
#include "JSystem/JUtility/JUTXfb.h"
|
||||
#include "dolphin/gx.h"
|
||||
#include <dolphin/vi.h>
|
||||
|
||||
/* 80451538-8045153C 000A38 0004+00 4/4 18/18 1/1 .sbss sManager__8JUTVideo */
|
||||
JUTVideo* JUTVideo::sManager;
|
||||
@@ -93,7 +94,7 @@ void JUTVideo::preRetraceProc(u32 retrace_count) {
|
||||
JUTVideo* videoManager = JUTGetVideoManager();
|
||||
const GXRenderModeObj* renderMode = videoManager->getRenderMode();
|
||||
JUTDirectPrint* directPrint = JUTDirectPrint::getManager();
|
||||
directPrint->changeFrameBuffer(frameBuffer, renderMode->fb_width, renderMode->efb_height);
|
||||
directPrint->changeFrameBuffer(frameBuffer, renderMode->fbWidth, renderMode->efbHeight);
|
||||
}
|
||||
|
||||
if (sManager->mSetBlack == 1) {
|
||||
@@ -198,7 +199,7 @@ void JUTVideo::postRetraceProc(u32 retrace_count) {
|
||||
/* 802E5198-802E5210 2DFAD8 0078+00 1/1 2/2 0/0 .text
|
||||
* setRenderMode__8JUTVideoFPC16_GXRenderModeObj */
|
||||
void JUTVideo::setRenderMode(GXRenderModeObj const* pObj) {
|
||||
if (mRenderObj != NULL && pObj->vi_tv_mode != mRenderObj->vi_tv_mode) {
|
||||
if (mRenderObj != NULL && pObj->viTVmode != mRenderObj->viTVmode) {
|
||||
mSetBlack = true;
|
||||
mSetBlackFrameCount = 4;
|
||||
}
|
||||
@@ -213,4 +214,4 @@ void JUTVideo::setRenderMode(GXRenderModeObj const* pObj) {
|
||||
}
|
||||
|
||||
/* 802E5210-802E5214 2DFB50 0004+00 0/0 1/1 0/0 .text waitRetraceIfNeed__8JUTVideoFv */
|
||||
void JUTVideo::waitRetraceIfNeed() {}
|
||||
void JUTVideo::waitRetraceIfNeed() {}
|
||||
|
||||
@@ -59,15 +59,15 @@ JUTXfb::JUTXfb(GXRenderModeObj const* pObj, JKRHeap* pHeap, JUTXfb::EXfbNumber x
|
||||
common_init(xfbNum);
|
||||
|
||||
if (pObj) {
|
||||
initiate(pObj->fb_width, pObj->xfb_height, pHeap, xfbNum);
|
||||
initiate(pObj->fbWidth, pObj->xfbHeight, pHeap, xfbNum);
|
||||
} else {
|
||||
u16 fb_width = JUTVideo::getManager()->getRenderMode()->fb_width;
|
||||
u16 efb_height = (u32)JUTVideo::getManager()->getRenderMode()->efb_height;
|
||||
u16 xfb_height = JUTVideo::getManager()->getRenderMode()->xfb_height;
|
||||
f32 scale_factor = GXGetYScaleFactor(efb_height, xfb_height);
|
||||
u16 xfb_lines = GXGetNumXfbLines(efb_height, scale_factor);
|
||||
u16 fbWidth = JUTVideo::getManager()->getRenderMode()->fbWidth;
|
||||
u16 efbHeight = (u32)JUTVideo::getManager()->getRenderMode()->efbHeight;
|
||||
u16 xfb_height = JUTVideo::getManager()->getRenderMode()->xfbHeight;
|
||||
f32 scale_factor = GXGetYScaleFactor(efbHeight, xfb_height);
|
||||
u16 xfb_lines = GXGetNumXfbLines(efbHeight, scale_factor);
|
||||
|
||||
initiate(fb_width, xfb_lines, pHeap, xfbNum);
|
||||
initiate(fbWidth, xfb_lines, pHeap, xfbNum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user