resonance 1.0.1
Loading...
Searching...
No Matches
ScoreTrackGraph Class Referenceabstract

Shared base of the four per-instrument gameplay stages. More...

#include <scoretrackgraph.h>

Inheritance diagram for ScoreTrackGraph:
Collaboration diagram for ScoreTrackGraph:

Public Member Functions

 ScoreTrackGraph (TrackData *pTrackData)
 Build the stage's quantiser, phrase manager, phrase player, mixer, and synthesiser.
virtual ~ScoreTrackGraph ()
PhraseDatabase * GetPhraseDatabase ()
 Report the phrase database of this stage's phrase manager.
virtual void Start ()
 Start the stage.
virtual void Stop ()
 Stop the stage.
virtual void ConnectInputs (MsgSource *pPrimary, MsgSource *pOptional, MsgSource *pSecondary)=0
 Wire the stage's objects to the sources that drive it.
virtual void ConnectGamer (MsgSource *pSource)
 Register the mixer with one source.
virtual void SetMixerOutput (MsgSink *pOutput)=0
 Attach the mixer to the synthesiser and give it its output sink.
virtual void ConnectToTunnel (MsgSink *pSink)=0
 Register one sink with every source the stage provides.
virtual void SetNetSink (MsgSink *pSink)=0
 Install the sink the phrase manager reports phrase changes to.
virtual int HasNothingPending ()
 Report whether the stage has nothing outstanding.
virtual void GivePhrases (int nTick, Player *pPlayer)
 Give every phrase of the track to one player.
virtual int CanGivePhrases ()
 Report whether GivePhrases() acts on this stage.
virtual void CreatePowerbarMgr ()
 Create the phrase manager's powerbar manager.
int StartMF ()
 Run Start() and report zero.
int StopMF ()
 Run Stop() and report zero.

Static Public Member Functions

static void Delete (ScoreTrackGraph *pGraph)
 Delete a stage, which may be null.

Public Attributes

TrackData * mTrackData
 The track description, the constructor's argument.

Protected Attributes

int mTrack
PhraseMgr * mPhraseMgr
PhrasePlayer * mPhrasePlayer
Quantizer * mQuantizer
MuseSynth * mMuseSynth
int mUnused
Mixer * mMixer
Application * mApplication
BarSequencer * mSequencer

Detailed Description

Shared base of the four per-instrument gameplay stages.

Its RTTI descriptor is at 0x0086f640, built through the built-in descriptor constructor with no base list. Four classes derive from it, and the RTTI records each with this class at offset 0: AxingSTG at 0x008efe70, CatchingSTG at 0x00902230, PitchingSTG at 0x00902240, and VoxingSTG at 0x008efe80. The shared base is recovered from those four descriptors and from the table walk rather than inferred from the names.

Its table is at 0x007e5148 and runs thirteen entries to the zero terminator, and all four derived tables run thirteen as well, so no subclass introduces a virtual of its own. Slots 4, 6, 7, and 8 address the shared pure-virtual stub at 0x005381a8, which makes this class abstract. Slots 5, 9, 10, 11, and 12 are inert defaults with real bodies here.

The object is 0x2c bytes with the vptr at +0x28, which is where this toolchain places it for a class with no base. Derived members therefore start at +0x2c.

The constructor builds the five objects the members below store. The phrase manager, phrase player, mixer, and synthesiser go through the tagged allocator under the tag MsgSink, and the quantiser through the plain allocator.

The five default bodies at 0x001cf750, 0x001cf758, 0x001cf760, 0x001cf768, and 0x001cf778 sit in this class's table at slots 5, 9, 10, 11, and 12, and AxingSTG, PitchingSTG, and VoxingSTG inherit all five.

Each slot's comment records its table index. Start() and Stop() (slots 2 and 3) are the start and the stop of a stage, as the four overrides establish between them. Each Start() override sends controller 0x52 with value 0x7f on the track's channel and each Stop() override sends the same controller with value zero, and every other pairing in the four classes is symmetric in the same way.

Every data member apart from mTrackData is protected. The four derived classes read seven of the ten directly and no accessor for any of them exists in the image.

Constructor & Destructor Documentation

◆ ScoreTrackGraph()

ScoreTrackGraph::ScoreTrackGraph ( TrackData * pTrackData)
explicit

Build the stage's quantiser, phrase manager, phrase player, mixer, and synthesiser.

The phrase manager takes the song clock, a bar of 1920 ticks, the play map, and configuration code 0x2be. The phrase player is then installed in the phrase manager.

