resonance 1.0.1
Loading...
Searching...
No Matches
Ps2HardSynth Class Reference

The game's hardware synthesiser. More...

#include <ps2hardsynth.h>

Inheritance diagram for Ps2HardSynth:
Collaboration diagram for Ps2HardSynth:

Public Member Functions

 Ps2HardSynth ()
 Select the sound-effect bank and bring the synthesiser driver up.
virtual ~Ps2HardSynth ()
virtual void LoadBankSet4 ()
virtual void LoadBankSet5 ()
virtual void LoadBankSet6 ()
virtual void UnloadBanks ()
virtual void PlayMidi (unsigned char nStatus, unsigned char nData1, unsigned char nData2)
virtual void SelectBank (unsigned char nChannel, unsigned char nBank)
virtual void SetStereo (int bStereo)
virtual void SetRemixMode (int bRemix)
virtual void SetPaused (int bPaused)
virtual void AllNotesOff ()
virtual void LoadBankPair (const HxStr &bdName, const HxStr &hdName, int nTag, int nPlacement)
 Compose both bank paths and load the pair.
void SelectSfxProgram ()
 Program the sound-effect channel.
Public Member Functions inherited from Synth
virtual ~Synth ()
virtual void UnusedHook ()
 Do nothing.
virtual void OnPlayStarted ()
 Respond to the start of play.
virtual void AllNotesOffExceptSfxChannel ()
 Silence every channel but the sound-effect channel.
void SetChannelVolume (unsigned char nVolume)
 Set the volume of every channel.
void Setup ()
 Put every channel into its starting state.
void FadeOut (int nDurationMs)
 Fade every channel's volume to silence over a duration.
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the tagged heap under the tag "MsgSink".
void operator delete (void *pBlock)
 Release a sink to the tagged heap.
virtual ~MsgSink ()
virtual void Dispatch (Message *pMsg)
 Accept a message.

Additional Inherited Members

Protected Member Functions inherited from Synth
void OnStdMidi (StdMidiMsg *pMsg)
 Sends the message's three bytes through PlayMidi().
virtual void DispatchPriv (Message *pMsg)
 Act on a message.

Detailed Description

The game's hardware synthesiser.

Its RTTI descriptor is at 0x009021d0. It has Synth as its one base. The inherited MsgSink vptr sits at offset 0 and the class is 0xc bytes. Its vtable is at 0x00814fc0 and has eighteen slots, one more than the seventeen Synth declares. The class adds a single virtual at slot 17.

It answers ten of Synth's slots and inherits slots 7, 10, and 16 unchanged. The class is thin. Every override reaches the driver at 0x00461a88 through 0x00465200, which owns the voices and the sound banks, and the constructor brings that driver up through its initialiser at 0x004647a8.

Slot 17 is the one member the class adds, and the three bank loaders are its only callers. It prefixes both bank names with the device the host mode selects and hands the pair to LoadSoundBank().

Globals owns the single instance, created in Globals::CreateSynth() and destroyed in Globals::Shutdown().

Constructor & Destructor Documentation

◆ Ps2HardSynth()

Ps2HardSynth::Ps2HardSynth ( )

Select the sound-effect bank and bring the synthesiser driver up.

Sets mUseSfxBank and clears mAlternateBanksResident, then runs InitSynthDriver(). CreatePs2HardSynth() expands the same body in place, and the image lists no caller for this out-of-line copy.

Ghidra address:
NTSC-U/C: 0x003f64e0
Ghidra address:
PAL: 0x0042ecc8

◆ ~Ps2HardSynth()

virtual Ps2HardSynth::~Ps2HardSynth ( )
virtual
Ghidra address:
NTSC-U/C: 0x003f6670
Ghidra address:
PAL: 0x0042ee58

Member Function Documentation

◆ LoadBankSet4()

virtual void Ps2HardSynth::LoadBankSet4 ( )
virtual
Ghidra address:
NTSC-U/C: 0x003f47b8
Ghidra address:
PAL: 0x0042ce70

