Buzz Internals
This shows dummy C++ classes for implementing a binary replacement for Buzz.exe where memory alignments have been taken into account.
For large and/or debug projects it may be necessary to adjust the linker /BASE:xxx-setting to link against a lower base address.
Information based on reverse-engineering of PVST, hints from ld0d, and inspection of the buzzHACK-source.
CMainFrame, CPlayer and CSeqencer class names are imaginary and based on Buzé's equivalents. While the CMainFrame and CPlayer structures assume hard coded positions in the exeutable image; we only need to arrange the member variables in correct order in CMachine. The distance between known offsets in CMainFrame and CPlayer decides whether it is really worth the effort to implement these in two separate classes.
CMachine represents the same class that is available to Buzz machines via the CMICallbacks::GetThisMachine? method.
class CMainFrame { // some container class, single-instance
char temp[??]; // reserve some number of bytes calculated
// from where the compiler puts the
// CMainFrame instance in memory.
CMICallbacks* callbacks; // 0x4DA800, used by overloader for accessing
// wavetable, probably callbacks for the master
unsigned int midiOutDevices[255]; // 0x4DA280, list of enabled midi devices
// 0 = not enabled, anything else = enabled
/* there is probably a pointer or member instance of CPlayer in this class */
}
class CPlayer { // the player class, single-instance
// probably contained in or by CMainFrame
char temp[??]; // reserve some number of bytes calculated
// from where the compiler puts the CPlayer
// instance in memory.
unsigned int BPM; // 0x004F0180
unsigned int TPB; // 0x004F0184
/* ... 28 bytes ... */
CSequencer* sequencer; // 0x004F01B0,
// a.k.a HACKsong_pos_pointer from BuzzHACK
}
class CSequencer {
char[912]; // 912 bytes of unknown data ...
int loopBegin; // CSequencer + 0x390
int loopEnd; // CSequencer + 0x394
int songEnd; // CSequencer + 0x398
int songPos; // CSequencer + 0x39C
}
class CMachine {
char temp[16]; // 16 bytes of unknown data
char* songName // CMachine + 0x14
char temp[??]; // ?? bytes of unknown data
CMachineInterfaceEx* ex; // CMachine + 0x50, ??? PVSTi calls
// vtbl+0x14 on this object with two
// arguments when connecting to a playing
// machine
char temp[??]; // ?? bytes of unknown data
tval globalVals; // CMachine + 0x68
// copy of machine global parameters
tval trackVals; // CMachine + 0x6C
// copy of machine track parameters
}
