earliest VGM export!
only supports single-chip Genesis for now the other systems will be added shortly
This commit is contained in:
parent
35ee06d6cf
commit
858d5343b8
6 changed files with 284 additions and 52 deletions
|
|
@ -192,6 +192,7 @@ void DivPlatformGenesis::tick() {
|
|||
immWrite(chanOffs[i]+ADDR_FREQ,freqt&0xff);
|
||||
if (chan[i].furnaceDac) {
|
||||
dacRate=(1280000*1.25)/chan[i].baseFreq;
|
||||
if (dumpWrites) addWrite(0xffff0001,chan[i].baseFreq);
|
||||
}
|
||||
chan[i].freqChanged=false;
|
||||
}
|
||||
|
|
@ -202,6 +203,11 @@ void DivPlatformGenesis::tick() {
|
|||
}
|
||||
|
||||
psg.tick();
|
||||
|
||||
for (DivRegWrite& i: psg.getRegisterWrites()) {
|
||||
if (dumpWrites) addWrite(i.addr,i.val);
|
||||
}
|
||||
psg.getRegisterWrites().clear();
|
||||
}
|
||||
|
||||
int DivPlatformGenesis::octave(int freq) {
|
||||
|
|
@ -277,7 +283,10 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
dacSample=ins->amiga.initSample;
|
||||
if (dacSample<0 || dacSample>=parent->song.sampleLen) {
|
||||
dacSample=-1;
|
||||
if (dumpWrites) addWrite(0xffff0002,0);
|
||||
break;
|
||||
} else {
|
||||
if (dumpWrites) addWrite(0xffff0000,dacSample);
|
||||
}
|
||||
dacPos=0;
|
||||
dacPeriod=0;
|
||||
|
|
@ -288,11 +297,15 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
dacSample=12*sampleBank+c.value%12;
|
||||
if (dacSample>=parent->song.sampleLen) {
|
||||
dacSample=-1;
|
||||
if (dumpWrites) addWrite(0xffff0002,0);
|
||||
break;
|
||||
} else {
|
||||
if (dumpWrites) addWrite(0xffff0000,dacSample);
|
||||
}
|
||||
dacPos=0;
|
||||
dacPeriod=0;
|
||||
dacRate=1280000/parent->song.sample[dacSample]->rate;
|
||||
if (dumpWrites) addWrite(0xffff0001,parent->song.sample[dacSample]->rate);
|
||||
chan[c.chan].furnaceDac=false;
|
||||
}
|
||||
break;
|
||||
|
|
@ -342,6 +355,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
case DIV_CMD_NOTE_OFF:
|
||||
if (c.chan==5) {
|
||||
dacSample=-1;
|
||||
if (dumpWrites) addWrite(0xffff0002,0);
|
||||
}
|
||||
chan[c.chan].keyOff=true;
|
||||
chan[c.chan].active=false;
|
||||
|
|
@ -522,6 +536,11 @@ void DivPlatformGenesis::forceIns() {
|
|||
immWrite(0x22,lfoValue);
|
||||
}
|
||||
|
||||
void DivPlatformGenesis::toggleRegisterDump(bool enable) {
|
||||
DivDispatch::toggleRegisterDump(enable);
|
||||
psg.toggleRegisterDump(enable);
|
||||
}
|
||||
|
||||
void DivPlatformGenesis::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
OPN2_Reset(&fm);
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ class DivPlatformGenesis: public DivDispatch {
|
|||
bool isStereo();
|
||||
bool keyOffAffectsArp(int ch);
|
||||
bool keyOffAffectsPorta(int ch);
|
||||
void toggleRegisterDump(bool enable);
|
||||
void setPAL(bool pal);
|
||||
void notifyInsChange(int ins);
|
||||
void notifyInsDeletion(void* ins);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#define FREQ_BASE 1712.0f
|
||||
|
||||
#define rWrite(v) {sn->write(v); if (dumpWrites) {addWrite(0,v);} }
|
||||
#define rWrite(v) {sn->write(v); if (dumpWrites) {addWrite(0x200,v);} }
|
||||
|
||||
void DivPlatformSMS::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
sn->sound_stream_update(bufL+start,len);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue