58extern sceSifClientData
gCd;
279void LoadSoundBank(
const char *pszBdPath,
const char *pszHdPath,
int nTag,
int nPlacement);
Receiver that streams a BD sound bank into the sound driver one chunk at a time.
Definition callbackxferbdtoiop.h:25
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
void InitSynthDriver()
Bring the voice and bank driver up.
int g_nBankIopAddress
Address on the IOP a sound bank is moved to.
void SetBankLoadProgressHook(void(*pfnProgress)())
Install the bank-load progress hook.
int SubmitSoundDriverRequest(int nSelector, uintptr_t nArgument)
Submit one command to the sound driver.
void InitSpu2Cores()
Bind libsdr and bring both SPU2 cores up.
void DumpSynthVoices(int bActiveOnly)
Report the state of both SPU2 cores and all 48 voices to the log.
SoundDriverCommand g_bankCommand
Block that describes a whole bank, submitted under selector 0x1050 when the last chunk lands.
int StartHdBankXfer(const char *pszPath, int nPlacement)
Start an HD bank transfer.
constexpr int kIopStagingBufferCount
Staging buffers on the IOP that chunk transfers alternate between.
Definition midi_main.h:150
CallbackXferBdToIop * g_pBdXfer
Transfer currently streaming a BD bank, or null.
void * g_pHdXferBuffer
Buffer the HD bank transfer read into, released once the transfer reports.
void(* g_pfnBankLoadProgress)()
Called once after every chunk is submitted and once when a bank transfer finishes.
void SubmitDriverSetMono(int bMono)
Switch the sound driver between mono and stereo output.
int g_nSynthXferTag
Word every command block is stamped with at +0x10.
int g_nHdXferInFlight
Non-zero while an HD bank transfer occupies the shared command block.
std::vector< BankSlot > g_bankSlots
Every bank currently claiming sound memory.
constexpr int kBankDestBufferCount
Destination buffers the rotating placement alternates between.
Definition midi_main.h:386
constexpr int kBankIopAddressCount
Addresses on the IOP a bank may go to.
Definition midi_main.h:410
constexpr int kSoundDriverCommandPayloadSize
Bytes of payload a command block has above its five-word header.
Definition midi_main.h:117
int g_nIopStagingIndex
Staging buffer the next chunk transfer will use.
void LoadSoundBank(const char *pszBdPath, const char *pszHdPath, int nTag, int nPlacement)
Load a BD and HD bank pair and record the claim.
void ps2_InitMSin()
Bind the MIDI stream input of Sony's component sound library.
int g_anIopStagingAddress[kIopStagingBufferCount]
Addresses of the staging buffers on the IOP.
void ReleaseBankSlotAt(int nDest)
Release the bank claiming a region of sound memory.
int StartBdBankXfer(const char *pszPath)
Start a chunked BD bank transfer and report the bank's size.
void StopSoundBankMovie()
Destroy the sound-bank movie, if one is open, and clear the pointer.
void WaitForBankTransfers()
Wait until no bank transfer is outstanding.
int XferBankFromMemory(const void *pData, int nLength)
Move a bank that is already in memory to the IOP and report it complete.
void ShutdownSynthDriver()
Take the voice and bank driver down.
constexpr int kBankFixedDestAddress
Destination in sound memory a placement of 0 or 1 selects.
Definition midi_main.h:370
sceSifClientData gCd
Client of the game's sound driver on the IOP, bound by ezMidiInit().
constexpr int kBankPlacementFirstBuffer
Placement that selects the first destination buffer.
Definition midi_main.h:373
HxStr g_hdBankName
Path of the HD bank currently loaded.
int ezMidiInit()
Bind gCd to the sound driver's RPC server.
int g_anBankIopAddress[kBankIopAddressCount]
Addresses on the IOP a bank may go to.
void PollSynthStream()
Advance the streaming voice buffers.
constexpr int kBankPlacementRotate
Placement that rotates through the destination buffers and the IOP addresses.
Definition midi_main.h:376
SoundDriverCommand g_chunkCommand
Block that describes one chunk of a sound bank, submitted under selector 0x1070.
void SubmitDriverSetRemix(int bRemix)
Switch the remix mode of the sound driver.
void * g_pBdXferBuffer
Buffer the BD bank transfer reads into, released once the last chunk has been moved.
void SendMidiToDriver(unsigned char nStatus, unsigned char nData1, unsigned char nData2)
Move one MIDI message to the sound driver.
int IsBankXferBusy()
Report whether a bank transfer is still moving.
void ReleaseSoundBanks()
Release every loaded bank.
void SetSynthStreamBar(int nBar)
Move the streamed audio to the start of a bar.
void ConfigureSpu2Effects(int bEnable)
Apply the configured reverb to both SPU2 cores.
HxStr g_bdBankName
Path of the BD bank currently loaded.
int ezTransToIOP(int nIopAddress, const void *pSource, int nLength)
Move a buffer from main memory into the sound driver's memory on the IOP.
void ReleaseAllBankSlots()
Release every bank and empty g_bankSlots.
constexpr int kBankBufferAlignment
Boundary both bank read buffers are rounded up to.
Definition midi_main.h:282
char g_szHdBankPath[]
Path of the HD bank, copied in by StartHdBankXfer().
void SynthCommand(int nCommand)
Voice and sound-bank driver that Ps2HardSynth is a thin class over.
int g_anBankDestAddress[kBankDestBufferCount]
Destinations in sound memory a bank pair may go to.
int g_nBankIopIndex
Entry of g_anBankIopAddress the next rotating placement will use.
void RegisterBankSlot(int nTag, int nDest, int nIopAddress)
Record that a bank claims a region of sound memory, releasing whatever claimed it before.
void SubmitDriverSetPaused(int bPaused)
Pause or resume the sound driver.
void StartSoundBankMovie(const char *pszPath)
Open the sound-bank movie and start feeding its chunks to the driver.
constexpr int kHdBankPathSize
Bytes of g_szHdBankPath.
Definition midi_main.h:383
int g_nBankDestAddress
Address in sound memory a bank is written to.
char * FourCcToString(const void *pFourCc)
Copy a four-character code into a buffer it can be printed from.
int g_nBankDestIndex
Destination buffer the next rotating placement will use.
void PollSynthEvents()
Advance the driver's pending events.
void SubmitDriverAllNotesOff()
Silence every channel of the sound driver.
One loaded bank's claim on a region of sound memory.
Definition midi_main.h:193
int mTag
Definition midi_main.h:194
int mDest
Definition midi_main.h:195
int mIopAddress
Definition midi_main.h:196
Command block the sound driver reads a bank transfer out of.
Definition midi_main.h:132
char mPayload[kSoundDriverCommandPayloadSize]
Definition midi_main.h:138
int mTag
Definition midi_main.h:137
int mLength
Definition midi_main.h:135
int mDest
Definition midi_main.h:136
int mBankAddress
Definition midi_main.h:133
int mStagingAddress
Definition midi_main.h:134