Parameters
pTrackDataThe track description.
Ghidra address:
NTSC-U/C: 0x001cee50
Ghidra address:
PAL: 0x001d4d08

◆ ~ScoreTrackGraph()

virtual ScoreTrackGraph::~ScoreTrackGraph ( )
virtual
Ghidra address:
NTSC-U/C: 0x001cf840
Ghidra address:
PAL: 0x001d56f8

Member Function Documentation

◆ GetPhraseDatabase()

PhraseDatabase * ScoreTrackGraph::GetPhraseDatabase ( )

Report the phrase database of this stage's phrase manager.

GrooveWorld's phrase save and load paths call it for every stage.

Returns
The phrase manager's database.
Ghidra address:
NTSC-U/C: 0x001cf978
Ghidra address:
PAL: 0x001d5830

◆ Start()

virtual void ScoreTrackGraph::Start ( )
virtual

Start the stage.

Slot 2. Starts the phrase manager's commands, chases the MIDI of every bar of the play map into the synthesiser so controllers and programs are current, and then builds and starts a BarSequencer at the song start that plays the track into the synthesiser.

Ghidra address:
NTSC-U/C: 0x001cf088
Ghidra address:
PAL: 0x001d4f40

Reimplemented in AxingSTG, CatchingSTG, PitchingSTG, and VoxingSTG.

◆ Stop()

virtual void ScoreTrackGraph::Stop ( )
virtual

Stop the stage.

Slot 3. Withdraws the phrase manager's commands and deletes the sequencer Start() built.

Ghidra address:
NTSC-U/C: 0x001cf918
Ghidra address:
PAL: 0x001d57d0

Reimplemented in AxingSTG, CatchingSTG, PitchingSTG, and VoxingSTG.

◆ ConnectInputs()

virtual void ScoreTrackGraph::ConnectInputs ( MsgSource * pPrimary,
MsgSource * pOptional,
MsgSource * pSecondary )
pure virtual

Wire the stage's objects to the sources that drive it.

Slot 4, pure. Each override registers the stage's own objects with the first and third sources, and with the second only when it is supplied. The second source is the only argument any override guards against a null pointer.

Parameters
pPrimaryThe source every override registers with first.
pOptionalA further source, ignored when null.
pSecondaryThe source every override registers the phrase manager with.

Implemented in AxingSTG, CatchingSTG, PitchingSTG, and VoxingSTG.

◆ ConnectGamer()

virtual void ScoreTrackGraph::ConnectGamer ( MsgSource * pSource)
virtual

Register the mixer with one source.

Slot 5. The default body is empty. CatchingSTG is the only class that overrides it, and its override registers the mixer.

Parameters
pSourceThe source to register with.
Ghidra address:
NTSC-U/C: 0x001cf750
Ghidra address:
PAL: 0x001d5608

Reimplemented in CatchingSTG.

◆ SetMixerOutput()

virtual void ScoreTrackGraph::SetMixerOutput ( MsgSink * pOutput)
pure virtual

Attach the mixer to the synthesiser and give it its output sink.

Slot 6, pure. All four overrides are the same three instructions: they register the mixer with the synthesiser through MuseSynth::AddSink() and then store the argument in Mixer::mOutput, which types it as a sink.

Parameters
pOutputThe sink the mixer sends to.

Implemented in AxingSTG, CatchingSTG, PitchingSTG, and VoxingSTG.

◆ ConnectToTunnel()

virtual void ScoreTrackGraph::ConnectToTunnel ( MsgSink * pSink)
pure virtual

Register one sink with every source the stage provides.

Slot 7, pure. Each override registers the sink with the phrase manager and with each of its own objects that is a source.

Parameters
pSinkThe sink to register.

Implemented in AxingSTG, CatchingSTG, PitchingSTG, and VoxingSTG.

◆ SetNetSink()

virtual void ScoreTrackGraph::SetNetSink ( MsgSink * pSink)
pure virtual

Install the sink the phrase manager reports phrase changes to.

Slot 8, pure. All four overrides store the argument in PhraseMgr::mNetSink and ignore a null sink. PhraseMgr sends messages through that member's MsgSink::Dispatch(), which is what types the argument.

Parameters
pSinkThe sink to install, ignored when null.

Implemented in AxingSTG, CatchingSTG, PitchingSTG, and VoxingSTG.

◆ HasNothingPending()

virtual int ScoreTrackGraph::HasNothingPending ( )
virtual

Report whether the stage has nothing outstanding.

