From 253758b8ef7d78d728a8609b24331bacb425dde1 Mon Sep 17 00:00:00 2001 From: PikHacker Date: Mon, 14 Oct 2024 00:29:51 -0400 Subject: [PATCH] zukan2d fixes / misc cleanup --- docs/recommended_todo.md | 24 +- include/Game/BaseGameSection.h | 20 +- include/Game/gameGenerator.h | 16 +- include/Morimura/ScrollList.h | 9 +- include/ebi/FS.h | 1 - include/kh/khUtil.h | 8 +- src/plugProjectKandoU/baseGameSection.cpp | 4 +- src/plugProjectKandoU/gameGenerator.cpp | 22 +- src/plugProjectKandoU/gameGeneratorCache.cpp | 2 +- src/plugProjectKandoU/gameSeaMgr.cpp | 6 +- src/plugProjectKandoU/mapMgr.cpp | 4 +- src/plugProjectKonoU/khUtil.cpp | 14 +- src/plugProjectKonoU/khWorldMap.cpp | 7 +- src/plugProjectMorimuraU/blackMan.cpp | 6 +- src/plugProjectMorimuraU/hiScore2D.cpp | 18 +- src/plugProjectMorimuraU/plants.cpp | 31 +-- src/plugProjectMorimuraU/scrollList.cpp | 8 +- src/plugProjectMorimuraU/vsSelect2D.cpp | 5 +- src/plugProjectMorimuraU/zukan2D.cpp | 88 ++++--- src/plugProjectNishimuraU/MiniHoudai.cpp | 240 +------------------ src/plugProjectYamashitaU/farmMgr.cpp | 4 +- src/plugProjectYamashitaU/genEnemy.cpp | 5 +- src/sysGCU/demoSection.cpp | 11 +- 23 files changed, 158 insertions(+), 395 deletions(-) diff --git a/docs/recommended_todo.md b/docs/recommended_todo.md index 914f661df..e113248c3 100644 --- a/docs/recommended_todo.md +++ b/docs/recommended_todo.md @@ -82,7 +82,7 @@ | fakePiki.cpp | 42148 | collinfo.cpp | 42951 | | cellPyramid.cpp | 48069 | aiFormation.cpp | 53090 | | pelletState.cpp | 63251 | itemUjamushi.cpp | 64561 | -| itemPlant.cpp | 73568 | baseGameSection.cpp | 86076 | +| itemPlant.cpp | 73568 | baseGameSection.cpp | 86168 | | aiPrimitives.cpp | 117179 | pelletMgr.cpp | 130665 | | pikiState.cpp | 140997 | navi.cpp | 148740 | | naviState.cpp | 163246 | singleGS_Zukan.cpp | 163886 | @@ -92,19 +92,19 @@ | File | Size (bytes) | File | Size (bytes) | | ---- | ---- | ---- | ---- | | khFinalResult.cpp | 60103 | khDayEndResult.cpp | 81751 | -| khWorldMap.cpp | 119372 | | | +| khWorldMap.cpp | 119406 | | | ###
plugProjectMorimuraU
| File | Size (bytes) | File | Size (bytes) | | ---- | ---- | ---- | ---- | -| scrollList.cpp | 25920 | dayEndCount.cpp | 26621 | +| scrollList.cpp | 25904 | dayEndCount.cpp | 26621 | | hurryUp2D.cpp | 27172 | miulin.cpp | 27527 | | jigumo.cpp | 42368 | shijimiChou.cpp | 43362 | | panModoki.cpp | 45170 | kingChappyState.cpp | 50819 | | umiMushi.cpp | 60146 | kingChappy.cpp | 64498 | -| hiScore2D.cpp | 76415 | blackMan.cpp | 121903 | -| zukan2D.cpp | 134435 | challengeResult2D.cpp | 142165 | -| challengeSelect2D.cpp | 186008 | vsSelect2D.cpp | 196392 | +| hiScore2D.cpp | 76289 | blackMan.cpp | 121950 | +| zukan2D.cpp | 134332 | challengeResult2D.cpp | 142165 | +| challengeSelect2D.cpp | 186008 | vsSelect2D.cpp | 196329 | ###
plugProjectNishimuraU
| File | Size (bytes) | File | Size (bytes) | @@ -114,12 +114,12 @@ | KumaChappy.cpp | 10290 | SnakeWholeShadow.cpp | 11928 | | SnakeCrowShadow.cpp | 12091 | BabyState.cpp | 12331 | | Kogane.cpp | 14498 | RandMapMgr.cpp | 15237 | -| Rock.cpp | 17638 | Ujia.cpp | 18104 | -| JointShadowBase.cpp | 18414 | Ujib.cpp | 18626 | -| ElecBug.cpp | 18636 | ImomushiState.cpp | 19604 | -| Imomushi.cpp | 20110 | UjiaState.cpp | 20343 | -| Armor.cpp | 20970 | ElecHiba.cpp | 21756 | -| QueenState.cpp | 22553 | MiniHoudai.cpp | 22737 | +| MiniHoudai.cpp | 17291 | Rock.cpp | 17638 | +| Ujia.cpp | 18104 | JointShadowBase.cpp | 18414 | +| Ujib.cpp | 18626 | ElecBug.cpp | 18636 | +| ImomushiState.cpp | 19604 | Imomushi.cpp | 20110 | +| UjiaState.cpp | 20343 | Armor.cpp | 20970 | +| ElecHiba.cpp | 21756 | QueenState.cpp | 22553 | | UjibState.cpp | 25546 | Tobi.cpp | 25548 | | BigTreasureShadow.cpp | 25799 | ArmorState.cpp | 26549 | | TobiState.cpp | 27052 | SaraiState.cpp | 27370 | diff --git a/include/Game/BaseGameSection.h b/include/Game/BaseGameSection.h index 9c7d948a7..f6d640372 100644 --- a/include/Game/BaseGameSection.h +++ b/include/Game/BaseGameSection.h @@ -67,16 +67,16 @@ enum DemoTimers { }; enum DrawBufferType { - DB_NormalLayer = 0, - DB_NormalFogOffLayer, - DB_MapLayer, - DB_PikiLayer, - DB_PostRenderLayer, - DB_2DLayer, - DB_FirstLayer, - DB_PostShadowLayer, - DB_ObjectLastLayer, - DB_FarmLayer, + DB_NormalLayer = 0, + DB_NormalFogOffLayer = 1, + DB_MapLayer = 2, + DB_PikiLayer = 3, + DB_PostRenderLayer = 4, + DB_2DLayer = 5, + DB_FirstLayer = 6, + DB_PostShadowLayer = 7, + DB_ObjectLastLayer = 8, + DB_FarmLayer = 9, }; struct BaseGameSection : public BaseHIOSection { diff --git a/include/Game/gameGenerator.h b/include/Game/gameGenerator.h index a8c0c9126..026ab29d9 100644 --- a/include/Game/gameGenerator.h +++ b/include/Game/gameGenerator.h @@ -66,6 +66,16 @@ struct Generator : public CNode { return count; } + // These represent the "reserved" value from the gen file entry + enum ReservedFlag { + Reserved_Null = 0, // This value should always be used in defaultgen, plantgen, or day gens + Reserved_doSaveGen = 1, // needed to save gen info, such as object type and pellet info + Reserved_doSaveCreature = 2, // needed to save creature info, mostly needed for position and item specific properties + Reserved_doTrackDeath = 4, // needed for respawn days to take effect? This ones weird, but enemies that respawn use it + Reserved_doTrackPosition = 8, // used for pellets to save current position between loads, might work for enemies + }; + inline bool isReservedFlag(u8 flag) { return mReservedNum & flag; } + GenObject* mObject; // _18 u32 mId; // _1C /* Initialized to '____' */ char mGenObjName[32]; // _20 /* shift-jis name given in generator files */ @@ -86,12 +96,12 @@ struct Generator : public CNode { u8 _88[12]; // _88 Vector3f mPosition; // _94 Vector3f mOffset; // _A0 - u8 mIsInactive; // _AC + u8 mIsInactive; // _AC, if true, the object wont spawn or need its assets loaded int mIndex; // _B0 enum RamMode { - RM_Disc = 0, - RM_MemoryCache, + RM_Disc = 0, + RM_MemoryCache = 1, }; static u8 ramMode; }; diff --git a/include/Morimura/ScrollList.h b/include/Morimura/ScrollList.h index 238a46d24..fca08f243 100644 --- a/include/Morimura/ScrollList.h +++ b/include/Morimura/ScrollList.h @@ -89,7 +89,7 @@ struct TIndexPane { void doIconOffsetY(); - inline void setPaneOffset(f32 offset) { mPane->setOffsetY(mYOffset + offset); } + inline void setOffset(f32 y) { mPane->setOffset(mPane->mOffset.x, mYOffset + y); } inline f32 getPaneYOffset() const { return mYOffset; } @@ -152,12 +152,7 @@ struct TScrollList : public TTestBase { inline TIndexPane* getIndexPane(int i) const { return mIndexPaneList[i]; } - inline void updateIDPaneYOffset(int id, f32 yoffs) - { - // should be using r4 instead of r3 - getIndexPane(id)->setPaneOffset(yoffs); - getIndexPane(id)->mYOffset = getIndexPane(id)->getPaneOffsetY(); - } + inline f32 getHeight() const { return mIndexPaneList[1]->getMainPane()->getOffsetY() - mIndexPaneList[0]->getMainPane()->getOffsetY(); } // _00 = VTBL1 // _18 = VTBL2 diff --git a/include/ebi/FS.h b/include/ebi/FS.h index 018664ef5..94f0b9f1f 100644 --- a/include/ebi/FS.h +++ b/include/ebi/FS.h @@ -377,7 +377,6 @@ struct TMgr { bool mInSeq; // _C3C FSMStateMachine mStateMachine; // _C40 FSMState* mCurrentState; // _C5C - // TODO: members }; } // namespace FS } // namespace ebi diff --git a/include/kh/khUtil.h b/include/kh/khUtil.h index cb473277f..6d79b0fc9 100644 --- a/include/kh/khUtil.h +++ b/include/kh/khUtil.h @@ -81,8 +81,8 @@ struct khUtilFadePaneWM : public khUtilFadePane { virtual ~khUtilFadePaneWM() { } // _08 (weak) virtual void fadeout_finish(); // _20 - static khUtilFadePaneWM* create(P2DScreen::Mgr*, u64, u8); // UNUSED - void create(P2DScreen::Mgr*, J2DPane*, u8); // UNUSED + static khUtilFadePaneWM* create(P2DScreen::Mgr*, u64, u8); // UNUSED + static khUtilFadePaneWM* create(P2DScreen::Mgr*, J2DPane*, u8); // UNUSED // _00 = VTBL // _00-_30 = khUtilFadePane @@ -91,7 +91,7 @@ struct khUtilFadePaneWM : public khUtilFadePane { }; struct khUtilColorAnm : public P2DScreen::CallBackNode { - khUtilColorAnm(P2DScreen::Mgr* screen, u64 tag, int panes, int length); + khUtilColorAnm(P2DScreen::Mgr* screen, u64 tag, int colors, int length); virtual ~khUtilColorAnm() { } // _08 (weak) virtual void update(); // _10 (weak) @@ -113,7 +113,7 @@ struct khUtilColorAnm : public P2DScreen::CallBackNode { JUtility::TColor* mColorList; // _1C JUtility::TColor mColor; // _20 JUtility::TColor mDisabledColor; // _24 - int mPaneNum; // _28 + int mColorCount; // _28 int mLength; // _2C int mFrame; // _30 bool mUpdateMode; // _34 diff --git a/src/plugProjectKandoU/baseGameSection.cpp b/src/plugProjectKandoU/baseGameSection.cpp index a58766e62..c82f74c99 100644 --- a/src/plugProjectKandoU/baseGameSection.cpp +++ b/src/plugProjectKandoU/baseGameSection.cpp @@ -950,13 +950,13 @@ void BaseGameSection::saveToGeneratorCache(CourseInfo* courseinfo) generatorCache->beginSave(courseinfo->mCourseIndex); FOREACH_NODE(Generator, generatorCache->getFirstGenerator(), node) { - if (node->mReservedNum & 1) { + if (node->isReservedFlag(Generator::Reserved_doSaveGen)) { generatorCache->saveGenerator(node); } } FOREACH_NODE(Generator, generatorCache->getFirstGenerator(), node) { - if (node->mReservedNum & 1 && node->mReservedNum & 2) { + if (node->isReservedFlag(Generator::Reserved_doSaveGen) && node->isReservedFlag(Generator::Reserved_doSaveCreature)) { generatorCache->saveCreature(node); } } diff --git a/src/plugProjectKandoU/gameGenerator.cpp b/src/plugProjectKandoU/gameGenerator.cpp index ff2223991..718b1220c 100644 --- a/src/plugProjectKandoU/gameGenerator.cpp +++ b/src/plugProjectKandoU/gameGenerator.cpp @@ -8,7 +8,6 @@ #include "JSystem/JUtility/JUTException.h" #include "nans.h" #include "Parameters.h" -#include "types.h" u32 GeneratorCurrentVersion = 'v0.3'; @@ -155,7 +154,7 @@ Generator::Generator() { mObject = nullptr; mId = '____'; - mReservedNum = 0; + mReservedNum = Reserved_Null; mNameId.setID(' '); mVersion.setID(GeneratorCurrentVersion); strcpy(mGenObjName, "unset"); @@ -228,8 +227,8 @@ bool Generator::loadCreature(Stream& input) if (mCreature) { mCreature->mGenerator = this; u8 flag = 0; - if (mReservedNum & 0x8) { - flag |= 0x1; + if (isReservedFlag(Reserved_doTrackPosition)) { + flag |= CREATURE_SAVE_FLAG_POSITION; } mCreature->load(input, flag); } else { @@ -266,7 +265,7 @@ void Generator::saveCreature(Stream& output) { if (mCreature) { u8 conversion = 0; - if (mReservedNum & 8) { + if (isReservedFlag(Reserved_doTrackPosition)) { conversion |= CREATURE_SAVE_FLAG_POSITION; } @@ -298,14 +297,14 @@ void Generator::generate() mUnusedVal = 0; mDeathCount = 0; mDayNum = gameSystem->mTimeMgr->mDayCount; - } else if ((mReservedNum & 4) == 0) { + } else if (!isReservedFlag(Reserved_doTrackDeath)) { mUnusedVal = 0; return; } mCreature = nullptr; if (mObject) { - if (ramMode != RM_Disc && (mReservedNum & 4) != 0 + if (ramMode != RM_Disc && isReservedFlag(Reserved_doTrackDeath) && (int)gameSystem->mTimeMgr->mDayCount >= (int)(mDayNum + mDaysTillResurrection)) { mDayNum = gameSystem->mTimeMgr->mDayCount; mDeathCount = 0; @@ -429,6 +428,9 @@ void Generator::read(Stream& input) */ void Generator::write(Stream& output) { + // Note that the entire functionality of outputting Generators as text is unused code + // Only binary is ever used by the actual game + output.textWriteTab(output.mTabCount); ID32 id(GeneratorCurrentVersion); id.write(output); @@ -443,20 +445,21 @@ void Generator::write(Stream& output) output.textWriteText("\t# 復活日数\r\n"); // 'resurrection days' if (ramMode == RM_Disc) { - // generator files as stored on disc + // write the generator's name when working with plain text output.textWriteTab(output.mTabCount); for (int i = 0; i < 32; i++) { output.writeByte(mGenObjName[i]); } output.textWriteText("\t# <%s>\r\n", mGenObjName); } else { - // gencache? + // binary skips writing the name, but does write additional values to keep track of its alive status output.writeByte('\0'); output.writeShort(mDeathCount); output.writeShort(mDayNum); output.writeShort(mDayLimit); } + // Store position as shorts in binary mode, as floats in text mode if (ramMode != RM_Disc) { output.writeShort((s16)mPosition.x + mOffset.x); output.writeShort((s16)mPosition.y + mOffset.y); @@ -474,6 +477,7 @@ void Generator::write(Stream& output) output.writeFloat(mOffset.z); output.textWriteText("\t# offset\r\n"); } + if (mObject) { mObject->write(output); } else { diff --git a/src/plugProjectKandoU/gameGeneratorCache.cpp b/src/plugProjectKandoU/gameGeneratorCache.cpp index 613f17f6b..277bd0760 100644 --- a/src/plugProjectKandoU/gameGeneratorCache.cpp +++ b/src/plugProjectKandoU/gameGeneratorCache.cpp @@ -314,7 +314,7 @@ void GeneratorCache::updateUseList() void GeneratorCache::createNumberGenerators() { for (Generator* gen = getFirstGenerator(); gen != nullptr; gen = (Generator*)gen->mNext) { - if (gen->mIsInactive == FALSE && (gen->mReservedNum & 4U) != 0) { + if (gen->mIsInactive == FALSE && gen->isReservedFlag(Generator::Reserved_doTrackDeath)) { Generator::ramMode = Generator::RM_MemoryCache; gen->generate(); Generator::ramMode = Generator::RM_Disc; diff --git a/src/plugProjectKandoU/gameSeaMgr.cpp b/src/plugProjectKandoU/gameSeaMgr.cpp index 223a8c6fe..02a17e9e7 100644 --- a/src/plugProjectKandoU/gameSeaMgr.cpp +++ b/src/plugProjectKandoU/gameSeaMgr.cpp @@ -184,7 +184,7 @@ void AABBWaterBox::doEntry() if (gameSystem && !gameSystem->isStoryMode() && !gameSystem->isZukanMode() && (!gameSystem->isChallengeMode() || gameSystem->isMultiplayerMode())) { if (gameSystem) { - gameSystem->setDrawBuffer(4); + gameSystem->setDrawBuffer(DB_PostRenderLayer); mModel->mJ3dModel->calcMaterial(); mModel->mJ3dModel->entry(); } @@ -195,7 +195,7 @@ void AABBWaterBox::doEntry() BaseGameSection* section = gameSystem->getSection(); if (section->mPrevNaviIdx == NAVIID_Multiplayer) { if (gameSystem) { - gameSystem->setDrawBuffer(4); + gameSystem->setDrawBuffer(DB_PostRenderLayer); Mtx copyMatrix; PSMTXIdentity(copyMatrix); J3DTexMtx* texMtx = mModel->mJ3dModel->mModelData->mMaterialTable.mMaterials[0]->mTexGenBlock->getTexMtx(3); // good lord @@ -244,7 +244,7 @@ void AABBWaterBox::doEntry() } if (gameSystem) { - gameSystem->setDrawBuffer(4); + gameSystem->setDrawBuffer(DB_PostRenderLayer); mModel->mJ3dModel->calcMaterial(); if (mFbTexture) { diff --git a/src/plugProjectKandoU/mapMgr.cpp b/src/plugProjectKandoU/mapMgr.cpp index aad834772..dcea01ff6 100644 --- a/src/plugProjectKandoU/mapMgr.cpp +++ b/src/plugProjectKandoU/mapMgr.cpp @@ -581,9 +581,9 @@ void ShapeMapMgr::doEntry() if (mSeaMgr != nullptr) { mSeaMgr->doEntry(); } - gameSystem->setDrawBuffer(2); + gameSystem->setDrawBuffer(DB_MapLayer); mMapModel->getJ3DModel()->entry(); - gameSystem->setDrawBuffer(0); + gameSystem->setDrawBuffer(DB_NormalLayer); } else { mMapModel->getJ3DModel()->entry(); } diff --git a/src/plugProjectKonoU/khUtil.cpp b/src/plugProjectKonoU/khUtil.cpp index 79d592949..9dd6eafe2 100644 --- a/src/plugProjectKonoU/khUtil.cpp +++ b/src/plugProjectKonoU/khUtil.cpp @@ -187,14 +187,14 @@ void khUtilFadePane::set_init_alpha(u8 a) * @note Address: 0x8040BE70 * @note Size: 0x158 */ -khUtilColorAnm::khUtilColorAnm(P2DScreen::Mgr* screen, u64 tag, int panes, int frames) +khUtilColorAnm::khUtilColorAnm(P2DScreen::Mgr* screen, u64 tag, int colors, int frames) { - mPaneNum = panes; - mLength = frames; - mFrame = 0; + mColorCount = colors; + mLength = frames; + mFrame = 0; mColor.set(0, 0, 0, 0); - mColorList = new JUtility::TColor[mPaneNum]; - for (int i = 0; i < mPaneNum; i++) { + mColorList = new JUtility::TColor[mColorCount]; + for (int i = 0; i < mColorCount; i++) { mColorList[i].set(0, 0, 0, 0); } mDisabledColor.setRGBA(mColor); @@ -219,7 +219,7 @@ void khUtilColorAnm::update() f32 inverseT; // Calculate the animation position between start and end - f32 t = (mFrame * (mPaneNum - 1)) / (f32)mLength; + f32 t = (mFrame * (mColorCount - 1)) / (f32)mLength; // Get the two colors to interpolate between JUtility::TColor src = getColor((int)t); diff --git a/src/plugProjectKonoU/khWorldMap.cpp b/src/plugProjectKonoU/khWorldMap.cpp index 83dae707d..ef767025d 100644 --- a/src/plugProjectKonoU/khWorldMap.cpp +++ b/src/plugProjectKonoU/khWorldMap.cpp @@ -45,10 +45,7 @@ khUtilFadePaneWM* khUtilFadePaneWM::create(P2DScreen::Mgr* mgr, u64 tag, u8) * @note Address: N/A * @note Size: 0xB8 */ -void khUtilFadePaneWM::create(P2DScreen::Mgr*, J2DPane*, u8) -{ - // UNUSED FUNCTION -} +khUtilFadePaneWM* khUtilFadePaneWM::create(P2DScreen::Mgr* screen, J2DPane* pane, u8 a) { return create(screen, pane->mTag, a); } /** * @note Address: 0x803F1BA0 @@ -558,7 +555,7 @@ void WorldMap::loadResource() mEfxMapFlare->create(nullptr); mEfxShstar1->create(nullptr); - mCaveFadePane = khUtilFadePaneWM::create(mScreenInfo, mScreenInfo->search('Ncave0')->mTag, 0); + mCaveFadePane = khUtilFadePaneWM::create(mScreenInfo, mScreenInfo->search('Ncave0'), 0); mCaveFadePane->add(mScreenInfo->search('Ncave1')); mCaveFadePane->add(mScreenInfo->search('Ncave2')); diff --git a/src/plugProjectMorimuraU/blackMan.cpp b/src/plugProjectMorimuraU/blackMan.cpp index e1df6738a..48219dba5 100644 --- a/src/plugProjectMorimuraU/blackMan.cpp +++ b/src/plugProjectMorimuraU/blackMan.cpp @@ -1205,12 +1205,12 @@ bool BlackMan::Obj::earthquakeCallBack(Game::Creature* creature, f32 bounceFacto void BlackMan::Obj::doEntry() { if (C_PARMS->mUseDrawBuffer8) { - gameSystem->setDrawBuffer(8); + gameSystem->setDrawBuffer(DB_ObjectLastLayer); } else { - gameSystem->setDrawBuffer(4); + gameSystem->setDrawBuffer(DB_PostRenderLayer); } EnemyBase::doEntry(); - gameSystem->setDrawBuffer(0); + gameSystem->setDrawBuffer(DB_NormalLayer); } /** diff --git a/src/plugProjectMorimuraU/hiScore2D.cpp b/src/plugProjectMorimuraU/hiScore2D.cpp index eddcfb5c2..433780956 100644 --- a/src/plugProjectMorimuraU/hiScore2D.cpp +++ b/src/plugProjectMorimuraU/hiScore2D.cpp @@ -617,9 +617,8 @@ void THiScore::doCreate(JKRArchive* arc) f32 yoffs = mIndexGroup->mHeight; for (int i = 0; i < 2; i++) { for (int j = 0; j < mNumActiveRows; j++) { - TIndexPane* IDPane = mIndexPaneList[j]; - IDPane->mPane->setOffset(IDPane->mPane->mOffset.x, IDPane->mYOffset + yoffs); - mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->mPane->mOffset.y; + mIndexPaneList[j]->setOffset(yoffs); + mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->getPaneOffsetY(); } updateIndex(0); TIndexGroup* grp = mIndexGroup; @@ -2812,17 +2811,18 @@ void THiScore::changeColorBlock(J2DColorBlock* colorB, J2DColorBlock* colorA) */ void THiScore::updateLayout() { - f32 ydiff = mIndexPaneList[0]->mPane->mOffset.y - mIndexPaneList[1]->mPane->mOffset.y; - mPaneHeightDiff = ydiff * 2.0f; + f32 ydiff = getHeight(); + mPaneHeightDiff = getHeight() * 2.0f; if (mIsAllTreasures) { for (int i = 0; i < mNumActiveRows; i++) { - updateIDPaneYOffset(i, (ydiff * mClearListHeightRate) * f32(i - mCurrActiveRowSel)); + mIndexPaneList[i]->setOffset((ydiff * mClearListHeightRate) * f32(i - mCurrActiveRowSel)); + mIndexPaneList[i]->mYOffset = mIndexPaneList[i]->getPaneOffsetY(); } - ydiff = mIndexPaneList[0]->mPane->mOffset.y - mIndexPaneList[1]->mPane->mOffset.y; - mMinSelYOffset = mIndexPaneList[mCurrMinActiveRow]->mPane->mOffset.y; - mMaxSelYOffset = mIndexPaneList[mCurrMaxActiveRow]->mPane->mOffset.y; + ydiff = getHeight(); + mMinSelYOffset = mIndexPaneList[mCurrMinActiveRow]->getPaneOffsetY(); + mMaxSelYOffset = mIndexPaneList[mCurrMaxActiveRow]->getPaneOffsetY(); } mIndexGroup->mHeight = ydiff; /* diff --git a/src/plugProjectMorimuraU/plants.cpp b/src/plugProjectMorimuraU/plants.cpp index 245c752e9..275d40d1a 100644 --- a/src/plugProjectMorimuraU/plants.cpp +++ b/src/plugProjectMorimuraU/plants.cpp @@ -66,7 +66,7 @@ void Plants::Obj::onInit(CreatureInitArg* initArg) } mSpawnsSpectralids = false; - if (mPelletInfo.mColor == 0 && mPelletInfo.mSize == 1) { + if (mPelletInfo.mColor == PELCOLOR_SPECTRALID && mPelletInfo.mSize == PELSIZE_SPECTRALID) { mSpawnsSpectralids = true; } } @@ -219,9 +219,9 @@ void HikariKinoko::Obj::touchedSE(Navi* navi) */ void Watage::Obj::doEntry() { - gameSystem->setDrawBuffer(7); + gameSystem->setDrawBuffer(DB_PostShadowLayer); EnemyBase::doEntry(); - gameSystem->setDrawBuffer(0); + gameSystem->setDrawBuffer(DB_NormalLayer); } /** @@ -230,18 +230,7 @@ void Watage::Obj::doEntry() */ void Watage::Obj::touched() { - if (mSpawnsSpectralids) { - mSpawnsSpectralids = false; - ShijimiChou::Mgr* mgr = static_cast(generalEnemyMgr->getEnemyMgr(EnemyTypeID::EnemyID_ShijimiChou)); - if (mgr) { - EnemyBirthArg birthArg; - birthArg.mPosition = mPosition; - birthArg.mPosition.y = mPosition.y + static_cast(mParms)->mGeneral.mLifeMeterHeight.mValue; - birthArg.mFaceDir = 0.0f; - - mgr->createGroupByPlants(birthArg, 5); - } - } + Plants::Obj::touched(); efx::TWatage watageEFX; efx::Arg arg(mPosition); @@ -255,9 +244,9 @@ void Watage::Obj::touched() */ void Nekojarashi::Obj::doEntry() { - gameSystem->setDrawBuffer(7); + gameSystem->setDrawBuffer(DB_PostShadowLayer); EnemyBase::doEntry(); - gameSystem->setDrawBuffer(0); + gameSystem->setDrawBuffer(DB_NormalLayer); } /** @@ -277,9 +266,9 @@ void DiodeRed::Obj::touchedSE(Navi* navi) */ void DiodeRed::Obj::doEntry() { - gameSystem->setDrawBuffer(7); + gameSystem->setDrawBuffer(DB_PostShadowLayer); EnemyBase::doEntry(); - gameSystem->setDrawBuffer(0); + gameSystem->setDrawBuffer(DB_NormalLayer); } /** @@ -299,9 +288,9 @@ void DiodeGreen::Obj::touchedSE(Navi* navi) */ void DiodeGreen::Obj::doEntry() { - gameSystem->setDrawBuffer(7); + gameSystem->setDrawBuffer(DB_PostShadowLayer); EnemyBase::doEntry(); - gameSystem->setDrawBuffer(0); + gameSystem->setDrawBuffer(DB_NormalLayer); } } // namespace Game diff --git a/src/plugProjectMorimuraU/scrollList.cpp b/src/plugProjectMorimuraU/scrollList.cpp index 7245a1cbb..0d7cc2534 100644 --- a/src/plugProjectMorimuraU/scrollList.cpp +++ b/src/plugProjectMorimuraU/scrollList.cpp @@ -438,7 +438,7 @@ void TScrollList::updateIndex(bool doScrollDown) check2 = true; } - mIndexPaneList[mCurrMinActiveRow]->setPaneOffset(0.0f); + mIndexPaneList[mCurrMinActiveRow]->setOffset(0.0f); int updateIdx = mIndexPaneList[mCurrMaxActiveRow]->mIndex; getUpdateIndex(updateIdx, doScrollDown); @@ -465,7 +465,7 @@ void TScrollList::updateIndex(bool doScrollDown) check2 = true; } - mIndexPaneList[mCurrMaxActiveRow]->setPaneOffset(0.0f); + mIndexPaneList[mCurrMaxActiveRow]->setOffset(0.0f); int updateIdx = mIndexPaneList[mCurrMinActiveRow]->mIndex; getUpdateIndex(updateIdx, doScrollDown); @@ -885,7 +885,7 @@ bool TScrollList::updateList() f32 val2 = mIndexGroup->mScrollOffset; for (int i = 0; i < mNumActiveRows; i++) { - mIndexPaneList[i]->setPaneOffset(val2); + mIndexPaneList[i]->setOffset(val2); changeTextTevBlock(i); } @@ -904,7 +904,7 @@ bool TScrollList::updateList() mIndexGroup->mScrollOffset = val2; for (int i = 0; i < mNumActiveRows; i++) { - mIndexPaneList[i]->setPaneOffset(val2); + mIndexPaneList[i]->setOffset(val2); } mIndexGroup->mIsActiveSpeedUp = 0; diff --git a/src/plugProjectMorimuraU/vsSelect2D.cpp b/src/plugProjectMorimuraU/vsSelect2D.cpp index 410339f1f..487cb6858 100644 --- a/src/plugProjectMorimuraU/vsSelect2D.cpp +++ b/src/plugProjectMorimuraU/vsSelect2D.cpp @@ -1172,9 +1172,8 @@ void TVsSelect::doCreate(JKRArchive* arc) int max = (mStageCount - something) + 2; for (int i = 0; i < max; i++) { for (int j = 0; j < mNumActiveRows; j++) { - TIndexPane* indpane = mIndexPaneList[j]; - indpane->mPane->setOffsetY(indpane->mYOffset + calc); - mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->mPane->mOffset.y; + mIndexPaneList[j]->setOffset(calc); + mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->getPaneOffsetY(); } updateIndex(0); mIndexGroup->reset(); diff --git a/src/plugProjectMorimuraU/zukan2D.cpp b/src/plugProjectMorimuraU/zukan2D.cpp index 5652250e2..b0934ee59 100644 --- a/src/plugProjectMorimuraU/zukan2D.cpp +++ b/src/plugProjectMorimuraU/zukan2D.cpp @@ -1860,7 +1860,7 @@ void TEnemyZukan::doCreate(JKRArchive* arc) TZukanBase::doCreate(arc); - f32 yoffs = mIndexPaneList[1]->getPaneOffsetY() - mIndexPaneList[0]->getPaneOffsetY(); + f32 yoffs = getHeight(); if (mIsPreDebt && mMaxSelectZukan <= (mNumActiveRows - 1) * 3) { mCanScroll = false; @@ -1869,9 +1869,8 @@ void TEnemyZukan::doCreate(JKRArchive* arc) f32 xoffs = 0.0f; for (int i = 0; i < 6; i++) { for (int j = 0; j < mNumActiveRows; j++) { - f32 y = mIndexPaneList[j]->mYOffset; - mIndexPaneList[j]->mPane->setOffsetY(y + yoffs); - mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->mPane->mOffset.y; + mIndexPaneList[j]->setOffset(yoffs); + mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->getPaneOffsetY(); } updateIndex(false); TIndexGroup* grp = mIndexGroup; @@ -1899,17 +1898,12 @@ void TEnemyZukan::doCreate(JKRArchive* arc) if (index >= 0) { int backupindex = index; - int max2 = mMaxSelectZukan; if (mIsPreDebt) { for (int i = 0; i < mMaxPane; i++) { - // backupindex = i; if (index == mViewablePanelIDList[i]) { index = i; break; } - // break; - // max2--; - // backupindex = index; } } if (index > 2) { @@ -1926,7 +1920,8 @@ void TEnemyZukan::doCreate(JKRArchive* arc) if (mIndexPaneList[mCurrActiveRowSel]->mSizeType != TIndexPane::Size_Small) { yoffs = -yoffs * 0.5f; for (int j = 0; j < mNumActiveRows; j++) { - updateIDPaneYOffset(j, yoffs); + mIndexPaneList[j]->setOffset(yoffs); + mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->getPaneOffsetY(); } mRightOffset = 1; } else { @@ -1938,7 +1933,8 @@ void TEnemyZukan::doCreate(JKRArchive* arc) } for (int j = 0; j < mNumActiveRows; j++) { - updateIDPaneYOffset(j, -yoffs); + mIndexPaneList[j]->setOffset(-yoffs); + mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->getPaneOffsetY(); } updateIndex(true); TIndexGroup* grp = mIndexGroup; @@ -3525,7 +3521,7 @@ void TItemZukan::doCreate(JKRArchive* arc) TZukanBase::doCreate(arc); - f32 yoffs = mIndexPaneList[1]->mPane->getOffsetY() - mIndexPaneList[0]->mPane->getOffsetY(); + f32 yoffs = getHeight(); mMaxSelectZukan = mMaxPane; if (!mIsPreDebt) { @@ -3535,7 +3531,8 @@ void TItemZukan::doCreate(JKRArchive* arc) f32 xoffs = 0.0f; for (int i = 0; i < 4; i++) { for (int j = 0; j < mNumActiveRows; j++) { - updateIDPaneYOffset(j, yoffs); + mIndexPaneList[j]->setOffset(yoffs); + mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->getPaneOffsetY(); } updateIndex(false); TIndexGroup* grp = mIndexGroup; @@ -3581,7 +3578,8 @@ void TItemZukan::doCreate(JKRArchive* arc) if (index > 2) { for (int i = 0; i < index / 3; i++) { for (int j = 0; j < mNumActiveRows; j++) { - updateIDPaneYOffset(j, -yoffs); + mIndexPaneList[j]->setOffset(-yoffs); + mIndexPaneList[j]->mYOffset = mIndexPaneList[j]->getPaneOffsetY(); } updateIndex(true); TIndexGroup* grp = mIndexGroup; @@ -3597,8 +3595,7 @@ void TItemZukan::doCreate(JKRArchive* arc) mCurrIndex = mIndexPaneList[mCurrActiveRowSel]->getIndex(); if (mCurrIndex >= 0) { J2DPane* pane = mPaneMessageDemo; - u64 tag = getXMsgID(mCurrIndex); - pane->setMsgID(tag); + pane->setMsgID(getXMsgID(mCurrIndex)); } backup->becomeCurrentHeap(); @@ -3641,7 +3638,7 @@ void TItemZukan::doDemoDraw(Graphics& gfx) for (int i = 0; i < mNumActiveRows; i++) { for (int j = 0; j < 3; j++) { - TIconInfo* icon = mIndexPaneList[i]->mIconInfos[j]; + TIconInfo* icon = getIndexPane(i)->getIconInfo(j); if (mSelection == icon->mCategoryID && icon->mPane->isVisible()) { u8 alpha = mMessageBoxBGAlpha * mCategoryAlphaRate; J2DPictureEx* pane2; @@ -3654,7 +3651,7 @@ void TItemZukan::doDemoDraw(Graphics& gfx) pane1->calcMtx(); pane1->setAlpha(oldalpha); - pane2 = static_cast(mIndexPaneList[i]->mIconInfos[j]->mPane); + pane2 = static_cast(getIndexPane(i)->getIconInfo(j)->mPane); oldalpha = pane2->mAlpha; pane2->setAlpha(mMessageBoxBGAlpha); pane2->draw(pane2->getGlbVtx(GLBVTX_BtmLeft).x, pane2->getGlbVtx(GLBVTX_BtmLeft).y, pane2->getWidth(), pane2->getHeight(), @@ -3662,7 +3659,7 @@ void TItemZukan::doDemoDraw(Graphics& gfx) pane2->calcMtx(); pane2->setAlpha(oldalpha); - pane3 = static_cast(mIndexPaneList[i]->mIconInfos[j]->mPane2); + pane3 = static_cast(getIndexPane(i)->getIconInfo(j)->mPane2); oldalpha = pane3->mAlpha; pane3->setAlpha(mMessageBoxBGAlpha); pane3->draw(pane3->getGlbVtx(GLBVTX_BtmLeft).x, pane3->getGlbVtx(GLBVTX_BtmLeft).y, pane3->getWidth(), pane3->getHeight(), @@ -3687,13 +3684,13 @@ void TItemZukan::doDemoDraw(Graphics& gfx) mIconScreen->draw(gfx, *graf); for (int i = 0; i < mNumActiveRows; i++) { - if (mIndexPaneList[i]->mPane->isVisible()) { + if (getIndexPane(i)->mPane->isVisible()) { for (int j = 0; j < 3; j++) { - TIconInfo* icon = mIndexPaneList[i]->mIconInfos[j]; + TIconInfo* icon = getIndexPane(i)->getIconInfo(j); if (mSelection == icon->mCategoryID) { if (mSelection == icon->mCategoryID && icon->mParentIndex) { - mPaneNew1->mGlobalMtx[0][3] = mNewOffset.x + mIndexPaneList[i]->mIconInfos[j]->mPane->mGlobalMtx[0][3]; - mPaneNew1->mGlobalMtx[1][3] = mNewOffset.y + mIndexPaneList[i]->mIconInfos[j]->mPane->mGlobalMtx[1][3]; + mPaneNew1->mGlobalMtx[0][3] = mNewOffset.x + getIndexPane(i)->getIconInfo(j)->mPane->mGlobalMtx[0][3]; + mPaneNew1->mGlobalMtx[1][3] = mNewOffset.y + getIndexPane(i)->getIconInfo(j)->mPane->mGlobalMtx[1][3]; mMessageNew->draw(gfx, *graf); } } @@ -4701,13 +4698,12 @@ void TZukanWindow::update() y * sinf(mIconYHeightSin) + (mScrollPosition + mPaneIcon->getOffsetY())); } } - JGeometry::TVec3f pos1 = mPaneWinCap->getGlbVtx(GLBVTX_BtmLeft); - JGeometry::TVec3f pos2 = mPaneWinCap->getGlbVtx(GLBVTX_TopRight); - pos1.x += 10.0f; - pos1.y += 5.0f; - pos2.x -= 10.0f; - pos2.y -= 10.0f; - JGeometry::TBox2f box(pos1.x, pos1.y, pos2.x, pos2.y); + + JGeometry::TBox2f box(mPaneWinCap->getGlbVtx(GLBVTX_TopRight), mPaneWinCap->getGlbVtx(GLBVTX_BtmLeft)); + box.i.x += 10.0f; + box.i.y += 5.0f; + box.f.x -= 10.0f; + box.f.y -= 10.0f; mScissor->mBounds = box; } @@ -4800,23 +4796,25 @@ void TZukanWindow::onIcon(int id) */ void TZukanWindow::moveIcon(f32 x) { - if (TZukanBase::mIconMove) { - if (FABS(x) < 0.1f) { - x = 0.0f; - } - if (FABS(mScrollPosition) < 1.0f) { - mScrollPosition = 0.0f; - } - if (mScrollPosition == 0.0f && x != 0.0f) { - mScaleMgr->up(0.05f, 1.0f, 0.2f, 0.0f); - } + if (!TZukanBase::mIconMove) { + return; + } - f32 test = 0.1f; - if (x == 0.0f) { - test = 0.15f; - } - mScrollPosition += test * (x * 5.0f - mScrollPosition); + if (FABS(x) < 0.1f) { + x = 0.0f; + } + if (FABS(mScrollPosition) < 1.0f) { + mScrollPosition = 0.0f; + } + if (mScrollPosition == 0.0f && x != 0.0f) { + mScaleMgr->up(0.05f, 1.0f, 0.2f, 0.0f); + } + + f32 test = 0.1f; + if (x == 0.0f) { + test = 0.15f; } + mScrollPosition += test * (x * 5.0f - mScrollPosition); } /** diff --git a/src/plugProjectNishimuraU/MiniHoudai.cpp b/src/plugProjectNishimuraU/MiniHoudai.cpp index 80d0b488d..289c40f5d 100644 --- a/src/plugProjectNishimuraU/MiniHoudai.cpp +++ b/src/plugProjectNishimuraU/MiniHoudai.cpp @@ -522,11 +522,11 @@ bool Obj::isAttackableTarget() Vector3f dir = getDirection(mFaceDir); Vector3f perpDir(-dir.z, 0.0f, dir.x); - f32 offset = C_GENERALPARMS.mSearchDistance.mValue * 0.5f; - Vector3f pos = Vector3f(dir.x * offset + mPosition.x, dir.y * offset + mPosition.y, dir.z * offset + mPosition.z); - f32 rad = C_GENERALPARMS.mSearchDistance.mValue * 0.75f; - Sys::Sphere sphere(pos, rad); - // sphere.mRadius = C_GENERALPARMS.mSearchDistance.mValue * 0.75f; + f32 scale = 0.5f * C_GENERALPARMS.mSearchDistance(); + + Vector3f pos(dir.x * scale + mPosition.x, dir.y * scale + mPosition.y, dir.z * scale + mPosition.z); + Sys::Sphere sphere(pos, 0.75f * C_GENERALPARMS.mSearchDistance()); + CellIteratorArg iterArg(sphere); iterArg.mOptimise = true; CellIterator iter(iterArg); @@ -554,237 +554,7 @@ bool Obj::isAttackableTarget() } } } - return false; - /* - stwu r1, -0x130(r1) - mflr r0 - stw r0, 0x134(r1) - stfd f31, 0x120(r1) - psq_st f31, 296(r1), 0, qr0 - stfd f30, 0x110(r1) - psq_st f30, 280(r1), 0, qr0 - stfd f29, 0x100(r1) - psq_st f29, 264(r1), 0, qr0 - stfd f28, 0xf0(r1) - psq_st f28, 248(r1), 0, qr0 - stfd f27, 0xe0(r1) - psq_st f27, 232(r1), 0, qr0 - stfd f26, 0xd0(r1) - psq_st f26, 216(r1), 0, qr0 - stw r31, 0xcc(r1) - stw r30, 0xc8(r1) - stw r29, 0xc4(r1) - mr r31, r3 - addi r3, r1, 0x20 - lwz r4, 0x2f8(r31) - bl getShotGunPosition__Q34Game10MiniHoudai20MiniHoudaiShotGunMgrFv - lfs f3, 0x1fc(r31) - lfs f0, lbl_8051CF8C@sda21(r2) - fmr f1, f3 - lfs f28, 0x20(r1) - fcmpo cr0, f3, f0 - lfs f27, 0x24(r1) - lfs f26, 0x28(r1) - bge lbl_802ECF68 - fneg f1, f3 - -lbl_802ECF68: - lfs f2, lbl_8051CFE0@sda21(r2) - lis r3, sincosTable___5JMath@ha - lfs f0, lbl_8051CF8C@sda21(r2) - addi r4, r3, sincosTable___5JMath@l - fmuls f1, f1, f2 - fcmpo cr0, f3, f0 - fctiwz f0, f1 - stfd f0, 0xa8(r1) - lwz r0, 0xac(r1) - rlwinm r0, r0, 3, 0x12, 0x1c - add r3, r4, r0 - lfs f30, 4(r3) - bge lbl_802ECFC0 - lfs f0, lbl_8051CFE4@sda21(r2) - fmuls f0, f3, f0 - fctiwz f0, f0 - stfd f0, 0xb0(r1) - lwz r0, 0xb4(r1) - rlwinm r0, r0, 3, 0x12, 0x1c - lfsx f0, r4, r0 - fneg f29, f0 - b lbl_802ECFD8 - -lbl_802ECFC0: - fmuls f0, f3, f2 - fctiwz f0, f0 - stfd f0, 0xb8(r1) - lwz r0, 0xbc(r1) - rlwinm r0, r0, 3, 0x12, 0x1c - lfsx f29, r4, r0 - -lbl_802ECFD8: - lwz r4, 0xc0(r31) - fneg f31, f30 - lfs f0, lbl_8051CFE8@sda21(r2) - addi r3, r1, 0x3c - lfs f2, 0x44c(r4) - addi r4, r1, 0x2c - lfs f1, lbl_8051CFEC@sda21(r2) - fmuls f5, f0, f2 - lfs f3, 0x194(r31) - lfs f0, 0x18c(r31) - fmuls f4, f1, f2 - lfs f1, 0x190(r31) - lfs f2, lbl_8051CF8C@sda21(r2) - fmadds f3, f30, f5, f3 - stfs f4, 0x38(r1) - fmadds f1, f2, f5, f1 - fmadds f0, f29, f5, f0 - stfs f3, 0x34(r1) - stfs f0, 0x2c(r1) - stfs f1, 0x30(r1) - bl __ct__Q24Game15CellIteratorArgFRQ23Sys6Sphere - li r0, 1 - addi r3, r1, 0x5c - stb r0, 0x58(r1) - addi r4, r1, 0x3c - bl __ct__Q24Game12CellIteratorFRQ24Game15CellIteratorArg - addi r3, r1, 0x5c - bl first__Q24Game12CellIteratorFv - b lbl_802ED1B8 - -lbl_802ED04C: - addi r3, r1, 0x5c - bl __ml__Q24Game12CellIteratorFv - lwz r12, 0(r3) - mr r30, r3 - lwz r12, 0xa8(r12) - mtctr r12 - bctrl - clrlwi. r0, r3, 0x18 - beq lbl_802ED1B0 - mr r3, r30 - lwz r12, 0(r30) - lwz r12, 0x1c(r12) - mtctr r12 - bctrl - clrlwi. r0, r3, 0x18 - mr r29, r3 - bne lbl_802ED0CC - mr r3, r30 - lwz r12, 0(r30) - lwz r12, 0x18(r12) - mtctr r12 - bctrl - clrlwi. r0, r3, 0x18 - beq lbl_802ED0CC - mr r3, r30 - lwz r12, 0(r30) - lwz r12, 0x1c0(r12) - mtctr r12 - bctrl - clrlwi. r0, r3, 0x18 - beq lbl_802ED0CC - li r29, 1 - -lbl_802ED0CC: - clrlwi. r0, r29, 0x18 - beq lbl_802ED1B0 - mr r4, r30 - addi r3, r1, 0x14 - lwz r12, 0(r30) - lwz r12, 8(r12) - mtctr r12 - bctrl - lfs f2, 0x18(r1) - lfs f3, 0x14(r1) - fsubs f2, f2, f27 - lfs f4, 0x1c(r1) - lfs f0, lbl_8051CF8C@sda21(r2) - fsubs f3, f3, f28 - fsubs f4, f4, f26 - fcmpo cr0, f2, f0 - ble lbl_802ED118 - fmr f1, f2 - b lbl_802ED11C - -lbl_802ED118: - fneg f1, f2 - -lbl_802ED11C: - lfs f0, lbl_8051CFF0@sda21(r2) - fcmpo cr0, f1, f0 - bge lbl_802ED1B0 - lfs f1, lbl_8051CF8C@sda21(r2) - fmuls f5, f1, f2 - fmadds f0, f31, f3, f5 - fmadds f2, f29, f4, f0 - fcmpo cr0, f2, f1 - ble lbl_802ED144 - b lbl_802ED148 - -lbl_802ED144: - fneg f2, f2 - -lbl_802ED148: - lfs f0, lbl_8051CFF4@sda21(r2) - fcmpo cr0, f2, f0 - bge lbl_802ED1B0 - fmadds f1, f29, f3, f5 - lfs f0, lbl_8051CFA0@sda21(r2) - fmadds f1, f30, f4, f1 - fcmpo cr0, f1, f0 - ble lbl_802ED1B0 - lwz r3, 0xc0(r31) - lfs f0, 0x44c(r3) - fcmpo cr0, f1, f0 - bge lbl_802ED1B0 - mr r4, r30 - addi r3, r1, 8 - lwz r12, 0(r30) - lwz r12, 8(r12) - mtctr r12 - bctrl - lfs f0, 8(r1) - li r3, 1 - stfs f0, 0x2d8(r31) - lfs f0, 0xc(r1) - stfs f0, 0x2dc(r31) - lfs f0, 0x10(r1) - stfs f0, 0x2e0(r31) - b lbl_802ED1CC - -lbl_802ED1B0: - addi r3, r1, 0x5c - bl next__Q24Game12CellIteratorFv - -lbl_802ED1B8: - addi r3, r1, 0x5c - bl isDone__Q24Game12CellIteratorFv - clrlwi. r0, r3, 0x18 - beq lbl_802ED04C - li r3, 0 - -lbl_802ED1CC: - psq_l f31, 296(r1), 0, qr0 - lfd f31, 0x120(r1) - psq_l f30, 280(r1), 0, qr0 - lfd f30, 0x110(r1) - psq_l f29, 264(r1), 0, qr0 - lfd f29, 0x100(r1) - psq_l f28, 248(r1), 0, qr0 - lfd f28, 0xf0(r1) - psq_l f27, 232(r1), 0, qr0 - lfd f27, 0xe0(r1) - psq_l f26, 216(r1), 0, qr0 - lfd f26, 0xd0(r1) - lwz r31, 0xcc(r1) - lwz r30, 0xc8(r1) - lwz r0, 0x134(r1) - lwz r29, 0xc4(r1) - mtlr r0 - addi r1, r1, 0x130 - blr - */ } /** diff --git a/src/plugProjectYamashitaU/farmMgr.cpp b/src/plugProjectYamashitaU/farmMgr.cpp index 3a462c6b4..27c57c66d 100644 --- a/src/plugProjectYamashitaU/farmMgr.cpp +++ b/src/plugProjectYamashitaU/farmMgr.cpp @@ -82,11 +82,11 @@ void FarmMgr::doAnimation() */ void FarmMgr::doEntry() { - gameSystem->setDrawBuffer(9); + gameSystem->setDrawBuffer(DB_FarmLayer); if (mFarmsRootNode.mChild) { FOREACH_NODE(Farm, mFarmsRootNode.mChild, farm) { farm->doEntry(); } } - gameSystem->setDrawBuffer(0); + gameSystem->setDrawBuffer(DB_NormalLayer); } /** diff --git a/src/plugProjectYamashitaU/genEnemy.cpp b/src/plugProjectYamashitaU/genEnemy.cpp index 0cf512928..c55daaba1 100644 --- a/src/plugProjectYamashitaU/genEnemy.cpp +++ b/src/plugProjectYamashitaU/genEnemy.cpp @@ -103,12 +103,11 @@ Creature* GenObjectEnemy::generate(Game::Generator* gen) // If teki is Type 1, don't do any random adjustments if (mSpawnType == 1) { posVector[i] = startpos; - // copy(&posVector[i], &startpos); continue; } // If teki isn't Type 1, jiggle it a bit oa = TAU * randFloat(); // random angle between 0 and 360 degrees - offR = mAppearRadius * randFloat(); // random distance between 0 and m_appearRadius + offR = mAppearRadius * randFloat(); // random distance between 0 and mAppearRadius oz = offR * pikmin2_cosf(oa); ox = offR * pikmin2_sinf(oa); @@ -121,7 +120,7 @@ Creature* GenObjectEnemy::generate(Game::Generator* gen) posVector[i] = vector; } - // Default enemy territory size is 35 units, unless overwritten by m_enemySize + // Default enemy territory size is 35 units, unless overwritten by mEnemySize // f32 enemy_territory = 35.0f; // f32 dz, dx, dy; f32 dx, dy, dz; diff --git a/src/sysGCU/demoSection.cpp b/src/sysGCU/demoSection.cpp index 7db5490bf..250fb7bab 100644 --- a/src/sysGCU/demoSection.cpp +++ b/src/sysGCU/demoSection.cpp @@ -15,8 +15,11 @@ static void _Print(char* format, ...) { OSReport(format, __FILE__); } namespace Demo { namespace { -static u8 sMovieIndexTable[8] = { 5, 6, 7, 0, 8, 9, 10, 0 }; -static s8 sMovieIndex = -1; +static u8 sMovieIndexTable[8] = { + Game::THPPlayer::PLAY_1, Game::THPPlayer::PLAY_2, Game::THPPlayer::PLAY_3, Game::THPPlayer::OPENING_GameStart, + Game::THPPlayer::PLAY_4, Game::THPPlayer::PLAY_5, Game::THPPlayer::PLAY_6, Game::THPPlayer::OPENING_GameStart, +}; +static s8 sMovieIndex = -1; struct LogoLocation { u16 x; @@ -73,7 +76,7 @@ void Section::init() JUTProcBar::sManager->setVisible(false); JUTProcBar::sManager->setVisibleHeapBar(false); if (sMovieIndex == -1) { - sMovieIndex = randInt(8); + sMovieIndex = randInt(sizeof(sMovieIndexTable)); } } @@ -123,7 +126,7 @@ void Section::doExit() { PSMGetSceneMgrCheck()->deleteCurrentScene(); - u32 max = 8; + u32 max = sizeof(sMovieIndexTable); if (++sMovieIndex >= max) { sMovieIndex = 0; }