diff options
| author | Roman Sandu <roma.sandu@gmail.com> | 2026-03-27 04:54:07 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-26 18:54:07 -0700 |
| commit | 0fc019dcfa2ed1834825e9754d47e7948e1745f7 (patch) | |
| tree | c3b06bbb412d48cc6586bea3312274dd70f00761 /include | |
| parent | f8cf5458482d7b380f52740289745b8241448559 (diff) | |
JAHostIO and friends (#3131)
Diffstat (limited to 'include')
| -rw-r--r-- | include/Z2AudioLib/Z2Audience.h | 12 | ||||
| -rw-r--r-- | include/Z2AudioLib/Z2DebugSys.h | 1 | ||||
| -rw-r--r-- | include/Z2AudioLib/Z2F1TestWindow.h | 31 | ||||
| -rw-r--r-- | include/Z2AudioLib/Z2FxLineMgr.h | 95 | ||||
| -rw-r--r-- | include/Z2AudioLib/Z2SceneMgr.h | 8 | ||||
| -rw-r--r-- | include/Z2AudioLib/Z2SpeechMgr2.h | 3 | ||||
| -rw-r--r-- | include/global.h | 4 |
7 files changed, 126 insertions, 28 deletions
diff --git a/include/Z2AudioLib/Z2Audience.h b/include/Z2AudioLib/Z2Audience.h index dd30b87948..75998e878b 100644 --- a/include/Z2AudioLib/Z2Audience.h +++ b/include/Z2AudioLib/Z2Audience.h @@ -33,7 +33,7 @@ struct Z2AudioCamera { f32 getVolCenterZ() const { return mVolCenterZ; } void setMainCamera(bool param_0) { mSetMainCamera = param_0; } - void setTargetVolume(f32 vol) { + void setTargetVolume(f32 vol) { JUT_ASSERT(281, vol <= 1.f); if (vol < 0.0f) { vol = 0.0f; @@ -45,6 +45,10 @@ struct Z2AudioCamera { f32 getFovySin() const { return mFovySin; } const JGeometry::TVec3<f32>* getVel() const { return &mVel; } + f32 getTargetVolume() const { return mTargetVolume; } + f32 getCamDist() const { return mCamDist; } + + /* 0x00 */ JGeometry::TPosition3f32 field_0x0; /* 0x30 */ JGeometry::TVec3<f32> mVel; /* 0x3C */ JGeometry::TVec3<f32> mPos; @@ -68,6 +72,10 @@ struct Z2SpotMic { u32 calcMicPriority(f32); f32 calcMicVolume(f32, int camID, f32); + void calcPriorityFactor(); + void setIgnoreIfOut(bool value) { mIgnoreIfOut = value; } + void setMicOn(bool value) { mMicOn = value; } + void setPosPtr(Vec* posPtr) { mPosPtr = posPtr; } bool isOn() { return mMicOn; } @@ -231,6 +239,8 @@ struct Z2Audience : public JAIAudience, public JASGlobalInstance<Z2Audience> { const Z2AudioCamera* getAudioCamera(int camID) const { return &mAudioCamera[camID]; } + void setUsingOffMicVol(bool value) { mUsingOffMicVol = value; } + /* 0x004 */ f32 field_0x4; /* 0x008 */ u8 field_0x8; /* 0x00C */ Z2Audience3DSetting mSetting; diff --git a/include/Z2AudioLib/Z2DebugSys.h b/include/Z2AudioLib/Z2DebugSys.h index a98292e8c1..1acd8f97b9 100644 --- a/include/Z2AudioLib/Z2DebugSys.h +++ b/include/Z2AudioLib/Z2DebugSys.h @@ -12,7 +12,6 @@ class Z2ParamNode : public JAHFrameNode { public: Z2ParamNode() : JAHFrameNode("サウンド各種パラメータ") {} - /* vt[07] */ virtual ~Z2ParamNode() {} /* vt[08] */ virtual void message(JAHControl& control); /* vt[0F] */ virtual void propertyEvent(JAH_P_Event, u32); /* vt[12] */ virtual void onFrame(); diff --git a/include/Z2AudioLib/Z2F1TestWindow.h b/include/Z2AudioLib/Z2F1TestWindow.h index 162e5e4b82..4c43d2678e 100644 --- a/include/Z2AudioLib/Z2F1TestWindow.h +++ b/include/Z2AudioLib/Z2F1TestWindow.h @@ -1,6 +1,7 @@ #ifndef Z2F1TESTWINDOW_H #define Z2F1TESTWINDOW_H +#include "JSystem/JAHostIO/JAHFrameNode.h" #include "JSystem/JAHostIO/JAHUTableEdit.h" #include "JSystem/JAWExtSystem/JAWWindow.h" @@ -8,6 +9,21 @@ class Z2F1TestWindow : public JAWWindow { public: Z2F1TestWindow(); + virtual void onDraw(JAWGraphContext*); + virtual void frameWork(); + virtual void onPadProc(const JUTGamePad&); + virtual void onTrigY(const JUTGamePad&); + virtual void onTrigMenu(const JUTGamePad&); + + void calcF1(); + f32 tau(f32); + static f32 calcThreshold(int); + f32 getRawX() const; + f32 calcNoise(); + void setValue(f32, f32); + f32 getValue2(); + f32 getValue(); + /* 0x3F0 */ f32 field_0x3f0; /* 0x3F4 */ f32 field_0x3f4; /* 0x3F8 */ f32 field_0x3f8[500]; @@ -21,12 +37,15 @@ class Z2F1SwingTestNode : public JAHFrameNode, public Z2F1TestWindow { public: Z2F1SwingTestNode(); + virtual void message(JAHControl&); + virtual void onFrame(); + /* 0xC48 */ JAHUSeBox field_0xc48; /* 0xCD0 */ JAHUSeBox field_0xcd0; - /* 0xD58 */ u8 field_0xd58; - /* 0xD59 */ u8 field_0xd59; - /* 0xD5A */ u8 field_0xd5a; - /* 0xD5B */ u8 field_0xd5b; + /* 0xD58 */ u8 mModulateVolume; + /* 0xD59 */ u8 mModulatePitch; + /* 0xD5A */ u8 mModulatePan; + /* 0xD5B */ u8 mModulateDolby; /* 0xD5C */ f32 field_0xd5c; /* 0xD60 */ f32 field_0xd60; /* 0xD64 */ f32 field_0xd64; @@ -37,11 +56,15 @@ public: class Z2AudSettingView : public JAWWindow { public: Z2AudSettingView(); + + virtual void onDraw(JAWGraphContext*); }; class Z2DSPCheck : public JAWWindow { public: Z2DSPCheck() : JAWWindow("Z2DSPCheck", 500, 450) {} + + virtual void onDraw(JAWGraphContext*); }; #endif /* Z2F1TESTWINDOW_H */ diff --git a/include/Z2AudioLib/Z2FxLineMgr.h b/include/Z2AudioLib/Z2FxLineMgr.h index 0614f531da..9e16670031 100644 --- a/include/Z2AudioLib/Z2FxLineMgr.h +++ b/include/Z2AudioLib/Z2FxLineMgr.h @@ -1,35 +1,92 @@ #ifndef Z2FXLINEMGR_H #define Z2FXLINEMGR_H -#include "JSystem/JAudio2/JASGadget.h" #include "JSystem/JAHostIO/JAHFrameNode.h" +#include "JSystem/JAudio2/JASDSPInterface.h" +#include "JSystem/JAudio2/JASGadget.h" class JKRArchive; class JKRExpHeap; class JKRHeap; -class Z2FxLineEditNode : public JAHFrameNode { -public: - Z2FxLineEditNode(JKRExpHeap*); +struct Z2FxLineConfigSingle { + /* 0x00 */ u8 unk0; + /* 0x01 */ u8 unk1; + /* 0x02 */ u8 unk2; + /* 0x03 */ u8 unk3; + /* 0x04 */ s16 unk4; + /* 0x06 */ s16 unk6; + /* 0x08 */ s16 unk8[8]; }; struct Z2FxLineConfig { - /* 0x00 */ u8 field_0x0; - /* 0x01 */ u8 field_0x1; - /* 0x02 */ u8 field_0x2; - /* 0x03 */ u8 field_0x3; - /* 0x04 */ s16 field_0x4; - /* 0x06 */ s16 field_0x6; - /* 0x08 */ s16 field_0x8[8]; - /* 0x18 */ u8 field_0x18; - /* 0x19 */ u8 field_0x19; - /* 0x1A */ u8 field_0x1a; - /* 0x1B */ u8 field_0x1b; - /* 0x1C */ s16 field_0x1c; - /* 0x1E */ s16 field_0x1e; - /* 0x20 */ s16 field_0x20[8]; + /* 0x00 */ Z2FxLineConfigSingle unk0; + /* 0x18 */ Z2FxLineConfigSingle unk18; }; // Size: 0x30 +class Z2FxLineEditNode : public JAHFrameNode { +public: + class LineStereo : public JAHFrameNode { + public: + LineStereo(bool dolby) : JAHFrameNode(NULL) { + unk70.unk0.unk0 = 1; + unk70.unk0.unk1 = 0; + unk70.unk0.unk4 = 0x6000; + unk70.unk0.unk2 = 1; + unk70.unk0.unk6 = 0; + unk70.unk0.unk3 = 0x40; + unk70.unk0.unk8[0] = 0; + unk70.unk0.unk8[1] = 0; + unk70.unk0.unk8[2] = 0; + unk70.unk0.unk8[3] = 0; + unk70.unk0.unk8[4] = 0; + unk70.unk0.unk8[5] = 0; + unk70.unk0.unk8[6] = 0x3fff; + unk70.unk0.unk8[7] = 0; + + unk70.unk18.unk0 = 1; + unk70.unk18.unk1 = 0; + unk70.unk18.unk4 = 0; + unk70.unk18.unk2 = 1; + unk70.unk18.unk6 = 0x6000; + unk70.unk18.unk3 = 0x40; + unk70.unk18.unk8[0] = 0; + unk70.unk18.unk8[1] = 0; + unk70.unk18.unk8[2] = 0; + unk70.unk18.unk8[3] = 0; + unk70.unk18.unk8[4] = 0; + unk70.unk18.unk8[5] = 0; + unk70.unk18.unk8[6] = 0x3fff; + unk70.unk18.unk8[7] = 0; + + if (dolby) + setNodeName("Dolby Stereo"); + else + setNodeName("Norma Stereo"); + mIsDolby = dolby; + } + + void message(JAHControl&); + void propertyEvent(JAH_P_Event, u32); + void lineEditSingle(Z2FxLineConfigSingle*, JAHControl&); + + /* 0x70 */ Z2FxLineConfig unk70; + /* 0xA0 */ bool mIsDolby; + }; + + Z2FxLineEditNode(JKRExpHeap*); + + void message(JAHControl&); + void syncSetting(u8, JASDsp::FxlineConfig_*); + void update(bool); + void saveLine(LineStereo*); + void loadLine(LineStereo*); + + /* 0x70 */ JKRExpHeap* mHeap; + /* 0x74 */ LineStereo* unk74; + /* 0x78 */ LineStereo* unk78; +}; + struct Z2FxLineMgr : public JASGlobalInstance<Z2FxLineMgr> { Z2FxLineMgr(); void initDataArc(JKRArchive* arc, JKRHeap* heap); @@ -39,6 +96,8 @@ struct Z2FxLineMgr : public JASGlobalInstance<Z2FxLineMgr> { void setUnderWaterFx(bool isUnderWaterFx); void setSceneFx(s32 sceneNo); + void setHIOEdit(Z2FxLineEditNode* hioEdit) { mHIOEdit = hioEdit; } + /* 0x00 */ Z2FxLineConfig* mConfig; /* 0x04 */ void* mFxLineBuffer[4]; /* 0x14 */ s8 mLineID; diff --git a/include/Z2AudioLib/Z2SceneMgr.h b/include/Z2AudioLib/Z2SceneMgr.h index c1e6402aca..1b3ef2cc0b 100644 --- a/include/Z2AudioLib/Z2SceneMgr.h +++ b/include/Z2AudioLib/Z2SceneMgr.h @@ -14,8 +14,8 @@ public: void setFadeOutStart(u8 fadeType); void setFadeInStart(u8 fadeType); void setSceneName(char* spot, s32 room, s32 layer); - void sceneChange(JAISoundID bgm, u8 seWave1, u8 seWave2, u8 bgmWave1, u8 bgmWave2, - u8 demoWave, bool); + void sceneChange(JAISoundID bgm, u8 seWave1, u8 seWave2, u8 bgmWave1, u8 bgmWave2, u8 demoWave, + bool); void framework(); void load1stDynamicWave(); void _load1stWaveInner_1(); @@ -31,9 +31,9 @@ public: bool loadSeWave(u32 wave); bool loadBgmWave(u32 wave); - #if PLATFORM_SHIELD +#if PLATFORM_SHIELD bool loadSceneWave(u32 wave, u32 bank); - #endif +#endif bool isSceneExist() { return sceneExist; } int getCurrentSceneNum() { return sceneNum; } diff --git a/include/Z2AudioLib/Z2SpeechMgr2.h b/include/Z2AudioLib/Z2SpeechMgr2.h index f0ab336165..5360a6c34b 100644 --- a/include/Z2AudioLib/Z2SpeechMgr2.h +++ b/include/Z2AudioLib/Z2SpeechMgr2.h @@ -30,6 +30,9 @@ struct Z2SpeechMgr2 : public JASGlobalInstance<Z2SpeechMgr2> { void playOneShotVoice(u8, u16, Vec*, s8); bool isMidnaSpeak(); + u16* getStylePtr() { return &mMood; } + u8* getTalkerPtr() { return &mVoice; } + /* 0x000 */ JAISoundHandle field_0x0; /* 0x004 */ JAISoundHandle field_0x4; /* 0x008 */ JMath::TRandom_<JMath::TRandom_fast_> random; diff --git a/include/global.h b/include/global.h index a8c2b0e07e..a404487b22 100644 --- a/include/global.h +++ b/include/global.h @@ -152,6 +152,7 @@ static const float INF = 2000000000.0f; #ifdef __MWERKS__ #define MULTI_CHAR(x) (x) #else +#if __cplusplus template <int N> inline constexpr unsigned long long MultiCharLiteral(const char (&buf)[N]) { static_assert(N - 1 >= 3 && N - 1 <= 10, "MULTI_CHAR literal must be 1-8 characters"); @@ -163,6 +164,7 @@ static const float INF = 2000000000.0f; } #define MULTI_CHAR(x) MultiCharLiteral(#x) #endif +#endif // potential fakematch? #if DEBUG @@ -172,9 +174,11 @@ static const float INF = 2000000000.0f; #endif #ifndef __MWERKS__ +#if __cplusplus #include <cmath> using std::isnan; #endif +#endif // Comparing a non-volatile reference type to NULL is tautological // and triggers a warning on modern compilers, but in some cases is |
