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

Event the game passes between a MsgSource and a MsgSink. More...

#include <sustainnotemsg.h>

Inheritance diagram for SustainNoteMsg:
Collaboration diagram for SustainNoteMsg:

Public Member Functions

 SustainNoteMsg ()
 Construct a message with the song position at kTickInfinity and the byte unset.
 SustainNoteMsg (int nTick, unsigned char nNote)
 Report a sustained note at a song position.
virtual Message * Clone ()
 Produce a heap copy of this message.
virtual int Type ()
 Report this message's registered identity.
virtual const char * GetName () const
 Report this message's class name.
virtual void PrintExtra (std::ostream &stream) const
 Write the song position and the byte, as a character, to a diagnostic stream.
virtual void saveGuts (OBStream &stream) const
 Write the byte to a stream through OBStream::Write().
virtual void restoreGuts (IBStream &stream)
 Read the byte back in place through IBStream::Read().
Public Member Functions inherited from MuseMsg
 MuseMsg ()
 Start the song position at kTickInfinity.
 MuseMsg (int nTick)
 Start the song position at a tick.
MuseMsg * CloneAndShift (int nTick)
 Copy this message and move the copy to a song position.
Public Member Functions inherited from Message
void * operator new (size_t nSize)
 Allocate a message from the tagged heap under the tag MSG.
void operator delete (void *pBlock)
 Release a message to the tagged heap under the tag MSG.
virtual ~Message ()
 Vtable slot 1.
std::ostream & Print (std::ostream &stream) const
 Write this message to a diagnostic stream as {GetName() PrintExtra()}.

Static Public Member Functions

static Message * New ()
 Produce a default-constructed message on the heap.
Static Public Member Functions inherited from Message
static Message * NewMessage (int nType)
 Produce a message of the identified class through the factory list.

Public Attributes

unsigned char mNote
 The note number, and the one byte the message includes.
Public Attributes inherited from MuseMsg
int mTick
 The song position, in MIDI ticks.

Static Public Attributes

static unsigned int sID
 Identity that Type() reports.

Detailed Description

Event the game passes between a MsgSource and a MsgSink.

Its RTTI descriptor is at 0x00901e20. It has MuseMsg as its one base. The object is 0xc bytes and its vtable is at 0x00812db0. The members below are the whole of the class. No other routine in the image refers to this type by anything but its vtable. The fields through +0x07 belong to MuseMsg and are declared there.

The payload layout comes from the run of field copies in Clone(), so the offsets and widths are recovered but the purpose of each field is not. Readers of the fields have not been traced, so they are private by default.

Clone() copies only as far as 0x9 of the 0xc bytes it allocates, so the remaining 3 are either alignment padding or a field the copy omits.

The destructor at 0x003dc658 is compiler-generated and has no declaration here.

Constructor & Destructor Documentation

◆ SustainNoteMsg() [1/2]

SustainNoteMsg::SustainNoteMsg ( )
inline

Construct a message with the song position at kTickInfinity and the byte unset.

Inline. New() expands it. A declaration is required because the class declares a second constructor.

◆ SustainNoteMsg() [2/2]

SustainNoteMsg::SustainNoteMsg ( int nTick,
unsigned char nNote )
inline

Report a sustained note at a song position.

Inline, with no address of its own. PitchPicker expands it on its stack at 0x001c2d70, storing the position and then the byte its routine at 0x001c3060 returns.

Parameters
nTickThe song position, in MIDI ticks.
nNoteThe byte at +0x08.

Member Function Documentation

◆ New()

Message * SustainNoteMsg::New ( )
static

Produce a default-constructed message on the heap.

The translation unit at 0x003d9818 registers this factory. Only the song position is initialised, by the MuseMsg constructor.

Returns
The message.
Ghidra address:
NTSC-U/C: 0x003d6e50
Ghidra address:
PAL: 0x0040ed40

◆ Clone()

virtual Message * SustainNoteMsg::Clone ( )
virtual

Produce a heap copy of this message.

Returns
The copy.
Ghidra address:
NTSC-U/C: 0x003dc778
Ghidra address:
PAL: 0x00414bb0

Implements Message.

◆ Type()

virtual int SustainNoteMsg::Type ( )
virtual

Report this message's registered identity.

Returns
sID.
Ghidra address:
NTSC-U/C: 0x003dc7d8
Ghidra address:
PAL: 0x00414c10

Implements Message.

◆ GetName()

virtual const char * SustainNoteMsg::GetName ( ) const
virtual

Report this message's class name.

Returns
The literal SustainNoteMsg.
Ghidra address:
NTSC-U/C: 0x003dc7e8
Ghidra address:
PAL: 0x00414c20

Implements Message.

◆ PrintExtra()

virtual void SustainNoteMsg::PrintExtra ( std::ostream & stream) const
virtual

Write the song position and the byte, as a character, to a diagnostic stream.

The byte is loaded sign-extended and written through the character inserter rather than the integer one, so a note number appears as the character with that code.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x003e3a18
Ghidra address:
PAL: 0x0041bdb8

Reimplemented from Message.

◆ saveGuts()

virtual void SustainNoteMsg::saveGuts ( OBStream & stream) const
virtual

Write the byte to a stream through OBStream::Write().

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x003e3a70
Ghidra address:
PAL: 0x0041be10

Reimplemented from Message.

◆ restoreGuts()

virtual void SustainNoteMsg::restoreGuts ( IBStream & stream)
virtual

Read the byte back in place through IBStream::Read().

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x003e3ab0
Ghidra address:
PAL: 0x0041be50

Reimplemented from Message.

Member Data Documentation

◆ sID

unsigned int SustainNoteMsg::sID
static

Identity that Type() reports.

Ghidra address:
NTSC-U/C: 0x006d01e4
Ghidra address:
PAL: 0x0071397c

◆ mNote

unsigned char SustainNoteMsg::mNote

The note number, and the one byte the message includes.

+0x08

Public because SynthSustainer::HandleSustainNote() at 0x001d20a0 reads it through a SustainNoteMsg pointer from outside the hierarchy, searching two held-note lists for it and appending it to one. The image exposes no accessor. A friend declaration fits equally well. That use is the evidence for the title. No string in the image supplies one.


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