POKEY: VGM export

This commit is contained in:
tildearrow 2022-12-20 14:54:55 -05:00
parent 15afb1da84
commit b7302e0d98
3 changed files with 25 additions and 3 deletions

View file

@ -1,9 +1,8 @@
# to-do for 0.6pre2 # to-do for 0.6pre2
- POKEY
- Pokémon Mini - Pokémon Mini
- register layout - register layout
- confirm emulation - confirm emulation
- (maybe) YM2612 CSM (no DualPCM) - (maybe) YM2612 CSM (no DualPCM)
- port op macro code to all other OPN chips - port op macro code to all other OPN chips
- bug fixes - bug fixes

View file

@ -1119,7 +1119,7 @@ void DivEngine::registerSystems() {
); );
sysDefs[DIV_SYSTEM_POKEY]=new DivSysDef( sysDefs[DIV_SYSTEM_POKEY]=new DivSysDef(
"POKEY", NULL, 0x94, 0, 4, false, true, 0, false, 0, "POKEY", NULL, 0x94, 0, 4, false, true, 0x161, false, 0,
"TIA, but better and more flexible.\nused in the Atari 8-bit family of computers (400/800/XL/XE).", "TIA, but better and more flexible.\nused in the Atari 8-bit family of computers (400/800/XL/XE).",
{"Channel 1", "Channel 2", "Channel 3", "Channel 4"}, {"Channel 1", "Channel 2", "Channel 3", "Channel 4"},
{"CH1", "CH2", "CH3", "CH4"}, {"CH1", "CH2", "CH3", "CH4"},

View file

@ -333,6 +333,13 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
w->writeC(0); w->writeC(0);
} }
break; break;
case DIV_SYSTEM_POKEY:
for (int i=0; i<9; i++) {
w->writeC(0xbb);
w->writeC(i|baseAddr2);
w->writeC(0);
}
break;
case DIV_SYSTEM_LYNX: case DIV_SYSTEM_LYNX:
w->writeC(0x4e); w->writeC(0x4e);
w->writeC(0x44); w->writeC(0x44);
@ -698,6 +705,11 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
w->writeC(baseAddr2|(write.addr&0xff)); w->writeC(baseAddr2|(write.addr&0xff));
w->writeC(write.val); w->writeC(write.val);
break; break;
case DIV_SYSTEM_POKEY:
w->writeC(0xbb);
w->writeC(baseAddr2|(write.addr&0x0f));
w->writeC(write.val&0xff);
break;
case DIV_SYSTEM_LYNX: case DIV_SYSTEM_LYNX:
w->writeC(0x4e); w->writeC(0x4e);
w->writeC(write.addr&0xff); w->writeC(write.addr&0xff);
@ -1246,6 +1258,17 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
howManyChips++; howManyChips++;
} }
break; break;
case DIV_SYSTEM_POKEY:
if (!hasPOKEY) {
hasPOKEY=disCont[i].dispatch->chipClock;
willExport[i]=true;
} else if (!(hasPOKEY&0x40000000)) {
isSecond[i]=true;
willExport[i]=true;
hasPOKEY|=0x40000000;
howManyChips++;
}
break;
case DIV_SYSTEM_LYNX: case DIV_SYSTEM_LYNX:
if (!hasLynx) { if (!hasLynx) {
hasLynx=disCont[i].dispatch->chipClock; hasLynx=disCont[i].dispatch->chipClock;