wavelength 1.0.0
Loading...
Searching...
No Matches
BankLoader Class Reference

Loader of the sound banks of a song, from its track named "BANK". More...

#include <bankloader.h>

Classes

class  PermBankLoader
 Loader of one permanent bank, bound to a synthesiser bank slot. More...
class  SwapBankLoader
 Loader that swaps the banks of a song through two synthesiser slots as the song moves on. More...

Public Types

enum  State { kStateIdle = 0 , kStateLoading = 1 , kStateLoaded = 2 , kStatePlaying = 3 }
 Values of mState. More...

Public Member Functions

 BankLoader (unsigned short nFirstSlot, PlayMap *pPlayMap, int nIntroBars, int nNumBars, int nTicksPerBar)
 Construct a loader with no bank.
 ~BankLoader ()
 Stop a load and release the loaders.
void AddPermBank (const char *pszFile)
 Add a permanent bank in the next free slot.
void AddSwapBank (const char *pszFile, int nBar)
 Add a swapped bank that plays from a bar on.
void Load ()
 Start loading the sound banks.
bool PollLoad ()
 Advance the load and report whether it finished.
void Start ()
 Enter the playing state and start swapping the banks.
void Stop ()
 Stop a load or the swapping that is under way.
void Restart ()
 Swap the banks for the song position again.
int GetNumSlots ()
 Report the number of slots the banks fill.
unsigned short GetEndBankSlot ()
 Report the first synthesiser bank slot after the slots the banks fill.

Detailed Description

Loader of the sound banks of a song, from its track named "BANK".

The class is not polymorphic. The RTTI of the nested BankLoader::PermBankLoader and BankLoader::SwapBankLoader records the name. A permanent bank stays in its synthesiser slot for the whole song. The swapped banks take turns in two slots after the permanent banks, each from the bar the track gives.

Member Enumeration Documentation

◆ State

Values of mState.

Enumerator
kStateIdle 

Not loading.

kStateLoading 

The banks load.

kStateLoaded 

Every bank is loaded.

kStatePlaying 

The song plays.

Constructor & Destructor Documentation

◆ BankLoader()

BankLoader::BankLoader ( unsigned short nFirstSlot,
PlayMap * pPlayMap,
int nIntroBars,
int nNumBars,
int nTicksPerBar )

Construct a loader with no bank.

Parameters
nFirstSlotThe synthesiser slot of the first bank.
pPlayMapThe map of the song positions.
nIntroBarsThe bars before bar 0.
nNumBarsThe length of the song in bars.
nTicksPerBarThe song ticks in one bar.
Ghidra address:
NTSC-U/C: 0x00149b80
Ghidra address:
PAL: 0x0014b540

◆ ~BankLoader()

BankLoader::~BankLoader ( )

Stop a load and release the loaders.

Ghidra address:
NTSC-U/C: 0x00149bc0
Ghidra address:
PAL: 0x0014b580

Member Function Documentation

◆ AddPermBank()

void BankLoader::AddPermBank ( const char * pszFile)

Add a permanent bank in the next free slot.

Parameters
pszFileThe bank file.
Ghidra address:
NTSC-U/C: 0x00149c88
Ghidra address:
PAL: 0x0014b648

◆ AddSwapBank()

void BankLoader::AddSwapBank ( const char * pszFile,
int nBar )

Add a swapped bank that plays from a bar on.

Parameters
pszFileThe bank file.
nBarThe bar.
Ghidra address:
NTSC-U/C: 0x00149e00
Ghidra address:
PAL: 0x0014b7c0

◆ Load()

void BankLoader::Load ( )

Start loading the sound banks.

The first load also divides the synthesiser memory among the slots and loads the permanent banks.

Ghidra address:
NTSC-U/C: 0x00149e90
Ghidra address:
PAL: 0x0014b850

◆ PollLoad()

bool BankLoader::PollLoad ( )

Advance the load and report whether it finished.

Returns
Whether every bank is loaded.
Ghidra address:
NTSC-U/C: 0x00149f88
Ghidra address:
PAL: 0x0014b948

◆ Start()

void BankLoader::Start ( )

Enter the playing state and start swapping the banks.

Ghidra address:
NTSC-U/C: 0x0014a028
Ghidra address:
PAL: 0x0014b9e8

◆ Stop()

void BankLoader::Stop ( )

Stop a load or the swapping that is under way.

Ghidra address:
NTSC-U/C: 0x0014a058
Ghidra address:
PAL: 0x0014ba18

◆ Restart()

void BankLoader::Restart ( )

Swap the banks for the song position again.

Ghidra address:
NTSC-U/C: 0x0014a090
Ghidra address:
PAL: 0x0014ba50

◆ GetNumSlots()

int BankLoader::GetNumSlots ( )

Report the number of slots the banks fill.

Returns
The permanent banks, and two more when there are swapped banks.
Ghidra address:
NTSC-U/C: 0x0014a0b8
Ghidra address:
PAL: 0x0014ba78

◆ GetEndBankSlot()

unsigned short BankLoader::GetEndBankSlot ( )

Report the first synthesiser bank slot after the slots the banks fill.

Returns
The slot.
Ghidra address:
NTSC-U/C: 0x0014a0e8
Ghidra address:
PAL: 0x0014baa8

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