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

Loader that swaps the banks of a song through two synthesiser slots as the song moves on. More...

#include <bankloader.h>

Classes

struct  SwapBank
 One bank file and its size. More...

Public Types

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

Public Member Functions

 SwapBankLoader (unsigned short nBaseSlot, PlayMap *pPlayMap, int nLeadBars, int nNumBars, int nTicksPerBar)
 Construct a loader with no banks.
 ~SwapBankLoader ()
 Unload the banks.
void AddBank (const char *pszFile, int nStartBar)
 Add a bank that plays from a bar to the end of the song.
int GetMaxBankSize () const
 Report the size of the largest bank.
void Load ()
 Start loading the first bank.
bool PollLoad ()
 Report whether the first bank is loaded.
void Start ()
 Load the bank the song needs next.
void Unload ()
 Withdraw the scheduled load and unload the slots.
void Restart ()
 Withdraw the scheduled load and load the bank the song needs next.
unsigned short GetBaseSlot () const

Detailed Description

Loader that swaps the banks of a song through two synthesiser slots as the song moves on.

The RTTI includes the nested name and the nested SwapBankLoader::SwapBank. The class is not polymorphic. Each bar of the song has a bank. While one slot plays, the loader loads the next different bank into the other slot ahead of the bar that needs it.

Member Enumeration Documentation

◆ State

Values of mState.

Enumerator
kStateIdle 

Nothing is loading.

kStateLoading 

The first bank loads.

kStateLoaded 

The first bank is loaded.

Constructor & Destructor Documentation

◆ SwapBankLoader()

BankLoader::SwapBankLoader::SwapBankLoader ( unsigned short nBaseSlot,
PlayMap * pPlayMap,
int nLeadBars,
int nNumBars,
int nTicksPerBar )

Construct a loader with no banks.

Parameters
nBaseSlotThe first of the two synthesiser slots.
pPlayMapThe play map of the song.
nLeadBarsThe bars before bar 0 that have a bank.
nNumBarsThe bars of the song.
nTicksPerBarThe song ticks in one bar.
Ghidra address:
NTSC-U/C: 0x00154bf0
Ghidra address:
PAL: 0x00156458

◆ ~SwapBankLoader()

BankLoader::SwapBankLoader::~SwapBankLoader ( )

Unload the banks.

Ghidra address:
NTSC-U/C: 0x00154d18
Ghidra address:
PAL: 0x00156580

Member Function Documentation

◆ AddBank()

void BankLoader::SwapBankLoader::AddBank ( const char * pszFile,
int nStartBar )

Add a bank that plays from a bar to the end of the song.

Parameters
pszFileThe bank file.
nStartBarThe first bar.
Ghidra address:
NTSC-U/C: 0x00154e00
Ghidra address:
PAL: 0x00156668

◆ GetMaxBankSize()

int BankLoader::SwapBankLoader::GetMaxBankSize ( ) const

Report the size of the largest bank.

Returns
The size, or 0 without banks.
Ghidra address:
NTSC-U/C: 0x001550e8
Ghidra address:
PAL: 0x00156950

◆ Load()

void BankLoader::SwapBankLoader::Load ( )

Start loading the first bank.

Ghidra address:
NTSC-U/C: 0x00155128
Ghidra address:
PAL: 0x00156990

◆ PollLoad()

bool BankLoader::SwapBankLoader::PollLoad ( )

Report whether the first bank is loaded.

Returns
Whether it is loaded, and true unless it is loading.
Ghidra address:
NTSC-U/C: 0x00155170
Ghidra address:
PAL: 0x001569d8

◆ Start()

void BankLoader::SwapBankLoader::Start ( )

Load the bank the song needs next.

Ghidra address:
NTSC-U/C: 0x001551d8
Ghidra address:
PAL: 0x00156a40

◆ Unload()

void BankLoader::SwapBankLoader::Unload ( )

Withdraw the scheduled load and unload the slots.

Ghidra address:
NTSC-U/C: 0x001551f8
Ghidra address:
PAL: 0x00156a60

◆ Restart()

void BankLoader::SwapBankLoader::Restart ( )

Withdraw the scheduled load and load the bank the song needs next.

Ghidra address:
NTSC-U/C: 0x001552b8
Ghidra address:
PAL: 0x00156b20

◆ GetBaseSlot()

unsigned short BankLoader::SwapBankLoader::GetBaseSlot ( ) const
inline
Returns
The first of the two synthesiser slots.

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