Slot 9. The default reports that nothing is outstanding. CatchingSTG is the only class that overrides it, and its override forwards to Catcher::IsPhraseRunEmpty(). That routine reports whether the catcher's counter at +0x60 is zero. Gamer ends the game for a player out of juice only once every stage reports non-zero.

Returns
Non-zero when nothing is outstanding.
Ghidra address:
NTSC-U/C: 0x001cf758
Ghidra address:
PAL: 0x001d5610

Reimplemented in CatchingSTG.

◆ GivePhrases()

virtual void ScoreTrackGraph::GivePhrases ( int nTick,
Player * pPlayer )
virtual

Give every phrase of the track to one player.

Slot 10. The default body is empty. CatchingSTG is the only class that overrides it, and its override forwards both arguments to SingleCatcher::ResetOwners(). The Gamer routine at 0x001123b0 calls the slot for every track whose CanGivePhrases() reports non-zero, with the winning player, and discards the return register.

Parameters
nTickThe song position the caller received. No implementation reads it.
pPlayerThe player the phrases go to.
Ghidra address:
NTSC-U/C: 0x001cf760
Ghidra address:
PAL: 0x001d5618

Reimplemented in CatchingSTG.

◆ CanGivePhrases()

virtual int ScoreTrackGraph::CanGivePhrases ( )
virtual

Report whether GivePhrases() acts on this stage.

Slot 11. The default returns zero and CatchingSTG, the one class whose GivePhrases() has a body, returns 1. Gamer tests it before each GivePhrases() call.

Returns
Zero here.
Ghidra address:
NTSC-U/C: 0x001cf768
Ghidra address:
PAL: 0x001d5620

Reimplemented in CatchingSTG.

◆ CreatePowerbarMgr()

virtual void ScoreTrackGraph::CreatePowerbarMgr ( )
virtual

Create the phrase manager's powerbar manager.

Slot 12. The default body is empty. CatchingSTG is the only class that overrides it, and its override runs PhraseMgr::CreatePowerbarMgr(). GrooveWorld::BuildGraphs() calls it for each catch track after loading saved phrases.

Ghidra address:
NTSC-U/C: 0x001cf778
Ghidra address:
PAL: 0x001d5630

Reimplemented in CatchingSTG.

◆ StartMF()

int ScoreTrackGraph::StartMF ( )
inline

Run Start() and report zero.

Inline. GrooveWorld::StartSequencers() reaches it through a pointer to member, and the address is its uncalled out-of-line copy.

Returns
Always 0.
Ghidra address:
NTSC-U/C: 0x001cf6b8
Ghidra address:
PAL: 0x001d5570

◆ StopMF()

int ScoreTrackGraph::StopMF ( )
inline

Run Stop() and report zero.

Inline. GrooveWorld::FinishSong() reaches it through a pointer to member, and the address is its uncalled out-of-line copy.

Returns
Always 0.
Ghidra address:
NTSC-U/C: 0x001cf6e8
Ghidra address:
PAL: 0x001d55a0

◆ Delete()

void ScoreTrackGraph::Delete ( ScoreTrackGraph * pGraph)
inlinestatic

Delete a stage, which may be null.

Inline. GrooveWorld::DestroyGraphs() passes it to std::for_each.

Parameters
pGraphThe stage.
Ghidra address:
NTSC-U/C: 0x001cf718
Ghidra address:
PAL: 0x001d55d0

Member Data Documentation

◆ mTrack

int ScoreTrackGraph::mTrack
protected

◆ mTrackData

TrackData* ScoreTrackGraph::mTrackData

The track description, the constructor's argument.

+0x04

Public because GrooveWorld::BuildGraphs() loads it directly at 0x0018d730 and passes it to TrackData::AddPhrases(), and the image has no accessor.

◆ mPhraseMgr

PhraseMgr* ScoreTrackGraph::mPhraseMgr
protected

◆ mPhrasePlayer

PhrasePlayer* ScoreTrackGraph::mPhrasePlayer
protected

◆ mQuantizer

Quantizer* ScoreTrackGraph::mQuantizer
protected

◆ mMuseSynth

MuseSynth* ScoreTrackGraph::mMuseSynth
protected

◆ mUnused

int ScoreTrackGraph::mUnused
protected

◆ mMixer

Mixer* ScoreTrackGraph::mMixer
protected

◆ mApplication

Application* ScoreTrackGraph::mApplication
protected

◆ mSequencer

BarSequencer* ScoreTrackGraph::mSequencer
protected

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