22 #ifndef AGOS_SFXPARSER_ACCOLADE_H 23 #define AGOS_SFXPARSER_ACCOLADE_H 25 #include "agos/drivers/accolade/adlib.h" 26 #include "agos/drivers/accolade/mt32.h" 28 #include "common/mutex.h" 29 #include "common/stream.h" 36 static const byte INSTRUMENT_SIZE_MT32 = 0xF9;
38 static const uint16 SCRIPT_TIMER_FREQUENCY = 292;
40 static const uint16 SCRIPT_TIMER_RATE = 1000000 / SCRIPT_TIMER_FREQUENCY;
44 static const byte INSTRUMENT_SIZE_ADLIB = 0x09;
46 static const byte MAX_SCRIPT_SIZE = 0x30;
48 static const byte OPL2_NUM_SOURCES = 2;
50 static const byte OPL3_NUM_SOURCES = 4;
55 byte instrumentDefinition[INSTRUMENT_SIZE_MT32];
57 int16 scriptData[MAX_SCRIPT_SIZE];
86 uint16 currentNoteFraction;
93 int16 noteFractionDelta;
117 bool atEndOfScript();
120 int16 readScript(
bool opCode);
133 void setTimerRate(uint32 rate);
136 void play(uint8 sfxNumber);
140 void pauseAll(
bool paused);
143 static void timerCallback(
void *data);
149 void processOpCode(
SfxSlot *sfxSlot, byte opCode);
152 virtual byte getNumberOfSfxSources() = 0;
162 virtual bool loadInstrument(
SfxSlot *sfxSlot) = 0;
164 virtual void changeInstrument(
SfxSlot *sfxSlot) { };
166 virtual void noteOn(
SfxSlot *sfxSlot);
168 virtual void noteOff(
SfxSlot *sfxSlot);
170 virtual void updateNote(
SfxSlot *sfxSlot) { };
185 int8 _sourceAllocations[4];
197 byte getNumberOfSfxSources()
override;
199 bool loadInstrument(
SfxSlot *sfxSlot)
override;
200 void noteOn(
SfxSlot *sfxSlot)
override;
201 void updateNote(
SfxSlot *sfxSlot)
override;
212 byte getNumberOfSfxSources()
override;
214 bool loadInstrument(
SfxSlot *sfxSlot)
override;
215 void changeInstrument(
SfxSlot *sfxSlot)
override;
Definition: sfxparser_accolade.h:63
Definition: mididrv_ms.h:86
Definition: sfxparser_accolade.h:206
Definition: sfxparser_accolade.h:53
Definition: sfxparser_accolade.h:33
Definition: sfxparser_accolade.h:191