T6W28: VGM export
This commit is contained in:
parent
340a70653b
commit
285d81c716
|
@ -1657,7 +1657,7 @@ void DivEngine::registerSystems() {
|
||||||
|
|
||||||
sysDefs[DIV_SYSTEM_T6W28]=new DivSysDef(
|
sysDefs[DIV_SYSTEM_T6W28]=new DivSysDef(
|
||||||
// 0x0a = wild guess. it may as well be 0x83
|
// 0x0a = wild guess. it may as well be 0x83
|
||||||
"T6W28", NULL, 0xbf, 0x0a, 4, false, true, 0, false, 0,
|
"T6W28", NULL, 0xbf, 0x0a, 4, false, true, 0x160, false, 0,
|
||||||
"an SN76489 derivative used in Neo Geo Pocket, has independent stereo volume and noise channel frequency.",
|
"an SN76489 derivative used in Neo Geo Pocket, has independent stereo volume and noise channel frequency.",
|
||||||
{"Square 1", "Square 2", "Square 3", "Noise"},
|
{"Square 1", "Square 2", "Square 3", "Noise"},
|
||||||
{"S1", "S2", "S3", "NO"},
|
{"S1", "S2", "S3", "NO"},
|
||||||
|
|
|
@ -79,6 +79,14 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
|
||||||
w->writeC(0x90|(i<<5)|15);
|
w->writeC(0x90|(i<<5)|15);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case DIV_SYSTEM_T6W28:
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
w->writeC(0x30);
|
||||||
|
w->writeC(0x90|(i<<5)|15);
|
||||||
|
w->writeC(0x50);
|
||||||
|
w->writeC(0x90|(i<<5)|15);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case DIV_SYSTEM_GB:
|
case DIV_SYSTEM_GB:
|
||||||
// square 1
|
// square 1
|
||||||
w->writeC(0xb3);
|
w->writeC(0xb3);
|
||||||
|
@ -497,6 +505,12 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
|
||||||
w->writeC(baseAddr2|12);
|
w->writeC(baseAddr2|12);
|
||||||
w->writeC(1);
|
w->writeC(1);
|
||||||
break;
|
break;
|
||||||
|
case DIV_SYSTEM_VBOY:
|
||||||
|
// isn't it amazing when a chip has a built-in reset command?
|
||||||
|
w->writeC(0xc7);
|
||||||
|
w->writeS_BE(baseAddr2S|(0x580>>2));
|
||||||
|
w->writeC(0xff);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -559,6 +573,14 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
|
||||||
w->writeC(smsAddr);
|
w->writeC(smsAddr);
|
||||||
w->writeC(write.val);
|
w->writeC(write.val);
|
||||||
break;
|
break;
|
||||||
|
case DIV_SYSTEM_T6W28:
|
||||||
|
if (write.addr) {
|
||||||
|
w->writeC(0x30);
|
||||||
|
} else {
|
||||||
|
w->writeC(0x50);
|
||||||
|
}
|
||||||
|
w->writeC(write.val);
|
||||||
|
break;
|
||||||
case DIV_SYSTEM_GB:
|
case DIV_SYSTEM_GB:
|
||||||
w->writeC(0xb3);
|
w->writeC(0xb3);
|
||||||
w->writeC(baseAddr2|((write.addr-16)&0xff));
|
w->writeC(baseAddr2|((write.addr-16)&0xff));
|
||||||
|
@ -808,14 +830,14 @@ void DivEngine::performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHIP_VOL(_id,_mult) { \
|
#define CHIP_VOL(_id,_mult) { \
|
||||||
double _vol=fabs(song.systemVol[i])*4.0*_mult; \
|
double _vol=fabs((float)song.systemVol[i])*4.0*_mult; \
|
||||||
if (_vol<0.0) _vol=0.0; \
|
if (_vol<0.0) _vol=0.0; \
|
||||||
if (_vol>32767.0) _vol=32767.0; \
|
if (_vol>32767.0) _vol=32767.0; \
|
||||||
chipVol.push_back((_id)|(0x80000000)|(((unsigned int)_vol)<<16)); \
|
chipVol.push_back((_id)|(0x80000000)|(((unsigned int)_vol)<<16)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHIP_VOL_SECOND(_id,_mult) { \
|
#define CHIP_VOL_SECOND(_id,_mult) { \
|
||||||
double _vol=fabs(song.systemVol[i])*4.0*_mult; \
|
double _vol=fabs((float)song.systemVol[i])*4.0*_mult; \
|
||||||
if (_vol<0.0) _vol=0.0; \
|
if (_vol<0.0) _vol=0.0; \
|
||||||
if (_vol>32767.0) _vol=32767.0; \
|
if (_vol>32767.0) _vol=32767.0; \
|
||||||
chipVol.push_back((_id)|(0x80000100)|(((unsigned int)_vol)<<16)); \
|
chipVol.push_back((_id)|(0x80000100)|(((unsigned int)_vol)<<16)); \
|
||||||
|
@ -1362,6 +1384,13 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
|
||||||
howManyChips++;
|
howManyChips++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case DIV_SYSTEM_T6W28:
|
||||||
|
if (!hasSN) {
|
||||||
|
hasSN=0xc0000000|disCont[i].dispatch->chipClock;
|
||||||
|
CHIP_VOL(0,1.0);
|
||||||
|
willExport[i]=true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue