Allow audio samples to be played back from anywhere in memory rather than ARAM.

This is accomplished through a new mAramBaseAddress field on the DSP channels, which effectively relocates ARAM for that channel.
This commit is contained in:
PJB3005
2026-07-25 15:49:13 +02:00
parent 30c36df76b
commit ad80933ccf
8 changed files with 57 additions and 3 deletions
@@ -13,6 +13,12 @@ struct JASBasicWaveBank : public JASWaveBank {
TWaveHandle() { mHeap = NULL; }
virtual intptr_t getWavePtr() const;
virtual const JASWaveInfo* getWaveInfo() const { return &mWaveInfo; }
#if TARGET_PC
/**
* @see JASChannel::mAramBaseAddress
*/
[[nodiscard]] void const* getAramBaseAddress() const override { return nullptr; }
#endif
bool compareHeap(JASHeap* heap) const { return mHeap == heap;}
/* 0x04 */ JASWaveInfo mWaveInfo;
@@ -166,6 +166,18 @@ public:
u32 field_0x104;
};
#if TARGET_PC
/**
* Memory address at which this sound effect should consider ARAM to start.
*
* By changing this, sound effects can effectively be played back from anywhere in memory,
* rather than just the emulated ARAM space.
*
* If nullptr, the regular emulated ARAM is used.
*/
void const* mAramBaseAddress;
#endif
static DUSK_GAME_DATA OSMessageQueue sBankDisposeMsgQ;
static DUSK_GAME_DATA OSMessage sBankDisposeMsg[16];
static DUSK_GAME_DATA OSMessage sBankDisposeList[16];
@@ -179,6 +179,20 @@ namespace JASDsp {
/* 0x130 */ u8 _unused9[0x148 - 0x130];
/* 0x148 */ s16 iir_filter_params[8];
/* 0x158 */ u8 _unused10[0x180 - 0x158];
#endif
#if TARGET_PC
/**
* Memory address at which this sound effect should consider ARAM to start.
* This means fields like mWaveAramAddress will be relative to this pointer instead.
*
* By changing this, sound effects can effectively be played back from anywhere in memory,
* rather than just the emulated ARAM space.
*
* If nullptr, the regular emulated ARAM is used.
*/
void const* mAramBaseAddress;
#endif
};
void boot(void (*)(void*));
@@ -10,6 +10,12 @@ struct JASSimpleWaveBank : JASWaveBank, JASWaveArc {
intptr_t getWavePtr() const;
TWaveHandle();
const JASWaveInfo* getWaveInfo() const;
#if TARGET_PC
/**
* @see JASChannel::mAramBaseAddress
*/
[[nodiscard]] void const* getAramBaseAddress() const override { return nullptr; }
#endif
/* 0x04 */ JASWaveInfo mWaveInfo;
/* 0x28 */ JASHeap* mHeap;
@@ -45,6 +45,12 @@ public:
virtual ~JASWaveHandle() {}
virtual const JASWaveInfo* getWaveInfo() const = 0;
virtual intptr_t getWavePtr() const = 0;
#if TARGET_PC
/**
* @see JASChannel::mAramBaseAddress
*/
[[nodiscard]] virtual void const* getAramBaseAddress() const = 0;
#endif
};
/**