NOTICE: ADPCM-B DOES NOT WORK YET

it's selectable now but the channel is useless (for now)
This commit is contained in:
tildearrow 2022-02-10 03:35:08 -05:00
parent d27dcfecac
commit 91cbf9947b
5 changed files with 19 additions and 8 deletions

View File

@ -17,6 +17,7 @@
#include "platform/amiga.h"
#include "platform/dummy.h"
#include "../ta-log.h"
#include "song.h"
void DivDispatchContainer::setRates(double gotRate) {
blip_set_rates(bb[0],dispatch->rate,gotRate);
@ -153,9 +154,11 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do
((DivPlatformArcade*)dispatch)->setYMFM(eng->getConfInt("arcadeCore",0)==0);
break;
case DIV_SYSTEM_YM2610:
case DIV_SYSTEM_YM2610_FULL:
dispatch=new DivPlatformYM2610;
break;
case DIV_SYSTEM_YM2610_EXT:
case DIV_SYSTEM_YM2610_FULL_EXT:
dispatch=new DivPlatformYM2610Ext;
break;
case DIV_SYSTEM_AMIGA:

View File

@ -681,6 +681,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
return 0;
break;
case DIV_CMD_GET_VOLMAX:
if (c.chan>12) return 127;
if (c.chan>6) return 31;
if (c.chan>3) return 15;
return 127;
@ -740,7 +741,7 @@ void DivPlatformYM2610::forceIns() {
rWrite(chanOffs[i]+ADDR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3));
rWrite(chanOffs[i]+ADDR_LRAF,(isMuted[i]?0:(chan[i].pan<<6))|(chan[i].state.fms&7)|((chan[i].state.ams&3)<<4));
}
for (int i=4; i<13; i++) {
for (int i=4; i<14; i++) {
chan[i].insChanged=true;
}
immWrite(0x0b,ayEnvPeriod);
@ -766,7 +767,7 @@ void DivPlatformYM2610::reset() {
addWrite(0xffffffff,0);
}
fm->reset();
for (int i=0; i<13; i++) {
for (int i=0; i<14; i++) {
chan[i]=DivPlatformYM2610::Channel();
}
for (int i=0; i<4; i++) {
@ -779,6 +780,7 @@ void DivPlatformYM2610::reset() {
for (int i=7; i<13; i++) {
chan[i].vol=0x1f;
}
chan[13].vol=0x7f;
for (int i=0; i<512; i++) {
oldWrites[i]=-1;
@ -821,7 +823,7 @@ bool DivPlatformYM2610::keyOffAffectsArp(int ch) {
}
void DivPlatformYM2610::notifyInsChange(int ins) {
for (int i=0; i<13; i++) {
for (int i=0; i<14; i++) {
if (chan[i].ins==ins) {
chan[i].insChanged=true;
}
@ -838,7 +840,7 @@ int DivPlatformYM2610::init(DivEngine* p, int channels, int sugRate, unsigned in
parent=p;
dumpWrites=false;
skipRegisterWrites=false;
for (int i=0; i<13; i++) {
for (int i=0; i<14; i++) {
isMuted[i]=false;
}
chipClock=8000000;
@ -847,7 +849,7 @@ int DivPlatformYM2610::init(DivEngine* p, int channels, int sugRate, unsigned in
iface.sampleBank=0;
fm=new ymfm::ym2610(iface);
reset();
return 10;
return 14;
}
void DivPlatformYM2610::quit() {

View File

@ -28,8 +28,8 @@ class DivPlatformYM2610: public DivDispatch {
DivMacroInt std;
Channel(): freqH(0), freqL(0), freq(0), baseFreq(0), pitch(0), note(0), ins(-1), psgMode(1), autoEnvNum(0), autoEnvDen(0), active(false), insChanged(true), freqChanged(false), keyOn(false), keyOff(false), portaPause(false), inPorta(false), vol(0), outVol(15), pan(3) {}
};
Channel chan[13];
bool isMuted[13];
Channel chan[14];
bool isMuted[14];
struct QueuedWrite {
unsigned short addr;
unsigned char val;

View File

@ -305,7 +305,7 @@ int DivPlatformYM2610Ext::init(DivEngine* parent, int channels, int sugRate, uns
}
reset();
return 16;
return 17;
}
void DivPlatformYM2610Ext::quit() {

View File

@ -6085,6 +6085,8 @@ bool FurnaceGUI::loop() {
sysAddOption(DIV_SYSTEM_ARCADE);
sysAddOption(DIV_SYSTEM_YM2610);
sysAddOption(DIV_SYSTEM_YM2610_EXT);
sysAddOption(DIV_SYSTEM_YM2610_FULL);
sysAddOption(DIV_SYSTEM_YM2610_FULL_EXT);
sysAddOption(DIV_SYSTEM_AY8910);
sysAddOption(DIV_SYSTEM_AMIGA);
sysAddOption(DIV_SYSTEM_YM2151);
@ -6260,6 +6262,8 @@ bool FurnaceGUI::loop() {
case DIV_SYSTEM_GB:
case DIV_SYSTEM_YM2610:
case DIV_SYSTEM_YM2610_EXT:
case DIV_SYSTEM_YM2610_FULL:
case DIV_SYSTEM_YM2610_FULL_EXT:
case DIV_SYSTEM_YMU759:
ImGui::Text("nothing to configure");
break;
@ -6288,6 +6292,8 @@ bool FurnaceGUI::loop() {
sysChangeOption(i,DIV_SYSTEM_ARCADE);
sysChangeOption(i,DIV_SYSTEM_YM2610);
sysChangeOption(i,DIV_SYSTEM_YM2610_EXT);
sysChangeOption(i,DIV_SYSTEM_YM2610_FULL);
sysChangeOption(i,DIV_SYSTEM_YM2610_FULL_EXT);
sysChangeOption(i,DIV_SYSTEM_AY8910);
sysChangeOption(i,DIV_SYSTEM_AMIGA);
sysChangeOption(i,DIV_SYSTEM_YM2151);