mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-02 09:17:26 +00:00
fix OPN CSM osc view, fix OPNA ADPCM channel not playing
This commit is contained in:
parent
5f47166012
commit
2e2796c245
4 changed files with 34 additions and 24 deletions
|
@ -238,7 +238,7 @@ void DivPlatformYM2203::acquire_combo(short** buf, size_t len) {
|
|||
}
|
||||
|
||||
for (int i=(3+isCSM); i<(6+isCSM); i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=fmout.data[i-2+isCSM]<<1;
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=fmout.data[i-(2+isCSM)]<<1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -280,9 +280,9 @@ const char** DivPlatformYM2608::getRegisterSheet() {
|
|||
}
|
||||
|
||||
double DivPlatformYM2608::NOTE_OPNB(int ch, int note) {
|
||||
if (ch>8) { // ADPCM-B
|
||||
if (ch>(8+isCSM)) { // ADPCM-B
|
||||
return NOTE_ADPCMB(note);
|
||||
} else if (ch>5) { // PSG
|
||||
} else if (ch>(5+isCSM)) { // PSG
|
||||
return NOTE_PERIODIC(note);
|
||||
}
|
||||
// FM
|
||||
|
@ -290,8 +290,8 @@ double DivPlatformYM2608::NOTE_OPNB(int ch, int note) {
|
|||
}
|
||||
|
||||
double DivPlatformYM2608::NOTE_ADPCMB(int note) {
|
||||
if (chan[15].sample>=0 && chan[15].sample<parent->song.sampleLen) {
|
||||
double off=65535.0*(double)(parent->getSample(chan[15].sample)->centerRate)/8363.0;
|
||||
if (chan[15+isCSM].sample>=0 && chan[15+isCSM].sample<parent->song.sampleLen) {
|
||||
double off=65535.0*(double)(parent->getSample(chan[15+isCSM].sample)->centerRate)/8363.0;
|
||||
return parent->calcBaseFreq((double)chipClock/144,off,note,false);
|
||||
}
|
||||
return 0;
|
||||
|
@ -404,7 +404,7 @@ void DivPlatformYM2608::acquire_combo(short** buf, size_t len) {
|
|||
buf[1][h]=os[1];
|
||||
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
for (int i=0; i<(psgChanOffs-isCSM); i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm_nuked.ch_out[i]<<1,-32768,32767);
|
||||
}
|
||||
|
||||
|
@ -961,8 +961,8 @@ void DivPlatformYM2608::tick(bool sysTick) {
|
|||
if (chan[(15+isCSM)].std.panL.had) {
|
||||
if (chan[(15+isCSM)].pan!=(chan[(15+isCSM)].std.panL.val&3)) {
|
||||
chan[(15+isCSM)].pan=chan[(15+isCSM)].std.panL.val&3;
|
||||
if (!isMuted[15]) {
|
||||
immWrite(0x101,(isMuted[15]?0:(chan[(15+isCSM)].pan<<6))|1);
|
||||
if (!isMuted[(15 + isCSM)]) {
|
||||
immWrite(0x101,(isMuted[(15 + isCSM)]?0:(chan[(15+isCSM)].pan<<6))|1);
|
||||
hardResetElapsed++;
|
||||
}
|
||||
}
|
||||
|
@ -1308,7 +1308,7 @@ int DivPlatformYM2608::dispatch(DivCommand c) {
|
|||
immWrite(0x101,(isMuted[c.chan]?0:(chan[c.chan].pan<<6))|1);
|
||||
break;
|
||||
}
|
||||
if (c.chan>8) {
|
||||
if (c.chan>(8 + isCSM)) {
|
||||
immWrite(0x18+(c.chan-(9+isCSM)),isMuted[c.chan]?0:((chan[c.chan].pan<<6)|chan[c.chan].outVol));
|
||||
break;
|
||||
}
|
||||
|
@ -1647,8 +1647,8 @@ void DivPlatformYM2608::muteChannel(int ch, bool mute) {
|
|||
immWrite(0x18+(ch-9),isMuted[ch]?0:((chan[ch].pan<<6)|chan[ch].outVol));
|
||||
return;
|
||||
}
|
||||
if (ch>5) { // PSG
|
||||
ay->muteChannel(ch-6,mute);
|
||||
if (ch>(5+isCSM)) { // PSG
|
||||
ay->muteChannel(ch-(6+isCSM),mute);
|
||||
return;
|
||||
}
|
||||
// FM
|
||||
|
@ -1698,7 +1698,7 @@ void DivPlatformYM2608::forceIns() {
|
|||
}
|
||||
immWrite(0x11,globalRSSVolume&0x3f);
|
||||
immWrite(0x22,lfoValue);
|
||||
for (int i=(+isCSM); i<(16+isCSM); i++) {
|
||||
for (int i=(9+isCSM); i<(16+isCSM); i++) {
|
||||
chan[i].insChanged=true;
|
||||
if (i>(14+isCSM)) { // ADPCM-B
|
||||
immWrite(0x10b,chan[i].outVol);
|
||||
|
@ -1721,7 +1721,7 @@ void* DivPlatformYM2608::getChanState(int ch) {
|
|||
}
|
||||
|
||||
DivMacroInt* DivPlatformYM2608::getChanMacroInt(int ch) {
|
||||
if (ch>=(6+isCSM) && ch<(9+isCSM)) return ay->getChanMacroInt(ch-6);
|
||||
if (ch>=(6+isCSM) && ch<(9+isCSM)) return ay->getChanMacroInt(ch-(6+isCSM));
|
||||
return &chan[ch].std;
|
||||
}
|
||||
|
||||
|
@ -1760,7 +1760,7 @@ void DivPlatformYM2608::reset() {
|
|||
OPN2_SetChipType(&fm_nuked,ym3438_mode_opn);
|
||||
fm->reset();
|
||||
memset(&fm_lle,0,sizeof(fmopna_t));
|
||||
for (int i=0; i<16; i++) {
|
||||
for (int i=0; i<17; i++) {
|
||||
chan[i]=DivPlatformOPN::OPNChannelStereo();
|
||||
chan[i].std.setEngine(parent);
|
||||
}
|
||||
|
@ -1774,7 +1774,7 @@ void DivPlatformYM2608::reset() {
|
|||
for (int i=(9+isCSM); i<(15+isCSM); i++) {
|
||||
chan[i].vol=0x1f;
|
||||
}
|
||||
chan[15].vol=0xff;
|
||||
chan[15+isCSM].vol=0xff;
|
||||
|
||||
for (int i=0; i<512; i++) {
|
||||
oldWrites[i]=-1;
|
||||
|
@ -2004,7 +2004,7 @@ void DivPlatformYM2608::setFlags(const DivConfig& flags) {
|
|||
} else {
|
||||
rate=fm->sample_rate(chipClock);
|
||||
}
|
||||
for (int i=0; i<(16+isCSM); i++) {
|
||||
for (int i=0; i<17; i++) {
|
||||
oscBuf[i]->rate=rate;
|
||||
}
|
||||
immWrite(0x2d,0xff);
|
||||
|
@ -2024,7 +2024,7 @@ int DivPlatformYM2608::init(DivEngine* p, int channels, int sugRate, const DivCo
|
|||
iface.sampleBank=0;
|
||||
dumpWrites=false;
|
||||
skipRegisterWrites=false;
|
||||
for (int i=0; i<16+isCSM; i++) {
|
||||
for (int i=0; i<17; i++) {
|
||||
isMuted[i]=false;
|
||||
oscBuf[i]=new DivDispatchOscBuffer;
|
||||
}
|
||||
|
@ -2041,6 +2041,10 @@ int DivPlatformYM2608::init(DivEngine* p, int channels, int sugRate, const DivCo
|
|||
|
||||
void DivPlatformYM2608::setCSM(bool isCSM) {
|
||||
this->isCSM=isCSM;
|
||||
psgChanOffs=6+isCSM; // doing this hurts me...
|
||||
adpcmAChanOffs=9+isCSM;
|
||||
adpcmBChanOffs=15+isCSM;
|
||||
chanNum=16+isCSM;
|
||||
if (isCSM) {
|
||||
csmChan=6;
|
||||
} else {
|
||||
|
|
|
@ -399,6 +399,9 @@ int DivPlatformYM2608Ext::dispatch(DivCommand c) {
|
|||
case DIV_CMD_MACRO_ON:
|
||||
opChan[ch].std.mask(c.value,false);
|
||||
break;
|
||||
case DIV_CMD_MACRO_RESTART:
|
||||
chan[c.chan].std.restart(c.value);
|
||||
break;
|
||||
case DIV_CMD_PRE_PORTA:
|
||||
break;
|
||||
default:
|
||||
|
@ -856,7 +859,7 @@ int DivPlatformYM2608Ext::init(DivEngine* parent, int channels, int sugRate, con
|
|||
extSys=true;
|
||||
|
||||
reset();
|
||||
return 19+isCSM;
|
||||
return 20;
|
||||
}
|
||||
|
||||
void DivPlatformYM2608Ext::quit() {
|
||||
|
|
|
@ -1219,7 +1219,7 @@ void DivEngine::registerSystems() {
|
|||
|
||||
sysDefs[DIV_SYSTEM_YM2203_EXT]=new DivSysDef(
|
||||
_("Yamaha YM2203 (OPN) Extended Channel 3"), NULL, 0xb6, 0, 9, true, true, 0x151, false, 1U<<DIV_SAMPLE_DEPTH_8BIT, 0, 0,
|
||||
_("cost-reduced version of the OPM with a different register layout and no stereo...\n...but it has a built-in AY-3-8910! (actually an YM2149)\nthis one is in Extended Channel mode, which turns the third FM channel into four operators with independent notes/frequencies"),
|
||||
_("cost-reduced version of the OPM with a different register layout and no stereo...\n...but it has a built-in AY-3-8910! (actually an YM2149)\nthis one is in Extended Channel mode, which turns the third FM channel into four operators with independent notes/frequencies."),
|
||||
{_("FM 1"), _("FM 2"), _("FM 3 OP1"), _("FM 3 OP2"), _("FM 3 OP3"), _("FM 3 OP4"), _("PSG 1"), _("PSG 2"), _("PSG 3")},
|
||||
{"F1", "F2", "O1", "O2", "O3", "O4", "S1", "S2", "S3"},
|
||||
{DIV_CH_FM, DIV_CH_FM, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_PULSE},
|
||||
|
@ -1232,7 +1232,8 @@ void DivEngine::registerSystems() {
|
|||
|
||||
sysDefs[DIV_SYSTEM_YM2203_CSM]=new DivSysDef(
|
||||
_("Yamaha YM2203 (OPN) CSM"), NULL, 0xc3, 0, 10, true, true, 0x151, false, 1U<<DIV_SAMPLE_DEPTH_8BIT, 0, 0,
|
||||
_("cost-reduced version of the OPM with a different register layout and no stereo...\n...but it has a built-in AY-3-8910! (actually an YM2149)\nCSM blah blah"),
|
||||
_("cost-reduced version of the OPM with a different register layout and no stereo...\n...but it has a built-in AY-3-8910! (actually an YM2149)\nthis one is in Extended Channel mode, which turns the third FM channel into four operators with independent notes/frequencies."
|
||||
"\nthis one includes CSM mode control for special effects on Channel 3."),
|
||||
{_("FM 1"), _("FM 2"), _("FM 3 OP1"), _("FM 3 OP2"), _("FM 3 OP3"), _("FM 3 OP4"), _("CSM Timer"), _("PSG 1"), _("PSG 2"), _("PSG 3")},
|
||||
{"F1", "F2", "O1", "O2", "O3", "O4", "CSM", "S1", "S2", "S3"},
|
||||
{DIV_CH_FM, DIV_CH_FM, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_NOISE, DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_PULSE},
|
||||
|
@ -1257,7 +1258,7 @@ void DivEngine::registerSystems() {
|
|||
|
||||
sysDefs[DIV_SYSTEM_YM2608_EXT]=new DivSysDef(
|
||||
_("Yamaha YM2608 (OPNA) Extended Channel 3"), NULL, 0xb7, 0, 19, true, true, 0x151, false, (1U<<DIV_SAMPLE_DEPTH_ADPCM_B)|(1U<<DIV_SAMPLE_DEPTH_8BIT), 0, 0,
|
||||
_("OPN but twice the FM channels, stereo makes a come-back and has rhythm and ADPCM channels.\nthis one is in Extended Channel mode, which turns the third FM channel into four operators with independent notes/frequencies"),
|
||||
_("OPN but twice the FM channels, stereo makes a come-back and has rhythm and ADPCM channels.\nthis one is in Extended Channel mode, which turns the third FM channel into four operators with independent notes/frequencies."),
|
||||
{_("FM 1"), _("FM 2"), _("FM 3 OP1"), _("FM 3 OP2"), _("FM 3 OP3"), _("FM 3 OP4"), _("FM 4"), _("FM 5"), _("FM 6"), _("Square 1"), _("Square 2"), _("Square 3"), _("Kick"), _("Snare"), _("Top"), _("HiHat"), _("Tom"), _("Rim"), _("ADPCM")},
|
||||
{"F1", "F2", "O1", "O2", "O3", "O4", "F4", "F5", "F6", "S1", "S2", "S3", "BD", "SD", "TP", "HH", "TM", "RM", "P"},
|
||||
{DIV_CH_FM, DIV_CH_FM, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_PCM},
|
||||
|
@ -1270,7 +1271,8 @@ void DivEngine::registerSystems() {
|
|||
|
||||
sysDefs[DIV_SYSTEM_YM2608_CSM]=new DivSysDef(
|
||||
_("Yamaha YM2608 (OPNA) CSM"), NULL, 0xc4, 0, 20, true, true, 0x151, false, (1U<<DIV_SAMPLE_DEPTH_ADPCM_B)|(1U<<DIV_SAMPLE_DEPTH_8BIT), 0, 0,
|
||||
_("OPN but twice the FM channels, stereo makes a come-back and has rhythm and ADPCM channels.\nCSM blah blah"),
|
||||
_("OPN but twice the FM channels, stereo makes a come-back and has rhythm and ADPCM channels.\nthis one is in Extended Channel mode, which turns the third FM channel into four operators with independent notes/frequencies.\n"
|
||||
"this one includes CSM mode control for special effects on Channel 3."),
|
||||
{_("FM 1"), _("FM 2"), _("FM 3 OP1"), _("FM 3 OP2"), _("FM 3 OP3"), _("FM 3 OP4"), _("FM 4"), _("FM 5"), _("FM 6"), _("CSM Timer"), _("Square 1"), _("Square 2"), _("Square 3"), _("Kick"), _("Snare"), _("Top"), _("HiHat"), _("Tom"), _("Rim"), _("ADPCM")},
|
||||
{"F1", "F2", "O1", "O2", "O3", "O4", "F4", "F5", "F6", "CSM", "S1", "S2", "S3", "BD", "SD", "TP", "HH", "TM", "RM", "P"},
|
||||
{DIV_CH_FM, DIV_CH_FM, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_NOISE, DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_PCM},
|
||||
|
@ -1669,7 +1671,8 @@ void DivEngine::registerSystems() {
|
|||
|
||||
sysDefs[DIV_SYSTEM_YM2610B_CSM]=new DivSysDef(
|
||||
_("Yamaha YM2610B (OPNB2) CSM"), NULL, 0xc5, 0, 20, true, false, 0x151, false, (1U<<DIV_SAMPLE_DEPTH_ADPCM_A)|(1U<<DIV_SAMPLE_DEPTH_ADPCM_B)|(1U<<DIV_SAMPLE_DEPTH_8BIT), 0, 0,
|
||||
_("so Taito asked Yamaha if they could get the two missing FM channels back, and Yamaha gladly provided them with this chip.\nCSM blah blah"),
|
||||
_("so Taito asked Yamaha if they could get the two missing FM channels back, and Yamaha gladly provided them with this chip.\nthis one is in Extended Channel mode, which turns the third FM channel into four operators with independent notes/frequencies."
|
||||
"\nthis one includes CSM mode control for special effects on Channel 3."),
|
||||
{_("FM 1"), _("FM 2"), _("FM 3 OP1"), _("FM 3 OP2"), _("FM 3 OP3"), _("FM 3 OP4"), _("FM 4"), _("FM 5"), _("FM 6"), _("CSM Timer"), _("PSG 1"), _("PSG 2"), _("PSG 3"), _("ADPCM-A 1"), _("ADPCM-A 2"), _("ADPCM-A 3"), _("ADPCM-A 4"), _("ADPCM-A 5"), _("ADPCM-A 6"), _("ADPCM-B")},
|
||||
{"F1", "F2", "O1", "O2", "O3", "O4", "F4", "F5", "F6", "CSM", "S1", "S2", "S3", "P1", "P2", "P3", "P4", "P5", "P6", "B"},
|
||||
{DIV_CH_FM, DIV_CH_FM, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_NOISE, DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_PCM},
|
||||
|
@ -1981,7 +1984,7 @@ void DivEngine::registerSystems() {
|
|||
|
||||
sysDefs[DIV_SYSTEM_YM2612_DUALPCM_EXT]=new DivSysDef(
|
||||
_("Yamaha YM2612 (OPN2) Extended Channel 3 with DualPCM and CSM"), NULL, 0xbd, 0, 11, true, false, 0x150, false, 1U<<DIV_SAMPLE_DEPTH_8BIT, 0, 0,
|
||||
_("this chip is mostly known for being in the Sega Genesis (but it also was on the FM Towns computer).\nthis system uses software mixing to provide two sample channels.\nthis one is in Extended Channel mode, which turns the third FM channel into four operators with independent notes/frequencies."),
|
||||
_("this chip is mostly known for being in the Sega Genesis (but it also was on the FM Towns computer).\nthis system uses software mixing to provide two sample channels.\nthis one is in Extended Channel mode, which turns the third FM channel into four operators with independent notes/frequencies.\nthis one includes CSM mode control for special effects on Channel 3."),
|
||||
{_("FM 1"), _("FM 2"), _("FM 3 OP1"), _("FM 3 OP2"), _("FM 3 OP3"), _("FM 3 OP4"), _("FM 4"), _("FM 5"), _("FM 6/PCM 1"), _("PCM 2"), _("CSM Timer")},
|
||||
{"F1", "F2", "O1", "O2", "O3", "O4", "F4", "F5", "P1", "P2", "CSM"},
|
||||
{DIV_CH_FM, DIV_CH_FM, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_OP, DIV_CH_FM, DIV_CH_FM, DIV_CH_PCM, DIV_CH_PCM, DIV_CH_NOISE},
|
||||
|
|
Loading…
Reference in a new issue