Reimplemented from Synth.

◆ LoadBankSet5()

virtual void Ps2HardSynth::LoadBankSet5 ( )
virtual
Ghidra address:
NTSC-U/C: 0x003f4960
Ghidra address:
PAL: 0x0042d058

Reimplemented from Synth.

◆ LoadBankSet6()

virtual void Ps2HardSynth::LoadBankSet6 ( )
virtual
Ghidra address:
NTSC-U/C: 0x003f4af0
Ghidra address:
PAL: 0x0042d1e8

Reimplemented from Synth.

◆ UnloadBanks()

virtual void Ps2HardSynth::UnloadBanks ( )
virtual
Ghidra address:
NTSC-U/C: 0x003f6650
Ghidra address:
PAL: 0x0042ee38

Reimplemented from Synth.

◆ PlayMidi()

virtual void Ps2HardSynth::PlayMidi ( unsigned char nStatus,
unsigned char nData1,
unsigned char nData2 )
virtual
Ghidra address:
NTSC-U/C: 0x003f66d8
Ghidra address:
PAL: 0x0042eec0

Implements Synth.

◆ SelectBank()

virtual void Ps2HardSynth::SelectBank ( unsigned char nChannel,
unsigned char nBank )
virtual
Ghidra address:
NTSC-U/C: 0x003f65c8
Ghidra address:
PAL: 0x0042edb0

Reimplemented from Synth.

◆ SetStereo()

virtual void Ps2HardSynth::SetStereo ( int bStereo)
virtual
Ghidra address:
NTSC-U/C: 0x003f6700
Ghidra address:
PAL: 0x0042eee8

Reimplemented from Synth.

◆ SetRemixMode()

virtual void Ps2HardSynth::SetRemixMode ( int bRemix)
virtual
Ghidra address:
NTSC-U/C: 0x003f6740
Ghidra address:
PAL: 0x0042ef28

Reimplemented from Synth.

◆ SetPaused()

virtual void Ps2HardSynth::SetPaused ( int bPaused)
virtual
Ghidra address:
NTSC-U/C: 0x003f6720
Ghidra address:
PAL: 0x0042ef08

Reimplemented from Synth.

◆ AllNotesOff()

virtual void Ps2HardSynth::AllNotesOff ( )
virtual
Ghidra address:
NTSC-U/C: 0x003f4c50
Ghidra address:
PAL: 0x0042d3c8

Reimplemented from Synth.

◆ LoadBankPair()

virtual void Ps2HardSynth::LoadBankPair ( const HxStr & bdName,
const HxStr & hdName,
int nTag,
int nPlacement )
virtual

Compose both bank paths and load the pair.

Table slot 17, the one virtual this class adds. Prefixes each name with host0: when GetHostMode() reports kHostModeHostOnly and with cdrom0: otherwise, then calls LoadSoundBank() with the two composed paths. An empty composed path is passed as the shared empty string rather than as a null pointer.

Parameters
bdNameThe BD bank name, without a device prefix.
hdNameThe HD bank name, without a device prefix.
nTagThe tag both banks are recorded with.
nPlacementWhere the pair goes in sound memory.
Ghidra address:
NTSC-U/C: 0x003f4590
Ghidra address:
PAL: 0x0042cbc8

◆ SelectSfxProgram()

void Ps2HardSynth::SelectSfxProgram ( )

Program the sound-effect channel.

Sends bank select 0 and then bank 15, or bank 0 when mUseSfxBank is clear, on channel 15, followed by program 16. LoadBankSet4(), LoadBankSet5(), and AllNotesOff() expand the same three messages in place, and the image lists no caller for this out-of-line copy. The title is inferred.

Ghidra address:
NTSC-U/C: 0x003f6540
Ghidra address:
PAL: 0x0042ed28

The documentation for this class was generated from the following file: