Virtual Boy: VGM export

This commit is contained in:
tildearrow 2022-10-09 00:00:00 -05:00
parent 504778d975
commit b53319354c
3 changed files with 21 additions and 5 deletions

View file

@ -25,7 +25,7 @@
#define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
#define chWrite(c,a,v) rWrite(0x400+((c)<<6)+((a)<<2),v);
#define CHIP_DIVIDER 64
#define CHIP_DIVIDER 16
const char* regCheatSheetVB[]={
"Wave0", "000",
@ -75,7 +75,7 @@ const char* regCheatSheetVB[]={
"S4EV1", "514",
"S4RAM", "518",
"S5SWP", "51C",
"S4SWP", "51C",
"S5INT", "540",
"S5LRV", "544",
@ -598,9 +598,9 @@ void DivPlatformVB::notifyInsDeletion(void* ins) {
}
void DivPlatformVB::setFlags(const DivConfig& flags) {
chipClock=20000000.0;
chipClock=5000000.0;
antiClickEnabled=!flags.getBool("noAntiClick",false);
rate=chipClock/64;
rate=chipClock/16;
for (int i=0; i<6; i++) {
oscBuf[i]->rate=rate;
}

View file

@ -1173,7 +1173,7 @@ void DivEngine::registerSystems() {
);
sysDefs[DIV_SYSTEM_VBOY]=new DivSysDef(
"Virtual Boy", NULL, 0x9c, 0, 6, false, true, 0, false, 1U<<DIV_SAMPLE_DEPTH_8BIT,
"Virtual Boy", NULL, 0x9c, 0, 6, false, true, 0x171, false, 1U<<DIV_SAMPLE_DEPTH_8BIT,
"a console which failed to sell well due to its headache-inducing features.",
{"Channel 1", "Channel 2", "Channel 3", "Channel 4", "Channel 5", "Noise"},
{"CH1", "CH2", "CH3", "CH4", "CH5", "NO"},

View file

@ -683,6 +683,11 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
w->writeC(write.val&0xff);
}
break;
case DIV_SYSTEM_VBOY:
w->writeC(0xc7);
w->writeS_BE(baseAddr2S|(write.addr>>2));
w->writeC(write.val&0xff);
break;
case DIV_SYSTEM_OPL:
case DIV_SYSTEM_OPL_DRUMS:
w->writeC(0x0b|baseAddr1);
@ -1217,6 +1222,17 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
howManyChips++;
}
break;
case DIV_SYSTEM_VBOY:
if (!hasVSU) {
hasVSU=disCont[i].dispatch->chipClock;
willExport[i]=true;
} else if (!(hasVSU&0x40000000)) {
isSecond[i]=true;
willExport[i]=true;
hasVSU|=0x40000000;
howManyChips++;
}
break;
case DIV_SYSTEM_OPL:
case DIV_SYSTEM_OPL_DRUMS:
if (!hasOPL) {