misc audio cleanup

This commit is contained in:
HeartPiece 2024-04-30 23:02:23 +10:00
parent bcf39f7274
commit 043dbc2e67
32 changed files with 743 additions and 1657 deletions

View File

@ -23,7 +23,7 @@
### <section id="JSystem">JSystem</section>
| File | Size (bytes) | File | Size (bytes) |
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAISoundTable.cpp">JAudio//JAI/JAISoundTable.cpp</a> | 4337 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMaterialAnm.cpp">J3D/J3DMaterialAnm.cpp</a> | 4804 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAISoundTable.cpp">JAudio//JAI/JAISoundTable.cpp</a> | 4380 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMaterialAnm.cpp">J3D/J3DMaterialAnm.cpp</a> | 4804 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DBloSaver.cpp">J2D/J2DBloSaver.cpp</a> | 5633 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DTevs.cpp">J2D/J2DTevs.cpp</a> | 5860 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAIFx.cpp">JAudio//JAI/JAIFx.cpp</a> | 6025 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JGadget/std-list.cpp">JGadget/std-list.cpp</a> | 6333 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JMessage/control.cpp">JMessage/control.cpp</a> | 6412 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/jstudio-math.cpp">JStudio/jstudio-math.cpp</a> | 9130 |
@ -38,8 +38,8 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio_JStage/object-camera.cpp">JStudio_JStage/object-camera.cpp</a> | 17767 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DCluster.cpp">J3D/J3DCluster.cpp</a> | 18124 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DTextBoxEx.cpp">J2D/J2DTextBoxEx.cpp</a> | 18983 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAISystemInterface.cpp">JAudio//JAI/JAISystemInterface.cpp</a> | 19058 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASChannel.cpp">JAudio//JAS/JASChannel.cpp</a> | 19166 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JMessage/resource.cpp">JMessage/resource.cpp</a> | 19364 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DShape.cpp">J3D/J3DShape.cpp</a> | 19482 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DTevs.cpp">J3D/J3DTevs.cpp</a> | 20295 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/fvb.cpp">JStudio/fvb.cpp</a> | 20306 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASBNKParser.cpp">JAudio//JAS/JASBNKParser.cpp</a> | 20964 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DShape.cpp">J3D/J3DShape.cpp</a> | 19482 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASBNKParser.cpp">JAudio//JAS/JASBNKParser.cpp</a> | 19529 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DTevs.cpp">J3D/J3DTevs.cpp</a> | 20295 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/fvb.cpp">JStudio/fvb.cpp</a> | 20306 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DModelLoaderCalcSize.cpp">J3D/J3DModelLoaderCalcSize.cpp</a> | 21199 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMaterial.cpp">J3D/J3DMaterial.cpp</a> | 21468 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAIAnimation.cpp">JAudio//JAI/JAIAnimation.cpp</a> | 21643 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMtxBuffer.cpp">J3D/J3DMtxBuffer.cpp</a> | 22444 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DWindow.cpp">J2D/J2DWindow.cpp</a> | 22819 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DMaterial.cpp">J2D/J2DMaterial.cpp</a> | 23607 |
@ -72,8 +72,8 @@
| File | Size (bytes) | File | Size (bytes) |
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectHikinoU/PSBnkMgr.cpp">PSBnkMgr.cpp</a> | 10222 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectHikinoU/PSSe.cpp">PSSe.cpp</a> | 22622 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectHikinoU/PSSeq.cpp">PSSeq.cpp</a> | 52072 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectHikinoU/PSAutoBgm.cpp">PSAutoBgm.cpp</a> | 53589 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectHikinoU/PSGame.cpp">PSGame.cpp</a> | 74167 | | |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectHikinoU/PSSeq.cpp">PSSeq.cpp</a> | 52100 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectHikinoU/PSAutoBgm.cpp">PSAutoBgm.cpp</a> | 53589 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectHikinoU/PSGame.cpp">PSGame.cpp</a> | 75602 | | |
### <section id="plugProjectKandoU">plugProjectKandoU</section>
| File | Size (bytes) | File | Size (bytes) |
@ -95,7 +95,7 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pikiMgr.cpp">pikiMgr.cpp</a> | 47897 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_CaveGame.cpp">singleGS_CaveGame.cpp</a> | 52772 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/cellPyramid.cpp">cellPyramid.cpp</a> | 52800 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiFormation.cpp">aiFormation.cpp</a> | 53092 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/navi_demoCheck.cpp">navi_demoCheck.cpp</a> | 57727 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemWeed.cpp">itemWeed.cpp</a> | 62058 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pelletState.cpp">pelletState.cpp</a> | 63012 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemUjamushi.cpp">itemUjamushi.cpp</a> | 63548 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pelletState.cpp">pelletState.cpp</a> | 63200 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemUjamushi.cpp">itemUjamushi.cpp</a> | 63548 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/fakePiki.cpp">fakePiki.cpp</a> | 65918 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemPlant.cpp">itemPlant.cpp</a> | 73150 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/baseGameSection.cpp">baseGameSection.cpp</a> | 91856 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiPrimitives.cpp">aiPrimitives.cpp</a> | 117041 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pelletMgr.cpp">pelletMgr.cpp</a> | 142975 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/navi.cpp">navi.cpp</a> | 152187 |
@ -194,7 +194,7 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/titleSection.cpp">titleSection.cpp</a> | 19575 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/JSTObjectActor.cpp">JSTObjectActor.cpp</a> | 19718 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/resourceMgr.cpp">resourceMgr.cpp</a> | 21567 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/matMath.cpp">matMath.cpp</a> | 26236 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/moviePlayer.cpp">moviePlayer.cpp</a> | 26267 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/memoryCard.cpp">memoryCard.cpp</a> | 32567 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/windowMessage.cpp">windowMessage.cpp</a> | 37900 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/bootSection.cpp">bootSection.cpp</a> | 38359 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/windowMessage.cpp">windowMessage.cpp</a> | 37900 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/bootSection.cpp">bootSection.cpp</a> | 38387 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/system.cpp">system.cpp</a> | 38660 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/movieMessage.cpp">movieMessage.cpp</a> | 48171 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/screenMgr.cpp">screenMgr.cpp</a> | 50710 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/pikmin2MemoryCardMgr.cpp">pikmin2MemoryCardMgr.cpp</a> | 50817 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/graphics.cpp">graphics.cpp</a> | 76095 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysGCU/messageRendering.cpp">messageRendering.cpp</a> | 98881 |
@ -205,9 +205,9 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_CreaturePrm.cpp">PSMainSide_CreaturePrm.cpp</a> | 4148 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_ObjCalc.cpp">PSMainSide_ObjCalc.cpp</a> | 9411 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Sound.cpp">PSMainSide_Sound.cpp</a> | 11782 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_TrackMap.cpp">PSMainSide_TrackMap.cpp</a> | 17101 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/menu.cpp">menu.cpp</a> | 17351 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_BossMgr.cpp">PSMainSide_BossMgr.cpp</a> | 17562 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_DirectorMgr.cpp">PSMainSide_DirectorMgr.cpp</a> | 28567 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Demo.cpp">PSMainSide_Demo.cpp</a> | 30399 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Se.cpp">PSMainSide_Se.cpp</a> | 45041 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Scene.cpp">PSMainSide_Scene.cpp</a> | 49661 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Director.cpp">PSMainSide_Director.cpp</a> | 57480 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_ObjSound.cpp">PSMainSide_ObjSound.cpp</a> | 86608 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Director.cpp">PSMainSide_Director.cpp</a> | 28380 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_DirectorMgr.cpp">PSMainSide_DirectorMgr.cpp</a> | 28495 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Demo.cpp">PSMainSide_Demo.cpp</a> | 34015 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Se.cpp">PSMainSide_Se.cpp</a> | 45041 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Scene.cpp">PSMainSide_Scene.cpp</a> | 49598 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_ObjSound.cpp">PSMainSide_ObjSound.cpp</a> | 86608 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Factory.cpp">PSMainSide_Factory.cpp</a> | 88145 | | |

View File

@ -7,10 +7,10 @@
namespace JASBNKParser {
struct THeader {
u8 _00[0x24]; // _00
u32 mInstOffsets[0x80]; // _24
u8 _224[0x190]; // _224
u32 mPercOffsets[12]; // _3B4
u8 _00[0x20]; // _00
u32 mInstOffsets[0x80]; // _20
u8 _220[0x190]; // _220
u32 mPercOffsets[12]; // _3B0
};
struct TInst {
@ -77,8 +77,6 @@ struct TVmap {
};
JASBasicBank* createBasicBank(void* stream);
JASOscillator::Data* findOscPtr(JASBasicBank*, THeader*, TOsc*);
s16* getOscTableEndPtr(s16*);
// unused/inlined:
u32 getUsedHeapSize();

View File

@ -3,6 +3,7 @@
#include "types.h"
#include "JSystem/JAudio/JAS/JASOscillator.h"
#include "JSystem/JAudio/JAS/JASBNKParser.h"
enum JASInstTarget {
JASINST_Volume = 0,
@ -137,8 +138,8 @@ struct JASBasicInst : public JASInst {
TVeloRegion* getVeloRegion(int) const;
int mBaseKey; // _00
u32 mVeloRegionCount; // _04 - velo region count?
TVeloRegion* mVeloRegions; // _08 - velo region pointer?
u32 mVeloRegionCount; // _04
TVeloRegion* mVeloRegions; // _08
};
JASBasicInst();

View File

@ -4,6 +4,25 @@
#include "types.h"
struct JASOscillator {
enum State {
STATE_Stop = 0,
STATE_Start = 1,
STATE_Hold = 2,
STATE_Release = 3,
STATE_ForceStop = 4,
STATE_Unk5 = 5,
};
enum EnvelopeMode {
ENVMODE_Linear = 0,
ENVMODE_Square = 1,
ENVMODE_SqRoot = 2,
ENVMODE_SampleCell = 3,
ENVMODE_Loop = 13,
ENVMODE_Hold = 14,
ENVMODE_Stop = 15,
};
enum Target {
TARGET_Volume = 0,
TARGET_Pitch = 1,
@ -24,34 +43,34 @@ struct JASOscillator {
JASOscillator();
void init();
void initStart(const Data*);
void initStart(const Data* oscData);
void incCounter();
f32 getValue() const;
bool release();
f32 calc(const s16*);
f32 calc(const s16* envelopes);
bool isValid() const { return mData != nullptr; }
bool isStop() const { return _1C == 0; }
bool isStop() const { return mState == STATE_Stop; }
u32 getTarget() { return mData->mTarget; }
// unused/inlined
void forceStop();
const Data* mData; // _00
f32 _04; // _04
f32 _08; // _08
f32 _0C; // _0C
f32 _10; // _10
f32 _14; // _14
u16 _18; // _18
u16 mRelease; // _1A
u8 _1C; // _1C
u8 _1D; // _1D
static const f32 relTableSampleCell[17];
static const f32 relTableSqRoot[17];
static const f32 relTableSquare[17];
static const s16 oscTableForceStop[6];
const Data* mData; // _00
f32 _04; // _04
f32 mPhase; // _08
f32 mTargetPhase; // _0C
f32 _10; // _10
f32 _14; // _14
u16 mCurrEnvelopeID; // _18
u16 mRelease; // _1A
u8 mState; // _1C
u8 mEnvelopeMode; // _1D
};
#endif

View File

@ -39,7 +39,7 @@ struct AutoBgm : public PSSystem::DirectedBgm {
virtual void startSeq(); // _14
virtual void pauseOn(PSSystem::SeqBase::PauseMode); // _1C
virtual void pauseOff(); // _20
virtual u8 getCastType() { return 3; } // _24 (weak)
virtual u8 getCastType() { return TYPE_AutoBgm; } // _24 (weak)
virtual PSSystem::SeqTrackRoot* newSeqTrackRoot() { return new AutoBgmSeqTrackRoot(&mConductorMgr); } // _44 (weak)
void loadConductor(PSSystem::TaskChecker*);
@ -74,7 +74,7 @@ struct ConductorArcMgr {
{
mArchive = nullptr;
mArchive = JKRMountArchive("/AudioRes/Conductor.arc", JKRArchive::EMM_Dvd, JKRGetCurrentHeap(), JKRArchive::EMD_Head);
P2ASSERTLINE(746, mArchive); // this file needs to be PSAutoBgm.h
P2ASSERTLINE(746, mArchive);
}
static void createInstance()

View File

@ -105,7 +105,7 @@ struct PikSceneMgr : public PSSystem::SceneMgr {
= 0;
/**
* @brief Checks if the current scene is a boss floor.
* @brief Checks if the current scene is the Titan Dweevil floor.
* @return False.
*/
virtual bool curSceneIsBigBossFloor() { return false; }

View File

@ -54,8 +54,8 @@ struct DamageDirector : public OneShotDirector {
};
struct SwitcherDirector : public ::PSSystem::SwitcherDirector {
inline SwitcherDirector(int type, const char* name)
: ::PSSystem::SwitcherDirector(type, name)
inline SwitcherDirector(int numTracks, const char* name)
: ::PSSystem::SwitcherDirector(numTracks, name)
{
}
@ -65,8 +65,19 @@ struct SwitcherDirector : public ::PSSystem::SwitcherDirector {
// _00-_48 = PSSystem::SwitcherDirector
};
struct PikminNumberDirector : public SwitcherDirector {
PikminNumberDirector(int, u8, ::PSSystem::DirectedBgm&);
// this seems like the only way to fix a few of these ctors but i hate this
// don't ask i dont wanna talk about it >:( - HP
struct CopyActorWrapper {
inline CopyActorWrapper()
: mActor(nullptr)
{
}
::PSSystem::DirectorCopyActor* mActor; // _00
};
struct PikminNumberDirector : public SwitcherDirector, public CopyActorWrapper {
PikminNumberDirector(int numTracks, u8 mask, ::PSSystem::DirectedBgm& bgm);
virtual ~PikminNumberDirector() { } // _08 (weak)
virtual void execInner(); // _1C
@ -75,15 +86,15 @@ struct PikminNumberDirector : public SwitcherDirector {
// _00 = VTBL
// _00-_48 = SwitcherDirector
::PSSystem::DirectorCopyActor* mActor; // _48
u8 mMaskId; // _4C
// ::PSSystem::DirectorCopyActor* mActor; // _48
u8 mMaskId; // _4C
};
/**
* @size{0x54}
*/
struct PikminNumberDirector_AutoBgm : public PikminNumberDirector {
PikminNumberDirector_AutoBgm(int, u8, ::PSSystem::DirectedBgm&);
PikminNumberDirector_AutoBgm(int numTracks, u8 mask, ::PSSystem::DirectedBgm& bgm);
virtual ~PikminNumberDirector_AutoBgm() { } // _08 (weak)
virtual void directOnTrack(::PSSystem::SeqTrackBase&); // _20
@ -130,7 +141,7 @@ struct ActorDirector_TempoChange : public TempoChangeDirectorBase {
};
struct TrackOnDirectorBase : public SwitcherDirector {
TrackOnDirectorBase(int, const char*, s32, s32);
TrackOnDirectorBase(int numTracks, const char* name, s32 fadeIn, s32 fadeOut);
virtual ~TrackOnDirectorBase() { } // _08 (weak)
virtual void directOnTrack(::PSSystem::SeqTrackBase&); // _20
@ -148,7 +159,7 @@ struct TrackOnDirectorBase : public SwitcherDirector {
* @size{0x54}
*/
struct PikAttackDirector : public TrackOnDirectorBase {
PikAttackDirector(int);
PikAttackDirector(int numTracks);
virtual ~PikAttackDirector() { } // _08 (weak)
@ -169,8 +180,8 @@ struct ListDirectorActor : public ::PSSystem::DirectorCopyActor, public JSUList<
};
struct TrackOnDirector_Scaled : public TrackOnDirectorBase {
inline TrackOnDirector_Scaled(const char* name, int p2, f32 p3, f32 p4, s32 p5, s32 p6, u32 p7)
: TrackOnDirectorBase(p2, name, p5, p6)
inline TrackOnDirector_Scaled(const char* name, int numTracks, f32 p3, f32 p4, s32 fadeIn, s32 fadeOut, u32 p7)
: TrackOnDirectorBase(numTracks, name, fadeIn, fadeOut)
, _54(p3)
, _58(p4)
, mCurrDistance(100000.0f)
@ -196,8 +207,8 @@ struct TrackOnDirector_Scaled : public TrackOnDirectorBase {
* @size{0x58}
*/
struct TrackOnDirector_Voting : public TrackOnDirectorBase {
TrackOnDirector_Voting(int track, const char* name, int p1, int p2)
: TrackOnDirectorBase(track, name, p1, p2)
TrackOnDirector_Voting(int numTracks, const char* name, int fadeIn, int fadeOut)
: TrackOnDirectorBase(numTracks, name, fadeIn, fadeOut)
{
mVoteState = 0;
}
@ -213,7 +224,7 @@ struct TrackOnDirector_Voting : public TrackOnDirectorBase {
* @size{0x54}
*/
struct ExiteDirector : public TrackOnDirectorBase {
ExiteDirector(int);
ExiteDirector(int numTracks);
virtual ~ExiteDirector() { } // _08 (weak)
@ -224,23 +235,23 @@ struct ExiteDirector : public TrackOnDirectorBase {
/**
* @size{0x58}
*/
struct ActorDirector_TrackOn : public TrackOnDirectorBase {
ActorDirector_TrackOn(const char*, int, s32, s32);
struct ActorDirector_TrackOn : public TrackOnDirectorBase, public CopyActorWrapper {
ActorDirector_TrackOn(const char* name, int numTracks, s32 fadeIn, s32 fadeOut);
virtual ~ActorDirector_TrackOn() { } // _08 (weak)
virtual void execInner(); // _1C
// _00 = VTBL
// _00-_54 = TrackOnDirectorBase
::PSSystem::DirectorCopyActor* mActor; // _54
// ::PSSystem::DirectorCopyActor* mActor; // _54
};
/**
* @size{0x58}
*/
struct GroundDirector_Cave : public ActorDirector_TrackOn {
GroundDirector_Cave(const char* name, int tracks, s32 a1, s32 a2)
: ActorDirector_TrackOn(name, tracks, a1, a2)
GroundDirector_Cave(const char* name, int numTracks, s32 fadeIn, s32 fadeOut)
: ActorDirector_TrackOn(name, numTracks, fadeIn, fadeOut)
{
}
@ -256,7 +267,7 @@ struct GroundDirector_Cave : public ActorDirector_TrackOn {
* @size{0x68}
*/
struct ActorDirector_Scaled : public TrackOnDirector_Scaled {
ActorDirector_Scaled(const char*, int, f32, f32, s32, s32, u32);
ActorDirector_Scaled(const char* name, int numTracks, f32 p3, f32 p4, s32 fadeIn, s32 fadeOut, u32 p7);
virtual ~ActorDirector_Scaled() { } // _08 (weak)
virtual void execInner(); // _1C
@ -276,8 +287,8 @@ struct ActorDirector_Enemy : public ActorDirector_Scaled {
virtual ~ActorDirector_Enemy() { } // _08 (weak)
virtual void underDirection(); // _18
virtual void onSetMinDistObj(Game::Creature*); // _3C
virtual f64 getVolZeroDist(Game::EnemyBase*) = 0; // _40
virtual f64 getVolMaxDist(Game::EnemyBase*) = 0; // _44
virtual f32 getVolZeroDist(Game::EnemyBase*) = 0; // _40
virtual f32 getVolMaxDist(Game::EnemyBase*) = 0; // _44
// _00 = VTBL
// _00-_68 = ActorDirector_Scaled
@ -294,8 +305,8 @@ struct ActorDirector_Battle : public ActorDirector_Enemy {
}
virtual ~ActorDirector_Battle() { } // _08 (weak)
virtual f64 getVolZeroDist(Game::EnemyBase*); // _40
virtual f64 getVolMaxDist(Game::EnemyBase*); // _44
virtual f32 getVolZeroDist(Game::EnemyBase*); // _40
virtual f32 getVolMaxDist(Game::EnemyBase*); // _44
// _00 = VTBL
// _00-_6C = ActorDirector_Enemy
@ -311,8 +322,8 @@ struct ActorDirector_Kehai : public ActorDirector_Enemy {
}
virtual ~ActorDirector_Kehai() { } // _08 (weak)
virtual f64 getVolZeroDist(Game::EnemyBase*); // _40
virtual f64 getVolMaxDist(Game::EnemyBase*); // _44
virtual f32 getVolZeroDist(Game::EnemyBase*); // _40
virtual f32 getVolMaxDist(Game::EnemyBase*); // _44
// _00 = VTBL
// _00-_6C = ActorDirector_Enemy

View File

@ -5,13 +5,12 @@
#include "JSystem/JAudio/JAD/JADHioNode.h"
#include "JSystem/JAudio/JAS/JASTrack.h"
#include "PSSystem/PSSeq.h"
// #include "PSSystem/SeqTrack.h"
namespace PSSystem {
struct SeqTrackBase;
struct DirectorBase : public JADHioNode {
DirectorBase(int, const char*);
DirectorBase(int numTracks, const char* name);
virtual ~DirectorBase() { } // _08 (weak)
virtual void exec(); // _0C
@ -48,11 +47,11 @@ struct DirectorBase : public JADHioNode {
return false;
}
inline void fadeAllTracks(f32 rate, u32 a2)
inline void fadeAllTracks(f32 rate, u32* a2)
{
for (u8 i = 0; i < mTrackNum; i++) {
P2ASSERTLINE(51, i < mTrackNum);
static_cast<PSSystem::SeqTrackChild*>(mTracks[i])->fade(rate, a2, nullptr);
static_cast<PSSystem::SeqTrackChild*>(mTracks[i])->fade(rate, *a2, nullptr);
}
}
@ -88,8 +87,8 @@ struct OneShotDirector : public DirectorBase {
};
struct SwitcherDirector : public DirectorBase {
inline SwitcherDirector(int p1, const char* p2)
: DirectorBase(p1, p2)
inline SwitcherDirector(int numTracks, const char* name)
: DirectorBase(numTracks, name)
{
}
@ -121,7 +120,7 @@ struct DirectorCopyActor : public DirectorActorBase {
};
struct DirectorMgrBase : public JADHioNode {
DirectorMgrBase(u8);
DirectorMgrBase(u8 count);
virtual ~DirectorMgrBase() { } // _08 (weak)
virtual DirectorBase* newDirector(u8, DirectedBgm&) = 0; // _0C

View File

@ -22,7 +22,7 @@ struct BgmSeq : public SeqBase {
BgmSeq(const char* bmsFileName, const JAInter::SoundInfo& info);
virtual ~BgmSeq(); // _08
virtual u8 getCastType() { return 0; } // _24 (weak)
virtual u8 getCastType() { return TYPE_BgmSeq; } // _24 (weak)
virtual u32 getSeqType() { return 0x80000000; } // _28 (weak)
virtual JAISound** getHandleP() { return &mHandleP; } // _3C (weak)
@ -36,21 +36,13 @@ struct BgmSeq : public SeqBase {
* @size = 0xB8
*/
struct DirectedBgm : public BgmSeq {
enum CastType {
BgmType_NULL = 0,
BgmType_Battle = 2,
BgmType_Cave = 3,
BgmType_2PBattle = 8,
};
DirectedBgm(const char* bmsFileName, const JAInter::SoundInfo& info, DirectorMgrBase* directorMgr);
virtual ~DirectedBgm() { } // _08 (weak)
virtual void init(); // _0C
virtual void startSeq(); // _14
virtual void stopSeq(u32); // _18
virtual u8 getCastType() { return 2; } // _24 (weak)
virtual u8 getCastType() { return TYPE_DirectedBgm; } // _24 (weak)
virtual void onPlayingFrame(); // _30
virtual SeqTrackRoot* newSeqTrackRoot(); // _44
virtual SeqTrackChild* newSeqTrackChild(u8, SeqTrackRoot&); // _48
@ -113,17 +105,17 @@ struct JumpBgmPort {
struct JumpBgmSeq : public DirectedBgm {
JumpBgmSeq(const char* bmsFileName, const JAInter::SoundInfo& info, DirectorMgrBase* directorMgr);
virtual ~JumpBgmSeq() { } // _08 (weak)
virtual void startSeq(); // _14
virtual u8 getCastType() { return 4; } // _24 (weak)
virtual void onPlayingFrame(); // _30
virtual PSSystem::SeqTrackRoot* newSeqTrackRoot(); // _44
virtual u16 getSeqStartPoint(); // _4C
virtual void requestJumpBgmQuickly(u16); // _50
virtual void requestJumpBgmOnBeat(u16); // _54
virtual void requestJumpBgmEveryBeat(u16); // _58
virtual u16 outputJumpRequest(); // _5C
virtual void onJump(u16) { } // _60 (weak)
virtual ~JumpBgmSeq() { } // _08 (weak)
virtual void startSeq(); // _14
virtual u8 getCastType() { return TYPE_JumpBgmSeq; } // _24 (weak)
virtual void onPlayingFrame(); // _30
virtual PSSystem::SeqTrackRoot* newSeqTrackRoot(); // _44
virtual u16 getSeqStartPoint(); // _4C
virtual void requestJumpBgmQuickly(u16); // _50
virtual void requestJumpBgmOnBeat(u16); // _54
virtual void requestJumpBgmEveryBeat(u16); // _58
virtual u16 outputJumpRequest(); // _5C
virtual void onJump(u16) { } // _60 (weak)
void startSeq(u16);
void setAvoidJumpTimer_Checked(u32);

View File

@ -65,7 +65,7 @@ struct StreamBgm : public BgmSeq {
virtual void init(); // _0C
virtual void scene1st(TaskChecker*) { } // _10 (weak)
virtual void startSeq(); // _14
virtual u8 getCastType() { return 1; } // _24 (weak)
virtual u8 getCastType() { return TYPE_StreamBgm; } // _24 (weak)
virtual u32 getSeqType() { return 0; } // _28 (weak)
virtual bool isPlaying(); // _34
virtual JAISound** getHandleP() { return &mJaiSound; } // _3C (weak)

View File

@ -12,6 +12,8 @@
#include "PSSystem/Reservator.h"
#include "stl/string.h"
#define P2_STREAM_SOUND_ID(soundID) (JAISoundID_Type_Stream | 0x10000 | soundID)
namespace PSSystem {
struct SeqPlayReservator;
struct SeqPauseOffReservator;
@ -22,7 +24,16 @@ struct Scene;
/**
* @size 0x68
*/
struct SeqBase : JSULink<SeqBase> {
struct SeqBase : public JSULink<SeqBase> {
enum CastType {
TYPE_BgmSeq = 0,
TYPE_StreamBgm = 1,
TYPE_DirectedBgm = 2,
TYPE_AutoBgm = 3,
TYPE_JumpBgmSeq = 4,
TYPE_SeSeq = 5,
};
// need to work out what these are
enum PauseMode { MODE0 = 0, MODE1 = 1, MODE2 = 2, MODE3 = 3, MODE4 = 4 };
@ -44,7 +55,10 @@ struct SeqBase : JSULink<SeqBase> {
virtual JAISound** getHandleP() = 0; // _3C
virtual void setConfigVolume(); // _40
inline bool isDirectedType() { return (getCastType() == 2 || getCastType() == 3 || getCastType() == 4); }
inline bool isDirectedType()
{
return (getCastType() == TYPE_DirectedBgm || getCastType() == TYPE_AutoBgm || getCastType() == TYPE_JumpBgmSeq);
}
void* getFileEntry();
@ -117,7 +131,7 @@ struct SeSeq : public SeqBase {
}
virtual ~SeSeq(); // _08
virtual void stopSeq(u32); // _18
virtual u8 getCastType() { return 5; } // _24 (weak)
virtual u8 getCastType() { return TYPE_SeSeq; } // _24 (weak)
virtual u32 getSeqType() { return 0x80000800; } // _28 (weak)
virtual void seqLoadAfter(); // _38
virtual JAISound** getHandleP() { return (JAISound**)(JAInter::SeMgr::seHandle); } // _3C (weak)

View File

@ -1044,107 +1044,112 @@ enum SoundID {
PSSE_EN_KAGE_MELODYLOOP = 0x5189,
PSSE_EN_OPAN_DOWN_NEW = 0x598A,
PSSE_EN_OPAN_HIPPARARE = 0x598B,
PSSE_SEQ = 0x800,
PSSQ_BOSS = 0x1,
PSSQ_BOSS2 = 0x2,
PSSQ_BOSS3 = 0x3,
PSSQ_CAVE = 0x4,
PSSQ_CHAR = 0x5,
PSSQ_CRESULT = 0x6,
PSSQ_DIARY1 = 0x7,
PSSQ_DIARY2 = 0x8,
PSSQ_FANF1 = 0x9,
PSSQ_FANF1_1 = 0xA,
PSSQ_FANF2 = 0xB,
PSSQ_FANF3 = 0xC,
PSSQ_FANF4 = 0xD,
PSSQ_FLOW = 0xE,
PSSQ_FOREST = 0xF,
PSSQ_FRESULT = 0x10,
PSSQ_JUNGLE = 0x11,
PSSQ_MAP = 0x12,
PSSQ_PARTS = 0x13,
PSSQ_PLAY3 = 0x14,
PSSQ_RESULT = 0x15,
PSSQ_SELECT = 0x16,
PSSQ_TUTORIAL = 0x17,
PSSQ_YAKU = 0x18,
PSSTR_TITLE = 0x1000,
PSSTR_TREASURE_GET = 0x1001,
PSSTR_DAYEND_N = 0x1002,
PSSTR_DAYEND_G = 0x1003,
PSSTR_DAYEND_B = 0x1004,
PSSTR_PLAYERDOWN = 0x1005,
PSSTR_ANNIHI = 0x1006,
PSSTR_KEYGET = 0x1007,
PSSTR_DOPING = 0x1008,
PSSTR_DOPED = 0x1009,
PSSTR_POWERUP_GET = 0x100A,
PSSTR_EQUIP_GET = 0x100B,
PSSTR_ONYONBOOT = 0x100C,
PSSTR_PIKMIN_MEET = 0x100D,
PSSTR_ZUKAN = 0x100E,
PSSTR_VS_MENU = 0x100F,
PSSTR_OMAKE = 0x1010,
PSSTR_OPTION = 0x1011,
PSSTR_RESULT = 0x1012,
PSSTR_U_RESULT = 0x1013,
PSSTR_C_RESULT = 0x1014,
PSSTR_AKIRAME = 0x1015,
PSSTR_CHALLENGE_TIMEUP = 0x1016,
PSSTR_GET_BEEDAMA = 0x1017,
PSSTR_PLAYERDOWN_2PGAME = 0x1018,
PSSTR_ZENMETSU_2PGAME = 0x1019,
PSSTR_WIN_ORIMER_2PGAME = 0x101A,
PSSTR_WIN_LUGIE_2PGAME = 0x101B,
PSSTR_DRAW_2PGAME = 0x101C,
PSSTR_ZENMETSU_DAYEND = 0x101D,
PSSTR_FILE_SELECT = 0x101E,
PSSTR_PIKMIN_GREET = 0x101F,
PSSTR_PAY_COMPLETE = 0x1020,
PSSTR_PAY_NOT_ENOUGH = 0x1021,
PSSTR_READY_GO_2P = 0x1022,
PSSTR_READY_GO_CHALLENGE = 0x1023,
PSSTR_CAMERA_DEMO = 0x1024,
PSSTR_FINAL_FLOOR = 0x1025,
PSSTR_IN_HOLE = 0x1026,
PSSTR_TREASURE_GLAD = 0x1027,
PSSTR_OUT_HOLE = 0x1028,
PSSTR_MYSTERY = 0x1029,
PSSTR_GLAD = 0x102A,
PSSTR_PIKMIN_GLAD = 0x102B,
PSSTR_START_DEMO_TUTORIAL = 0x102C,
PSSTR_WATCH_PIKMIN = 0x102D,
PSSTR_JOIN = 0x102E,
PSSTR_ONYON = 0x102F,
PSSTR_BLUE_ONYON = 0x1030,
PSSTR_HIBA = 0x1031,
PSSTR_KUROIHITO = 0x1032,
PSSTR_EXPLAIN = 0x1033,
PSSTR_START_DEMO_OTHER = 0x1034,
PSSTR_LUGIE_START = 0x1035,
PSSTR_FLOOR_IN = 0x1036,
PSSTR_RETURN = 0x1037,
PSSTR_C_LOOR_IN = 0x1038,
PSSTR_CHALLENGE_START = 0x1039,
PSSTR_UNDERGROUND_START = 0x103A,
PSSTR_RETURN_E = 0x103B,
PSSTR_RED_ONYON = 0x103C,
PSSTR_VS_PDOWN_WIN_ORI = 0x103D,
PSSTR_VS_PDOWN_WIN_LUI = 0x103E,
PSSTR_VS_PDOWN_DROW = 0x103F,
PSSTR_VS_PIK_WIN_ORI = 0x1040,
PSSTR_VS_PIK_WIN_LUI = 0x1041,
PSSTR_VS_PIK_DROW = 0x1042,
PSSTR_VS_BEE_WIN_ORI = 0x1043,
PSSTR_VS_BEE_WIN_LUI = 0x1044,
PSSTR_VS_BEE_DROW = 0x1045,
PSSTR_IN_HOLE_U = 0x1046,
PSSTR_BLACK_DOPING = 0x1047,
PSSTR_EXPLAIN_60 = 0x1048,
PSSTR_EXPLAIN_75 = 0x1049,
PSSTR_EXPLAIN_90 = 0x104A,
dropItem = 22544,
PSSE_SEQ = 0x800,
// 0xXX = Sequenced music
PSSQ_BOSS = 0x1,
PSSQ_BOSS2 = 0x2,
PSSQ_BOSS3 = 0x3,
PSSQ_CAVE = 0x4,
PSSQ_CHAR = 0x5,
PSSQ_CRESULT = 0x6,
PSSQ_DIARY1 = 0x7,
PSSQ_DIARY2 = 0x8,
PSSQ_FANF1 = 0x9,
PSSQ_FANF1_1 = 0xA,
PSSQ_FANF2 = 0xB,
PSSQ_FANF3 = 0xC,
PSSQ_FANF4 = 0xD,
PSSQ_FLOW = 0xE,
PSSQ_FOREST = 0xF,
PSSQ_FRESULT = 0x10,
PSSQ_JUNGLE = 0x11,
PSSQ_MAP = 0x12,
PSSQ_PARTS = 0x13,
PSSQ_PLAY3 = 0x14,
PSSQ_RESULT = 0x15,
PSSQ_SELECT = 0x16,
PSSQ_TUTORIAL = 0x17,
PSSQ_YAKU = 0x18,
// 0x1XXX = Streamed BGM, comments from /user/Totaka/StreamList.txt
PSSTR_TITLE = 0x1000, // 'title'
PSSTR_TREASURE_GET = 0x1001, // 'get treasure'
PSSTR_DAYEND_N = 0x1002, // 'normal day end'
PSSTR_DAYEND_G = 0x1003, // 'good day end demo. there are no free Pikmin other than sprouts'
PSSTR_DAYEND_B = 0x1004, // 'bad day end demo. the % of free Pikmin other than sprouts is >= 50%'
PSSTR_PLAYERDOWN = 0x1005, // 'player down (s03_orimadown)'
PSSTR_ANNIHI = 0x1006, // 'Pikmin wiped out (s05_pikminzero)'
PSSTR_KEYGET = 0x1007, // 'key get (no demo list)'
PSSTR_DOPING = 0x1008, // 'doping complete (s11_dopebin_first_b, s11_dopebin_first_r)'
PSSTR_DOPED = 0x1009, // 'first doping (g1A_red_doping, g1B_black_doping)'
PSSTR_POWERUP_GET = 0x100A, // 'rocket power up item get demo (s17_suck_equipment)'
PSSTR_EQUIP_GET = 0x100B, // 'player equipment item get demo (s17_suck_equipment)'
PSSTR_ONYONBOOT = 0x100C, // 'encounter demo with onyon (g02_boot_onyonR, g1e_boot_onyonY, g20_boot_onyonB)'
PSSTR_PIKMIN_MEET = 0x100D, // 'Pikmin encounter demo'
PSSTR_ZUKAN = 0x100E, // 'Picture book (discontinued)'
PSSTR_VS_MENU = 0x100F, // 'VS menu'
PSSTR_OMAKE = 0x1010, // 'bonus'
PSSTR_OPTION = 0x1011, // 'option'
PSSTR_RESULT = 0x1012, // 'result'
PSSTR_U_RESULT = 0x1013, // 'underground results' (cave result)
PSSTR_C_RESULT = 0x1014, // 'challenge results'
PSSTR_AKIRAME = 0x1015, // 'give up and escape'
PSSTR_CHALLENGE_TIMEUP = 0x1016, // 'challenge time up'
PSSTR_GET_BEEDAMA = 0x1017, // 'get a marble'
PSSTR_PLAYERDOWN_2PGAME = 0x1018, // 'player down (battle)'
PSSTR_ZENMETSU_2PGAME = 0x1019, // 'annihilation (battle)'
PSSTR_WIN_ORIMER_2PGAME = 0x101A, // 'olimar victory (battle)'
PSSTR_WIN_LUGIE_2PGAME = 0x101B, // 'lousey victory (battle)'
PSSTR_DRAW_2PGAME = 0x101C, // 'draw (battle)'
PSSTR_ZENMETSU_DAYEND = 0x101D, // 'annihilation day end'
PSSTR_FILE_SELECT = 0x101E, // 'file select'
PSSTR_PIKMIN_GREET = 0x101F, // 'pikmin greetings'
PSSTR_PAY_COMPLETE = 0x1020, // 'repayment completed'
PSSTR_PAY_NOT_ENOUGH = 0x1021, // 'repayment X% completed' - name is PAY_NOT_COMPLETE in StreamList.txt
PSSTR_READY_GO_2P = 0x1022, // 'ready go (2P battle)'
PSSTR_READY_GO_CHALLENGE = 0x1023, // 'ready go (2P battle)' (copy-paste error?)
PSSTR_CAMERA_DEMO = 0x1024, // 'camera demo'
PSSTR_FINAL_FLOOR = 0x1025, // 'final floor'
PSSTR_IN_HOLE = 0x1026, // the rest don't have comments
PSSTR_TREASURE_GLAD = 0x1027,
PSSTR_OUT_HOLE = 0x1028,
PSSTR_MYSTERY = 0x1029,
PSSTR_GLAD = 0x102A,
PSSTR_PIKMIN_GLAD = 0x102B,
PSSTR_START_DEMO_TUTORIAL = 0x102C,
PSSTR_WATCH_PIKMIN = 0x102D,
PSSTR_JOIN = 0x102E,
PSSTR_ONYON = 0x102F,
PSSTR_BLUE_ONYON = 0x1030,
PSSTR_HIBA = 0x1031,
PSSTR_KUROIHITO = 0x1032,
PSSTR_EXPLAIN = 0x1033,
PSSTR_START_DEMO_OTHER = 0x1034,
PSSTR_LUGIE_START = 0x1035,
PSSTR_FLOOR_IN = 0x1036,
PSSTR_RETURN = 0x1037,
PSSTR_C_LOOR_IN = 0x1038,
PSSTR_CHALLENGE_START = 0x1039,
PSSTR_UNDERGROUND_START = 0x103A,
PSSTR_RETURN_E = 0x103B,
PSSTR_RED_ONYON = 0x103C,
PSSTR_VS_PDOWN_WIN_ORI = 0x103D,
PSSTR_VS_PDOWN_WIN_LUI = 0x103E,
PSSTR_VS_PDOWN_DROW = 0x103F,
PSSTR_VS_PIK_WIN_ORI = 0x1040,
PSSTR_VS_PIK_WIN_LUI = 0x1041,
PSSTR_VS_PIK_DROW = 0x1042,
PSSTR_VS_BEE_WIN_ORI = 0x1043,
PSSTR_VS_BEE_WIN_LUI = 0x1044,
PSSTR_VS_BEE_DROW = 0x1045,
PSSTR_IN_HOLE_U = 0x1046,
PSSTR_BLACK_DOPING = 0x1047,
PSSTR_EXPLAIN_60 = 0x1048,
PSSTR_EXPLAIN_75 = 0x1049,
PSSTR_EXPLAIN_90 = 0x104A,
dropItem = 22544,
};
#endif

View File

@ -61,7 +61,7 @@ struct ObjFinalFloor : public ::Screen::ObjBase {
inline void startBGM()
{
PSStart2DStream(0xc0011025);
PSStart2DStream(P2_STREAM_SOUND_ID(PSSTR_FINAL_FLOOR));
PSSystem::SceneMgr* mgr = PSSystem::getSceneMgr();
PSSystem::checkSceneMgr(mgr);
PSM::Scene_Game* scene = static_cast<PSM::Scene_Game*>(mgr->getChildScene());

View File

@ -10,12 +10,17 @@ struct JKRArchive;
namespace kh {
namespace Screen {
struct DispReadyGo : public og::Screen::DispMemberBase {
enum GameType {
TYPE_2PBattle = 0,
TYPE_Challenge = 1,
};
DispReadyGo()
{
mStatus = 0;
mIs2Player = false;
mIsFinalFloor = false;
mGameType = 0;
mGameType = TYPE_2PBattle;
}
virtual u32 getSize() { return sizeof(DispReadyGo); } // _08 (weak)
@ -27,7 +32,7 @@ struct DispReadyGo : public og::Screen::DispMemberBase {
int mStatus; // _08
bool mIs2Player; // _0C
bool mIsFinalFloor; // _0D
int mGameType; // _10
int mGameType; // _10, see GameType enum
};
struct ObjReadyGo : public ::Screen::ObjBase {

View File

@ -99,15 +99,15 @@ JAInter::SoundInfo* JAInter::SoundTable::getInfoPointer(u32 soundID)
{
SoundInfo* info = nullptr;
u32 category;
switch (soundID & 0xC0000000) {
case 0x00000000:
switch (soundID & JAISoundID_TypeMask) {
case JAISoundID_Type_Se:
category = soundID >> 0xC & 0xFF;
JAIGlobalParameter::getParamSeCategoryMax();
break;
case 0x80000000:
case JAISoundID_Type_Sequence:
category = 0x10;
break;
case 0xC0000000:
case JAISoundID_Type_Stream:
category = 0x11;
break;
}

View File

@ -7,6 +7,14 @@
#include "JSystem/JKernel/JKRDisposer.h"
#include "JSystem/JSupport/JSU.h"
static size_t JASBNKParser::sUsedHeapSize = 0;
namespace JASBNKParser {
// forward declare statics
static JASOscillator::Data* findOscPtr(JASBasicBank*, THeader*, TOsc*);
static s16* getOscTableEndPtr(s16*);
/**
* @note Address: 0x8009A7DC
* @note Size: 0x6D0
@ -15,17 +23,19 @@ JASBasicBank* JASBNKParser::createBasicBank(void* stream)
{
JKRHeap* heap = JASBank::getCurrentHeap();
const u32 freeSize = heap->getFreeSize();
THeader* header = static_cast<THeader*>(stream);
JASBasicBank* bank = new (heap, 0) JASBasicBank;
if (bank == nullptr) {
return nullptr;
}
bank->setInstCount(0x100);
THeader* header = static_cast<THeader*>(stream);
/// Populate insts:
for (int i = 0; i < 0x80; i++) {
TInst* instRaw = JSUConvertOffsetToPtr<TInst>(header, header->mInstOffsets[i]); // problem with mInstOffsets again
if (instRaw != nullptr) {
TInst* instRaw = JSUConvertOffsetToPtr<TInst>(header, header->mInstOffsets[i + 1]); // problem with mInstOffsets again
if (instRaw) {
JASBasicInst* inst = new (heap, 0) JASBasicInst;
inst->mVolume = instRaw->mVolume;
inst->mPitch = instRaw->mPitch;
@ -42,19 +52,19 @@ JASBasicBank* JASBNKParser::createBasicBank(void* stream)
oscData->mRate = oscRaw->mRate;
s16* oscTable = JSUConvertOffsetToPtr<s16>(header, oscRaw->mAttack);
if (oscTable != nullptr) {
u32 tableLength = getOscTableEndPtr(oscTable) - oscTable;
s16* tableCopy = new (heap, 0) s16[tableLength];
JASCalc::bcopy(oscTable, tableCopy, tableLength * sizeof(s16));
oscData->mAttack = tableCopy;
u32 tableLength = (getOscTableEndPtr(oscTable) - oscTable) * sizeof(s16);
u8* tableCopy = new (heap, 0) u8[tableLength];
JASCalc::bcopy(oscTable, tableCopy, tableLength);
oscData->mAttack = (s16*)tableCopy;
} else {
oscData->mAttack = nullptr;
}
oscTable = JSUConvertOffsetToPtr<s16>(header, oscRaw->mRelease);
if (oscTable != nullptr) {
u32 tableLength = getOscTableEndPtr(oscTable) - oscTable;
s16* tableCopy = new (heap, 0) s16[tableLength];
JASCalc::bcopy(oscTable, tableCopy, tableLength * sizeof(s16));
oscData->mRelease = tableCopy;
u32 tableLength = (getOscTableEndPtr(oscTable) - oscTable) * sizeof(s16);
u8* tableCopy = new (heap, 0) u8[tableLength];
JASCalc::bcopy(oscTable, tableCopy, tableLength);
oscData->mRelease = (s16*)tableCopy;
} else {
oscData->mRelease = nullptr;
}
@ -109,7 +119,7 @@ JASBasicBank* JASBNKParser::createBasicBank(void* stream)
}
for (int i = 0; i < 12; i++) {
TPerc* percRaw = JSUConvertOffsetToPtr<TPerc>(header, header->mPercOffsets[i]);
TPerc* percRaw = JSUConvertOffsetToPtr<TPerc>(header, header->mPercOffsets[i + 1]);
if (percRaw != nullptr) {
JASDrumSet* drumSet = new (heap, 0) JASDrumSet;
for (int j = 0; j < 0x80; j++) {
@ -665,14 +675,17 @@ lbl_8009AE98:
*/
JASOscillator::Data* JASBNKParser::findOscPtr(JASBasicBank* bank, JASBNKParser::THeader* header, JASBNKParser::TOsc* oscPtr)
{
u32* instOffsets = header->mInstOffsets;
for (int i = 0; i < 128; i++) {
TInst* instRaw = JSUConvertOffsetToPtr<TInst>(header, header->mInstOffsets[i]); // mismatch here
if (instRaw != nullptr) {
TInst* instRaw = JSUConvertOffsetToPtr<TInst>(header, instOffsets[i + 1]); // first inst offset is always 0
if (instRaw) {
// look through both oscillators
for (int j = 0; j < 2; j++) {
TOsc* oscRaw = JSUConvertOffsetToPtr<TOsc>(header, instRaw->mOscOffsets[j]);
if (oscRaw == oscPtr) {
JASInst* inst = bank->getInst(i);
if (inst != nullptr) {
if (inst) {
// check we have that oscillator for this instrument
JASInstParam param;
inst->getParam(60, 127, &param);
if (j < param.mOscCount) {
@ -684,91 +697,6 @@ JASOscillator::Data* JASBNKParser::findOscPtr(JASBasicBank* bank, JASBNKParser::
}
}
return nullptr;
/*
.loc_0x0:
stwu r1, -0x50(r1)
mflr r0
stw r0, 0x54(r1)
stmw r25, 0x34(r1)
mr r26, r4
mr r25, r3
mr r27, r5
li r29, 0
addi r30, r26, 0x20
.loc_0x24:
lwz r4, 0x4(r30)
mr r3, r26
bl 0x1C8
cmplwi r3, 0
beq- .loc_0xF8
li r28, 0
mr r31, r3
.loc_0x40:
lwz r4, 0x10(r31)
mr r3, r26
bl 0x194
cmplw r3, r27
bne- .loc_0xE8
mr r3, r25
mr r4, r29
lwz r12, 0x0(r25)
lwz r12, 0xC(r12)
mtctr r12
bctrl
cmplwi r3, 0
beq- .loc_0xE8
lfs f2, -0x76A8(r2)
li r0, 0
lfs f0, -0x76A4(r2)
addi r6, r1, 0x8
lfs f1, -0x7690(r2)
li r4, 0x3C
stb r0, 0x8(r1)
li r5, 0x7F
stw r0, 0xC(r1)
stw r0, 0x10(r1)
stw r0, 0x14(r1)
stfs f2, 0x18(r1)
stfs f2, 0x1C(r1)
stfs f1, 0x20(r1)
stfs f0, 0x24(r1)
stfs f0, 0x28(r1)
stb r0, 0x2C(r1)
sth r0, 0x2E(r1)
lwz r12, 0x0(r3)
lwz r12, 0xC(r12)
mtctr r12
bctrl
lwz r0, 0x14(r1)
cmplw r28, r0
bge- .loc_0xE8
lwz r3, 0x10(r1)
rlwinm r0,r28,2,0,29
lwzx r3, r3, r0
b .loc_0x10C
.loc_0xE8:
addi r28, r28, 0x1
addi r31, r31, 0x4
cmpwi r28, 0x2
blt+ .loc_0x40
.loc_0xF8:
addi r29, r29, 0x1
addi r30, r30, 0x4
cmpwi r29, 0x80
blt+ .loc_0x24
li r3, 0
.loc_0x10C:
lmw r25, 0x34(r1)
lwz r0, 0x54(r1)
mtlr r0
addi r1, r1, 0x50
blr
*/
}
/**
@ -784,3 +712,4 @@ s16* JASBNKParser::getOscTableEndPtr(s16* p1)
} while (v1 <= 0xa);
return p1;
}
} // namespace JASBNKParser

View File

@ -2,46 +2,24 @@
#include "JSystem/JAudio/JAS/JASDriver.h"
#include "JSystem/JMath.h"
const f32 JASOscillator::relTableSampleCell[17] = { 1.0f,
0.9704890251159668f,
0.7812740206718445f,
0.5462809801101685f,
0.39979198575019836f,
0.28931498527526855f,
0.21210399270057678f,
0.15747599303722382f,
0.1126129999756813f,
0.08178959786891937f,
0.057985201478004456f,
0.04364150017499924f,
0.03082370012998581f,
0.023712899535894394f,
0.015259300358593464f,
0.00915555004030466f,
0.0f };
// clang-format off
const f32 JASOscillator::relTableSampleCell[17]
= { 1.0f, 0.9704890251159668f, 0.7812740206718445f, 0.5462809801101685f,
0.39979198575019836f, 0.28931498527526855f, 0.21210399270057678f, 0.15747599303722382f,
0.1126129999756813f, 0.08178959786891937f, 0.057985201478004456f, 0.04364150017499924f,
0.03082370012998581f, 0.023712899535894394f, 0.015259300358593464f, 0.00915555004030466f,
0.0f };
const f32 JASOscillator::relTableSqRoot[17]
= { 1.0f, 0.8789060115814209f, 0.765625f, 0.6601560115814209f, 0.5625f, 0.4726560115814209f,
0.390625f, 0.3164060115814209f, 0.25f, 0.1914059966802597f, 0.140625f, 0.09765619784593582f,
0.0625f, 0.03515620157122612f, 0.015625f, 0.00390625f, 0.0f };
const f32 JASOscillator::relTableSquare[17] = {
1.0f,
0.9682459831237793f,
0.9354140162467957f,
0.9013879895210266f,
0.8660249710083008f,
0.8291559815406799f,
0.790569007396698f,
0.75f,
0.7071070075035095f,
0.66143798828125f,
0.6123719811439514f,
0.55901700258255f,
0.5f,
0.433012992143631f,
0.35355299711227417f,
0.25f,
0.0f,
};
const f32 JASOscillator::relTableSquare[17]
= { 1.0f, 0.9682459831237793f, 0.9354140162467957f, 0.9013879895210266f, 0.8660249710083008f, 0.8291559815406799f,
0.790569007396698f, 0.75f, 0.7071070075035095f, 0.66143798828125f, 0.6123719811439514f, 0.55901700258255f,
0.5f, 0.433012992143631f, 0.35355299711227417f, 0.25f, 0.0f };
// clang-format on
const s16 JASOscillator::oscTableForceStop[6] = { 0, 15, 0, 15, 0, 0 };
@ -51,16 +29,16 @@ const s16 JASOscillator::oscTableForceStop[6] = { 0, 15, 0, 15, 0, 0 };
*/
void JASOscillator::init()
{
mData = nullptr;
_1C = 0;
_1D = 0;
_18 = 0;
_04 = 0.0f;
_08 = 0.0f;
_0C = 0.0f;
_10 = 0.0f;
mRelease = 0;
_14 = 0.0f;
mData = nullptr;
mState = STATE_Stop;
mEnvelopeMode = ENVMODE_Linear;
mCurrEnvelopeID = 0;
_04 = 0.0f;
mPhase = 0.0f;
mTargetPhase = 0.0f;
_10 = 0.0f;
mRelease = 0;
_14 = 0.0f;
}
/**
@ -70,17 +48,19 @@ void JASOscillator::init()
void JASOscillator::initStart(const Data* data)
{
if (!data) {
_1C = 0;
mState = STATE_Stop;
} else {
_1C = 1;
mState = STATE_Start;
mData = data;
mRelease = 0;
if (!mData->mAttack) {
_08 = 0.0f;
mPhase = 0.0f;
} else {
_18 = 0;
_04 = 0.0f;
_0C = 0.0f;
mCurrEnvelopeID = 0;
_04 = 0.0f;
mTargetPhase = 0.0f;
_04 -= mData->mRate;
incCounter();
}
@ -93,31 +73,39 @@ void JASOscillator::initStart(const Data* data)
*/
void JASOscillator::incCounter()
{
const s16* v1;
switch (_1C) {
case 0:
case 2:
const s16* envelopes;
switch (mState) {
case STATE_Stop:
case STATE_Hold:
return;
case 1:
case STATE_Start:
break;
}
if (_1C == 3) {
v1 = mData->mRelease;
} else if (_1C == 4) {
v1 = oscTableForceStop;
if (mState == STATE_Release) {
envelopes = mData->mRelease;
} else if (mState == STATE_ForceStop) {
envelopes = oscTableForceStop;
} else {
v1 = mData->mAttack;
envelopes = mData->mAttack;
}
if (v1 == nullptr && _1C != 5) {
_08 = 1.0f;
if (envelopes == nullptr && mState != STATE_Unk5) {
mPhase = 1.0f;
return;
}
if (mState == STATE_ForceStop) {
_04 -= 1.0f;
} else {
if (_1C == 4) {
_04 -= 1.0f;
} else {
_04 -= mData->mRate;
}
calc(v1);
_04 -= mData->mRate;
}
calc(envelopes);
}
/**
@ -126,10 +114,11 @@ void JASOscillator::incCounter()
*/
f32 JASOscillator::getValue() const
{
if (_1C == 0) {
if (mState == STATE_Stop) {
return 1.0f;
}
return _08 * mData->mWidth + mData->mVertex;
return mPhase * mData->mWidth + mData->mVertex;
}
/**
@ -147,38 +136,41 @@ void JASOscillator::forceStop()
*/
bool JASOscillator::release()
{
f32 temp_f31;
if ((u8)_1C == 4) {
if (mState == STATE_ForceStop) {
return false;
}
mData = mData;
if ((u32)mData->mAttack != (u32)mData->mRelease) {
_18 = 0;
_04 = 0.0f;
_0C = _08;
if (mData->mAttack != mData->mRelease) {
mCurrEnvelopeID = 0;
_04 = 0.0f;
mTargetPhase = mPhase;
}
if (((u32)mData->mRelease == 0) && ((u16)mRelease == 0)) {
mRelease = 0x10;
if (!mData->mRelease && mRelease == 0) {
mRelease = 16;
}
if ((u16)mRelease != 0) {
_1C = 5;
_1D = (u8)((mRelease >> 0xE) & 3);
temp_f31 = (f32)(mRelease & 0x3FFF);
if (mRelease != 0) {
mState = STATE_Unk5;
mEnvelopeMode = (mRelease >> 0xE) & 3;
f32 temp_f31 = (f32)(mRelease & 0x3FFF);
temp_f31 *= ((JASDriver::getDacRate() / 80.0f) / 600.0f);
_04 = temp_f31;
if (_04 < 1.0f) {
_04 = 1.0f;
}
_14 = (f32)_04;
_0C = (f32)0.0f;
if ((u8)_1D == 0) {
_10 = (f32)((_0C - _08) / _04);
_14 = _04;
mTargetPhase = 0.0f;
if (mEnvelopeMode == ENVMODE_Linear) {
_10 = (f32)((mTargetPhase - mPhase) / _04);
} else {
_10 = (f32)(_0C - _08);
_10 = (f32)(mTargetPhase - mPhase);
}
} else {
_1C = 3;
mState = STATE_Release;
}
return true;
}
@ -187,111 +179,117 @@ bool JASOscillator::release()
* @note Address: 0x800A2E90
* @note Size: 0x374
*/
f32 JASOscillator::calc(const s16* p1)
f32 JASOscillator::calc(const s16* envelopes)
{
f32 val31 = 0.0f;
while (_04 <= 0.0f) {
int idx = _18 * 3;
_08 = _0C;
if (_1C == 5) {
_1C = 0;
int idx = mCurrEnvelopeID * 3;
mPhase = mTargetPhase;
if (mState == STATE_Unk5) {
mState = STATE_Stop;
break;
}
int val = p1[idx];
int val2 = p1[idx + 1];
int val3 = p1[idx + 2];
if (val == 13) {
_18 = val3;
int envMode = envelopes[idx];
int envTime = envelopes[idx + 1];
int envValue = envelopes[idx + 2];
// if it's a loop vector, value is ID to loop back to
if (envMode == ENVMODE_Loop) {
mCurrEnvelopeID = envValue;
continue;
}
if (val == 15) {
_1C = 0;
if (envMode == ENVMODE_Stop) {
mState = STATE_Stop;
break;
}
if (val == 14) {
_1C = 2;
return _08 * mData->mWidth + mData->mVertex;
if (envMode == ENVMODE_Hold) {
mState = STATE_Hold;
return mPhase * mData->mWidth + mData->mVertex;
}
_1D = val;
mEnvelopeMode = envMode;
if ((s16)val2 == 0) {
_0C = val3 / SHORT_FLOAT_MAX;
_18++;
if ((s16)envTime == 0) {
mTargetPhase = envValue / SHORT_FLOAT_MAX;
mCurrEnvelopeID++;
continue;
}
_04 = (f32)val2 * ((JASDriver::getDacRate() / 80.0f) / 600.0f);
_14 = _04;
_0C = val3 / SHORT_FLOAT_MAX;
_04 = (f32)envTime * ((JASDriver::getDacRate() / 80.0f) / 600.0f);
_14 = _04;
mTargetPhase = envValue / SHORT_FLOAT_MAX;
if (mEnvelopeMode == ENVMODE_Linear) {
_10 = (mTargetPhase - mPhase) / _04;
if (_1D == 0) {
_10 = (_0C - _08) / _04;
} else {
_10 = _0C - _08;
_10 = mTargetPhase - mPhase;
}
_18++;
mCurrEnvelopeID++;
}
if (mData->mWidth == 0.0f) {
return mData->mVertex;
}
f32 factor; // f2
f32 newPhase;
if (_14 == 0.0) { // yes this is a double. someone forgot an f
factor = _0C;
_08 = _0C;
newPhase = mTargetPhase;
mPhase = mTargetPhase;
} else {
if (_1D == 0 || (val31 = _10) == 0.0f) {
factor = _0C - (_10 * _04);
_08 = factor;
} else if (_1D == 3 || _1D == 1 || _1D == 2) {
const f32* table = nullptr; // r27
switch (_1D) {
case 3:
if (mEnvelopeMode == ENVMODE_Linear || (val31 = _10) == 0.0f) {
newPhase = mTargetPhase - (_10 * _04);
mPhase = newPhase;
} else if (mEnvelopeMode == ENVMODE_SampleCell || mEnvelopeMode == ENVMODE_Square || mEnvelopeMode == ENVMODE_SqRoot) {
const f32* table = nullptr;
switch (mEnvelopeMode) {
case ENVMODE_SampleCell:
table = relTableSampleCell;
break;
case 1:
case ENVMODE_Square:
table = relTableSquare;
break;
case 2:
case ENVMODE_SqRoot:
table = relTableSqRoot;
break;
}
f32 val30;
f32 fIdx;
if (val31 < 0.0f) {
val30 = 16.0f * (1.0f - (_04 / _14));
fIdx = 16.0f * (1.0f - (_04 / _14));
} else {
val30 = 16.0f * (_04 / _14);
fIdx = 16.0f * (_04 / _14);
}
u32 idx = val30;
f32 val4 = val30 - (f32)idx;
u32 idx = fIdx;
f32 prop = fIdx - (f32)idx;
if (idx >= 16) {
idx = 15;
val4 = 1.0f;
prop = 1.0f;
}
f32 valAbs = JMAAbs(val31 * (val4 * (table[idx + 1] - table[idx]) + table[idx]));
f32 valAbs = JMAAbs(val31 * (prop * (table[idx + 1] - table[idx]) + table[idx]));
if (_10 < 0.0f) {
factor = _0C + valAbs;
newPhase = mTargetPhase + valAbs;
} else {
factor = _0C - (_10 - valAbs);
newPhase = mTargetPhase - (_10 - valAbs);
}
_08 = factor;
mPhase = newPhase;
} else {
factor = _0C - val31 * _04;
_08 = factor;
newPhase = mTargetPhase - val31 * _04;
mPhase = newPhase;
}
}
return factor * mData->mWidth + mData->mVertex;
return newPhase * mData->mWidth + mData->mVertex;
}

View File

@ -8,7 +8,7 @@ u8 DirectorBase::sToolMode;
* @note Address: 0x80342EB4
* @note Size: 0x214
*/
DirectorBase::DirectorBase(int tracks, const char*)
DirectorBase::DirectorBase(int numTracks, const char* name)
: JADHioNode(nullptr)
{
mTracks = nullptr;
@ -17,12 +17,12 @@ DirectorBase::DirectorBase(int tracks, const char*)
OSInitMutex(&mMutex2);
mIsBegin = false;
mEnabled = false;
mTrackNum = tracks;
P2ASSERTLINE(24, tracks > 0);
mTracks = new SeqTrackBase*[tracks];
mTrackFlagList = new u8[tracks];
mTrackNum = numTracks;
P2ASSERTLINE(24, numTracks > 0);
mTracks = new SeqTrackBase*[numTracks];
mTrackFlagList = new u8[numTracks];
P2ASSERTLINE(29, mTracks);
for (u8 i = 0; i < tracks; i++) {
for (u8 i = 0; i < numTracks; i++) {
mTracks[i] = nullptr;
mTrackFlagList[i] = false;
}
@ -260,11 +260,11 @@ void SwitcherDirector::doUpdateRequest()
* @note Address: 0x80343848
* @note Size: 0x88
*/
DirectorMgrBase::DirectorMgrBase(u8 type)
DirectorMgrBase::DirectorMgrBase(u8 count)
: JADHioNode("ディレクターマネージャ") // "Director Manager"
{
mDirectors = nullptr;
mDirectorCount = type;
mDirectorCount = count;
P2ASSERTLINE(394, mDirectorCount != 0);
}

View File

@ -575,7 +575,7 @@ PSM::MiddleBossSeq* PikScene::getMiddleBossBgm()
}
name = seq->mBmsFileName;
if ((!strcmp(name, "m_boss.bms") || !strcmp(name, "l_boss.bms")) && seq->getCastType() == 4) {
if ((!strcmp(name, "m_boss.bms") || !strcmp(name, "l_boss.bms")) && seq->getCastType() == PSSystem::SeqBase::TYPE_JumpBgmSeq) {
return seq;
}
return nullptr;
@ -598,7 +598,7 @@ PSSystem::Scene* PikSceneMgr::newAndSetGlobalScene()
{
JUT_ASSERTLINE(1002, !mScenes, "2重にグローバルシーンを作成しようとした"); // 'I tried to create a global scene twice'
SceneInfo info;
info.mSceneType = 0;
info.mSceneType = SceneInfo::SCENE_NULL;
info.mCameras = 0;
info.setStageFlag(SceneInfo::SCENEFLAG_Unk0, SceneInfo::SFBS_1);
@ -614,18 +614,18 @@ PSSystem::Scene* PikSceneMgr::newAndSetGlobalScene()
P2ASSERTLINE(1028, PSSystem::SingletonBase<PSSystem::SeqDataList>::getInstance()->onlyLoad("/user/Totaka/BgmList.txt",
JKRDvdRipper::ALLOC_DIR_TOP));
JAInter::SoundInfo sound = { 0x00001f00, 255, 0, 0, 0x3F800000, 0x7f000000 };
P2ASSERTLINE(1040, sound.mVolume.c <= 0x7f);
PSSystem::SeSeq* seq = new PSSystem::SeSeq("se.bms", sound);
P2ASSERTLINE(1043, seq);
seq->init();
mScenes->appendSeq(seq);
JAInter::SoundInfo seInfo = { 0x00001F00, 255, 0, 0, 0x3F800000, 0x7f000000 };
P2ASSERTLINE(1040, seInfo.mVolume.c <= 127);
PSSystem::SeSeq* seSeq = new PSSystem::SeSeq("se.bms", seInfo);
P2ASSERTLINE(1043, seSeq);
seSeq->init();
mScenes->appendSeq(seSeq);
JAInter::SoundInfo sound2 = { 0x00000000, 0x7F, 1, 0, 0x3F800000, 0x32000000 };
PSSystem::BgmSeq* seq2 = newStreamBgm(0xc0011011, sound2);
P2ASSERTLINE(1061, seq2);
seq2->init();
mScenes->appendSeq(seq2);
JAInter::SoundInfo bgmInfo = { 0x00000000, 0x7F, 1, 0, 0x3F800000, 0x32000000 };
PSSystem::BgmSeq* bgmSeq = newStreamBgm(P2_STREAM_SOUND_ID(PSSTR_OPTION), bgmInfo);
P2ASSERTLINE(1061, bgmSeq);
bgmSeq->init();
mScenes->appendSeq(bgmSeq);
return mScenes;
}
@ -637,11 +637,11 @@ PSSystem::Scene* PikSceneMgr::newAndSetCurrentScene(SceneInfo& info)
{
u8 sceneType = info.getSceneType();
P2ASSERTLINE(1093, sceneType != SceneInfo::SCENE_NULL);
JUT_ASSERTLINE(1094, sceneType < SceneInfo::SCENE_COUNT, "scene noが不正");
JUT_ASSERTLINE(1094, sceneType < SceneInfo::SCENE_COUNT, "scene noが不正"); // 'scene no is invalid'
checkScene();
JUT_ASSERTLINE(1095, !mScenes->mChild, "前回のmCurrentSceneの後処理が不正");
JUT_ASSERTLINE(1095, !mScenes->mChild, "前回のmCurrentSceneの後処理が不正"); // 'previous mCurrentScene post-processing is invalid
info.setStageCamera();
@ -724,14 +724,15 @@ PSSystem::BgmSeq* PikSceneMgr::newStreamBgm(u32 id, JAInter::SoundInfo& info)
*/
PSSystem::BgmSeq* PikSceneMgr::initBossBgm(SceneInfo& info, u8* wScene)
{
JAInter::SoundInfo sound = { 0x00000000, 0x7F, 0x02, 0, 0x3F800000, 0x28000000 };
JAInter::SoundInfo soundInfo = { 0x00000000, 127, 2, 0, 0x3F800000, 0x28000000 };
PSSystem::DirectedBgm* seq;
if (curSceneIsBigBossFloor()) {
seq = (PSSystem::DirectedBgm*)newDirectedBgm("l_boss.bms", sound);
seq = (PSSystem::DirectedBgm*)newDirectedBgm("l_boss.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE35_TitanDweevil;
} else {
seq = (PSSystem::DirectedBgm*)newDirectedBgm("m_boss.bms", sound);
seq = (PSSystem::DirectedBgm*)newDirectedBgm("m_boss.bms", soundInfo);
}
P2ASSERTLINE(1264, seq);
@ -739,7 +740,7 @@ PSSystem::BgmSeq* PikSceneMgr::initBossBgm(SceneInfo& info, u8* wScene)
seq->assertValidTrack();
seq->mRootTrack->mBeatInterval = 60;
P2ASSERTLINE(1267, sound.mVolume.c <= 0x7f);
P2ASSERTLINE(1267, soundInfo.mVolume.c <= 127);
return seq;
}
@ -749,35 +750,37 @@ PSSystem::BgmSeq* PikSceneMgr::initBossBgm(SceneInfo& info, u8* wScene)
*/
void PikSceneMgr::initAdditionalBgm(SceneInfo& info, PSSystem::Scene* scene)
{
JAInter::SoundInfo sound = { 0x00000000, 0x7F, 0x01, 0, 0x3F800000, 0x32000000 };
JAInter::SoundInfo soundInfo = { 0x00000000, 0x7F, 0x01, 0, 0x3F800000, 0x32000000 };
PSSystem::BgmSeq* seq;
switch (info.mSceneType) {
case SceneInfo::TITLE_SCREEN:
seq = newStreamBgm(0xc0011011, sound);
seq = newStreamBgm(P2_STREAM_SOUND_ID(PSSTR_OPTION), soundInfo);
P2ASSERTLINE(1290, seq);
scene->appendSeq(seq);
seq = newBgmSeq("hiscore.bms", sound);
seq = newBgmSeq("hiscore.bms", soundInfo);
P2ASSERTLINE(1296, seq);
scene->appendSeq(seq);
seq = newStreamBgm(0xc0011010, sound);
seq = newStreamBgm(P2_STREAM_SOUND_ID(PSSTR_OMAKE), soundInfo);
P2ASSERTLINE(1302, seq);
scene->appendSeq(seq);
break;
case SceneInfo::COURSE_TUTORIALDAY1:
seq = newBgmSeq("n_tutorial_1stday.bms", sound);
seq = newBgmSeq("n_tutorial_1stday.bms", soundInfo);
P2ASSERTLINE(1318, seq);
scene->appendSeq(seq);
break;
case SceneInfo::CHALLENGE_MODE:
sound._05 = 0x04;
sound.mVolume.c = 0x23;
sound.mFlag = 0x1f00;
soundInfo._05 = 4;
soundInfo.mVolume.c = 35;
soundInfo.mFlag = 0x1F00;
JADUtility::AccessMode flag = (JADUtility::AccessMode)mAccessMode;
PSSystem::DirectedBgm* seqold = (PSSystem::DirectedBgm*)scene->mSeqMgr.getFirstSeq();
seq = newAutoBgm("cavekeyget.cnd", "cavekeyget.bms", sound, flag, info, seqold->mDirectorMgr);
seq = newAutoBgm("cavekeyget.cnd", "cavekeyget.bms", soundInfo, flag, info, seqold->mDirectorMgr);
scene->appendSeq(seq);
scene->setSecondaryWaveScene(PSSystem::WaveScene::WSCENE5_Challenge_KeyGet);
P2ASSERTLINE(1342, seq == scene->mSeqMgr.getSeq(2));
@ -787,7 +790,7 @@ void PikSceneMgr::initAdditionalBgm(SceneInfo& info, PSSystem::Scene* scene)
// Check for submerged castle theme
if (info.isCaveFloor() && info.mSceneType == SceneInfo::COURSE_YAKUSHIMA) {
if (static_cast<CaveFloorInfo&>(info).getCaveNoFromID() == 3 && !static_cast<CaveFloorInfo&>(info).isBossFloor()) {
seq = newBgmSeq("kuro_post.bms", sound);
seq = newBgmSeq("kuro_post.bms", soundInfo);
P2ASSERTLINE(1353, seq);
scene->appendSeq(seq);
}
@ -804,13 +807,14 @@ PSSystem::BgmSeq* PikSceneMgr::initMainBgm(SceneInfo& info, u8* wScene)
JADUtility::AccessMode mode = (JADUtility::AccessMode)mAccessMode;
PSSystem::BgmSeq* bgm = nullptr;
JAInter::SoundInfo sound = { 0x00001f00, 0x7F, 0xFF, 0, 0x3F800000, 0x32000000 };
sound._05 = 1;
JAInter::SoundInfo soundInfo = { 0x1F00, 127, 255, 0, 0x3F800000, 0x32000000 };
soundInfo._05 = 1;
CaveFloorInfo& cinfo = static_cast<CaveFloorInfo&>(info);
P2ASSERTLINE(1393, sound._05 < 5);
P2ASSERTLINE(1393, soundInfo._05 < 5);
if (info.isCaveFloor()) {
// we're in a 'cave' (story mode cave, 2P battle, vs or challenge mode)
switch (info.mSceneType) {
case SceneInfo::CHALLENGE_MODE:
const char* path = "/user/Totaka/ChallengeBgmList.txt";
@ -825,24 +829,25 @@ PSSystem::BgmSeq* PikSceneMgr::initMainBgm(SceneInfo& info, u8* wScene)
char* bmsName;
list->getSeqAndWaveFromConductor(name, &wScene2, &bmsName);
*wScene = wScene2;
bgm = newAutoBgm(name, bmsName, sound, (JADUtility::AccessMode)mode, info, nullptr);
bgm = newAutoBgm(name, bmsName, soundInfo, (JADUtility::AccessMode)mode, info, nullptr);
delete PSSystem::SingletonBase<ConductorList>::sInstance;
PSSystem::SingletonBase<ConductorList>::sInstance = nullptr;
break;
case SceneInfo::TWO_PLAYER_BATTLE:
bgm = newDirectedBgm("battle_t.bms", sound);
bgm = newDirectedBgm("battle_t.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE6_2P_Battle;
break;
}
if (!bgm) {
switch (cinfo.mBetaType) {
case 1: // Floor without music for bosses, apparently it loads caveconc_00 by default
bgm = newAutoBgm("caveconc_00_0.cnd", "caveconc.bms", sound, (JADUtility::AccessMode)mode, info, nullptr);
case CaveFloorInfo::BetaType_Boss: // Floor without music for bosses, apparently it loads caveconc_00 by default
bgm = newAutoBgm("caveconc_00_0.cnd", "caveconc.bms", soundInfo, (JADUtility::AccessMode)mode, info, nullptr);
break;
case 2:
bgm = newAutoBgm("caverelax.cnd", "caverelax.bms", sound, (JADUtility::AccessMode)mode, info, nullptr);
case CaveFloorInfo::BetaType_Relax: // Rest floor, load rest/relax music
bgm = newAutoBgm("caverelax.cnd", "caverelax.bms", soundInfo, (JADUtility::AccessMode)mode, info, nullptr);
*wScene = PSSystem::WaveScene::WSCENE28_CaveRestFloor;
break;
}
@ -850,8 +855,8 @@ PSSystem::BgmSeq* PikSceneMgr::initMainBgm(SceneInfo& info, u8* wScene)
// Check for submerged castle theme
if (info.isCaveFloor() && info.mSceneType == SceneInfo::COURSE_YAKUSHIMA) {
if (cinfo.getCaveNoFromID() == 3 && !cinfo.isBossFloor()) {
bgm = newBgmSeq("kuro_pre.bms", sound);
if (cinfo.getCaveNoFromID() == 3 && !cinfo.isBossFloor()) { // cave is submerged castle + not sublevel 5
bgm = newBgmSeq("kuro_pre.bms", soundInfo); // cue spooky music
P2ASSERTLINE(1566, bgm);
*wScene = PSSystem::WaveScene::WSCENE48_SubmergedCastle;
}
@ -879,6 +884,7 @@ PSSystem::BgmSeq* PikSceneMgr::initMainBgm(SceneInfo& info, u8* wScene)
txtpath = "/user/Totaka/BgmList_BgmTest.txt";
break;
}
PSSystem::SingletonBase<PSGame::ConductorList>::newHeapInstance();
ConductorList* list = PSSystem::SingletonBase<PSGame::ConductorList>::getInstance();
bool loaded = list->load(txtpath, JKRDvdRipper::ALLOC_DIR_BOTTOM);
@ -889,74 +895,96 @@ PSSystem::BgmSeq* PikSceneMgr::initMainBgm(SceneInfo& info, u8* wScene)
char* bmsName;
list->getSeqAndWaveFromConductor(name, &wScene2, &bmsName);
*wScene = wScene2;
bgm = newAutoBgm(name, bmsName, sound, (JADUtility::AccessMode)mode, info, nullptr);
bgm = newAutoBgm(name, bmsName, soundInfo, (JADUtility::AccessMode)mode, info, nullptr);
delete PSSystem::SingletonBase<ConductorList>::sInstance;
PSSystem::SingletonBase<ConductorList>::sInstance = nullptr;
}
} else {
// we're in story mode overworld, a menu/title/ending, or piklopedia
switch (info.mSceneType) {
// OVERWORLD
case SceneInfo::COURSE_TUTORIAL:
case SceneInfo::COURSE_TUTORIALDAY1:
bgm = newMainBgm("n_tutorial.bms", sound);
bgm = newMainBgm("n_tutorial.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE15_Valley_of_Repose;
break;
case SceneInfo::COURSE_FOREST:
bgm = newMainBgm("forest.bms", sound);
bgm = newMainBgm("forest.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE2_Awakening_Wood;
break;
case SceneInfo::COURSE_YAKUSHIMA:
bgm = newMainBgm("yakushima.bms", sound);
bgm = newMainBgm("yakushima.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE3_Perplexing_Pool;
P2ASSERTLINE(1640, bgm);
static_cast<PSSystem::DirectedBgm*>(bgm)->assertValidTrack();
static_cast<PSSystem::DirectedBgm*>(bgm)->mRootTrack->mBeatInterval = 30;
break;
case SceneInfo::COURSE_LAST:
bgm = newMainBgm("last.bms", sound);
bgm = newMainBgm("last.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE4_Wistful_Wild;
P2ASSERTLINE(1650, bgm);
static_cast<PSSystem::DirectedBgm*>(bgm)->assertValidTrack();
static_cast<PSSystem::DirectedBgm*>(bgm)->mRootTrack->mBeatInterval = 30;
break;
// TITLE
case SceneInfo::TITLE_SCREEN:
bgm = newStreamBgm(0xc0011000, sound);
bgm = newStreamBgm(P2_STREAM_SOUND_ID(PSSTR_TITLE), soundInfo);
*wScene = PSSystem::WaveScene::WSCENE21_HighScores;
break;
// RESULTS
case SceneInfo::CAVE_RESULTS:
bgm = newStreamBgm(0xc0011013, sound);
bgm = newStreamBgm(P2_STREAM_SOUND_ID(PSSTR_U_RESULT), soundInfo);
break;
case SceneInfo::CHALLENGE_RESULTS:
bgm = newStreamBgm(0xc0011014, sound);
bgm = newStreamBgm(P2_STREAM_SOUND_ID(PSSTR_C_RESULT), soundInfo);
break;
// FILE SELECT
case SceneInfo::FILE_SELECT:
bgm = newStreamBgm(0xc001101e, sound);
bgm = newStreamBgm(P2_STREAM_SOUND_ID(PSSTR_FILE_SELECT), soundInfo);
break;
// MAP
case SceneInfo::WORLD_MAP_NORMAL:
bgm = newBgmSeq("worldmap.bms", sound);
bgm = newBgmSeq("worldmap.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE16_WorldMap;
break;
case SceneInfo::WORLD_MAP_NEWLEVEL:
bgm = newBgmSeq("worldmap_intro.bms", sound);
bgm = newBgmSeq("worldmap_intro.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE16_WorldMap;
break;
// CM MENU
case SceneInfo::CHALLENGE_MENU:
bgm = newBgmSeq("c_menu.bms", sound);
bgm = newBgmSeq("c_menu.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE20_ChallengeSelect;
break;
// PIKLOPEDIA
case SceneInfo::PIKLOPEDIA:
bgm = newBgmSeq("book.bms", sound);
bgm = newBgmSeq("book.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE36_Piklopedia;
break;
// ENDINGS
case SceneInfo::ENDING_COMPLETE:
bgm = newBgmSeq("comp_result.bms", sound);
bgm = newBgmSeq("comp_result.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE19_Final_Result;
break;
case SceneInfo::ENDING_DEBTRESULT:
bgm = newBgmSeq("f_result.bms", sound);
bgm = newBgmSeq("f_result.bms", soundInfo);
*wScene = PSSystem::WaveScene::WSCENE19_Final_Result;
break;
// VS MENU
case SceneInfo::VERSUS_MENU:
bgm = newStreamBgm(0xc001100f, sound);
bgm = newStreamBgm(P2_STREAM_SOUND_ID(PSSTR_VS_MENU), soundInfo);
break;
default:
JUT_PANICLINE(1745, "P2Assert");
@ -964,7 +992,7 @@ PSSystem::BgmSeq* PikSceneMgr::initMainBgm(SceneInfo& info, u8* wScene)
}
P2ASSERTLINE(1749, bgm);
P2ASSERTLINE(1750, sound.mVolume.c <= 127);
P2ASSERTLINE(1750, soundInfo.mVolume.c <= 127);
return bgm;
/*
@ -2156,17 +2184,21 @@ u16 seqCpuSync(JASTrack* track, u16 command)
switch (command) {
case 0x4000:
P2ASSERTLINE(2085, seq->getCastType() == 4);
P2ASSERTLINE(2085, seq->getCastType() == PSSystem::SeqBase::TYPE_JumpBgmSeq);
return static_cast<PSSystem::JumpBgmSeq*>(seq)->getSeqStartPoint();
case 0x4001:
P2ASSERTLINE(2095, seq->getCastType() == 4);
P2ASSERTLINE(2095, seq->getCastType() == PSSystem::SeqBase::TYPE_JumpBgmSeq);
return static_cast<PSSystem::JumpBgmSeq*>(seq)->outputJumpRequest();
case 0xe00:
P2ASSERTBOOLLINE(2107, seq->getCastType() == 2 || seq->getCastType() == 4 || seq->getCastType() == 3);
P2ASSERTBOOLLINE(2107, seq->getCastType() == PSSystem::SeqBase::TYPE_DirectedBgm
|| seq->getCastType() == PSSystem::SeqBase::TYPE_JumpBgmSeq
|| seq->getCastType() == PSSystem::SeqBase::TYPE_AutoBgm);
static_cast<PSSystem::DirectedBgm*>(seq)->initRootTrack_onPlaying(track);
return 0;
case 0xf00:
P2ASSERTBOOLLINE(2117, seq->getCastType() == 2 || seq->getCastType() == 4 || seq->getCastType() == 3);
P2ASSERTBOOLLINE(2117, seq->getCastType() == PSSystem::SeqBase::TYPE_DirectedBgm
|| seq->getCastType() == PSSystem::SeqBase::TYPE_JumpBgmSeq
|| seq->getCastType() == PSSystem::SeqBase::TYPE_AutoBgm);
static_cast<PSSystem::DirectedBgm*>(seq)->initChildTrack_onPlaying(track, track->_348 & 0xf);
return 0;
case 0x600:
@ -2975,7 +3007,9 @@ PSSystem::DirectedBgm* PSGetDirectedMainBgm()
}
PSSystem::DirectedBgm* seq = (PSSystem::DirectedBgm*)scene->mSeqMgr.getFirstSeq();
if (seq && (seq->getCastType() == 2 || seq->getCastType() == 3 || seq->getCastType() == 4)) {
if (seq
&& (seq->getCastType() == PSSystem::SeqBase::TYPE_DirectedBgm || seq->getCastType() == PSSystem::SeqBase::TYPE_AutoBgm
|| seq->getCastType() == PSSystem::SeqBase::TYPE_JumpBgmSeq)) {
return seq;
}
return nullptr;

View File

@ -1174,7 +1174,7 @@ void StreamBgm::startSeq()
OSUnlockMutex(&mMutex);
P2ASSERTLINE(704, mJaiSound);
P2ASSERTLINE(705, mId == mJaiSound->mSoundID);
if (mId == 0xc001101f) {
if (mId == P2_STREAM_SOUND_ID(PSSTR_PIKMIN_GREET)) {
(*getHandleP())->setVolume(1.0f, 0, SOUNDPARAM_Unk8);
(*getHandleP())->setVolume(0.8f, 0, SOUNDPARAM_Unk3);
} else {

View File

@ -262,8 +262,8 @@ bool PelletGoalState::checkMovie(Pellet* pelt)
playData->isDemoFlag(DEMO_First_Spicy_Spray_Made);
int dope0 = playData->getDopeFruitCount(type);
playData->addDopeFruit(type);
playData->getDopeFruitCount(0);
playData->getDopeFruitCount(1);
playData->getDopeFruitCount(SPRAY_TYPE_SPICY);
playData->getDopeFruitCount(SPRAY_TYPE_BITTER);
if (!playData->isDemoFlag(DEMO_First_Spicy_Berry)) {
playData->setDemoFlag(DEMO_First_Spicy_Berry);
gameSystem->mSection->setDraw2DCreature(pelt);
@ -278,7 +278,7 @@ bool PelletGoalState::checkMovie(Pellet* pelt)
if (dope0 + 1 >= _aiConstants->mDopeCount.mData) {
playData->setDemoFlag(DEMO_First_Spicy_Spray_Made);
BaseItem* item = ItemHoney::mgr->birth();
ItemHoney::InitArg arg(1, 1);
ItemHoney::InitArg arg(HONEY_R, true);
item->init(&arg);
Vector3f pos(0.0f, FLOAT_DIST_MAX, 0.0f);
item->setPosition(pos, false);
@ -301,8 +301,8 @@ bool PelletGoalState::checkMovie(Pellet* pelt)
playData->isDemoFlag(DEMO_First_Bitter_Spray_Made);
int dope0 = playData->getDopeFruitCount(type);
playData->addDopeFruit(type);
playData->getDopeFruitCount(0);
playData->getDopeFruitCount(1);
playData->getDopeFruitCount(SPRAY_TYPE_SPICY);
playData->getDopeFruitCount(SPRAY_TYPE_BITTER);
if (!playData->isDemoFlag(DEMO_First_Bitter_Berry)) {
playData->setDemoFlag(DEMO_First_Bitter_Berry);
gameSystem->mSection->setDraw2DCreature(pelt);
@ -316,7 +316,7 @@ bool PelletGoalState::checkMovie(Pellet* pelt)
if (dope0 + 1 >= _aiConstants->mDopeCount.mData) {
playData->setDemoFlag(DEMO_First_Bitter_Spray_Made);
BaseItem* item = ItemHoney::mgr->birth();
ItemHoney::InitArg arg(2, 1);
ItemHoney::InitArg arg(HONEY_B, true);
item->init(&arg);
Vector3f pos(0.0f, FLOAT_DIST_MAX, 0.0f);
item->setPosition(pos, false);
@ -351,9 +351,9 @@ bool PelletGoalState::checkMovie(Pellet* pelt)
MoviePlayArg moviearg("s17_suck_equipment", const_cast<char*>(section->getCurrentCourseInfo()->mName),
section->mMovieFinishCallback, 0);
moviearg.mPelletName = pelt->mConfig->mParams.mName.mData;
moviearg.mStreamID = 0xc001100b;
moviearg.mStreamID = P2_STREAM_SOUND_ID(PSSTR_EQUIP_GET);
if (pelt->mConfig->mParams.mIndex >= 8) {
moviearg.mStreamID = 0xc001100a;
moviearg.mStreamID = P2_STREAM_SOUND_ID(PSSTR_POWERUP_GET);
}
moviePlayer->play(moviearg);
doPlay = true;
@ -379,6 +379,7 @@ bool PelletGoalState::checkMovie(Pellet* pelt)
moviearg.mPelletName = pelt->mConfig->mParams.mName.mData;
moviePlayer->play(moviearg);
doPlay = true;
} else if (pelt->getKind() == PELTYPE_UPGRADE) {
// Upgrade carried to the cave pod
gameSystem->mSection->setDraw2DCreature(pelt);
@ -388,12 +389,13 @@ bool PelletGoalState::checkMovie(Pellet* pelt)
moviearg.mDelegateStart = section->mMovieStartCallback;
moviearg.mOrigin = mOnyon->getPosition();
moviearg.mAngle = mOnyon->getFaceDir();
moviearg.mStreamID = 0xc001100b;
moviearg.mStreamID = P2_STREAM_SOUND_ID(PSSTR_EQUIP_GET);
if (pelt->mConfig->mParams.mIndex >= 8) {
moviearg.mStreamID = 0xc001100a;
moviearg.mStreamID = P2_STREAM_SOUND_ID(PSSTR_POWERUP_GET);
}
moviePlayer->play(moviearg);
doPlay = true;
} else if (pelt->getKind() == PELTYPE_CARCASS && pelt->mPelletFlag != Pellet::FLAG_NAVI_NAPSACK
&& !playData->isDemoFlag(DEMO_First_Corpse_In_Cave)) {
// first corpse collected in cave

View File

@ -117,12 +117,13 @@ void DayEndState::exec(SingleGameSection* game)
}
if (numTreasures == 0) {
arg.mStreamID = 0xC0011004;
arg.mStreamID = P2_STREAM_SOUND_ID(PSSTR_DAYEND_B); // bad day end
} else if (numTreasures <= 14) {
arg.mStreamID = 0xC0011002;
arg.mStreamID = P2_STREAM_SOUND_ID(PSSTR_DAYEND_N); // normal day end
} else {
arg.mStreamID = 0xC0011003;
arg.mStreamID = P2_STREAM_SOUND_ID(PSSTR_DAYEND_G); // good day end
}
JUT_ASSERTLINE(222, naviMgr->getAliveOrima(ALIVEORIMA_Active), "no alive:s01_dayend");
Navi* navi = naviMgr->getActiveNavi();
int id = 0;

View File

@ -82,13 +82,13 @@ void ObjPayDept::doCreate(JKRArchive* arc)
switch (disp->mPayDeptType) {
case DispPayDept::PAYDEPT_Percent:
PSStart2DStream(0xc0011021);
PSStart2DStream(P2_STREAM_SOUND_ID(PSSTR_PAY_NOT_ENOUGH));
break;
case DispPayDept::PAYDEPT_DebtPayed:
PSStart2DStream(0xc0011020);
PSStart2DStream(P2_STREAM_SOUND_ID(PSSTR_PAY_COMPLETE));
break;
case DispPayDept::PAYDEPT_Complete:
PSStart2DStream(0xc0011020);
PSStart2DStream(P2_STREAM_SOUND_ID(PSSTR_PAY_COMPLETE));
break;
}
}
@ -104,7 +104,7 @@ bool ObjPayDept::doUpdateFadein()
}
DispPayDept* disp = static_cast<DispPayDept*>(getDispMember());
u32 soundID = -1;
u32 soundID = PSSE_NULL;
switch (disp->mPayDeptType) {
case DispPayDept::PAYDEPT_Percent:
soundID = PSSE_PAY_COME;
@ -117,7 +117,7 @@ bool ObjPayDept::doUpdateFadein()
break;
}
if (soundID != -1) {
if (soundID != PSSE_NULL) {
PSSystem::spSysIF->playSystemSe(soundID, 0);
}
return true;

View File

@ -27,7 +27,7 @@ bool ObjReadyGo::doUpdateFadein()
DispReadyGo* disp = static_cast<DispReadyGo*>(getDispMember());
if (disp->mGameType == 0) {
if (disp->mGameType == DispReadyGo::TYPE_2PBattle) {
PSSystem::spSysIF->playSystemSe(PSSE_READYGO_BATTLE_COME, 0);
} else {
PSSystem::spSysIF->playSystemSe(PSSE_READYGO_CHALLENGE_COME, 0);
@ -70,10 +70,10 @@ void ObjReadyGo::doCreate(JKRArchive* arc)
getOwner()->setColorBG(0, 0, 0, 160);
if (disp->mGameType == 0) {
PSStart2DStream(0xc0011022);
if (disp->mGameType == DispReadyGo::TYPE_2PBattle) {
PSStart2DStream(P2_STREAM_SOUND_ID(PSSTR_READY_GO_2P));
} else {
PSStart2DStream(0xc0011023);
PSStart2DStream(P2_STREAM_SOUND_ID(PSSTR_READY_GO_CHALLENGE));
}
}
@ -166,7 +166,7 @@ bool ObjReadyGo::updateAnimation()
getPaneCenterY(mScreen[i]->search('NALL')) + msVal.mEfxOffsetY);
efx2d::Arg arg = vec;
if (disp->mGameType == 0) {
if (disp->mGameType == DispReadyGo::TYPE_2PBattle) {
efx2d::T2DGoBatl efx;
efx.create(&arg);
} else {

View File

@ -168,18 +168,18 @@ void SceneWinLoseReason::doCreateObj(JKRArchive* arc)
int streamID;
if (!(flag & 3)) {
if (flag & 0x20) {
streamID = 0xc001103d; // olimar win via louie dies
streamID = P2_STREAM_SOUND_ID(PSSTR_VS_PDOWN_WIN_ORI); // olimar win via louie dies
} else {
streamID = 0xc0011040; // olimar wins via extinct
streamID = P2_STREAM_SOUND_ID(PSSTR_VS_PIK_WIN_ORI); // olimar wins via extinct
}
} else if (!(flag & 0x30)) {
if (flag & 0x2) {
streamID = 0xc001103e; // louie win via olimar dies
streamID = P2_STREAM_SOUND_ID(PSSTR_VS_PDOWN_WIN_LUI); // louie win via olimar dies
} else {
streamID = 0xc0011041; // louie win via extinct
streamID = P2_STREAM_SOUND_ID(PSSTR_VS_PIK_WIN_LUI); // louie win via extinct
}
} else {
streamID = 0xc0011045; // draw
streamID = P2_STREAM_SOUND_ID(PSSTR_VS_BEE_DROW); // draw
}
PSStart2DStream(streamID);

View File

@ -241,7 +241,7 @@ void Game2DMgr::open_GameChallenge2P(og::Screen::DispMemberChallenge2P& disp, in
kh::Screen::DispReadyGo disp2;
disp2.mIs2Player = true;
disp2.mIsFinalFloor = true;
disp2.mGameType = 1;
disp2.mGameType = kh::Screen::DispReadyGo::TYPE_Challenge;
SetSceneArg arg2(SCENE_READY_GO, &disp2);
if (mScreenMgr->setScene(arg2)) {
mScreenMgr->startScene(nullptr);
@ -251,7 +251,7 @@ void Game2DMgr::open_GameChallenge2P(og::Screen::DispMemberChallenge2P& disp, in
if (mScreenMgr->setScene(arg)) {
kh::Screen::DispReadyGo disp2;
disp2.mIs2Player = true;
disp2.mGameType = 1;
disp2.mGameType = kh::Screen::DispReadyGo::TYPE_Challenge;
SetSceneArg arg2(SCENE_READY_GO, &disp2);
if (mScreenMgr->setScene(arg2)) {
mScreenMgr->startScene(nullptr);
@ -286,7 +286,7 @@ void Game2DMgr::open_GameChallenge1P(og::Screen::DispMemberChallenge1P& disp, in
if (mScreenMgr->setScene(arg)) {
kh::Screen::DispReadyGo disp2;
disp2.mIsFinalFloor = true;
disp2.mGameType = 1;
disp2.mGameType = kh::Screen::DispReadyGo::TYPE_Challenge;
SetSceneArg arg2(SCENE_READY_GO, &disp2);
if (mScreenMgr->setScene(arg2)) {
mScreenMgr->startScene(nullptr);
@ -295,7 +295,7 @@ void Game2DMgr::open_GameChallenge1P(og::Screen::DispMemberChallenge1P& disp, in
} else if (type == 1) {
if (mScreenMgr->setScene(arg)) {
kh::Screen::DispReadyGo disp2;
disp2.mGameType = 1;
disp2.mGameType = kh::Screen::DispReadyGo::TYPE_Challenge;
SetSceneArg arg2(SCENE_READY_GO, &disp2);
if (mScreenMgr->setScene(arg2)) {
mScreenMgr->startScene(nullptr);

View File

@ -273,7 +273,7 @@ void Sound::stopSound()
*/
void Sound::setVsWin1P()
{
PSStart2DStream(0xc0011043);
PSStart2DStream(P2_STREAM_SOUND_ID(PSSTR_VS_BEE_WIN_ORI));
PSSystem::SceneMgr* mgr = PSSystem::getSceneMgr();
PSSystem::checkSceneMgr(mgr);
@ -288,7 +288,7 @@ void Sound::setVsWin1P()
*/
void Sound::setVsWin2P()
{
PSStart2DStream(0xc0011044);
PSStart2DStream(P2_STREAM_SOUND_ID(PSSTR_VS_BEE_WIN_LUI));
PSSystem::SceneMgr* mgr = PSSystem::getSceneMgr();
PSSystem::checkSceneMgr(mgr);
@ -303,7 +303,7 @@ void Sound::setVsWin2P()
*/
void Sound::setVsDraw()
{
PSStart2DStream(0xc0011045);
PSStart2DStream(P2_STREAM_SOUND_ID(PSSTR_VS_BEE_DROW));
PSSystem::SceneMgr* mgr = PSSystem::getSceneMgr();
PSSystem::checkSceneMgr(mgr);

View File

@ -1440,7 +1440,7 @@ void BootSection::updateLoadResourceFirst()
PSSystem::checkSceneMgr(mgr);
PSM::Scene_Global* scene = static_cast<PSM::Scene_Global*>(mgr->mScenes);
P2ASSERTLINE(1723, scene);
scene->startGlobalStream(0xc001101f);
scene->startGlobalStream(P2_STREAM_SOUND_ID(PSSTR_PIKMIN_GREET));
#endif
setMode(SID_LOAD_MEMORY_CARD);
}

View File

@ -191,7 +191,7 @@ void Demo::demo1stLoadSync()
void Demo::initDemoScene(PSM::DemoArg& arg, PSM::Scene_Demo* scene)
{
if (!strcmp(arg.mName, "s21_dayend_takeoff")) {
scene->mGate = 1;
scene->mGate = true;
}
}
@ -203,158 +203,158 @@ PSSystem::BgmSeq* Demo::initiate(DemoArg demoArg, u8* unk)
{
PSSystem::BgmSeq* seq;
u32 AST_ID;
char buffer[32];
JAInter::SoundInfo audio_info = { 0x00000000, 0x7F, 0x03, 0, 0x3F800000, 0x3C000000 };
char bmsFilePath[32];
JAInter::SoundInfo audio_info = { 0, 127, 3, 0, 0x3F800000, 0x3C000000 };
seq = nullptr;
buffer[0] = '\0';
AST_ID = -1;
seq = nullptr;
bmsFilePath[0] = '\0';
AST_ID = PSSE_NULL;
DemoInitiator init = DemoInitiator(unk, demoArg.mName, AST_ID, buffer);
DemoInitiator init = DemoInitiator(unk, demoArg.mName, AST_ID, bmsFilePath);
init.setDefaultValues();
init.setDefault("s02_dayend_result", 0xc0011012);
init.setDefault("s02_dayend_result", P2_STREAM_SOUND_ID(PSSTR_RESULT));
init.setDefault("s01_dayend", demoArg.mBgmID);
init.setDefault("s03_orimadown", 0xc0011005);
init.setDefault("s05_pikminzero", 0xc0011006);
init.setDefault("s11_dope_first_b", 0xc0011001);
init.setDefault("s11_dope_first_r", 0xc0011001);
init.setDefault("s11_dopebin_first_b", 0xc0011008);
init.setDefault("s11_dopebin_first_r", 0xc0011008);
init.setDefault("s03_orimadown", P2_STREAM_SOUND_ID(PSSTR_PLAYERDOWN));
init.setDefault("s05_pikminzero", P2_STREAM_SOUND_ID(PSSTR_ANNIHI));
init.setDefault("s11_dope_first_b", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GET));
init.setDefault("s11_dope_first_r", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GET));
init.setDefault("s11_dopebin_first_b", P2_STREAM_SOUND_ID(PSSTR_DOPING));
init.setDefault("s11_dopebin_first_r", P2_STREAM_SOUND_ID(PSSTR_DOPING));
if (!streq("s01_dayend", init.mName)) {
bool is_key = demoArg.mCameraName && streq(demoArg.mCameraName, "key");
init.setDefault("s17_suck_equipment", demoArg.mBgmID, !is_key);
init.setDefault("s17_suck_equipment", 0xc0011007, is_key);
init.setDefault("s17_suck_equipment", P2_STREAM_SOUND_ID(PSSTR_KEYGET), is_key);
init.setDefault("s22_cv_suck_equipment", demoArg.mBgmID, !is_key);
init.setDefault("s22_cv_suck_equipment", 0xc0011007, is_key);
init.setDefault("s22_cv_suck_equipment", P2_STREAM_SOUND_ID(PSSTR_KEYGET), is_key);
init.setDefault("s10_suck_treasure", 0xc0011001, !is_key);
init.setDefault("s10_suck_treasure", 0xc0011007, is_key);
init.setDefault("s10_suck_treasure", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GET), !is_key);
init.setDefault("s10_suck_treasure", P2_STREAM_SOUND_ID(PSSTR_KEYGET), is_key);
init.setDefault("s22_cv_suck_treasure", 0xc0011007, is_key);
init.setDefault("s22_cv_suck_treasure", 0xc0011001, !is_key);
init.setDefault("s22_cv_suck_treasure", P2_STREAM_SOUND_ID(PSSTR_KEYGET), is_key);
init.setDefault("s22_cv_suck_treasure", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GET), !is_key);
}
init.setDefault("s04_dayend_orimadown", 0xc001101d);
init.setDefault("s06_dayend_pikminzero", 0xc001101d);
init.setDefault("s04_dayend_orimadown", P2_STREAM_SOUND_ID(PSSTR_ZENMETSU_DAYEND));
init.setDefault("s06_dayend_pikminzero", P2_STREAM_SOUND_ID(PSSTR_ZENMETSU_DAYEND));
init.setDefault("g1A_red_doping", 0xc0011009);
init.setDefault("g1A_red_doping", 0xc0011009);
init.setDefault("g1B_black_doping", 0xc0011047);
init.setDefault("g02_boot_onyonR", 0xc001100c);
init.setDefault("g1E_boot_onyonY", 0xc001100c);
init.setDefault("g20_boot_onyonB", 0xc001100c);
init.setDefault("g03_meet_redpikmin", 0xc001100d);
init.setDefault("g1F_meet_yellowpikmin", 0xc001100d);
init.setDefault("g21_meet_bluepikmin", 0xc001100d);
init.setDefault("g24_meet_blackpikmin", 0xc001100d);
init.setDefault("g27_meet_whitepikmin", 0xc001100d);
init.setDefault("g33_camera_demo", 0xc0011024);
init.setDefault("g1A_red_doping", P2_STREAM_SOUND_ID(PSSTR_DOPED));
init.setDefault("g1A_red_doping", P2_STREAM_SOUND_ID(PSSTR_DOPED));
init.setDefault("g1B_black_doping", P2_STREAM_SOUND_ID(PSSTR_BLACK_DOPING));
init.setDefault("g02_boot_onyonR", P2_STREAM_SOUND_ID(PSSTR_ONYONBOOT));
init.setDefault("g1E_boot_onyonY", P2_STREAM_SOUND_ID(PSSTR_ONYONBOOT));
init.setDefault("g20_boot_onyonB", P2_STREAM_SOUND_ID(PSSTR_ONYONBOOT));
init.setDefault("g03_meet_redpikmin", P2_STREAM_SOUND_ID(PSSTR_PIKMIN_MEET));
init.setDefault("g1F_meet_yellowpikmin", P2_STREAM_SOUND_ID(PSSTR_PIKMIN_MEET));
init.setDefault("g21_meet_bluepikmin", P2_STREAM_SOUND_ID(PSSTR_PIKMIN_MEET));
init.setDefault("g24_meet_blackpikmin", P2_STREAM_SOUND_ID(PSSTR_PIKMIN_MEET));
init.setDefault("g27_meet_whitepikmin", P2_STREAM_SOUND_ID(PSSTR_PIKMIN_MEET));
init.setDefault("g33_camera_demo", P2_STREAM_SOUND_ID(PSSTR_CAMERA_DEMO));
if (PSMGetGameSceneA()->isCave()) {
init.setDefault("s09_holein", 0xc0011046);
init.setDefault("s09_holein", P2_STREAM_SOUND_ID(PSSTR_IN_HOLE_U));
} else {
init.setDefault("s09_holein", 0xc0011026);
init.setDefault("s09_holein", P2_STREAM_SOUND_ID(PSSTR_IN_HOLE));
}
init.setDefault("s16_find_item_00", 0xc0011027);
init.setDefault("s16_find_item_01", 0xc0011027);
init.setDefault("s16_find_item_02", 0xc0011027);
init.setDefault("s16_find_item_03", 0xc0011027);
init.setDefault("s16_find_item_04", 0xc0011027);
init.setDefault("s16_find_item_05", 0xc0011027);
init.setDefault("s16_find_item_06", 0xc0011027);
init.setDefault("s16_find_item_07", 0xc0011027);
init.setDefault("s16_find_item_08", 0xc0011027);
init.setDefault("s16_find_item_09", 0xc0011027);
init.setDefault("s16_find_item_10", 0xc0011027);
init.setDefault("s16_find_item_11", 0xc0011027);
init.setDefault("s16_find_item_12", 0xc0011027);
init.setDefault("s16_find_item_00", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // brute knuckles
init.setDefault("s16_find_item_01", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // dream material
init.setDefault("s16_find_item_02", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // amplified amplifier
init.setDefault("s16_find_item_03", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // professional noisemaker
init.setDefault("s16_find_item_04", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // stellar orb
init.setDefault("s16_find_item_05", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // justice alloy
init.setDefault("s16_find_item_06", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // forged courage
init.setDefault("s16_find_item_07", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // repugnant appendage
init.setDefault("s16_find_item_08", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // prototype detector
init.setDefault("s16_find_item_09", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // five man napsack
init.setDefault("s16_find_item_10", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // spherical atlas
init.setDefault("s16_find_item_11", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // geographic projection
init.setDefault("s16_find_item_12", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD)); // the key
init.setDefault("s0C_cv_escape", 0xc0011028);
init.setDefault("s0C_cv_escape", P2_STREAM_SOUND_ID(PSSTR_OUT_HOLE));
init.setDefault("g01_pick_me", 0xc0011029);
init.setDefault("g01_pick_me", P2_STREAM_SOUND_ID(PSSTR_MYSTERY));
init.setDefault("g04_find_treasure", 0xc0011027);
init.setDefault("g04_find_treasure", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD));
init.setDefault("g05_find_cave_f_01", 0xc0011029);
init.setDefault("g05_find_cave_f_02", 0xc0011029);
init.setDefault("g05_find_cave_f_03", 0xc0011029);
init.setDefault("g05_find_cave_f_04", 0xc0011029);
init.setDefault("g05_find_cave_l_01", 0xc0011029);
init.setDefault("g05_find_cave_l_02", 0xc0011029);
init.setDefault("g05_find_cave_l_03", 0xc0011029);
init.setDefault("g05_find_cave_t_01", 0xc0011029);
init.setDefault("g05_find_cave_t_02", 0xc0011029);
init.setDefault("g05_find_cave_t_03", 0xc0011029);
init.setDefault("g05_find_cave_y_01", 0xc0011029);
init.setDefault("g05_find_cave_y_02", 0xc0011029);
init.setDefault("g05_find_cave_y_03", 0xc0011029);
init.setDefault("g05_find_cave_y_04", 0xc0011029);
init.setDefault("g05_find_cave_f_01", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // hole of beasts
init.setDefault("g05_find_cave_f_02", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // white flower garden
init.setDefault("g05_find_cave_f_03", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // bulblax kingdom
init.setDefault("g05_find_cave_f_04", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // snagret hole
init.setDefault("g05_find_cave_l_01", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // cavern of chaos
init.setDefault("g05_find_cave_l_02", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // hole of heroes
init.setDefault("g05_find_cave_l_03", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // dream den
init.setDefault("g05_find_cave_t_01", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // emergence cave
init.setDefault("g05_find_cave_t_02", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // subterranean complex
init.setDefault("g05_find_cave_t_03", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // frontier cavern
init.setDefault("g05_find_cave_y_01", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // citadel of spiders
init.setDefault("g05_find_cave_y_02", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // gluttons kitchen
init.setDefault("g05_find_cave_y_03", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // shower room
init.setDefault("g05_find_cave_y_04", P2_STREAM_SOUND_ID(PSSTR_MYSTERY)); // submerged castle
init.setDefault("g0A_cv_find_hole", 0xc0011029);
init.setDefault("g0B_cv_find_fountain", 0xc0011029);
init.setDefault("g0A_cv_find_hole", P2_STREAM_SOUND_ID(PSSTR_MYSTERY));
init.setDefault("g0B_cv_find_fountain", P2_STREAM_SOUND_ID(PSSTR_MYSTERY));
init.setDefault("g18_find_gate", 0xc001102a);
init.setDefault("g19_find_rock", 0xc0011029);
init.setDefault("g2D_red_extract", 0xc0011027);
init.setDefault("g2E_black_extract", 0xc0011027);
init.setDefault("g34_yellow_extract", 0xc001102b);
init.setDefault("g37_get_louie", 0xc0011027);
init.setDefault("g38_find_whitepom", 0xc0011029);
init.setDefault("g39_find_blackpom", 0xc0011029);
init.setDefault("g18_find_gate", P2_STREAM_SOUND_ID(PSSTR_GLAD));
init.setDefault("g19_find_rock", P2_STREAM_SOUND_ID(PSSTR_MYSTERY));
init.setDefault("g2D_red_extract", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD));
init.setDefault("g2E_black_extract", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD));
init.setDefault("g34_yellow_extract", P2_STREAM_SOUND_ID(PSSTR_PIKMIN_GLAD));
init.setDefault("g37_get_louie", P2_STREAM_SOUND_ID(PSSTR_TREASURE_GLAD));
init.setDefault("g38_find_whitepom", P2_STREAM_SOUND_ID(PSSTR_MYSTERY));
init.setDefault("g39_find_blackpom", P2_STREAM_SOUND_ID(PSSTR_MYSTERY));
init.setDefault("x01_gamestart", 0xc001102c);
init.setDefault("x02_watch_red_pikmin", 0xc001102d);
init.setDefault("x06_join", 0xc001102e);
init.setDefault("x12_drain_water", 0xc001102a);
init.setDefault("x10_find_yellow_onyon", 0xc001102f);
init.setDefault("x11_find_blue_onyon", 0xc0011030);
init.setDefault("x16_hiba", 0xc0011031);
init.setDefault("x13_exp_leafchappy", 0xc001102a);
init.setDefault("x20_blackman", 0xc0011032);
init.setDefault("x01_gamestart", P2_STREAM_SOUND_ID(PSSTR_START_DEMO_TUTORIAL));
init.setDefault("x02_watch_red_pikmin", P2_STREAM_SOUND_ID(PSSTR_WATCH_PIKMIN));
init.setDefault("x06_join", P2_STREAM_SOUND_ID(PSSTR_JOIN));
init.setDefault("x12_drain_water", P2_STREAM_SOUND_ID(PSSTR_GLAD));
init.setDefault("x10_find_yellow_onyon", P2_STREAM_SOUND_ID(PSSTR_ONYON));
init.setDefault("x11_find_blue_onyon", P2_STREAM_SOUND_ID(PSSTR_BLUE_ONYON));
init.setDefault("x16_hiba", P2_STREAM_SOUND_ID(PSSTR_HIBA));
init.setDefault("x13_exp_leafchappy", P2_STREAM_SOUND_ID(PSSTR_GLAD));
init.setDefault("x20_blackman", P2_STREAM_SOUND_ID(PSSTR_KUROIHITO));
init.setDefault("s13_pikmin_supply", 0xc0011033);
init.setDefault("s0B_cv_coursein", 0xc0011036);
init.setDefault("s0E_return_cave", 0xc0011037);
init.setDefault("s13_pikmin_supply", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("s0B_cv_coursein", P2_STREAM_SOUND_ID(PSSTR_FLOOR_IN));
init.setDefault("s0E_return_cave", P2_STREAM_SOUND_ID(PSSTR_RETURN));
init.setDefault("e00_E3_cavestart", 0xc0011039);
init.setDefault("e00_E3_cavestart", P2_STREAM_SOUND_ID(PSSTR_CHALLENGE_START));
init.setDefault("g07_cv_gamestart", 0xc001103a);
init.setDefault("g08_first_return", 0xc001103b);
init.setDefault("g09_first_sunset", 0xc0011033);
init.setDefault("g16_100_pikmin", 0xc0011033);
init.setDefault("g16_95_pikmin", 0xc0011033);
init.setDefault("g26_inout_black", 0xc001104a);
init.setDefault("g29_inout_white", 0xc0011048);
init.setDefault("g2B_white_poison", 0xc0011031);
init.setDefault("g2C_inout_red", 0xc0011033);
init.setDefault("g36_find_louie", 0xc0011031);
init.setDefault("g07_cv_gamestart", P2_STREAM_SOUND_ID(PSSTR_UNDERGROUND_START));
init.setDefault("g08_first_return", P2_STREAM_SOUND_ID(PSSTR_RETURN_E));
init.setDefault("g09_first_sunset", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("g16_100_pikmin", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("g16_95_pikmin", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("g26_inout_black", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN_90));
init.setDefault("g29_inout_white", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN_60));
init.setDefault("g2B_white_poison", P2_STREAM_SOUND_ID(PSSTR_HIBA));
init.setDefault("g2C_inout_red", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("g36_find_louie", P2_STREAM_SOUND_ID(PSSTR_HIBA));
init.setDefault("x01_coursein_forest", 0xc0011034);
init.setDefault("x01_coursein_yakushima", 0xc0011034);
init.setDefault("x01_coursein_last", 0xc0011034);
init.setDefault("x04_exp_y", 0xc0011049);
init.setDefault("x05_louiestart", 0xc0011035);
init.setDefault("x07_first_recovery", 0xc0011049);
init.setDefault("x08_cv_suck_carcass", 0xc0011033);
init.setDefault("x09_exp_detector", 0xc0011033);
init.setDefault("x14_white_dig", 0xc0011033);
init.setDefault("x01_coursein_forest", P2_STREAM_SOUND_ID(PSSTR_START_DEMO_OTHER));
init.setDefault("x01_coursein_yakushima", P2_STREAM_SOUND_ID(PSSTR_START_DEMO_OTHER));
init.setDefault("x01_coursein_last", P2_STREAM_SOUND_ID(PSSTR_START_DEMO_OTHER));
init.setDefault("x04_exp_y", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN_75));
init.setDefault("x05_louiestart", P2_STREAM_SOUND_ID(PSSTR_LUGIE_START));
init.setDefault("x07_first_recovery", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN_75));
init.setDefault("x08_cv_suck_carcass", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("x09_exp_detector", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("x14_white_dig", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("g32_get_map", 0xc0011048);
init.setDefault("g35_president_gamestart", 0xc0011033);
init.setDefault("g32_get_map", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN_60));
init.setDefault("g35_president_gamestart", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("x15_exp_x", 0xc0011033);
init.setDefault("x17_join_guide", 0xc0011033);
init.setDefault("x18_exp_pellet", 0xc0011033);
init.setDefault("x15_exp_x", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("x17_join_guide", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("x18_exp_pellet", P2_STREAM_SOUND_ID(PSSTR_EXPLAIN));
init.setDefault("x03_find_red_onyon", 0xc001103c);
init.setDefault("x03_find_red_onyon", P2_STREAM_SOUND_ID(PSSTR_RED_ONYON));
if (streq("s02_dayend_result", init.mName)) {
audio_info.mVolume.c -= 0xf;
audio_info.mVolume.c -= 15;
}
// clang-format off
if (streq("s10_suck_treasure", init.mName) ||
@ -368,16 +368,25 @@ PSSystem::BgmSeq* Demo::initiate(DemoArg demoArg, u8* unk)
streq("x19_vs_bedama", init.mName))
// clang-format on
{
// suck up something
mDoStartWithAudio = false;
mMovieStartSE = PSSE_EV_HOME_PELLET_BACUUM;
} else if (streq("g2F_appear_hole", init.mName)) { // change BGM in challenge mode when hole/fountain appear
} else if (streq("g2F_appear_hole", init.mName)) {
// change BGM in challenge mode when hole/fountain appear
mMovieStartSE = PSSE_SY_WORK_FINISH;
mFuncptr = PSChangeBgm_ChallengeGame;
} else if (streq("g30_appear_fountain", init.mName)) {
// change BGM in challenge mode when hole/fountain appear
mFuncptr = PSChangeBgm_ChallengeGame;
} else if (streq("x20_blackman", init.mName) || streq("x03_find_red_onyon", init.mName)) {
// waterwraith and red onyon cutscenes don't start with audio
mDoStartWithAudio = false;
} else if (streq("s01_dayend", init.mName)) {
// modify day end cutscene sound effects based on which captain's active
switch ((u32)demoArg.mCameraName) {
case 1:
mMovieStartSE = PSSE_PL_DAYEND_KAISAN_LUI;
@ -393,20 +402,24 @@ PSSystem::BgmSeq* Demo::initiate(DemoArg demoArg, u8* unk)
}
if (streq("x20_blackman", init.mName)) {
// load up tyre falling sound effect for waterwraith
mMovieStartSE = PSSE_EN_TIRE_FALL;
}
if (AST_ID != -1) {
if (AST_ID != PSSE_NULL) {
// we have streamed music, play it
PSGame::PikSceneMgr* scene_mgr = (PSGame::PikSceneMgr*)PSSystem::getSceneMgr();
PSSystem::checkSceneMgr(scene_mgr);
seq = scene_mgr->newStreamBgm(AST_ID, audio_info);
*unk = -1;
} else if (buffer[0] != '\0') {
} else if (bmsFilePath[0] != '\0') {
// we have bgm, play it
PSGame::PikSceneMgr* scene_mgr = (PSGame::PikSceneMgr*)PSSystem::getSceneMgr();
PSSystem::checkSceneMgr(scene_mgr);
seq = scene_mgr->newBgmSeq(buffer, audio_info);
seq = scene_mgr->newBgmSeq(bmsFilePath, audio_info);
P2ASSERTLINE(632, seq);
}
return seq;

File diff suppressed because it is too large Load Diff

View File

@ -65,15 +65,15 @@ void DirectorMgr_Scene::initTrackMap(::PSSystem::DirectedBgm& bgm)
path = "/user/Totaka/trackMap_Seq_T.txt";
} else if (!strcmp(bms, "caveconc.bms")) {
path = "/user/Totaka/trackMap_Cond_T.txt";
P2ASSERTLINE(116, bgm.getCastType() == ::PSSystem::DirectedBgm::BgmType_Cave);
P2ASSERTLINE(116, bgm.getCastType() == PSSystem::SeqBase::TYPE_AutoBgm);
bms = static_cast<PSAutoBgm::AutoBgm*>(&bgm)->mConductorFilePath;
} else if (!strncmp("new_", bms, strlen("new_"))) {
path = "/user/Totaka/trackMap_Cond_T.txt";
P2ASSERTLINE(126, bgm.getCastType() == ::PSSystem::DirectedBgm::BgmType_Cave);
P2ASSERTLINE(126, bgm.getCastType() == PSSystem::SeqBase::TYPE_AutoBgm);
bms = static_cast<PSAutoBgm::AutoBgm*>(&bgm)->mConductorFilePath;
} else if (!strcmp(bms, "cavesoil.bms") || (!strcmp(bms, "cavemetal.bms"))) {
path = "/user/Wakai/trackMap_Cond_W.txt";
P2ASSERTLINE(139, bgm.getCastType() == ::PSSystem::DirectedBgm::BgmType_Cave);
P2ASSERTLINE(139, bgm.getCastType() == PSSystem::SeqBase::TYPE_AutoBgm);
bms = static_cast<PSAutoBgm::AutoBgm*>(&bgm)->mConductorFilePath;
} else {
path = "/user/Wakai/trackMap_Seq_W.txt";
@ -131,7 +131,7 @@ void DirectorMgr_Scene::initTrackMap(::PSSystem::DirectedBgm& bgm)
break;
}
case Director_Ground: {
if (bgm.getCastType() == ::PSSystem::DirectedBgm::BgmType_Cave) {
if (bgm.getCastType() == PSSystem::SeqBase::TYPE_AutoBgm) {
actor = new GroundDirector_Cave("GroundD ", trackMap.mGroundTrackCount, 100, 100);
} else {
actor = new ActorDirector_Scaled("GroundD ", trackMap.mGroundTrackCount, 300.0f, 600.0f, 200, 200, 10);
@ -154,7 +154,7 @@ void DirectorMgr_Scene::initTrackMap(::PSSystem::DirectedBgm& bgm)
if (trackMap.mPikNum[i])
actor->setTrack(id++, bgm.getChildTrack(i));
}
if (bgm.getCastType() == 3) {
if (bgm.getCastType() == PSSystem::SeqBase::TYPE_AutoBgm) {
static_cast<PSAutoBgm::AutoBgm*>(&bgm)->setPikiMaskNum(trackMap.mPikNum);
}
break;
@ -854,7 +854,7 @@ PikminNumberDirector* DirectorMgr_Scene_AutoBgm::newPikminNumberDirector(int pik
* @note Size: 0x50
*/
DirectorMgr_Battle::DirectorMgr_Battle()
: ::PSSystem::DirectorMgrBase(::PSSystem::DirectedBgm::BgmType_Battle)
: ::PSSystem::DirectorMgrBase(2)
{
}
@ -1084,7 +1084,7 @@ lbl_80470460:
* @note Size: 0x50
*/
DirectorMgr_2PBattle::DirectorMgr_2PBattle()
: ::PSSystem::DirectorMgrBase(::PSSystem::DirectedBgm::BgmType_2PBattle)
: ::PSSystem::DirectorMgrBase(8)
{
}

View File

@ -129,7 +129,7 @@ PSSystem::StreamBgm* Scene_Global::getGlobalStream()
{
PSSystem::SeqBase* seq = mSeqMgr.getSeq(1);
P2ASSERTLINE(114, seq);
P2ASSERTLINE(115, seq->getCastType() == 1);
P2ASSERTLINE(115, seq->getCastType() == PSSystem::SeqBase::TYPE_StreamBgm);
return static_cast<PSSystem::StreamBgm*>(seq);
}
@ -1347,7 +1347,7 @@ void Scene_Ground::jumpMainBgm(u8 time)
{
MiddleBossSeq* seq = static_cast<MiddleBossSeq*>(mSeqMgr.getFirst()->getObject());
P2ASSERTLINE(846, seq);
P2ASSERTLINE(847, seq->getCastType() == CCT_EnemyBoss);
P2ASSERTLINE(847, seq->getCastType() == PSSystem::SeqBase::TYPE_JumpBgmSeq);
seq->requestJumpBgmOnBeat(time);
if (mEnvSeMgr) {
@ -2165,9 +2165,7 @@ lbl_8046B754:
*/
void PSStart2DStream(u32 id)
{
PSSystem::StreamBgm* seq = static_cast<PSSystem::StreamBgm*>(PSMGetSceneMgrCheck()->mScenes->mSeqMgr.getSeq(1));
P2ASSERTLINE(114, seq);
P2ASSERTLINE(115, seq->getCastType() == 1);
PSSystem::StreamBgm* seq = static_cast<PSM::Scene_Global*>(PSMGetSceneMgrCheck()->mScenes)->getGlobalStream();
seq->setId(id);
seq->startSeq();
}
@ -2178,9 +2176,7 @@ void PSStart2DStream(u32 id)
*/
u8 PSStop2DStream()
{
PSSystem::StreamBgm* seq = static_cast<PSSystem::StreamBgm*>(PSMGetSceneMgrCheck()->mScenes->mSeqMgr.getSeq(1));
P2ASSERTLINE(114, seq);
P2ASSERTLINE(115, seq->getCastType() == 1);
PSSystem::StreamBgm* seq = static_cast<PSM::Scene_Global*>(PSMGetSceneMgrCheck()->mScenes)->getGlobalStream();
seq->stopSeq(30);
}
@ -2224,7 +2220,7 @@ void PSPauseOff() { static_cast<PSM::Scene_Game*>(PSMGetChildScene())->pauseOff_
*/
void PSStartChallengeTimeUpStream()
{
PSStart2DStream(0xc0011016);
PSStart2DStream(P2_STREAM_SOUND_ID(PSSTR_CHALLENGE_TIMEUP));
PSM::Scene_Game* scene = static_cast<PSM::Scene_Game*>(PSMGetChildScene());
PSSystem::checkGameScene(scene);