move / fix bunch of stuff (#133)

* fix some class structures / d_event wip

* d_event wip

* move gamepad stuff

* move m_Do_main

* move d_bomb / partial m_Do_reset

* format

* remove asm

* add Z2SoundID enum

* move some Z2 classes

* fix

* move more Z2 stuff

* fix fopAc_ac_c more
This commit is contained in:
TakaRikka
2021-06-12 15:22:36 -07:00
committed by GitHub
parent 5be309a186
commit 4448c08ac0
132 changed files with 6755 additions and 3217 deletions
+37
View File
@@ -1,6 +1,43 @@
#ifndef Z2AUDIOMGR_H
#define Z2AUDIOMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JKernel/JKRArchive.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "Z2AudioLib/Z2SceneMgr.h"
#include "Z2AudioLib/Z2SeMgr.h"
#include "Z2AudioLib/Z2SeqMgr.h"
#include "Z2AudioLib/Z2SoundStarter.h"
#include "Z2AudioLib/Z2StatusMgr.h"
#include "dolphin/types.h"
class Z2AudioMgr {
public:
Z2AudioMgr();
void init(JKRSolidHeap*, u32, void*, JKRArchive*);
void setOutputMode(u32);
void zeldaGFrameWork();
void gframeProcess();
void resetProcess(u32, bool);
void resetRecover();
void hasReset() const;
void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
static Z2AudioMgr* mAudioMgrPtr;
private:
/* 0x0000 */ Z2SeMgr mSeMgr;
/* 0x03D0 */ Z2SeqMgr mSeqMgr;
/* 0x04A4 */ Z2SceneMgr mSceneMgr;
/* 0x04C4 */ Z2StatusMgr mStatusMgr;
/* 0x04F4 */ // Z2SoundObjMgr mSoundObjMgr;
/* 0x051C */ // JASAudioReseter mAudioReseter;
/* 0x052C */ Z2SoundStarter mSoundStarter;
/* 0x0530 */ // Z2SoundMgr mSoundMgr;
/* 0x0D40 */ // JAISoundInfo mSoundInfo;
/* 0x0D4C */ // Z2Audience mAudience;
/* 0x0F2C */ // Z2SpeechMgr2 mSpeechMgr;
/* 0x1370 */ // Z2FxLineMgr mFxLineMgr;
};
#endif /* Z2AUDIOMGR_H */
+22 -3
View File
@@ -53,12 +53,12 @@ public:
void setLinkSwordType(s32, s32);
void setLinkShieldType(s32, s32);
void setLinkBootsType(s32);
void deleteObject();
virtual void deleteObject();
void init(Vec*, Vec*, Vec*);
void initKantera(Vec*);
void deleteKantera(void);
void setKanteraState(u8);
void framework(u32, s8);
virtual void framework(u32, s8);
void setSinkDepth(s8);
void setRiding(bool);
void setMagnetized(bool);
@@ -68,7 +68,7 @@ public:
void startLinkVoice(JAISoundID, s8);
void startLinkVoiceLevel(JAISoundID, s8);
void startLinkSwordSound(JAISoundID, u32, s8);
void startCollisionSE(u32, u32);
virtual void startCollisionSE(u32, u32);
int startHitItemSE(u32, u32, Z2SoundObjBase*, float);
void setResumeAttack(bool);
@@ -106,4 +106,23 @@ private:
/* 0x99 */ u8 padding[3];
};
class Z2CreatureEnemy : public Z2Creature {
public:
virtual void test(); // temp to build OK, remove later
/* 802C0F64 */ Z2CreatureEnemy();
/* 802C0FC4 */ virtual void deleteObject();
/* 802C1094 */ void init(Vec*, Vec*, u8, u8);
/* 802C10B4 */ void init(Vec*, Vec*, Vec*, u8, u8, u8);
/* 802C10D4 */ virtual void framework(u32, s8);
/* 802C110C */ virtual void startCreatureSound(JAISoundID, u32, s8);
/* 802C136C */ virtual void startCreatureSoundLevel(JAISoundID, u32, s8);
/* 802C168C */ virtual void startCreatureVoice(JAISoundID, s8);
/* 802C1948 */ virtual void startCreatureVoiceLevel(JAISoundID, s8);
/* 802C199C */ virtual void startCreatureExtraSound(JAISoundID, u32, s8);
/* 802C19D8 */ virtual void startCreatureExtraSoundLevel(JAISoundID, u32, s8);
/* 802C1A14 */ virtual void startCollisionSE(u32, u32);
/* 802C1B7C */ void setLinkSearch(bool);
/* 802C1B90 */ void setEnemyName(char const*);
};
#endif /* Z2CREATURE_H */
+50
View File
@@ -1,6 +1,56 @@
#ifndef Z2SCENEMGR_H
#define Z2SCENEMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include "dolphin/types.h"
class Z2SceneMgr {
public:
Z2SceneMgr();
void setInDarkness(bool);
void setSceneExist(bool);
void setFadeOutStart(u8);
void setFadeInStart(u8);
void setSceneName(char*, s32, s32);
void sceneChange(JAISoundID, u8, u8, u8, u8, u8, bool);
void framework();
void load1stDynamicWave();
void _load1stWaveInner_1();
void _load1stWaveInner_2();
void check1stDynamicWave();
void load2ndDynamicWave();
void sceneBgmStart();
void loadStaticWaves();
bool checkFirstWaves();
void eraseSeWave(u32);
void eraseBgmWave(u32);
void getWaveLoadStatus(u32, u32);
void loadSeWave(u32);
void loadBgmWave(u32);
private:
/* 0x00 */ long BGM_ID;
/* 0x04 */ int sceneNum;
/* 0x08 */ int timer;
/* 0x0C */ s8 roomNum;
/* 0x0D */ u8 SeWave_1;
/* 0x0E */ u8 SeWaveToErase_1;
/* 0x0F */ u8 SeWave_2;
/* 0x10 */ u8 SeWaveToErase_2;
/* 0x11 */ u8 BgmWave_1;
/* 0x12 */ u8 BgmWaveToErase_1;
/* 0x13 */ u8 BgmWave_2;
/* 0x14 */ u8 BgmWaveToErase_2;
/* 0x15 */ u8 SeWave_3;
/* 0x16 */ u8 SeWaveToErase_3;
/* 0x17 */ u8 field_0x17;
/* 0x18 */ u8 field_0x18;
/* 0x19 */ u8 field_0x19;
/* 0x1A */ u8 field_0x1a;
/* 0x1B */ u8 field_0x1b;
/* 0x1C */ bool inGame;
/* 0x1D */ bool sceneExist;
/* 0x1E */ bool inDarkness;
}; // Size = 0x20
#endif /* Z2SCENEMGR_H */
File diff suppressed because it is too large Load Diff
+99
View File
@@ -1,6 +1,105 @@
#ifndef Z2SEQMGR_H
#define Z2SEQMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include "dolphin/types.h"
// move TTransition / Z2SoundFader ?
struct TTransition {
/* 0x0 */ float field_0x0;
/* 0x4 */ float field_0x4;
/* 0x8 */ u32 mCount;
}; // Size = 0xC
struct Z2SoundFader {
/* 0x0 */ float mIntensity;
/* 0x4 */ TTransition mTransition;
}; // Size = 0x10
class Z2SeqMgr {
public:
Z2SeqMgr();
void bgmStart(u32, u32, s32);
void bgmStop(u32, s32);
void subBgmStart(u32);
void subBgmStop();
void subBgmStopInner();
void bgmStreamPrepare(u32);
int bgmStreamCheckReady();
void bgmStreamPlay();
void bgmStreamStop(u32);
void changeBgmStatus(s32);
void changeSubBgmStatus(s32);
void onVariantBgmJumpEnd(bool);
void changeFishingBgm(s32);
void talkInBgm();
void talkOutBgm();
void menuInBgm();
void menuOutBgm();
void fanfareFramework();
void stopWolfHowlSong();
void setHeightVolMod(bool, u32);
void setTimeProcVolMod(bool, u32);
void processBgmFramework();
void checkBgmIDPlaying(u32);
void getChildTrackVolume(JAISoundHandle*, int);
void setChildTrackVolume(JAISoundHandle*, int, float, u32, float, float);
void resetBattleBgmParams();
void setBattleBgmOff(bool);
void setBattleSearched(bool);
void setBattleDistIgnore(bool);
void setBattleGhostMute(bool);
void setBattleDistState(u8);
void setBattleSeqState(u8);
void setBattleLastHit(u8);
void battleBgmFramework();
void startBattleBgm(bool);
void stopBattleBgm(u8, u8);
void fieldBgmStart();
void fieldRidingMute();
void onFieldBgmJumpStart();
void onFieldBgmJumpEnd();
void fieldBgmFramework();
void mbossBgmMuteProcess();
void bgmSetSwordUsing(s32);
void bgmNowBattle(float);
void taktModeMute();
void taktModeMuteOff();
void setFieldBgmPlay(bool);
private:
/* 0x00 */ JAISoundHandle mMainBgmHandle;
/* 0x04 */ JAISoundHandle mSubBgmHandle;
/* 0x08 */ JAISoundHandle field_0x08;
/* 0x0C */ JAISoundHandle field_0x0c;
/* 0x10 */ JAISoundID field_0x10;
/* 0x14 */ Z2SoundFader field_0x14;
/* 0x24 */ Z2SoundFader field_0x24;
/* 0x34 */ Z2SoundFader field_0x34;
/* 0x44 */ Z2SoundFader field_0x44;
/* 0x54 */ Z2SoundFader field_0x54;
/* 0x64 */ Z2SoundFader field_0x64;
/* 0x74 */ Z2SoundFader field_0x74;
/* 0x84 */ Z2SoundFader field_0x84;
/* 0x94 */ Z2SoundFader field_0x94;
/* 0xA4 */ Z2SoundFader field_0xa4;
/* 0xB4 */ float mTwilightGateVolume;
/* 0xB8 */ u16 field_0xb8;
/* 0xBA */ u8 field_0xba;
/* 0xBB */ u8 field_0xbb;
/* 0xBC */ u8 field_0xbc;
/* 0xBD */ u8 field_0xbd;
/* 0xBE */ u8 field_0xbe;
/* 0xBF */ u8 field_0xbf;
/* 0xC0 */ u8 field_0xc0;
/* 0xC1 */ u8 field_0xc1;
/* 0xC2 */ u8 field_0xc2;
/* 0xC3 */ u8 field_0xc3;
/* 0xC4 */ u8 field_0xc4;
/* 0xC8 */ float field_0xc8;
/* 0xCC */ float field_0xcc;
/* 0xD0 */ u8 mFlags;
}; // Size = 0xD4
#endif /* Z2SEQMGR_H */
+33
View File
@@ -1,6 +1,39 @@
#ifndef Z2SOUNDOBJMGR_H
#define Z2SOUNDOBJMGR_H
#include "JSystem/JSupport/JSUList.h"
#include "Z2AudioLib/Z2Creature.h"
#include "dolphin/types.h"
class Z2SoundObjMgr : protected JSUList<Z2CreatureEnemy> {
public:
Z2SoundObjMgr();
void setForceBattleArea(bool, u16, u16, u16);
void searchEnemy();
void setGhostEnemyState(u8);
void getEnemyID(char const*, JSULink<Z2CreatureEnemy>*);
void setBattleInit();
void checkBattleFinish();
void deleteEnemyAll();
void removeEnemy(JSULink<Z2CreatureEnemy>*);
bool isTwilightBattle();
bool isForceBattle() { return mForceBattle; }
private:
/* 0x0C */ u8 field_0xc[2];
/* 0x0E */ u16 field_0xe;
/* 0x10 */ u16 field_0x10;
/* 0x12 */ u16 field_0x12;
/* 0x14 */ u8 field_0x14;
/* 0x15 */ u8 mEnemyNumNear;
/* 0x16 */ u8 field_0x16;
/* 0x17 */ u8 mEnemyNumVeryFar;
/* 0x18 */ u8 field_0x18;
/* 0x19 */ u8 mGhostEnemyState;
/* 0x1A */ bool field_0x1a;
/* 0x1B */ bool mTwilightBattle;
/* 0x1C */ bool mForceBattle;
}; // Size = 0x20
#endif /* Z2SOUNDOBJMGR_H */
+15 -18
View File
@@ -23,23 +23,20 @@ struct Z2StatusMgr {
//! @todo there are a number of inlines only called from rels: see CHN_debug
u8 mHour;
u8 mMinute;
u8 mWeekday;
u8 field_0x03;
s16 mTime;
u8 field_0x6[2];
void* mEventBit;
bool mIsMenuIn;
u8 field_0xd[3];
u32 mCameraMapInfo;
u32 field_0x14;
float mUnderwaterDepth;
float mCameraInWaterDepthRatio;
Vec mPolygonPosition;
u8 mDemoStatus;
u8 mHeartGaugeOn;
u8 padding[2];
};
/* 0x00 */ u8 mHour;
/* 0x01 */ u8 mMinute;
/* 0x02 */ u8 mWeekday;
/* 0x03 */ u8 field_0x03;
/* 0x04 */ s16 mTime;
/* 0x08 */ void* mEventBit;
/* 0x0C */ bool mIsMenuIn;
/* 0x10 */ u32 mCameraMapInfo;
/* 0x14 */ u32 field_0x14;
/* 0x18 */ float mUnderwaterDepth;
/* 0x1C */ float mCameraInWaterDepthRatio;
/* 0x20 */ Vec mPolygonPosition;
/* 0x2C */ u8 mDemoStatus;
/* 0x2D */ u8 mHeartGaugeOn;
}; // Size = 0x30
#endif /* Z2STATUSMGR_H */