Merge branch 'master' of https://github.com/tildearrow/furnace into es5506_alt
This commit is contained in:
commit
987cc113b4
|
@ -76,6 +76,8 @@ additional guidelines:
|
||||||
- I will run a test suite to make sure this is the case.
|
- I will run a test suite to make sure this is the case.
|
||||||
- if something breaks, you might want to add a compatibility flag (this requires changing the format though).
|
- if something breaks, you might want to add a compatibility flag (this requires changing the format though).
|
||||||
- do not use `#pragma once`.
|
- do not use `#pragma once`.
|
||||||
|
- on a switch block, **always** put `default` last and not in any other position.
|
||||||
|
- I have fear of some C/C++ compilers ignoring the rest of cases upon hitting default.
|
||||||
|
|
||||||
## Demo Songs
|
## Demo Songs
|
||||||
|
|
||||||
|
|
|
@ -1229,7 +1229,7 @@ chips which aren't on this list don't have any flags.
|
||||||
|
|
||||||
## 0x05: PC Engine
|
## 0x05: PC Engine
|
||||||
|
|
||||||
- bit 1: clockSel (int)
|
- bit 0: clockSel (int)
|
||||||
- 0: NTSC
|
- 0: NTSC
|
||||||
- 1: pseudo-PAL
|
- 1: pseudo-PAL
|
||||||
- bit 2: chipType (int)
|
- bit 2: chipType (int)
|
||||||
|
@ -1289,6 +1289,7 @@ chips which aren't on this list don't have any flags.
|
||||||
- 2: Sunsoft 5B
|
- 2: Sunsoft 5B
|
||||||
- 3: AY-3-8914
|
- 3: AY-3-8914
|
||||||
- bit 6: stereo (bool)
|
- bit 6: stereo (bool)
|
||||||
|
- bit 7: halfClock (bool)
|
||||||
- bit 8-15: stereoSep (int)
|
- bit 8-15: stereoSep (int)
|
||||||
|
|
||||||
## 0x81: Amiga
|
## 0x81: Amiga
|
||||||
|
@ -1454,6 +1455,7 @@ chips which aren't on this list don't have any flags.
|
||||||
- 11: double NTSC
|
- 11: double NTSC
|
||||||
- 12: 3.6MHz
|
- 12: 3.6MHz
|
||||||
- bit 6: stereo (bool)
|
- bit 6: stereo (bool)
|
||||||
|
- bit 7: halfClock (bool)
|
||||||
- bit 8-15: stereoSep (int)
|
- bit 8-15: stereoSep (int)
|
||||||
|
|
||||||
## 0x9d: VRC7
|
## 0x9d: VRC7
|
||||||
|
@ -1560,4 +1562,4 @@ chips which aren't on this list don't have any flags.
|
||||||
## 0xe0: QSound
|
## 0xe0: QSound
|
||||||
|
|
||||||
- bit 0-11: echoDelay (int)
|
- bit 0-11: echoDelay (int)
|
||||||
- bit 12-19: echoFeedback (int)
|
- bit 12-19: echoFeedback (int)
|
||||||
|
|
|
@ -48,6 +48,43 @@ String DivConfig::toString() {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* base64Table="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
|
||||||
|
String DivConfig::toBase64() {
|
||||||
|
String data=toString();
|
||||||
|
String ret;
|
||||||
|
|
||||||
|
ret.reserve((2+data.size()*4)/3);
|
||||||
|
|
||||||
|
unsigned int groupOfThree=0;
|
||||||
|
unsigned char pos=0;
|
||||||
|
for (char& i: data) {
|
||||||
|
groupOfThree|=((unsigned char)i)<<((2-pos)<<3);
|
||||||
|
if (++pos>=3) {
|
||||||
|
pos=0;
|
||||||
|
ret+=base64Table[(groupOfThree>>18)&63];
|
||||||
|
ret+=base64Table[(groupOfThree>>12)&63];
|
||||||
|
ret+=base64Table[(groupOfThree>>6)&63];
|
||||||
|
ret+=base64Table[groupOfThree&63];
|
||||||
|
groupOfThree=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pos==2) {
|
||||||
|
ret+=base64Table[(groupOfThree>>18)&63];
|
||||||
|
ret+=base64Table[(groupOfThree>>12)&63];
|
||||||
|
ret+=base64Table[(groupOfThree>>6)&63];
|
||||||
|
ret+='=';
|
||||||
|
} else if (pos==1) {
|
||||||
|
ret+=base64Table[(groupOfThree>>18)&63];
|
||||||
|
ret+=base64Table[(groupOfThree>>12)&63];
|
||||||
|
ret+="==";
|
||||||
|
}
|
||||||
|
|
||||||
|
logV("toBase64: %s",ret);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
void DivConfig::parseLine(const char* line) {
|
void DivConfig::parseLine(const char* line) {
|
||||||
String key="";
|
String key="";
|
||||||
String value="";
|
String value="";
|
||||||
|
@ -105,7 +142,43 @@ bool DivConfig::loadFromMemory(const char* buf) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivConfig::getConfBool(String key, bool fallback) {
|
bool DivConfig::loadFromBase64(const char* buf) {
|
||||||
|
String data;
|
||||||
|
|
||||||
|
unsigned int groupOfThree=0;
|
||||||
|
signed char pos=18;
|
||||||
|
for (const char* i=buf; *i; i++) {
|
||||||
|
unsigned char nextVal=0;
|
||||||
|
if ((*i)=='/') {
|
||||||
|
nextVal=63;
|
||||||
|
} else if ((*i)=='+') {
|
||||||
|
nextVal=62;
|
||||||
|
} else if ((*i)>='0' && (*i)<='9') {
|
||||||
|
nextVal=52+((*i)-'0');
|
||||||
|
} else if ((*i)>='a' && (*i)<='z') {
|
||||||
|
nextVal=26+((*i)-'a');
|
||||||
|
} else if ((*i)>='A' && (*i)<='Z') {
|
||||||
|
nextVal=((*i)-'A');
|
||||||
|
} else {
|
||||||
|
nextVal=0;
|
||||||
|
}
|
||||||
|
groupOfThree|=nextVal<<pos;
|
||||||
|
pos-=6;
|
||||||
|
if (pos<0) {
|
||||||
|
pos=18;
|
||||||
|
if ((groupOfThree>>16)&0xff) data+=(groupOfThree>>16)&0xff;
|
||||||
|
if ((groupOfThree>>8)&0xff) data+=(groupOfThree>>8)&0xff;
|
||||||
|
if (groupOfThree&0xff) data+=groupOfThree&0xff;
|
||||||
|
groupOfThree=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logV("fromBase64: %s",data);
|
||||||
|
|
||||||
|
return loadFromMemory(data.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DivConfig::getBool(String key, bool fallback) const {
|
||||||
try {
|
try {
|
||||||
String val=conf.at(key);
|
String val=conf.at(key);
|
||||||
if (val=="true") {
|
if (val=="true") {
|
||||||
|
@ -118,7 +191,7 @@ bool DivConfig::getConfBool(String key, bool fallback) {
|
||||||
return fallback;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivConfig::getConfInt(String key, int fallback) {
|
int DivConfig::getInt(String key, int fallback) const {
|
||||||
try {
|
try {
|
||||||
String val=conf.at(key);
|
String val=conf.at(key);
|
||||||
int ret=std::stoi(val);
|
int ret=std::stoi(val);
|
||||||
|
@ -129,7 +202,7 @@ int DivConfig::getConfInt(String key, int fallback) {
|
||||||
return fallback;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
float DivConfig::getConfFloat(String key, float fallback) {
|
float DivConfig::getFloat(String key, float fallback) const {
|
||||||
try {
|
try {
|
||||||
String val=conf.at(key);
|
String val=conf.at(key);
|
||||||
float ret=std::stof(val);
|
float ret=std::stof(val);
|
||||||
|
@ -140,7 +213,7 @@ float DivConfig::getConfFloat(String key, float fallback) {
|
||||||
return fallback;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
double DivConfig::getConfDouble(String key, double fallback) {
|
double DivConfig::getDouble(String key, double fallback) const {
|
||||||
try {
|
try {
|
||||||
String val=conf.at(key);
|
String val=conf.at(key);
|
||||||
double ret=std::stod(val);
|
double ret=std::stod(val);
|
||||||
|
@ -151,7 +224,7 @@ double DivConfig::getConfDouble(String key, double fallback) {
|
||||||
return fallback;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
String DivConfig::getConfString(String key, String fallback) {
|
String DivConfig::getString(String key, String fallback) const {
|
||||||
try {
|
try {
|
||||||
String val=conf.at(key);
|
String val=conf.at(key);
|
||||||
return val;
|
return val;
|
||||||
|
@ -160,7 +233,7 @@ String DivConfig::getConfString(String key, String fallback) {
|
||||||
return fallback;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivConfig::setConf(String key, bool value) {
|
void DivConfig::set(String key, bool value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
conf[key]="true";
|
conf[key]="true";
|
||||||
} else {
|
} else {
|
||||||
|
@ -168,22 +241,30 @@ void DivConfig::setConf(String key, bool value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivConfig::setConf(String key, int value) {
|
void DivConfig::set(String key, int value) {
|
||||||
conf[key]=fmt::sprintf("%d",value);
|
conf[key]=fmt::sprintf("%d",value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivConfig::setConf(String key, float value) {
|
void DivConfig::set(String key, float value) {
|
||||||
conf[key]=fmt::sprintf("%f",value);
|
conf[key]=fmt::sprintf("%f",value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivConfig::setConf(String key, double value) {
|
void DivConfig::set(String key, double value) {
|
||||||
conf[key]=fmt::sprintf("%f",value);
|
conf[key]=fmt::sprintf("%f",value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivConfig::setConf(String key, const char* value) {
|
void DivConfig::set(String key, const char* value) {
|
||||||
conf[key]=String(value);
|
conf[key]=String(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivConfig::setConf(String key, String value) {
|
void DivConfig::set(String key, String value) {
|
||||||
conf[key]=value;
|
conf[key]=value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DivConfig::remove(String key) {
|
||||||
|
return conf.erase(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DivConfig::clear() {
|
||||||
|
conf.clear();
|
||||||
|
}
|
||||||
|
|
|
@ -29,24 +29,32 @@ class DivConfig {
|
||||||
public:
|
public:
|
||||||
// config loading/saving
|
// config loading/saving
|
||||||
bool loadFromMemory(const char* buf);
|
bool loadFromMemory(const char* buf);
|
||||||
|
bool loadFromBase64(const char* buf);
|
||||||
bool loadFromFile(const char* path, bool createOnFail=true);
|
bool loadFromFile(const char* path, bool createOnFail=true);
|
||||||
String toString();
|
String toString();
|
||||||
|
String toBase64();
|
||||||
bool save(const char* path);
|
bool save(const char* path);
|
||||||
|
|
||||||
// get a config value
|
// get a config value
|
||||||
bool getConfBool(String key, bool fallback);
|
bool getBool(String key, bool fallback) const;
|
||||||
int getConfInt(String key, int fallback);
|
int getInt(String key, int fallback) const;
|
||||||
float getConfFloat(String key, float fallback);
|
float getFloat(String key, float fallback) const;
|
||||||
double getConfDouble(String key, double fallback);
|
double getDouble(String key, double fallback) const;
|
||||||
String getConfString(String key, String fallback);
|
String getString(String key, String fallback) const;
|
||||||
|
|
||||||
// set a config value
|
// set a config value
|
||||||
void setConf(String key, bool value);
|
void set(String key, bool value);
|
||||||
void setConf(String key, int value);
|
void set(String key, int value);
|
||||||
void setConf(String key, float value);
|
void set(String key, float value);
|
||||||
void setConf(String key, double value);
|
void set(String key, double value);
|
||||||
void setConf(String key, const char* value);
|
void set(String key, const char* value);
|
||||||
void setConf(String key, String value);
|
void set(String key, String value);
|
||||||
|
|
||||||
|
// remove a config value
|
||||||
|
bool remove(String key);
|
||||||
|
|
||||||
|
// clear config
|
||||||
|
void clear();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -118,45 +118,45 @@ bool DivEngine::loadConf() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivEngine::getConfBool(String key, bool fallback) {
|
bool DivEngine::getConfBool(String key, bool fallback) {
|
||||||
return conf.getConfBool(key,fallback);
|
return conf.getBool(key,fallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivEngine::getConfInt(String key, int fallback) {
|
int DivEngine::getConfInt(String key, int fallback) {
|
||||||
return conf.getConfInt(key,fallback);
|
return conf.getInt(key,fallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
float DivEngine::getConfFloat(String key, float fallback) {
|
float DivEngine::getConfFloat(String key, float fallback) {
|
||||||
return conf.getConfFloat(key,fallback);
|
return conf.getFloat(key,fallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
double DivEngine::getConfDouble(String key, double fallback) {
|
double DivEngine::getConfDouble(String key, double fallback) {
|
||||||
return conf.getConfDouble(key,fallback);
|
return conf.getDouble(key,fallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
String DivEngine::getConfString(String key, String fallback) {
|
String DivEngine::getConfString(String key, String fallback) {
|
||||||
return conf.getConfString(key,fallback);
|
return conf.getString(key,fallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::setConf(String key, bool value) {
|
void DivEngine::setConf(String key, bool value) {
|
||||||
conf.setConf(key,value);
|
conf.set(key,value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::setConf(String key, int value) {
|
void DivEngine::setConf(String key, int value) {
|
||||||
conf.setConf(key,value);
|
conf.set(key,value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::setConf(String key, float value) {
|
void DivEngine::setConf(String key, float value) {
|
||||||
conf.setConf(key,value);
|
conf.set(key,value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::setConf(String key, double value) {
|
void DivEngine::setConf(String key, double value) {
|
||||||
conf.setConf(key,value);
|
conf.set(key,value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::setConf(String key, const char* value) {
|
void DivEngine::setConf(String key, const char* value) {
|
||||||
conf.setConf(key,value);
|
conf.set(key,value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::setConf(String key, String value) {
|
void DivEngine::setConf(String key, String value) {
|
||||||
conf.setConf(key,value);
|
conf.set(key,value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#define ONE_SEMITONE 2200
|
#define ONE_SEMITONE 2200
|
||||||
|
|
||||||
|
@ -448,9 +449,9 @@ class DivDispatch {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the chip flags.
|
* set the chip flags.
|
||||||
* @param flags the flags. see song.h for possible values.
|
* @param flags a DivConfig containing chip flags.
|
||||||
*/
|
*/
|
||||||
virtual void setFlags(unsigned int flags);
|
virtual void setFlags(const DivConfig& flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set skip reg writes.
|
* set skip reg writes.
|
||||||
|
@ -536,10 +537,10 @@ class DivDispatch {
|
||||||
* @param parent the parent DivEngine.
|
* @param parent the parent DivEngine.
|
||||||
* @param channels the number of channels to acquire.
|
* @param channels the number of channels to acquire.
|
||||||
* @param sugRate the suggested rate. this may change, so don't rely on it.
|
* @param sugRate the suggested rate. this may change, so don't rely on it.
|
||||||
* @param flags the chip flags. see song.h for possible values.
|
* @param flags a DivConfig containing chip flags.
|
||||||
* @return the number of channels allocated.
|
* @return the number of channels allocated.
|
||||||
*/
|
*/
|
||||||
virtual int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
virtual int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* quit the DivDispatch.
|
* quit the DivDispatch.
|
||||||
|
|
|
@ -158,7 +158,7 @@ void DivDispatchContainer::clear() {
|
||||||
prevSample[1]=temp[1];*/
|
prevSample[1]=temp[1];*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, double gotRate, unsigned int flags) {
|
void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, double gotRate, const DivConfig& flags) {
|
||||||
if (dispatch!=NULL) return;
|
if (dispatch!=NULL) return;
|
||||||
|
|
||||||
bb[0]=blip_new(32768);
|
bb[0]=blip_new(32768);
|
||||||
|
|
|
@ -1037,21 +1037,8 @@ void DivEngine::renderSamples() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String DivEngine::encodeSysDesc(std::vector<int>& desc) {
|
String DivEngine::decodeSysDesc(String desc) {
|
||||||
String ret;
|
DivConfig newDesc;
|
||||||
if (desc[0]!=0) {
|
|
||||||
int index=0;
|
|
||||||
for (size_t i=0; i<desc.size(); i+=4) {
|
|
||||||
ret+=fmt::sprintf("%d %d %d %d ",systemToFileFur((DivSystem)desc[i]),desc[i+1],desc[i+2],desc[i+3]);
|
|
||||||
index++;
|
|
||||||
if (index>=32) break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<int> DivEngine::decodeSysDesc(String desc) {
|
|
||||||
std::vector<int> ret;
|
|
||||||
bool hasVal=false;
|
bool hasVal=false;
|
||||||
bool negative=false;
|
bool negative=false;
|
||||||
int val=0;
|
int val=0;
|
||||||
|
@ -1060,6 +1047,7 @@ std::vector<int> DivEngine::decodeSysDesc(String desc) {
|
||||||
int sysVol=0;
|
int sysVol=0;
|
||||||
int sysPan=0;
|
int sysPan=0;
|
||||||
int sysFlags=0;
|
int sysFlags=0;
|
||||||
|
int curSys=0;
|
||||||
desc+=' '; // ha
|
desc+=' '; // ha
|
||||||
for (char i: desc) {
|
for (char i: desc) {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
|
@ -1082,15 +1070,19 @@ std::vector<int> DivEngine::decodeSysDesc(String desc) {
|
||||||
case 3:
|
case 3:
|
||||||
sysFlags=val;
|
sysFlags=val;
|
||||||
|
|
||||||
if (systemFromFileFur(sysID)!=0) {
|
if (sysID!=0) {
|
||||||
if (sysVol<-128) sysVol=-128;
|
if (sysVol<-128) sysVol=-128;
|
||||||
if (sysVol>127) sysVol=127;
|
if (sysVol>127) sysVol=127;
|
||||||
if (sysPan<-128) sysPan=-128;
|
if (sysPan<-128) sysPan=-128;
|
||||||
if (sysPan>127) sysPan=127;
|
if (sysPan>127) sysPan=127;
|
||||||
ret.push_back(systemFromFileFur(sysID));
|
newDesc.set(fmt::sprintf("id%d",curSys),sysID);
|
||||||
ret.push_back(sysVol);
|
newDesc.set(fmt::sprintf("vol%d",curSys),sysVol);
|
||||||
ret.push_back(sysPan);
|
newDesc.set(fmt::sprintf("pan%d",curSys),sysPan);
|
||||||
ret.push_back(sysFlags);
|
DivConfig newFlagsC;
|
||||||
|
newFlagsC.clear();
|
||||||
|
convertOldFlags((unsigned int)sysFlags,newFlagsC,systemFromFileFur(sysID));
|
||||||
|
newDesc.set(fmt::sprintf("flags%d",curSys),newFlagsC.toBase64());
|
||||||
|
curSys++;
|
||||||
}
|
}
|
||||||
|
|
||||||
curStage=0;
|
curStage=0;
|
||||||
|
@ -1111,28 +1103,35 @@ std::vector<int> DivEngine::decodeSysDesc(String desc) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
|
||||||
|
return newDesc.toBase64();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::initSongWithDesc(const int* description) {
|
void DivEngine::initSongWithDesc(const char* description) {
|
||||||
int chanCount=0;
|
int chanCount=0;
|
||||||
if (description[0]!=0) {
|
DivConfig c;
|
||||||
int index=0;
|
c.loadFromBase64(description);
|
||||||
for (int i=0; description[i]; i+=4) {
|
int index=0;
|
||||||
song.system[index]=(DivSystem)description[i];
|
for (; index<32; index++) {
|
||||||
song.systemVol[index]=description[i+1];
|
song.system[index]=systemFromFileFur(c.getInt(fmt::sprintf("id%d",index),0));
|
||||||
song.systemPan[index]=description[i+2];
|
if (song.system[index]==DIV_SYSTEM_NULL) {
|
||||||
song.systemFlagsOld[index]=description[i+3];
|
break;
|
||||||
index++;
|
|
||||||
chanCount+=getChannelCount(song.system[index]);
|
|
||||||
if (chanCount>=DIV_MAX_CHANS) break;
|
|
||||||
if (index>=32) break;
|
|
||||||
}
|
}
|
||||||
song.systemLen=index;
|
chanCount+=getChannelCount(song.system[index]);
|
||||||
|
if (chanCount>=DIV_MAX_CHANS) {
|
||||||
|
song.system[index]=DIV_SYSTEM_NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
song.systemVol[index]=c.getInt(fmt::sprintf("vol%d",index),DIV_SYSTEM_NULL);
|
||||||
|
song.systemPan[index]=c.getInt(fmt::sprintf("pan%d",index),DIV_SYSTEM_NULL);
|
||||||
|
song.systemFlags[index].clear();
|
||||||
|
String flags=c.getString(fmt::sprintf("flags%d",index),"");
|
||||||
|
song.systemFlags[index].loadFromBase64(flags.c_str());
|
||||||
}
|
}
|
||||||
|
song.systemLen=index;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::createNew(const int* description, String sysName) {
|
void DivEngine::createNew(const char* description, String sysName) {
|
||||||
quitDispatch();
|
quitDispatch();
|
||||||
BUSY_BEGIN;
|
BUSY_BEGIN;
|
||||||
saveLock.lock();
|
saveLock.lock();
|
||||||
|
@ -1345,7 +1344,7 @@ void DivEngine::changeSystem(int index, DivSystem which, bool preserveOrder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
song.system[index]=which;
|
song.system[index]=which;
|
||||||
song.systemFlagsOld[index]=0;
|
song.systemFlags[index].clear();
|
||||||
recalcChans();
|
recalcChans();
|
||||||
saveLock.unlock();
|
saveLock.unlock();
|
||||||
BUSY_END;
|
BUSY_END;
|
||||||
|
@ -1371,7 +1370,7 @@ bool DivEngine::addSystem(DivSystem which) {
|
||||||
song.system[song.systemLen]=which;
|
song.system[song.systemLen]=which;
|
||||||
song.systemVol[song.systemLen]=64;
|
song.systemVol[song.systemLen]=64;
|
||||||
song.systemPan[song.systemLen]=0;
|
song.systemPan[song.systemLen]=0;
|
||||||
song.systemFlagsOld[song.systemLen++]=0;
|
song.systemFlags[song.systemLen++].clear();
|
||||||
recalcChans();
|
recalcChans();
|
||||||
saveLock.unlock();
|
saveLock.unlock();
|
||||||
BUSY_END;
|
BUSY_END;
|
||||||
|
@ -1415,7 +1414,7 @@ bool DivEngine::removeSystem(int index, bool preserveOrder) {
|
||||||
song.system[i]=song.system[i+1];
|
song.system[i]=song.system[i+1];
|
||||||
song.systemVol[i]=song.systemVol[i+1];
|
song.systemVol[i]=song.systemVol[i+1];
|
||||||
song.systemPan[i]=song.systemPan[i+1];
|
song.systemPan[i]=song.systemPan[i+1];
|
||||||
song.systemFlagsOld[i]=song.systemFlagsOld[i+1];
|
song.systemFlags[i]=song.systemFlags[i+1];
|
||||||
}
|
}
|
||||||
recalcChans();
|
recalcChans();
|
||||||
saveLock.unlock();
|
saveLock.unlock();
|
||||||
|
@ -1541,9 +1540,10 @@ bool DivEngine::swapSystem(int src, int dest, bool preserveOrder) {
|
||||||
song.systemPan[dest]^=song.systemPan[src];
|
song.systemPan[dest]^=song.systemPan[src];
|
||||||
song.systemPan[src]^=song.systemPan[dest];
|
song.systemPan[src]^=song.systemPan[dest];
|
||||||
|
|
||||||
song.systemFlagsOld[src]^=song.systemFlagsOld[dest];
|
// I am kinda scared to use std::swap
|
||||||
song.systemFlagsOld[dest]^=song.systemFlagsOld[src];
|
DivConfig oldFlags=song.systemFlags[src];
|
||||||
song.systemFlagsOld[src]^=song.systemFlagsOld[dest];
|
song.systemFlags[src]=song.systemFlags[dest];
|
||||||
|
song.systemFlags[dest]=oldFlags;
|
||||||
|
|
||||||
recalcChans();
|
recalcChans();
|
||||||
saveLock.unlock();
|
saveLock.unlock();
|
||||||
|
@ -3469,12 +3469,9 @@ void DivEngine::setOrder(unsigned char order) {
|
||||||
BUSY_END;
|
BUSY_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::setSysFlags(int system, unsigned int flags, bool restart) {
|
void DivEngine::updateSysFlags(int system, bool restart) {
|
||||||
BUSY_BEGIN_SOFT;
|
BUSY_BEGIN_SOFT;
|
||||||
saveLock.lock();
|
disCont[system].dispatch->setFlags(song.systemFlags[system]);
|
||||||
song.systemFlagsOld[system]=flags;
|
|
||||||
saveLock.unlock();
|
|
||||||
disCont[system].dispatch->setFlags(song.systemFlagsOld[system]);
|
|
||||||
disCont[system].setRates(got.rate);
|
disCont[system].setRates(got.rate);
|
||||||
if (restart && isPlaying()) {
|
if (restart && isPlaying()) {
|
||||||
playSub(false);
|
playSub(false);
|
||||||
|
@ -3632,7 +3629,7 @@ void DivEngine::rescanAudioDevices() {
|
||||||
void DivEngine::initDispatch() {
|
void DivEngine::initDispatch() {
|
||||||
BUSY_BEGIN;
|
BUSY_BEGIN;
|
||||||
for (int i=0; i<song.systemLen; i++) {
|
for (int i=0; i<song.systemLen; i++) {
|
||||||
disCont[i].init(song.system[i],this,getChannelCount(song.system[i]),got.rate,song.systemFlagsOld[i]);
|
disCont[i].init(song.system[i],this,getChannelCount(song.system[i]),got.rate,song.systemFlags[i]);
|
||||||
disCont[i].setRates(got.rate);
|
disCont[i].setRates(got.rate);
|
||||||
disCont[i].setQuality(lowQuality);
|
disCont[i].setQuality(lowQuality);
|
||||||
}
|
}
|
||||||
|
@ -3823,11 +3820,14 @@ bool DivEngine::init() {
|
||||||
// set default system preset
|
// set default system preset
|
||||||
if (!hasLoadedSomething) {
|
if (!hasLoadedSomething) {
|
||||||
logD("setting default preset");
|
logD("setting default preset");
|
||||||
std::vector<int> preset=decodeSysDesc(getConfString("initialSys",""));
|
String preset=getConfString("initialSys2","");
|
||||||
|
if (preset.empty()) {
|
||||||
|
// try loading old preset
|
||||||
|
preset=decodeSysDesc(getConfString("initialSys",""));
|
||||||
|
}
|
||||||
logD("preset size %ld",preset.size());
|
logD("preset size %ld",preset.size());
|
||||||
if (preset.size()>0 && (preset.size()&3)==0) {
|
if (preset.size()>0 && (preset.size()&3)==0) {
|
||||||
preset.push_back(0);
|
initSongWithDesc(preset.c_str());
|
||||||
initSongWithDesc(preset.data());
|
|
||||||
}
|
}
|
||||||
String sysName=getConfString("initialSysName","");
|
String sysName=getConfString("initialSysName","");
|
||||||
if (sysName=="") {
|
if (sysName=="") {
|
||||||
|
|
|
@ -47,8 +47,8 @@
|
||||||
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
|
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
|
||||||
#define BUSY_END isBusy.unlock(); softLocked=false;
|
#define BUSY_END isBusy.unlock(); softLocked=false;
|
||||||
|
|
||||||
#define DIV_VERSION "dev118"
|
#define DIV_VERSION "dev119"
|
||||||
#define DIV_ENGINE_VERSION 118
|
#define DIV_ENGINE_VERSION 119
|
||||||
// for imports
|
// for imports
|
||||||
#define DIV_VERSION_MOD 0xff01
|
#define DIV_VERSION_MOD 0xff01
|
||||||
#define DIV_VERSION_FC 0xff02
|
#define DIV_VERSION_FC 0xff02
|
||||||
|
@ -183,7 +183,7 @@ struct DivDispatchContainer {
|
||||||
void flush(size_t count);
|
void flush(size_t count);
|
||||||
void fillBuf(size_t runtotal, size_t offset, size_t size);
|
void fillBuf(size_t runtotal, size_t offset, size_t size);
|
||||||
void clear();
|
void clear();
|
||||||
void init(DivSystem sys, DivEngine* eng, int chanCount, double gotRate, unsigned int flags);
|
void init(DivSystem sys, DivEngine* eng, int chanCount, double gotRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
DivDispatchContainer():
|
DivDispatchContainer():
|
||||||
dispatch(NULL),
|
dispatch(NULL),
|
||||||
|
@ -425,10 +425,6 @@ class DivEngine {
|
||||||
// MIDI stuff
|
// MIDI stuff
|
||||||
std::function<int(const TAMidiMessage&)> midiCallback=[](const TAMidiMessage&) -> int {return -2;};
|
std::function<int(const TAMidiMessage&)> midiCallback=[](const TAMidiMessage&) -> int {return -2;};
|
||||||
|
|
||||||
DivSystem systemFromFileFur(unsigned char val);
|
|
||||||
unsigned char systemToFileFur(DivSystem val);
|
|
||||||
DivSystem systemFromFileDMF(unsigned char val);
|
|
||||||
unsigned char systemToFileDMF(DivSystem val);
|
|
||||||
int dispatchCmd(DivCommand c);
|
int dispatchCmd(DivCommand c);
|
||||||
void processRow(int i, bool afterDelay);
|
void processRow(int i, bool afterDelay);
|
||||||
void nextOrder();
|
void nextOrder();
|
||||||
|
@ -442,6 +438,8 @@ class DivEngine {
|
||||||
void reset();
|
void reset();
|
||||||
void playSub(bool preserveDrift, int goalRow=0);
|
void playSub(bool preserveDrift, int goalRow=0);
|
||||||
|
|
||||||
|
void convertOldFlags(unsigned int oldFlags, DivConfig& newFlags, DivSystem sys);
|
||||||
|
|
||||||
bool loadDMF(unsigned char* file, size_t len);
|
bool loadDMF(unsigned char* file, size_t len);
|
||||||
bool loadFur(unsigned char* file, size_t len);
|
bool loadFur(unsigned char* file, size_t len);
|
||||||
bool loadMod(unsigned char* file, size_t len);
|
bool loadMod(unsigned char* file, size_t len);
|
||||||
|
@ -469,7 +467,7 @@ class DivEngine {
|
||||||
bool deinitAudioBackend(bool dueToSwitchMaster=false);
|
bool deinitAudioBackend(bool dueToSwitchMaster=false);
|
||||||
|
|
||||||
void registerSystems();
|
void registerSystems();
|
||||||
void initSongWithDesc(const int* description);
|
void initSongWithDesc(const char* description);
|
||||||
|
|
||||||
void exchangeIns(int one, int two);
|
void exchangeIns(int one, int two);
|
||||||
void swapChannels(int src, int dest);
|
void swapChannels(int src, int dest);
|
||||||
|
@ -500,11 +498,10 @@ class DivEngine {
|
||||||
DivWavetable* getWave(int index);
|
DivWavetable* getWave(int index);
|
||||||
DivSample* getSample(int index);
|
DivSample* getSample(int index);
|
||||||
DivDispatch* getDispatch(int index);
|
DivDispatch* getDispatch(int index);
|
||||||
// parse system setup description
|
// parse old system setup description
|
||||||
String encodeSysDesc(std::vector<int>& desc);
|
String decodeSysDesc(String desc);
|
||||||
std::vector<int> decodeSysDesc(String desc);
|
|
||||||
// start fresh
|
// start fresh
|
||||||
void createNew(const int* description, String sysName);
|
void createNew(const char* description, String sysName);
|
||||||
// load a file.
|
// load a file.
|
||||||
bool load(unsigned char* f, size_t length);
|
bool load(unsigned char* f, size_t length);
|
||||||
// save as .dmf.
|
// save as .dmf.
|
||||||
|
@ -532,6 +529,12 @@ class DivEngine {
|
||||||
// notify wavetable change
|
// notify wavetable change
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
|
|
||||||
|
// get system IDs
|
||||||
|
DivSystem systemFromFileFur(unsigned char val);
|
||||||
|
unsigned char systemToFileFur(DivSystem val);
|
||||||
|
DivSystem systemFromFileDMF(unsigned char val);
|
||||||
|
unsigned char systemToFileDMF(DivSystem val);
|
||||||
|
|
||||||
// benchmark (returns time in seconds)
|
// benchmark (returns time in seconds)
|
||||||
double benchmarkPlayback();
|
double benchmarkPlayback();
|
||||||
double benchmarkSeek();
|
double benchmarkSeek();
|
||||||
|
@ -818,8 +821,8 @@ class DivEngine {
|
||||||
// go to order
|
// go to order
|
||||||
void setOrder(unsigned char order);
|
void setOrder(unsigned char order);
|
||||||
|
|
||||||
// set system flags
|
// update system flags
|
||||||
void setSysFlags(int system, unsigned int flags, bool restart);
|
void updateSysFlags(int system, bool restart);
|
||||||
|
|
||||||
// set Hz
|
// set Hz
|
||||||
void setSongRate(float hz, bool pal);
|
void setSongRate(float hz, bool pal);
|
||||||
|
|
|
@ -977,11 +977,587 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DivEngine::convertOldFlags(unsigned int oldFlags, DivConfig& newFlags, DivSystem sys) {
|
||||||
|
newFlags.clear();
|
||||||
|
|
||||||
|
switch (sys) {
|
||||||
|
case DIV_SYSTEM_SMS:
|
||||||
|
switch (oldFlags&0xff03) {
|
||||||
|
case 0x0000:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 0x0001:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 0x0002:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 0x0003:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
case 0x0100:
|
||||||
|
newFlags.set("clockSel",4);
|
||||||
|
break;
|
||||||
|
case 0x0101:
|
||||||
|
newFlags.set("clockSel",5);
|
||||||
|
break;
|
||||||
|
case 0x0102:
|
||||||
|
newFlags.set("clockSel",6);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (oldFlags&0xcc) {
|
||||||
|
case 0x00:
|
||||||
|
newFlags.set("chipType",0);
|
||||||
|
break;
|
||||||
|
case 0x04:
|
||||||
|
newFlags.set("chipType",1);
|
||||||
|
break;
|
||||||
|
case 0x08:
|
||||||
|
newFlags.set("chipType",2);
|
||||||
|
break;
|
||||||
|
case 0x0c:
|
||||||
|
newFlags.set("chipType",3);
|
||||||
|
break;
|
||||||
|
case 0x40:
|
||||||
|
newFlags.set("chipType",4);
|
||||||
|
break;
|
||||||
|
case 0x44:
|
||||||
|
newFlags.set("chipType",5);
|
||||||
|
break;
|
||||||
|
case 0x48:
|
||||||
|
newFlags.set("chipType",6);
|
||||||
|
break;
|
||||||
|
case 0x4c:
|
||||||
|
newFlags.set("chipType",7);
|
||||||
|
break;
|
||||||
|
case 0x80:
|
||||||
|
newFlags.set("chipType",8);
|
||||||
|
break;
|
||||||
|
case 0x84:
|
||||||
|
newFlags.set("chipType",9);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (oldFlags&16) newFlags.set("noPhaseReset",true);
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_GB:
|
||||||
|
newFlags.set("chipType",(int)(oldFlags&3));
|
||||||
|
if (oldFlags&8) newFlags.set("noAntiClick",true);
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_PCE:
|
||||||
|
newFlags.set("clockSel",(int)(oldFlags&1));
|
||||||
|
newFlags.set("chipType",(oldFlags&4)?1:0);
|
||||||
|
if (oldFlags&8) newFlags.set("noAntiClick",true);
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_NES:
|
||||||
|
case DIV_SYSTEM_VRC6:
|
||||||
|
case DIV_SYSTEM_FDS:
|
||||||
|
case DIV_SYSTEM_MMC5:
|
||||||
|
case DIV_SYSTEM_SAA1099:
|
||||||
|
case DIV_SYSTEM_OPZ:
|
||||||
|
switch (oldFlags) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_C64_6581:
|
||||||
|
case DIV_SYSTEM_C64_8580:
|
||||||
|
switch (oldFlags&15) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_YM2610:
|
||||||
|
case DIV_SYSTEM_YM2610_EXT:
|
||||||
|
case DIV_SYSTEM_YM2610_FULL:
|
||||||
|
case DIV_SYSTEM_YM2610_FULL_EXT:
|
||||||
|
case DIV_SYSTEM_YM2610B:
|
||||||
|
case DIV_SYSTEM_YM2610B_EXT:
|
||||||
|
switch (oldFlags&0xff) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_AY8910:
|
||||||
|
case DIV_SYSTEM_AY8930:
|
||||||
|
switch (oldFlags&15) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
newFlags.set("clockSel",4);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
newFlags.set("clockSel",5);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
newFlags.set("clockSel",6);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
newFlags.set("clockSel",7);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
newFlags.set("clockSel",8);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
newFlags.set("clockSel",9);
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
newFlags.set("clockSel",10);
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
newFlags.set("clockSel",11);
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
newFlags.set("clockSel",12);
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
if (sys==DIV_SYSTEM_AY8910) newFlags.set("clockSel",13);
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
|
if (sys==DIV_SYSTEM_AY8910) newFlags.set("clockSel",14);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (sys==DIV_SYSTEM_AY8910) switch ((oldFlags>>4)&3) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("chipType",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("chipType",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("chipType",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("chipType",3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (oldFlags&64) newFlags.set("stereo",true);
|
||||||
|
if (oldFlags&128) newFlags.set("halfClock",true);
|
||||||
|
newFlags.set("stereoSep",(int)((oldFlags>>8)&255));
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_AMIGA:
|
||||||
|
if (oldFlags&1) newFlags.set("clockSel",1);
|
||||||
|
if (oldFlags&2) newFlags.set("chipType",1);
|
||||||
|
if (oldFlags&4) newFlags.set("bypassLimits",true);
|
||||||
|
newFlags.set("stereoSep",(int)((oldFlags>>8)&127));
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_YM2151:
|
||||||
|
switch (oldFlags&255) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_YM2612:
|
||||||
|
case DIV_SYSTEM_YM2612_EXT:
|
||||||
|
case DIV_SYSTEM_YM2612_FRAC:
|
||||||
|
case DIV_SYSTEM_YM2612_FRAC_EXT:
|
||||||
|
switch (oldFlags&0x7fffffff) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
newFlags.set("clockSel",4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (oldFlags&0x80000000) newFlags.set("ladderEffect",true);
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_TIA:
|
||||||
|
newFlags.set("clockSel",(int)(oldFlags&1));
|
||||||
|
switch ((oldFlags>>1)&3) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("mixingType",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("mixingType",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("mixingType",2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_VIC20:
|
||||||
|
newFlags.set("clockSel",(int)(oldFlags&1));
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_SNES:
|
||||||
|
newFlags.set("volScaleL",(int)(oldFlags&127));
|
||||||
|
newFlags.set("volScaleR",(int)((oldFlags>>8)&127));
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_OPLL:
|
||||||
|
case DIV_SYSTEM_OPLL_DRUMS:
|
||||||
|
switch (oldFlags&15) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (oldFlags>>4) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("patchSet",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("patchSet",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("patchSet",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("patchSet",3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_N163:
|
||||||
|
switch (oldFlags&15) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
newFlags.set("channels",(int)((oldFlags>>4)&7));
|
||||||
|
if (oldFlags&128) newFlags.set("multiplex",true);
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_OPN:
|
||||||
|
case DIV_SYSTEM_OPN_EXT:
|
||||||
|
switch (oldFlags&31) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
newFlags.set("clockSel",4);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
newFlags.set("clockSel",5);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch ((oldFlags>>5)&3) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("prescale",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("prescale",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("prescale",2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_PC98:
|
||||||
|
case DIV_SYSTEM_PC98_EXT:
|
||||||
|
switch (oldFlags&31) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch ((oldFlags>>5)&3) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("prescale",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("prescale",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("prescale",2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_OPL:
|
||||||
|
case DIV_SYSTEM_OPL2:
|
||||||
|
case DIV_SYSTEM_Y8950:
|
||||||
|
case DIV_SYSTEM_OPL_DRUMS:
|
||||||
|
case DIV_SYSTEM_OPL2_DRUMS:
|
||||||
|
case DIV_SYSTEM_Y8950_DRUMS:
|
||||||
|
case DIV_SYSTEM_YMZ280B:
|
||||||
|
switch (oldFlags&0xff) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
newFlags.set("clockSel",4);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
newFlags.set("clockSel",5);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_OPL3:
|
||||||
|
case DIV_SYSTEM_OPL3_DRUMS:
|
||||||
|
switch (oldFlags&0xff) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
newFlags.set("clockSel",4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_PCSPKR:
|
||||||
|
newFlags.set("speakerType",(int)(oldFlags&3));
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_RF5C68:
|
||||||
|
switch (oldFlags&15) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (oldFlags>>4) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("chipType",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("chipType",0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_VRC7:
|
||||||
|
switch (oldFlags&15) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_SFX_BEEPER:
|
||||||
|
newFlags.set("clockSel",(int)(oldFlags&1));
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_SCC:
|
||||||
|
case DIV_SYSTEM_SCC_PLUS:
|
||||||
|
switch (oldFlags&63) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_MSM6295:
|
||||||
|
switch (oldFlags&63) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
newFlags.set("clockSel",4);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
newFlags.set("clockSel",5);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
newFlags.set("clockSel",6);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
newFlags.set("clockSel",7);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
newFlags.set("clockSel",8);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
newFlags.set("clockSel",9);
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
newFlags.set("clockSel",10);
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
newFlags.set("clockSel",11);
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
newFlags.set("clockSel",12);
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
newFlags.set("clockSel",13);
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
|
newFlags.set("clockSel",14);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (oldFlags&128) newFlags.set("rateSel",true);
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_MSM6258:
|
||||||
|
switch (oldFlags) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newFlags.set("clockSel",3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_OPL4:
|
||||||
|
case DIV_SYSTEM_OPL4_DRUMS:
|
||||||
|
switch (oldFlags&0xff) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newFlags.set("clockSel",2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_X1_010:
|
||||||
|
switch (oldFlags&15) {
|
||||||
|
case 0:
|
||||||
|
newFlags.set("clockSel",0);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newFlags.set("clockSel",1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (oldFlags&16) newFlags.set("stereo",true);
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_SOUND_UNIT:
|
||||||
|
newFlags.set("clockSel",(int)(oldFlags&1));
|
||||||
|
if (oldFlags&4) newFlags.set("echo",true);
|
||||||
|
if (oldFlags&8) newFlags.set("swapEcho",true);
|
||||||
|
newFlags.set("sampleMemSize",(int)((oldFlags>>4)&1));
|
||||||
|
if (oldFlags&32) newFlags.set("pdm",true);
|
||||||
|
newFlags.set("echoDelay",(int)((oldFlags>>8)&63));
|
||||||
|
newFlags.set("echoFeedback",(int)((oldFlags>>16)&15));
|
||||||
|
newFlags.set("echoResolution",(int)((oldFlags>>20)&15));
|
||||||
|
newFlags.set("echoVol",(int)((oldFlags>>24)&255));
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_PCM_DAC:
|
||||||
|
if (!oldFlags) oldFlags=0x1f0000|44099;
|
||||||
|
newFlags.set("rate",(int)((oldFlags&0xffff)+1));
|
||||||
|
newFlags.set("outDepth",(int)((oldFlags>>16)&15));
|
||||||
|
if (oldFlags&0x100000) newFlags.set("stereo",true);
|
||||||
|
break;
|
||||||
|
case DIV_SYSTEM_QSOUND:
|
||||||
|
newFlags.set("echoDelay",(int)(oldFlags&0xfff));
|
||||||
|
newFlags.set("echoFeedback",(int)((oldFlags>>12)&255));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
||||||
unsigned int insPtr[256];
|
unsigned int insPtr[256];
|
||||||
unsigned int wavePtr[256];
|
unsigned int wavePtr[256];
|
||||||
unsigned int samplePtr[256];
|
unsigned int samplePtr[256];
|
||||||
unsigned int subSongPtr[256];
|
unsigned int subSongPtr[256];
|
||||||
|
unsigned int sysFlagsPtr[32];
|
||||||
std::vector<int> patPtr;
|
std::vector<int> patPtr;
|
||||||
int numberOfSubSongs=0;
|
int numberOfSubSongs=0;
|
||||||
char magic[5];
|
char magic[5];
|
||||||
|
@ -1235,7 +1811,7 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
||||||
|
|
||||||
// system props
|
// system props
|
||||||
for (int i=0; i<32; i++) {
|
for (int i=0; i<32; i++) {
|
||||||
ds.systemFlagsOld[i]=reader.readI();
|
sysFlagsPtr[i]=reader.readI();
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle compound systems
|
// handle compound systems
|
||||||
|
@ -1587,6 +2163,40 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
||||||
ds.autoSystem=true;
|
ds.autoSystem=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// read system flags
|
||||||
|
if (ds.version>=119) {
|
||||||
|
logD("reading chip flags...");
|
||||||
|
for (int i=0; i<32; i++) {
|
||||||
|
if (sysFlagsPtr[i]==0) continue;
|
||||||
|
|
||||||
|
if (!reader.seek(sysFlagsPtr[i],SEEK_SET)) {
|
||||||
|
logE("couldn't seek to chip %d flags!",i+1);
|
||||||
|
lastError=fmt::sprintf("couldn't seek to chip %d flags!",i+1);
|
||||||
|
ds.unload();
|
||||||
|
delete[] file;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
reader.read(magic,4);
|
||||||
|
if (strcmp(magic,"FLAG")!=0) {
|
||||||
|
logE("%d: invalid flag header!",i);
|
||||||
|
lastError="invalid flag header!";
|
||||||
|
ds.unload();
|
||||||
|
delete[] file;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
reader.readI();
|
||||||
|
|
||||||
|
String data=reader.readString();
|
||||||
|
ds.systemFlags[i].loadFromMemory(data.c_str());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logD("reading old chip flags...");
|
||||||
|
for (int i=0; i<ds.systemLen; i++) {
|
||||||
|
convertOldFlags(sysFlagsPtr[i],ds.systemFlags[i],ds.system[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// read subsongs
|
// read subsongs
|
||||||
if (ds.version>=95) {
|
if (ds.version>=95) {
|
||||||
for (int i=0; i<numberOfSubSongs; i++) {
|
for (int i=0; i<numberOfSubSongs; i++) {
|
||||||
|
@ -2373,7 +2983,10 @@ bool DivEngine::loadMod(unsigned char* file, size_t len) {
|
||||||
ds.systemLen=(chCount+3)/4;
|
ds.systemLen=(chCount+3)/4;
|
||||||
for(int i=0; i<ds.systemLen; i++) {
|
for(int i=0; i<ds.systemLen; i++) {
|
||||||
ds.system[i]=DIV_SYSTEM_AMIGA;
|
ds.system[i]=DIV_SYSTEM_AMIGA;
|
||||||
ds.systemFlagsOld[i]=1|(80<<8)|(bypassLimits?4:0)|((ds.systemLen>1 || bypassLimits)?2:0); // PAL
|
ds.systemFlags[i].set("clockSel",1); // PAL
|
||||||
|
ds.systemFlags[i].set("stereoSep",80);
|
||||||
|
ds.systemFlags[i].set("bypassLimits",bypassLimits);
|
||||||
|
ds.systemFlags[i].set("chipType",(bool)(ds.systemLen>1 || bypassLimits));
|
||||||
}
|
}
|
||||||
for(int i=0; i<chCount; i++) {
|
for(int i=0; i<chCount; i++) {
|
||||||
ds.subsong[0]->chanShow[i]=true;
|
ds.subsong[0]->chanShow[i]=true;
|
||||||
|
@ -2579,7 +3192,8 @@ bool DivEngine::loadFC(unsigned char* file, size_t len) {
|
||||||
ds.system[0]=DIV_SYSTEM_AMIGA;
|
ds.system[0]=DIV_SYSTEM_AMIGA;
|
||||||
ds.systemVol[0]=64;
|
ds.systemVol[0]=64;
|
||||||
ds.systemPan[0]=0;
|
ds.systemPan[0]=0;
|
||||||
ds.systemFlagsOld[0]=1|(80<<8); // PAL
|
ds.systemFlags[0].set("clockSel",1); // PAL
|
||||||
|
ds.systemFlags[0].set("stereoSep",80);
|
||||||
ds.systemName="Amiga";
|
ds.systemName="Amiga";
|
||||||
|
|
||||||
seqLen=reader.readI_BE();
|
seqLen=reader.readI_BE();
|
||||||
|
@ -3219,11 +3833,11 @@ bool DivEngine::loadFTM(unsigned char* file, size_t len) {
|
||||||
}
|
}
|
||||||
if (expansions&16) {
|
if (expansions&16) {
|
||||||
ds.system[systemID]=DIV_SYSTEM_N163;
|
ds.system[systemID]=DIV_SYSTEM_N163;
|
||||||
ds.systemFlagsOld[systemID++]=n163Chans;
|
ds.systemFlags[systemID++].set("channels",(int)n163Chans);
|
||||||
}
|
}
|
||||||
if (expansions&32) {
|
if (expansions&32) {
|
||||||
ds.system[systemID]=DIV_SYSTEM_AY8910;
|
ds.system[systemID]=DIV_SYSTEM_AY8910;
|
||||||
ds.systemFlagsOld[systemID++]=38; // Sunsoft 5B
|
ds.systemFlags[systemID++].set("chipType",2); // Sunsoft 5B
|
||||||
}
|
}
|
||||||
ds.systemLen=systemID;
|
ds.systemLen=systemID;
|
||||||
|
|
||||||
|
@ -3605,11 +4219,12 @@ struct PatToWrite {
|
||||||
SafeWriter* DivEngine::saveFur(bool notPrimary) {
|
SafeWriter* DivEngine::saveFur(bool notPrimary) {
|
||||||
saveLock.lock();
|
saveLock.lock();
|
||||||
std::vector<int> subSongPtr;
|
std::vector<int> subSongPtr;
|
||||||
|
std::vector<int> sysFlagsPtr;
|
||||||
std::vector<int> insPtr;
|
std::vector<int> insPtr;
|
||||||
std::vector<int> wavePtr;
|
std::vector<int> wavePtr;
|
||||||
std::vector<int> samplePtr;
|
std::vector<int> samplePtr;
|
||||||
std::vector<int> patPtr;
|
std::vector<int> patPtr;
|
||||||
size_t ptrSeek, subSongPtrSeek, blockStartSeek, blockEndSeek;
|
size_t ptrSeek, subSongPtrSeek, sysFlagsPtrSeek, blockStartSeek, blockEndSeek;
|
||||||
size_t subSongIndex=0;
|
size_t subSongIndex=0;
|
||||||
DivSubSong* subSong=song.subsong[subSongIndex];
|
DivSubSong* subSong=song.subsong[subSongIndex];
|
||||||
warnings="";
|
warnings="";
|
||||||
|
@ -3733,8 +4348,10 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
|
||||||
w->writeC(song.systemPan[i]);
|
w->writeC(song.systemPan[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// chip flags (we'll seek here later)
|
||||||
|
sysFlagsPtrSeek=w->tell();
|
||||||
for (int i=0; i<32; i++) {
|
for (int i=0; i<32; i++) {
|
||||||
w->writeI(song.systemFlagsOld[i]);
|
w->writeI(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// song name
|
// song name
|
||||||
|
@ -3933,6 +4550,27 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
|
||||||
w->seek(0,SEEK_END);
|
w->seek(0,SEEK_END);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// CHIP FLAGS
|
||||||
|
for (int i=0; i<song.systemLen; i++) {
|
||||||
|
String data=song.systemFlags[i].toString();
|
||||||
|
if (data.empty()) {
|
||||||
|
sysFlagsPtr.push_back(0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
sysFlagsPtr.push_back(w->tell());
|
||||||
|
w->write("FLAG",4);
|
||||||
|
blockStartSeek=w->tell();
|
||||||
|
w->writeI(0);
|
||||||
|
|
||||||
|
w->writeString(data,false);
|
||||||
|
|
||||||
|
blockEndSeek=w->tell();
|
||||||
|
w->seek(blockStartSeek,SEEK_SET);
|
||||||
|
w->writeI(blockEndSeek-blockStartSeek-4);
|
||||||
|
w->seek(0,SEEK_END);
|
||||||
|
}
|
||||||
|
|
||||||
/// INSTRUMENT
|
/// INSTRUMENT
|
||||||
for (int i=0; i<song.insLen; i++) {
|
for (int i=0; i<song.insLen; i++) {
|
||||||
DivInstrument* ins=song.ins[i];
|
DivInstrument* ins=song.ins[i];
|
||||||
|
@ -4050,14 +4688,18 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
|
||||||
w->writeI(i);
|
w->writeI(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// SUBSONG POINTERS
|
|
||||||
w->seek(subSongPtrSeek,SEEK_SET);
|
|
||||||
|
|
||||||
// subsong pointers
|
// subsong pointers
|
||||||
|
w->seek(subSongPtrSeek,SEEK_SET);
|
||||||
for (size_t i=0; i<(song.subsong.size()-1); i++) {
|
for (size_t i=0; i<(song.subsong.size()-1); i++) {
|
||||||
w->writeI(subSongPtr[i]);
|
w->writeI(subSongPtr[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// flag pointers
|
||||||
|
w->seek(sysFlagsPtrSeek,SEEK_SET);
|
||||||
|
for (size_t i=0; i<sysFlagsPtr.size(); i++) {
|
||||||
|
w->writeI(sysFlagsPtr[i]);
|
||||||
|
}
|
||||||
|
|
||||||
saveLock.unlock();
|
saveLock.unlock();
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ bool DivDispatch::getWantPreNote() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivDispatch::setFlags(unsigned int flags) {
|
void DivDispatch::setFlags(const DivConfig& flags) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivDispatch::setSkipRegisterWrites(bool value) {
|
void DivDispatch::setSkipRegisterWrites(bool value) {
|
||||||
|
@ -157,7 +157,7 @@ void DivDispatch::renderSamples() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivDispatch::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivDispatch::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -427,8 +427,8 @@ void DivPlatformAmiga::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformAmiga::setFlags(unsigned int flags) {
|
void DivPlatformAmiga::setFlags(const DivConfig& flags) {
|
||||||
if (flags&1) {
|
if (flags.getInt("clockSel",0)) {
|
||||||
chipClock=COLOR_PAL*4.0/5.0;
|
chipClock=COLOR_PAL*4.0/5.0;
|
||||||
} else {
|
} else {
|
||||||
chipClock=COLOR_NTSC;
|
chipClock=COLOR_NTSC;
|
||||||
|
@ -437,10 +437,11 @@ void DivPlatformAmiga::setFlags(unsigned int flags) {
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->rate=rate;
|
||||||
}
|
}
|
||||||
sep1=((flags>>8)&127)+127;
|
int sep=flags.getInt("stereoSep",0)&127;
|
||||||
sep2=127-((flags>>8)&127);
|
sep1=sep+127;
|
||||||
amigaModel=flags&2;
|
sep2=127-sep;
|
||||||
bypassLimits=flags&4;
|
amigaModel=flags.getInt("chipType",0);
|
||||||
|
bypassLimits=flags.getBool("bypassLimits",false);
|
||||||
if (amigaModel) {
|
if (amigaModel) {
|
||||||
filtConstOff=4000;
|
filtConstOff=4000;
|
||||||
filtConstOn=sin(M_PI*8000.0/(double)rate)*4096.0;
|
filtConstOn=sin(M_PI*8000.0/(double)rate)*4096.0;
|
||||||
|
@ -450,7 +451,7 @@ void DivPlatformAmiga::setFlags(unsigned int flags) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformAmiga::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformAmiga::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -101,12 +101,12 @@ class DivPlatformAmiga: public DivDispatch {
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
DivMacroInt* getChanMacroInt(int ch);
|
DivMacroInt* getChanMacroInt(int ch);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -849,13 +849,8 @@ void DivPlatformArcade::reset() {
|
||||||
//rWrite(0x1b,0x00);
|
//rWrite(0x1b,0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformArcade::setFlags(unsigned int flags) {
|
void DivPlatformArcade::setFlags(const DivConfig& flags) {
|
||||||
switch (flags&0xff) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
default:
|
|
||||||
case 0:
|
|
||||||
chipClock=COLOR_NTSC;
|
|
||||||
baseFreqOff=0;
|
|
||||||
break;
|
|
||||||
case 1:
|
case 1:
|
||||||
chipClock=COLOR_PAL*4.0/5.0;
|
chipClock=COLOR_PAL*4.0/5.0;
|
||||||
baseFreqOff=12;
|
baseFreqOff=12;
|
||||||
|
@ -864,6 +859,10 @@ void DivPlatformArcade::setFlags(unsigned int flags) {
|
||||||
chipClock=4000000.0;
|
chipClock=4000000.0;
|
||||||
baseFreqOff=-122;
|
baseFreqOff=-122;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
chipClock=COLOR_NTSC;
|
||||||
|
baseFreqOff=0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
rate=chipClock/64;
|
rate=chipClock/64;
|
||||||
for (int i=0; i<8; i++) {
|
for (int i=0; i<8; i++) {
|
||||||
|
@ -879,7 +878,7 @@ void DivPlatformArcade::setYMFM(bool use) {
|
||||||
useYMFM=use;
|
useYMFM=use;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformArcade::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformArcade::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -111,13 +111,13 @@ class DivPlatformArcade: public DivPlatformOPM {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
DivMacroInt* getChanMacroInt(int ch);
|
DivMacroInt* getChanMacroInt(int ch);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
void setYMFM(bool use);
|
void setYMFM(bool use);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformArcade();
|
~DivPlatformArcade();
|
||||||
};
|
};
|
||||||
|
|
|
@ -772,17 +772,13 @@ void DivPlatformAY8910::setExtClockDiv(unsigned int eclk, unsigned char ediv) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformAY8910::setFlags(unsigned int flags) {
|
void DivPlatformAY8910::setFlags(const DivConfig& flags) {
|
||||||
if (extMode) {
|
if (extMode) {
|
||||||
chipClock=extClock;
|
chipClock=extClock;
|
||||||
rate=chipClock/extDiv;
|
rate=chipClock/extDiv;
|
||||||
} else {
|
} else {
|
||||||
clockSel=(flags>>7)&1;
|
clockSel=flags.getBool("halfClock",false);
|
||||||
switch (flags&15) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
default:
|
|
||||||
case 0:
|
|
||||||
chipClock=COLOR_NTSC/2.0;
|
|
||||||
break;
|
|
||||||
case 1:
|
case 1:
|
||||||
chipClock=COLOR_PAL*2.0/5.0;
|
chipClock=COLOR_PAL*2.0/5.0;
|
||||||
break;
|
break;
|
||||||
|
@ -825,6 +821,9 @@ void DivPlatformAY8910::setFlags(unsigned int flags) {
|
||||||
case 14:
|
case 14:
|
||||||
chipClock=1536000;
|
chipClock=1536000;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
chipClock=COLOR_NTSC/2.0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
rate=chipClock/8;
|
rate=chipClock/8;
|
||||||
}
|
}
|
||||||
|
@ -833,7 +832,7 @@ void DivPlatformAY8910::setFlags(unsigned int flags) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ay!=NULL) delete ay;
|
if (ay!=NULL) delete ay;
|
||||||
switch ((flags>>4)&3) {
|
switch (flags.getInt("chipType",0)) {
|
||||||
case 1:
|
case 1:
|
||||||
ay=new ym2149_device(rate,clockSel);
|
ay=new ym2149_device(rate,clockSel);
|
||||||
sunsoft=false;
|
sunsoft=false;
|
||||||
|
@ -858,11 +857,11 @@ void DivPlatformAY8910::setFlags(unsigned int flags) {
|
||||||
ay->device_start();
|
ay->device_start();
|
||||||
ay->device_reset();
|
ay->device_reset();
|
||||||
|
|
||||||
stereo=(flags>>6)&1;
|
stereo=flags.getBool("stereo",false);
|
||||||
stereoSep=(flags>>8)&255;
|
stereoSep=flags.getInt("stereoSep",0)&255;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformAY8910::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformAY8910::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -162,7 +162,7 @@ class DivPlatformAY8910: public DivDispatch {
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
DivMacroInt* getChanMacroInt(int ch);
|
DivMacroInt* getChanMacroInt(int ch);
|
||||||
|
@ -171,7 +171,7 @@ class DivPlatformAY8910: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
DivPlatformAY8910(bool useExtMode=false, unsigned int eclk=COLOR_NTSC, unsigned char ediv=8):
|
DivPlatformAY8910(bool useExtMode=false, unsigned int eclk=COLOR_NTSC, unsigned char ediv=8):
|
||||||
DivDispatch(),
|
DivDispatch(),
|
||||||
|
|
|
@ -761,9 +761,9 @@ void DivPlatformAY8930::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) immWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) immWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformAY8930::setFlags(unsigned int flags) {
|
void DivPlatformAY8930::setFlags(const DivConfig& flags) {
|
||||||
clockSel=(flags>>7)&1;
|
clockSel=flags.getBool("halfClock",false);
|
||||||
switch (flags&15) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
case 1:
|
case 1:
|
||||||
chipClock=COLOR_PAL*2.0/5.0;
|
chipClock=COLOR_PAL*2.0/5.0;
|
||||||
break;
|
break;
|
||||||
|
@ -809,11 +809,11 @@ void DivPlatformAY8930::setFlags(unsigned int flags) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->rate=rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
stereo=(flags>>6)&1;
|
stereo=flags.getBool("stereo",false);
|
||||||
stereoSep=(flags>>8)&255;
|
stereoSep=flags.getInt("stereoSep",0)&255;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformAY8930::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformAY8930::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -164,7 +164,7 @@ class DivPlatformAY8930: public DivDispatch {
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
DivMacroInt* getChanMacroInt(int ch);
|
DivMacroInt* getChanMacroInt(int ch);
|
||||||
|
@ -172,7 +172,7 @@ class DivPlatformAY8930: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -321,7 +321,7 @@ void DivPlatformBubSysWSG::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformBubSysWSG::setFlags(unsigned int flags) {
|
void DivPlatformBubSysWSG::setFlags(const DivConfig& flags) {
|
||||||
chipClock=COLOR_NTSC;
|
chipClock=COLOR_NTSC;
|
||||||
rate=chipClock;
|
rate=chipClock;
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
|
@ -337,7 +337,7 @@ void DivPlatformBubSysWSG::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformBubSysWSG::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformBubSysWSG::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -80,13 +80,13 @@ class DivPlatformBubSysWSG: public DivDispatch {
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
DivMacroInt* getChanMacroInt(int ch);
|
DivMacroInt* getChanMacroInt(int ch);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformBubSysWSG();
|
~DivPlatformBubSysWSG();
|
||||||
};
|
};
|
||||||
|
|
|
@ -531,8 +531,8 @@ void DivPlatformC64::setFP(bool fp) {
|
||||||
isFP=fp;
|
isFP=fp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformC64::setFlags(unsigned int flags) {
|
void DivPlatformC64::setFlags(const DivConfig& flags) {
|
||||||
switch (flags&0xf) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
case 0x0: // NTSC C64
|
case 0x0: // NTSC C64
|
||||||
rate=COLOR_NTSC*2.0/7.0;
|
rate=COLOR_NTSC*2.0/7.0;
|
||||||
break;
|
break;
|
||||||
|
@ -554,7 +554,7 @@ void DivPlatformC64::setFlags(unsigned int flags) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformC64::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformC64::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -101,7 +101,7 @@ class DivPlatformC64: public DivDispatch {
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
bool getDCOffRequired();
|
bool getDCOffRequired();
|
||||||
bool getWantPreNote();
|
bool getWantPreNote();
|
||||||
|
@ -111,7 +111,7 @@ class DivPlatformC64: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void setChipModel(bool is6581);
|
void setChipModel(bool is6581);
|
||||||
void setFP(bool fp);
|
void setFP(bool fp);
|
||||||
void quit();
|
void quit();
|
||||||
|
|
|
@ -138,7 +138,7 @@ void DivPlatformDummy::reset() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformDummy::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformDummy::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -44,7 +44,7 @@ class DivPlatformDummy: public DivDispatch {
|
||||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||||
void reset();
|
void reset();
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformDummy();
|
~DivPlatformDummy();
|
||||||
};
|
};
|
||||||
|
|
|
@ -451,10 +451,11 @@ void DivPlatformFDS::setNSFPlay(bool use) {
|
||||||
useNP=use;
|
useNP=use;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformFDS::setFlags(unsigned int flags) {
|
void DivPlatformFDS::setFlags(const DivConfig& flags) {
|
||||||
if (flags==2) { // Dendy
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
|
if (clockSel==2) { // Dendy
|
||||||
rate=COLOR_PAL*2.0/5.0;
|
rate=COLOR_PAL*2.0/5.0;
|
||||||
} else if (flags==1) { // PAL
|
} else if (clockSel==1) { // PAL
|
||||||
rate=COLOR_PAL*3.0/8.0;
|
rate=COLOR_PAL*3.0/8.0;
|
||||||
} else { // NTSC
|
} else { // NTSC
|
||||||
rate=COLOR_NTSC/2.0;
|
rate=COLOR_NTSC/2.0;
|
||||||
|
@ -485,9 +486,8 @@ void DivPlatformFDS::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformFDS::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformFDS::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
apuType=flags;
|
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
writeOscBuf=0;
|
writeOscBuf=0;
|
||||||
|
|
|
@ -69,7 +69,6 @@ class DivPlatformFDS: public DivDispatch {
|
||||||
DivDispatchOscBuffer* oscBuf;
|
DivDispatchOscBuffer* oscBuf;
|
||||||
bool isMuted[1];
|
bool isMuted[1];
|
||||||
DivWaveSynth ws;
|
DivWaveSynth ws;
|
||||||
unsigned char apuType;
|
|
||||||
unsigned char writeOscBuf;
|
unsigned char writeOscBuf;
|
||||||
bool useNP;
|
bool useNP;
|
||||||
struct _fds* fds;
|
struct _fds* fds;
|
||||||
|
@ -99,13 +98,13 @@ class DivPlatformFDS: public DivDispatch {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
void setNSFPlay(bool use);
|
void setNSFPlay(bool use);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
float getPostAmp();
|
float getPostAmp();
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformFDS();
|
~DivPlatformFDS();
|
||||||
};
|
};
|
||||||
|
|
|
@ -106,6 +106,8 @@ class DivPlatformOPN: public DivPlatformFMBase {
|
||||||
unsigned int ayDiv;
|
unsigned int ayDiv;
|
||||||
bool extSys;
|
bool extSys;
|
||||||
|
|
||||||
|
DivConfig ayFlags;
|
||||||
|
|
||||||
DivPlatformOPN(double f=9440540.0, unsigned int d=72, unsigned int a=32, bool isExtSys=false):
|
DivPlatformOPN(double f=9440540.0, unsigned int d=72, unsigned int a=32, bool isExtSys=false):
|
||||||
DivPlatformFMBase(),
|
DivPlatformFMBase(),
|
||||||
fmFreqBase(f),
|
fmFreqBase(f),
|
||||||
|
|
|
@ -629,9 +629,9 @@ void DivPlatformGB::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) immWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) immWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformGB::setFlags(unsigned int flags) {
|
void DivPlatformGB::setFlags(const DivConfig& flags) {
|
||||||
antiClickEnabled=!(flags&8);
|
antiClickEnabled=!flags.getBool("noAntiClick",false);
|
||||||
switch (flags&3) {
|
switch (flags.getInt("chipType",0)) {
|
||||||
case 0:
|
case 0:
|
||||||
model=GB_MODEL_DMG_B;
|
model=GB_MODEL_DMG_B;
|
||||||
break;
|
break;
|
||||||
|
@ -647,7 +647,7 @@ void DivPlatformGB::setFlags(unsigned int flags) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformGB::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformGB::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
chipClock=4194304;
|
chipClock=4194304;
|
||||||
rate=chipClock/16;
|
rate=chipClock/16;
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
|
|
|
@ -116,8 +116,8 @@ class DivPlatformGB: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformGB();
|
~DivPlatformGB();
|
||||||
};
|
};
|
||||||
|
|
|
@ -1191,16 +1191,25 @@ void DivPlatformGenesis::setSoftPCM(bool value) {
|
||||||
softPCM=value;
|
softPCM=value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformGenesis::setFlags(unsigned int flags) {
|
void DivPlatformGenesis::setFlags(const DivConfig& flags) {
|
||||||
switch (flags&(~0x80000000)) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
|
case 1:
|
||||||
|
chipClock=COLOR_PAL*12.0/7.0;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
chipClock=8000000.0;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
chipClock=COLOR_NTSC*12.0/7.0;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
chipClock=COLOR_NTSC*9.0/4.0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
case 0: chipClock=COLOR_NTSC*15.0/7.0; break;
|
chipClock=COLOR_NTSC*15.0/7.0;
|
||||||
case 1: chipClock=COLOR_PAL*12.0/7.0; break;
|
break;
|
||||||
case 2: chipClock=8000000.0; break;
|
|
||||||
case 3: chipClock=COLOR_NTSC*12.0/7.0; break;
|
|
||||||
case 4: chipClock=COLOR_NTSC*9.0/4.0; break;
|
|
||||||
}
|
}
|
||||||
ladder=flags&0x80000000;
|
ladder=flags.getBool("ladderEffect",false);
|
||||||
OPN2_SetChipType(ladder?ym3438_mode_ym2612:0);
|
OPN2_SetChipType(ladder?ym3438_mode_ym2612:0);
|
||||||
if (useYMFM) {
|
if (useYMFM) {
|
||||||
if (fm_ymfm!=NULL) delete fm_ymfm;
|
if (fm_ymfm!=NULL) delete fm_ymfm;
|
||||||
|
@ -1218,7 +1227,7 @@ void DivPlatformGenesis::setFlags(unsigned int flags) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformGenesis::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformGenesis::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
ladder=false;
|
ladder=false;
|
||||||
|
|
|
@ -145,14 +145,14 @@ class DivPlatformGenesis: public DivPlatformOPN {
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
bool keyOffAffectsPorta(int ch);
|
bool keyOffAffectsPorta(int ch);
|
||||||
void toggleRegisterDump(bool enable);
|
void toggleRegisterDump(bool enable);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void setSoftPCM(bool value);
|
void setSoftPCM(bool value);
|
||||||
int getPortaFloor(int ch);
|
int getPortaFloor(int ch);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
DivPlatformGenesis():
|
DivPlatformGenesis():
|
||||||
DivPlatformOPN(9440540.0, 72, 32) {}
|
DivPlatformOPN(9440540.0, 72, 32) {}
|
||||||
|
|
|
@ -630,7 +630,7 @@ int DivPlatformGenesisExt::getPortaFloor(int ch) {
|
||||||
return (ch>8)?12:0;
|
return (ch>8)?12:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformGenesisExt::init(DivEngine* parent, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformGenesisExt::init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags) {
|
||||||
DivPlatformGenesis::init(parent,channels,sugRate,flags);
|
DivPlatformGenesis::init(parent,channels,sugRate,flags);
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
isOpMuted[i]=false;
|
isOpMuted[i]=false;
|
||||||
|
|
|
@ -67,7 +67,7 @@ class DivPlatformGenesisExt: public DivPlatformGenesis {
|
||||||
bool keyOffAffectsPorta(int ch);
|
bool keyOffAffectsPorta(int ch);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
int getPortaFloor(int ch);
|
int getPortaFloor(int ch);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformGenesisExt();
|
~DivPlatformGenesisExt();
|
||||||
};
|
};
|
||||||
|
|
|
@ -460,7 +460,7 @@ void DivPlatformLynx::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr, i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr, i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformLynx::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformLynx::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -107,7 +107,7 @@ class DivPlatformLynx: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformLynx();
|
~DivPlatformLynx();
|
||||||
};
|
};
|
||||||
|
|
|
@ -386,10 +386,11 @@ bool DivPlatformMMC5::keyOffAffectsArp(int ch) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMMC5::setFlags(unsigned int flags) {
|
void DivPlatformMMC5::setFlags(const DivConfig& flags) {
|
||||||
if (flags==2) { // Dendy
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
|
if (clockSel==2) { // Dendy
|
||||||
rate=COLOR_PAL*2.0/5.0;
|
rate=COLOR_PAL*2.0/5.0;
|
||||||
} else if (flags==1) { // PAL
|
} else if (clockSel==1) { // PAL
|
||||||
rate=COLOR_PAL*3.0/8.0;
|
rate=COLOR_PAL*3.0/8.0;
|
||||||
} else { // NTSC
|
} else { // NTSC
|
||||||
rate=COLOR_NTSC/2.0;
|
rate=COLOR_NTSC/2.0;
|
||||||
|
@ -414,9 +415,8 @@ void DivPlatformMMC5::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformMMC5::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformMMC5::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
apuType=flags;
|
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
writeOscBuf=0;
|
writeOscBuf=0;
|
||||||
|
|
|
@ -63,7 +63,6 @@ class DivPlatformMMC5: public DivDispatch {
|
||||||
unsigned int dacPos;
|
unsigned int dacPos;
|
||||||
int dacSample;
|
int dacSample;
|
||||||
unsigned char sampleBank;
|
unsigned char sampleBank;
|
||||||
unsigned char apuType;
|
|
||||||
unsigned char writeOscBuf;
|
unsigned char writeOscBuf;
|
||||||
struct _mmc5* mmc5;
|
struct _mmc5* mmc5;
|
||||||
unsigned char regPool[128];
|
unsigned char regPool[128];
|
||||||
|
@ -85,12 +84,12 @@ class DivPlatformMMC5: public DivDispatch {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
float getPostAmp();
|
float getPostAmp();
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformMMC5();
|
~DivPlatformMMC5();
|
||||||
};
|
};
|
||||||
|
|
|
@ -387,8 +387,8 @@ void DivPlatformMSM6258::renderSamples() {
|
||||||
adpcmMemLen=memPos+256;
|
adpcmMemLen=memPos+256;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMSM6258::setFlags(unsigned int flags) {
|
void DivPlatformMSM6258::setFlags(const DivConfig& flags) {
|
||||||
switch (flags) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
case 3:
|
case 3:
|
||||||
chipClock=8192000;
|
chipClock=8192000;
|
||||||
break;
|
break;
|
||||||
|
@ -408,7 +408,7 @@ void DivPlatformMSM6258::setFlags(unsigned int flags) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformMSM6258::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformMSM6258::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
adpcmMem=new unsigned char[getSampleMemCapacity(0)];
|
adpcmMem=new unsigned char[getSampleMemCapacity(0)];
|
||||||
adpcmMemLen=0;
|
adpcmMemLen=0;
|
||||||
|
|
|
@ -108,14 +108,14 @@ class DivPlatformMSM6258: public DivDispatch {
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
const void* getSampleMem(int index);
|
const void* getSampleMem(int index);
|
||||||
size_t getSampleMemCapacity(int index);
|
size_t getSampleMemCapacity(int index);
|
||||||
size_t getSampleMemUsage(int index);
|
size_t getSampleMemUsage(int index);
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
|
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformMSM6258();
|
~DivPlatformMSM6258();
|
||||||
};
|
};
|
||||||
|
|
|
@ -376,13 +376,9 @@ void DivPlatformMSM6295::renderSamples() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMSM6295::setFlags(unsigned int flags) {
|
void DivPlatformMSM6295::setFlags(const DivConfig& flags) {
|
||||||
rateSelInit=(flags>>7)&1;
|
rateSelInit=flags.getBool("rateSel",false);
|
||||||
switch (flags&0x7f) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
default:
|
|
||||||
case 0:
|
|
||||||
chipClock=4000000/4;
|
|
||||||
break;
|
|
||||||
case 1:
|
case 1:
|
||||||
chipClock=4224000/4;
|
chipClock=4224000/4;
|
||||||
break;
|
break;
|
||||||
|
@ -425,6 +421,9 @@ void DivPlatformMSM6295::setFlags(unsigned int flags) {
|
||||||
case 14:
|
case 14:
|
||||||
chipClock=COLOR_NTSC/3.0;
|
chipClock=COLOR_NTSC/3.0;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
chipClock=4000000/4;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
rate=chipClock/3;
|
rate=chipClock/3;
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
|
@ -436,7 +435,7 @@ void DivPlatformMSM6295::setFlags(unsigned int flags) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformMSM6295::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformMSM6295::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
adpcmMem=new unsigned char[getSampleMemCapacity(0)];
|
adpcmMem=new unsigned char[getSampleMemCapacity(0)];
|
||||||
adpcmMemLen=0;
|
adpcmMemLen=0;
|
||||||
|
|
|
@ -96,14 +96,14 @@ class DivPlatformMSM6295: public DivDispatch, public vgsound_emu_mem_intf {
|
||||||
virtual void notifyInsDeletion(void* ins) override;
|
virtual void notifyInsDeletion(void* ins) override;
|
||||||
virtual void poke(unsigned int addr, unsigned short val) override;
|
virtual void poke(unsigned int addr, unsigned short val) override;
|
||||||
virtual void poke(std::vector<DivRegWrite>& wlist) override;
|
virtual void poke(std::vector<DivRegWrite>& wlist) override;
|
||||||
virtual void setFlags(unsigned int flags) override;
|
virtual void setFlags(const DivConfig& flags) override;
|
||||||
virtual const char** getRegisterSheet() override;
|
virtual const char** getRegisterSheet() override;
|
||||||
virtual const void* getSampleMem(int index) override;
|
virtual const void* getSampleMem(int index) override;
|
||||||
virtual size_t getSampleMemCapacity(int index) override;
|
virtual size_t getSampleMemCapacity(int index) override;
|
||||||
virtual size_t getSampleMemUsage(int index) override;
|
virtual size_t getSampleMemUsage(int index) override;
|
||||||
virtual void renderSamples() override;
|
virtual void renderSamples() override;
|
||||||
|
|
||||||
virtual int init(DivEngine* parent, int channels, int sugRate, unsigned int flags) override;
|
virtual int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags) override;
|
||||||
virtual void quit() override;
|
virtual void quit() override;
|
||||||
DivPlatformMSM6295():
|
DivPlatformMSM6295():
|
||||||
DivDispatch(),
|
DivDispatch(),
|
||||||
|
|
|
@ -621,20 +621,20 @@ void DivPlatformN163::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformN163::setFlags(unsigned int flags) {
|
void DivPlatformN163::setFlags(const DivConfig& flags) {
|
||||||
switch (flags&0xf) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
case 0x0: // NTSC
|
case 1: // PAL
|
||||||
rate=COLOR_NTSC/2.0;
|
|
||||||
break;
|
|
||||||
case 0x1: // PAL
|
|
||||||
rate=COLOR_PAL*3.0/8.0;
|
rate=COLOR_PAL*3.0/8.0;
|
||||||
break;
|
break;
|
||||||
case 0x2: // Dendy
|
case 2: // Dendy
|
||||||
rate=COLOR_PAL*2.0/5.0;
|
rate=COLOR_PAL*2.0/5.0;
|
||||||
break;
|
break;
|
||||||
|
default: // NTSC
|
||||||
|
rate=COLOR_NTSC/2.0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
initChanMax=chanMax=(flags>>4)&7;
|
initChanMax=chanMax=flags.getInt("channels",0)&7;
|
||||||
multiplex=((flags>>7)&1)?false:true; // not accurate in real hardware
|
multiplex=!flags.getBool("multiplex",false); // not accurate in real hardware
|
||||||
chipClock=rate;
|
chipClock=rate;
|
||||||
rate/=15;
|
rate/=15;
|
||||||
n163.set_multiplex(multiplex);
|
n163.set_multiplex(multiplex);
|
||||||
|
@ -647,7 +647,7 @@ void DivPlatformN163::setFlags(unsigned int flags) {
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformN163::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformN163::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -104,14 +104,14 @@ class DivPlatformN163: public DivDispatch {
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformN163();
|
~DivPlatformN163();
|
||||||
};
|
};
|
||||||
|
|
|
@ -530,7 +530,7 @@ void DivPlatformNamcoWSG::setDeviceType(int type) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformNamcoWSG::setFlags(unsigned int flags) {
|
void DivPlatformNamcoWSG::setFlags(const DivConfig& flags) {
|
||||||
chipClock=3072000;
|
chipClock=3072000;
|
||||||
rate=chipClock/32;
|
rate=chipClock/32;
|
||||||
namco->device_clock_changed(rate);
|
namco->device_clock_changed(rate);
|
||||||
|
@ -547,7 +547,7 @@ void DivPlatformNamcoWSG::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformNamcoWSG::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformNamcoWSG::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -91,13 +91,13 @@ class DivPlatformNamcoWSG: public DivDispatch {
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
void setDeviceType(int type);
|
void setDeviceType(int type);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformNamcoWSG();
|
~DivPlatformNamcoWSG();
|
||||||
};
|
};
|
||||||
|
|
|
@ -640,11 +640,12 @@ bool DivPlatformNES::keyOffAffectsArp(int ch) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformNES::setFlags(unsigned int flags) {
|
void DivPlatformNES::setFlags(const DivConfig& flags) {
|
||||||
if (flags==2) { // Dendy
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
|
if (clockSel==2) { // Dendy
|
||||||
rate=COLOR_PAL*2.0/5.0;
|
rate=COLOR_PAL*2.0/5.0;
|
||||||
apuType=2;
|
apuType=2;
|
||||||
} else if (flags==1) { // PAL
|
} else if (clockSel==1) { // PAL
|
||||||
rate=COLOR_PAL*3.0/8.0;
|
rate=COLOR_PAL*3.0/8.0;
|
||||||
apuType=1;
|
apuType=1;
|
||||||
} else { // NTSC
|
} else { // NTSC
|
||||||
|
@ -730,9 +731,8 @@ void DivPlatformNES::renderSamples() {
|
||||||
dpcmMemLen=memPos;
|
dpcmMemLen=memPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformNES::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformNES::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
apuType=flags;
|
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
if (useNP) {
|
if (useNP) {
|
||||||
|
|
|
@ -104,7 +104,7 @@ class DivPlatformNES: public DivDispatch {
|
||||||
float getPostAmp();
|
float getPostAmp();
|
||||||
unsigned char readDMC(unsigned short addr);
|
unsigned char readDMC(unsigned short addr);
|
||||||
void setNSFPlay(bool use);
|
void setNSFPlay(bool use);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
|
@ -113,7 +113,7 @@ class DivPlatformNES: public DivDispatch {
|
||||||
size_t getSampleMemCapacity(int index);
|
size_t getSampleMemCapacity(int index);
|
||||||
size_t getSampleMemUsage(int index);
|
size_t getSampleMemUsage(int index);
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformNES();
|
~DivPlatformNES();
|
||||||
};
|
};
|
||||||
|
|
|
@ -1646,7 +1646,7 @@ void DivPlatformOPL::setOPLType(int type, bool drums) {
|
||||||
properDrumsSys=drums;
|
properDrumsSys=drums;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformOPL::setFlags(unsigned int flags) {
|
void DivPlatformOPL::setFlags(const DivConfig& flags) {
|
||||||
/*
|
/*
|
||||||
if (flags==3) {
|
if (flags==3) {
|
||||||
chipClock=COLOR_NTSC*12.0/7.0;
|
chipClock=COLOR_NTSC*12.0/7.0;
|
||||||
|
@ -1674,7 +1674,7 @@ void DivPlatformOPL::setFlags(unsigned int flags) {
|
||||||
switch (chipType) {
|
switch (chipType) {
|
||||||
default:
|
default:
|
||||||
case 1: case 2: case 8950:
|
case 1: case 2: case 8950:
|
||||||
switch (flags&0xff) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
case 0x01:
|
case 0x01:
|
||||||
chipClock=COLOR_PAL*4.0/5.0;
|
chipClock=COLOR_PAL*4.0/5.0;
|
||||||
break;
|
break;
|
||||||
|
@ -1698,7 +1698,7 @@ void DivPlatformOPL::setFlags(unsigned int flags) {
|
||||||
chipRateBase=rate;
|
chipRateBase=rate;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
switch (flags&0xff) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
case 0x01:
|
case 0x01:
|
||||||
chipClock=COLOR_PAL*16.0/5.0;
|
chipClock=COLOR_PAL*16.0/5.0;
|
||||||
break;
|
break;
|
||||||
|
@ -1719,7 +1719,7 @@ void DivPlatformOPL::setFlags(unsigned int flags) {
|
||||||
chipRateBase=rate;
|
chipRateBase=rate;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
switch (flags&0xff) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
case 0x01:
|
case 0x01:
|
||||||
chipClock=COLOR_PAL*32.0/5.0;
|
chipClock=COLOR_PAL*32.0/5.0;
|
||||||
break;
|
break;
|
||||||
|
@ -1785,7 +1785,7 @@ void DivPlatformOPL::renderSamples() {
|
||||||
adpcmBMemLen=memPos+256;
|
adpcmBMemLen=memPos+256;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformOPL::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformOPL::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -143,7 +143,7 @@ class DivPlatformOPL: public DivDispatch {
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
bool keyOffAffectsPorta(int ch);
|
bool keyOffAffectsPorta(int ch);
|
||||||
void toggleRegisterDump(bool enable);
|
void toggleRegisterDump(bool enable);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
int getPortaFloor(int ch);
|
int getPortaFloor(int ch);
|
||||||
|
@ -153,7 +153,7 @@ class DivPlatformOPL: public DivDispatch {
|
||||||
size_t getSampleMemCapacity(int index);
|
size_t getSampleMemCapacity(int index);
|
||||||
size_t getSampleMemUsage(int index);
|
size_t getSampleMemUsage(int index);
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformOPL();
|
~DivPlatformOPL();
|
||||||
};
|
};
|
||||||
|
|
|
@ -947,24 +947,25 @@ void DivPlatformOPLL::setYMFM(bool use) {
|
||||||
useYMFM=use;
|
useYMFM=use;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformOPLL::setFlags(unsigned int flags) {
|
void DivPlatformOPLL::setFlags(const DivConfig& flags) {
|
||||||
if ((flags&15)==3) {
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
|
if (clockSel==3) {
|
||||||
chipClock=COLOR_NTSC/2.0;
|
chipClock=COLOR_NTSC/2.0;
|
||||||
} else if ((flags&15)==2) {
|
} else if (clockSel==2) {
|
||||||
chipClock=4000000.0;
|
chipClock=4000000.0;
|
||||||
} else if ((flags&15)==1) {
|
} else if (clockSel==1) {
|
||||||
chipClock=COLOR_PAL*4.0/5.0;
|
chipClock=COLOR_PAL*4.0/5.0;
|
||||||
} else {
|
} else {
|
||||||
chipClock=COLOR_NTSC;
|
chipClock=COLOR_NTSC;
|
||||||
}
|
}
|
||||||
rate=chipClock/36;
|
rate=chipClock/36;
|
||||||
patchSet=flags>>4;
|
patchSet=flags.getInt("patchSet",0);
|
||||||
for (int i=0; i<11; i++) {
|
for (int i=0; i<11; i++) {
|
||||||
oscBuf[i]->rate=rate/2;
|
oscBuf[i]->rate=rate/2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformOPLL::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformOPLL::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -117,13 +117,13 @@ class DivPlatformOPLL: public DivDispatch {
|
||||||
void toggleRegisterDump(bool enable);
|
void toggleRegisterDump(bool enable);
|
||||||
void setVRC7(bool vrc);
|
void setVRC7(bool vrc);
|
||||||
void setProperDrums(bool pd);
|
void setProperDrums(bool pd);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
int getPortaFloor(int ch);
|
int getPortaFloor(int ch);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformOPLL();
|
~DivPlatformOPLL();
|
||||||
};
|
};
|
||||||
|
|
|
@ -557,14 +557,13 @@ void DivPlatformPCE::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPCE::setFlags(unsigned int flags) {
|
void DivPlatformPCE::setFlags(const DivConfig& flags) {
|
||||||
if (flags&1) { // technically there is no PAL PC Engine but oh well...
|
if (flags.getInt("clockSel",0)) { // technically there is no PAL PC Engine but oh well...
|
||||||
chipClock=COLOR_PAL*4.0/5.0;
|
chipClock=COLOR_PAL*4.0/5.0;
|
||||||
} else {
|
} else {
|
||||||
chipClock=COLOR_NTSC;
|
chipClock=COLOR_NTSC;
|
||||||
}
|
}
|
||||||
// flags&4 will be chip revision
|
antiClickEnabled=!flags.getBool("noAntiClick",false);
|
||||||
antiClickEnabled=!(flags&8);
|
|
||||||
rate=chipClock/12;
|
rate=chipClock/12;
|
||||||
for (int i=0; i<6; i++) {
|
for (int i=0; i<6; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->rate=rate;
|
||||||
|
@ -574,7 +573,7 @@ void DivPlatformPCE::setFlags(unsigned int flags) {
|
||||||
delete pce;
|
delete pce;
|
||||||
pce=NULL;
|
pce=NULL;
|
||||||
}
|
}
|
||||||
pce=new PCE_PSG(tempL,tempR,(flags&4)?PCE_PSG::REVISION_HUC6280A:PCE_PSG::REVISION_HUC6280);
|
pce=new PCE_PSG(tempL,tempR,flags.getInt("chipType",0)?PCE_PSG::REVISION_HUC6280A:PCE_PSG::REVISION_HUC6280);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPCE::poke(unsigned int addr, unsigned short val) {
|
void DivPlatformPCE::poke(unsigned int addr, unsigned short val) {
|
||||||
|
@ -585,7 +584,7 @@ void DivPlatformPCE::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformPCE::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformPCE::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -107,13 +107,13 @@ class DivPlatformPCE: public DivDispatch {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformPCE();
|
~DivPlatformPCE();
|
||||||
};
|
};
|
||||||
|
|
|
@ -382,18 +382,17 @@ void DivPlatformPCMDAC::notifyInsDeletion(void* ins) {
|
||||||
chan.std.notifyInsDeletion((DivInstrument*)ins);
|
chan.std.notifyInsDeletion((DivInstrument*)ins);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPCMDAC::setFlags(unsigned int flags) {
|
void DivPlatformPCMDAC::setFlags(const DivConfig& flags) {
|
||||||
// default to 44100Hz 16-bit stereo
|
// default to 44100Hz 16-bit stereo
|
||||||
if (!flags) flags=0x1f0000|44099;
|
rate=flags.getInt("rate",44100);
|
||||||
rate=(flags&0xffff)+1;
|
|
||||||
// rate can't be too low or the resampler will break
|
// rate can't be too low or the resampler will break
|
||||||
if (rate<1000) rate=1000;
|
if (rate<1000) rate=1000;
|
||||||
chipClock=rate;
|
chipClock=rate;
|
||||||
outDepth=(flags>>16)&0xf;
|
outDepth=(flags.getInt("outDepth",15))&15;
|
||||||
outStereo=(flags>>20)&1;
|
outStereo=flags.getBool("stereo",true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformPCMDAC::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformPCMDAC::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -91,11 +91,11 @@ class DivPlatformPCMDAC: public DivDispatch {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
DivMacroInt* getChanMacroInt(int ch);
|
DivMacroInt* getChanMacroInt(int ch);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -586,10 +586,10 @@ bool DivPlatformPCSpeaker::keyOffAffectsArp(int ch) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformPCSpeaker::setFlags(unsigned int flags) {
|
void DivPlatformPCSpeaker::setFlags(const DivConfig& flags) {
|
||||||
chipClock=COLOR_NTSC/3.0;
|
chipClock=COLOR_NTSC/3.0;
|
||||||
rate=chipClock/PCSPKR_DIVIDER;
|
rate=chipClock/PCSPKR_DIVIDER;
|
||||||
speakerType=flags&3;
|
speakerType=flags.getInt("speakerType",0)&3;
|
||||||
oscBuf->rate=rate;
|
oscBuf->rate=rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ void DivPlatformPCSpeaker::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
// ???
|
// ???
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformPCSpeaker::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformPCSpeaker::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -108,13 +108,13 @@ class DivPlatformPCSpeaker: public DivDispatch {
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void notifyPlaybackStop();
|
void notifyPlaybackStop();
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformPCSpeaker();
|
~DivPlatformPCSpeaker();
|
||||||
};
|
};
|
||||||
|
|
|
@ -295,7 +295,7 @@ void DivPlatformPET::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformPET::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformPET::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -81,7 +81,7 @@ class DivPlatformPET: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformPET();
|
~DivPlatformPET();
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -592,14 +592,14 @@ void DivPlatformQSound::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformQSound::setFlags(unsigned int flags) {
|
void DivPlatformQSound::setFlags(const DivConfig& flags) {
|
||||||
echoDelay = 2725 - (flags & 0xfff);
|
echoDelay = 2725 - flags.getInt("echoDelay",0);
|
||||||
echoFeedback = (flags >> 12) & 255;
|
echoFeedback = flags.getInt("echoFeedback",0) & 255;
|
||||||
|
|
||||||
if(echoDelay < 0) {
|
if (echoDelay < 0) {
|
||||||
echoDelay = 0;
|
echoDelay = 0;
|
||||||
}
|
}
|
||||||
if(echoDelay > 2725) {
|
if (echoDelay > 2725) {
|
||||||
echoDelay = 2725;
|
echoDelay = 2725;
|
||||||
}
|
}
|
||||||
//rate=chipClock/CHIP_DIVIDER;
|
//rate=chipClock/CHIP_DIVIDER;
|
||||||
|
@ -678,7 +678,7 @@ void DivPlatformQSound::renderSamples() {
|
||||||
sampleMemLen=memPos+256;
|
sampleMemLen=memPos+256;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformQSound::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformQSound::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -93,7 +93,7 @@ class DivPlatformQSound: public DivDispatch {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
|
@ -104,7 +104,7 @@ class DivPlatformQSound: public DivDispatch {
|
||||||
size_t getSampleMemCapacity(int index = 0);
|
size_t getSampleMemCapacity(int index = 0);
|
||||||
size_t getSampleMemUsage(int index = 0);
|
size_t getSampleMemUsage(int index = 0);
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -342,13 +342,13 @@ void DivPlatformRF5C68::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformRF5C68::setFlags(unsigned int flags) {
|
void DivPlatformRF5C68::setFlags(const DivConfig& flags) {
|
||||||
switch (flags&0x0f) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
case 1: chipClock=10000000; break;
|
case 1: chipClock=10000000; break;
|
||||||
case 2: chipClock=12500000; break;
|
case 2: chipClock=12500000; break;
|
||||||
default: chipClock=8000000; break;
|
default: chipClock=8000000; break;
|
||||||
}
|
}
|
||||||
chipType=flags>>4;
|
chipType=flags.getInt("chipType",0);
|
||||||
rate=chipClock/384;
|
rate=chipClock/384;
|
||||||
for (int i=0; i<8; i++) {
|
for (int i=0; i<8; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->rate=rate;
|
||||||
|
@ -416,7 +416,7 @@ void DivPlatformRF5C68::renderSamples() {
|
||||||
sampleMemLen=memPos;
|
sampleMemLen=memPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformRF5C68::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformRF5C68::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -92,7 +92,7 @@ class DivPlatformRF5C68: public DivDispatch {
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
|
@ -100,7 +100,7 @@ class DivPlatformRF5C68: public DivDispatch {
|
||||||
size_t getSampleMemCapacity(int index = 0);
|
size_t getSampleMemCapacity(int index = 0);
|
||||||
size_t getSampleMemUsage(int index = 0);
|
size_t getSampleMemUsage(int index = 0);
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
private:
|
private:
|
||||||
void chWrite(unsigned char ch, unsigned int addr, unsigned char val);
|
void chWrite(unsigned char ch, unsigned int addr, unsigned char val);
|
||||||
|
|
|
@ -422,10 +422,11 @@ void DivPlatformSAA1099::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSAA1099::setFlags(unsigned int flags) {
|
void DivPlatformSAA1099::setFlags(const DivConfig& flags) {
|
||||||
if (flags==2) {
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
|
if (clockSel==2) {
|
||||||
chipClock=COLOR_PAL*8.0/5.0;
|
chipClock=COLOR_PAL*8.0/5.0;
|
||||||
} else if (flags==1) {
|
} else if (clockSel==1) {
|
||||||
chipClock=COLOR_NTSC*2.0;
|
chipClock=COLOR_NTSC*2.0;
|
||||||
} else {
|
} else {
|
||||||
chipClock=8000000;
|
chipClock=8000000;
|
||||||
|
@ -448,7 +449,7 @@ void DivPlatformSAA1099::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformSAA1099::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformSAA1099::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -89,7 +89,7 @@ class DivPlatformSAA1099: public DivDispatch {
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
int getPortaFloor(int ch);
|
int getPortaFloor(int ch);
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
|
@ -97,7 +97,7 @@ class DivPlatformSAA1099: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -360,11 +360,8 @@ void DivPlatformSCC::setChipModel(bool isplus) {
|
||||||
isPlus=isplus;
|
isPlus=isplus;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSCC::setFlags(unsigned int flags) {
|
void DivPlatformSCC::setFlags(const DivConfig& flags) {
|
||||||
switch (flags&0x7f) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
case 0x00:
|
|
||||||
chipClock=COLOR_NTSC/2.0;
|
|
||||||
break;
|
|
||||||
case 0x01:
|
case 0x01:
|
||||||
chipClock=COLOR_PAL*2.0/5.0;
|
chipClock=COLOR_PAL*2.0/5.0;
|
||||||
break;
|
break;
|
||||||
|
@ -374,6 +371,9 @@ void DivPlatformSCC::setFlags(unsigned int flags) {
|
||||||
case 0x03:
|
case 0x03:
|
||||||
chipClock=4000000.0/2.0;
|
chipClock=4000000.0/2.0;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
chipClock=COLOR_NTSC/2.0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
rate=chipClock/8;
|
rate=chipClock/8;
|
||||||
for (int i=0; i<5; i++) {
|
for (int i=0; i<5; i++) {
|
||||||
|
@ -381,7 +381,7 @@ void DivPlatformSCC::setFlags(unsigned int flags) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformSCC::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformSCC::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -85,8 +85,8 @@ class DivPlatformSCC: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void setChipModel(bool isPlus);
|
void setChipModel(bool isPlus);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformSCC();
|
~DivPlatformSCC();
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO: new macro formula
|
|
||||||
#include "segapcm.h"
|
#include "segapcm.h"
|
||||||
#include "../engine.h"
|
#include "../engine.h"
|
||||||
#include "../../ta-log.h"
|
#include "../../ta-log.h"
|
||||||
|
@ -485,7 +484,7 @@ void DivPlatformSegaPCM::reset() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSegaPCM::setFlags(unsigned int flags) {
|
void DivPlatformSegaPCM::setFlags(const DivConfig& flags) {
|
||||||
chipClock=8000000.0;
|
chipClock=8000000.0;
|
||||||
rate=31250;
|
rate=31250;
|
||||||
for (int i=0; i<16; i++) {
|
for (int i=0; i<16; i++) {
|
||||||
|
@ -497,7 +496,7 @@ bool DivPlatformSegaPCM::isStereo() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformSegaPCM::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformSegaPCM::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -111,11 +111,11 @@ class DivPlatformSegaPCM: public DivDispatch {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformSegaPCM();
|
~DivPlatformSegaPCM();
|
||||||
};
|
};
|
||||||
|
|
|
@ -429,85 +429,78 @@ void DivPlatformSMS::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSMS::setFlags(unsigned int flags) {
|
void DivPlatformSMS::setFlags(const DivConfig& flags) {
|
||||||
switch (flags&0xff03) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
default:
|
case 1:
|
||||||
case 0x0000:
|
|
||||||
chipClock=COLOR_NTSC;
|
|
||||||
break;
|
|
||||||
case 0x0001:
|
|
||||||
chipClock=COLOR_PAL*4.0/5.0;
|
chipClock=COLOR_PAL*4.0/5.0;
|
||||||
break;
|
break;
|
||||||
case 0x0002:
|
case 2:
|
||||||
chipClock=4000000;
|
chipClock=4000000;
|
||||||
break;
|
break;
|
||||||
case 0x0003:
|
case 3:
|
||||||
chipClock=COLOR_NTSC/2.0;
|
chipClock=COLOR_NTSC/2.0;
|
||||||
break;
|
break;
|
||||||
case 0x0100:
|
case 4:
|
||||||
chipClock=3000000;
|
chipClock=3000000;
|
||||||
break;
|
break;
|
||||||
case 0x0101:
|
case 5:
|
||||||
chipClock=2000000;
|
chipClock=2000000;
|
||||||
break;
|
break;
|
||||||
case 0x0102:
|
case 6:
|
||||||
chipClock=COLOR_NTSC/8.0;
|
chipClock=COLOR_NTSC/8.0;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
chipClock=COLOR_NTSC;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
resetPhase=!(flags&16);
|
resetPhase=!flags.getBool("noPhaseReset",false);
|
||||||
divider=16;
|
divider=16;
|
||||||
toneDivider=64.0;
|
toneDivider=64.0;
|
||||||
noiseDivider=64.0;
|
noiseDivider=64.0;
|
||||||
if (sn!=NULL) delete sn;
|
if (sn!=NULL) delete sn;
|
||||||
switch (flags&0xcc) {
|
switch (flags.getInt("chipType",0)) {
|
||||||
default: // Sega
|
case 1: // TI SN76489
|
||||||
case 0x00:
|
|
||||||
sn=new segapsg_device();
|
|
||||||
isRealSN=false;
|
|
||||||
stereo=false;
|
|
||||||
break;
|
|
||||||
case 0x04: // TI SN76489
|
|
||||||
sn=new sn76489_device();
|
sn=new sn76489_device();
|
||||||
isRealSN=true;
|
isRealSN=true;
|
||||||
stereo=false;
|
stereo=false;
|
||||||
noiseDivider=60.0; // 64 for match to tone frequency on non-Sega PSG but compatibility
|
noiseDivider=60.0; // 64 for match to tone frequency on non-Sega PSG but compatibility
|
||||||
break;
|
break;
|
||||||
case 0x08: // TI+Atari
|
case 2: // TI+Atari
|
||||||
sn=new sn76496_base_device(0x4000, 0x0f35, 0x01, 0x02, true, false, 1/*8*/, false, true);
|
sn=new sn76496_base_device(0x4000, 0x0f35, 0x01, 0x02, true, false, 1/*8*/, false, true);
|
||||||
isRealSN=true;
|
isRealSN=true;
|
||||||
stereo=false;
|
stereo=false;
|
||||||
noiseDivider=60.0;
|
noiseDivider=60.0;
|
||||||
break;
|
break;
|
||||||
case 0x0c: // Game Gear (not fully emulated yet!)
|
case 3: // Game Gear (not fully emulated yet!)
|
||||||
sn=new gamegear_device();
|
sn=new gamegear_device();
|
||||||
isRealSN=false;
|
isRealSN=false;
|
||||||
stereo=true;
|
stereo=true;
|
||||||
break;
|
break;
|
||||||
case 0x40: // TI SN76489A
|
case 4: // TI SN76489A
|
||||||
sn=new sn76489a_device();
|
sn=new sn76489a_device();
|
||||||
isRealSN=false; // TODO
|
isRealSN=false; // TODO
|
||||||
stereo=false;
|
stereo=false;
|
||||||
noiseDivider=60.0;
|
noiseDivider=60.0;
|
||||||
break;
|
break;
|
||||||
case 0x44: // TI SN76496
|
case 5: // TI SN76496
|
||||||
sn=new sn76496_device();
|
sn=new sn76496_device();
|
||||||
isRealSN=false; // TODO
|
isRealSN=false; // TODO
|
||||||
stereo=false;
|
stereo=false;
|
||||||
noiseDivider=60.0;
|
noiseDivider=60.0;
|
||||||
break;
|
break;
|
||||||
case 0x48: // NCR 8496
|
case 6: // NCR 8496
|
||||||
sn=new ncr8496_device();
|
sn=new ncr8496_device();
|
||||||
isRealSN=false;
|
isRealSN=false;
|
||||||
stereo=false;
|
stereo=false;
|
||||||
noiseDivider=60.0;
|
noiseDivider=60.0;
|
||||||
break;
|
break;
|
||||||
case 0x4c: // Tandy PSSJ 3-voice sound
|
case 7: // Tandy PSSJ 3-voice sound
|
||||||
sn=new pssj3_device();
|
sn=new pssj3_device();
|
||||||
isRealSN=false;
|
isRealSN=false;
|
||||||
stereo=false;
|
stereo=false;
|
||||||
noiseDivider=60.0;
|
noiseDivider=60.0;
|
||||||
break;
|
break;
|
||||||
case 0x80: // TI SN94624
|
case 8: // TI SN94624
|
||||||
sn=new sn94624_device();
|
sn=new sn94624_device();
|
||||||
isRealSN=true;
|
isRealSN=true;
|
||||||
stereo=false;
|
stereo=false;
|
||||||
|
@ -515,7 +508,7 @@ void DivPlatformSMS::setFlags(unsigned int flags) {
|
||||||
toneDivider=8.0;
|
toneDivider=8.0;
|
||||||
noiseDivider=7.5;
|
noiseDivider=7.5;
|
||||||
break;
|
break;
|
||||||
case 0x84: // TI SN76494
|
case 9: // TI SN76494
|
||||||
sn=new sn76494_device();
|
sn=new sn76494_device();
|
||||||
isRealSN=false; // TODO
|
isRealSN=false; // TODO
|
||||||
stereo=false;
|
stereo=false;
|
||||||
|
@ -523,6 +516,11 @@ void DivPlatformSMS::setFlags(unsigned int flags) {
|
||||||
toneDivider=8.0;
|
toneDivider=8.0;
|
||||||
noiseDivider=7.5;
|
noiseDivider=7.5;
|
||||||
break;
|
break;
|
||||||
|
default: // Sega
|
||||||
|
sn=new segapsg_device();
|
||||||
|
isRealSN=false;
|
||||||
|
stereo=false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
rate=chipClock/divider;
|
rate=chipClock/divider;
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
|
@ -534,7 +532,7 @@ void DivPlatformSMS::setNuked(bool value) {
|
||||||
nuked=value;
|
nuked=value;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformSMS::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformSMS::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -97,13 +97,13 @@ class DivPlatformSMS: public DivDispatch {
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
bool keyOffAffectsPorta(int ch);
|
bool keyOffAffectsPorta(int ch);
|
||||||
int getPortaFloor(int ch);
|
int getPortaFloor(int ch);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
void setNuked(bool value);
|
void setNuked(bool value);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformSMS();
|
~DivPlatformSMS();
|
||||||
};
|
};
|
||||||
|
|
|
@ -672,21 +672,27 @@ void DivPlatformSNES::reset() {
|
||||||
writeControl=false;
|
writeControl=false;
|
||||||
writeNoise=false;
|
writeNoise=false;
|
||||||
writePitchMod=false;
|
writePitchMod=false;
|
||||||
writeEcho=false;
|
writeEcho=true;
|
||||||
|
|
||||||
echoDelay=0;
|
echoDelay=initEchoDelay;
|
||||||
echoFeedback=0;
|
echoFeedback=initEchoFeedback;
|
||||||
echoFIR[0]=127;
|
echoFIR[0]=initEchoFIR[0];
|
||||||
echoFIR[1]=0;
|
echoFIR[1]=initEchoFIR[1];
|
||||||
echoFIR[2]=0;
|
echoFIR[2]=initEchoFIR[2];
|
||||||
echoFIR[3]=0;
|
echoFIR[3]=initEchoFIR[3];
|
||||||
echoFIR[4]=0;
|
echoFIR[4]=initEchoFIR[4];
|
||||||
echoFIR[5]=0;
|
echoFIR[5]=initEchoFIR[5];
|
||||||
echoFIR[6]=0;
|
echoFIR[6]=initEchoFIR[6];
|
||||||
echoFIR[7]=0;
|
echoFIR[7]=initEchoFIR[7];
|
||||||
echoVolL=127;
|
echoVolL=initEchoVolL;
|
||||||
echoVolR=127;
|
echoVolR=initEchoVolR;
|
||||||
echoOn=false;
|
echoOn=initEchoOn;
|
||||||
|
|
||||||
|
for (int i=0; i<8; i++) {
|
||||||
|
if (initEchoMask&(1<<i)) {
|
||||||
|
chan[i].echo=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
initEcho();
|
initEcho();
|
||||||
}
|
}
|
||||||
|
@ -767,12 +773,29 @@ void DivPlatformSNES::renderSamples() {
|
||||||
memcpy(sampleMem,copyOfSampleMem,65536);
|
memcpy(sampleMem,copyOfSampleMem,65536);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSNES::setFlags(unsigned int flags) {
|
void DivPlatformSNES::setFlags(const DivConfig& flags) {
|
||||||
globalVolL=127-(flags&127);
|
globalVolL=127-flags.getInt("volScaleL",0);
|
||||||
globalVolR=127-((flags>>8)&127);
|
globalVolR=127-flags.getInt("volScaleR",0);
|
||||||
|
|
||||||
|
initEchoOn=flags.getBool("echo",false);
|
||||||
|
initEchoVolL=flags.getInt("echoVolL",127);
|
||||||
|
initEchoVolR=flags.getInt("echoVolR",127);
|
||||||
|
initEchoDelay=flags.getInt("echoDelay",0)&15;
|
||||||
|
initEchoFeedback=flags.getInt("echoFeedback",0);
|
||||||
|
|
||||||
|
initEchoFIR[0]=flags.getInt("echoFilter0",127);
|
||||||
|
initEchoFIR[1]=flags.getInt("echoFilter1",0);
|
||||||
|
initEchoFIR[2]=flags.getInt("echoFilter2",0);
|
||||||
|
initEchoFIR[3]=flags.getInt("echoFilter3",0);
|
||||||
|
initEchoFIR[4]=flags.getInt("echoFilter4",0);
|
||||||
|
initEchoFIR[5]=flags.getInt("echoFilter5",0);
|
||||||
|
initEchoFIR[6]=flags.getInt("echoFilter6",0);
|
||||||
|
initEchoFIR[7]=flags.getInt("echoFilter7",0);
|
||||||
|
|
||||||
|
initEchoMask=flags.getInt("echoMask",0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformSNES::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformSNES::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -87,6 +87,14 @@ class DivPlatformSNES: public DivDispatch {
|
||||||
bool writeEcho;
|
bool writeEcho;
|
||||||
bool echoOn;
|
bool echoOn;
|
||||||
|
|
||||||
|
bool initEchoOn;
|
||||||
|
signed char initEchoVolL;
|
||||||
|
signed char initEchoVolR;
|
||||||
|
signed char initEchoFeedback;
|
||||||
|
signed char initEchoFIR[8];
|
||||||
|
unsigned char initEchoDelay;
|
||||||
|
unsigned char initEchoMask;
|
||||||
|
|
||||||
struct QueuedWrite {
|
struct QueuedWrite {
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
unsigned char val;
|
unsigned char val;
|
||||||
|
@ -117,7 +125,7 @@ class DivPlatformSNES: public DivDispatch {
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
|
@ -126,7 +134,7 @@ class DivPlatformSNES: public DivDispatch {
|
||||||
size_t getSampleMemCapacity(int index = 0);
|
size_t getSampleMemCapacity(int index = 0);
|
||||||
size_t getSampleMemUsage(int index = 0);
|
size_t getSampleMemUsage(int index = 0);
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
private:
|
private:
|
||||||
void updateWave(int ch);
|
void updateWave(int ch);
|
||||||
|
|
|
@ -505,8 +505,8 @@ void DivPlatformSoundUnit::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSoundUnit::setFlags(unsigned int flags) {
|
void DivPlatformSoundUnit::setFlags(const DivConfig& flags) {
|
||||||
if (flags&1) {
|
if (flags.getInt("clockSel",0)) {
|
||||||
chipClock=1190000;
|
chipClock=1190000;
|
||||||
} else {
|
} else {
|
||||||
chipClock=1236000;
|
chipClock=1236000;
|
||||||
|
@ -515,14 +515,15 @@ void DivPlatformSoundUnit::setFlags(unsigned int flags) {
|
||||||
for (int i=0; i<8; i++) {
|
for (int i=0; i<8; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->rate=rate;
|
||||||
}
|
}
|
||||||
initIlCtrl=3|(flags&4);
|
bool echoOn=flags.getBool("echo",false);
|
||||||
initIlSize=((flags>>8)&63)|((flags&4)?0x40:0)|((flags&8)?0x80:0);
|
initIlCtrl=3|(echoOn?4:0);
|
||||||
initFil1=flags>>16;
|
initIlSize=((flags.getInt("echoDelay",0))&63)|(echoOn?0x40:0)|(flags.getBool("swapEcho",false)?0x80:0);
|
||||||
initEchoVol=flags>>24;
|
initFil1=flags.getInt("echoFeedback",0);
|
||||||
|
initEchoVol=flags.getInt("echoVol",0);
|
||||||
|
|
||||||
sampleMemSize=flags&16;
|
sampleMemSize=flags.getInt("sampleMemSize",0);
|
||||||
|
|
||||||
su->Init(sampleMemSize?65536:8192,flags&32);
|
su->Init(sampleMemSize?65536:8192,flags.getBool("pdm",false));
|
||||||
renderSamples();
|
renderSamples();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -572,7 +573,7 @@ void DivPlatformSoundUnit::renderSamples() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformSoundUnit::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformSoundUnit::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -130,7 +130,7 @@ class DivPlatformSoundUnit: public DivDispatch {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
|
@ -139,7 +139,7 @@ class DivPlatformSoundUnit: public DivDispatch {
|
||||||
size_t getSampleMemCapacity(int index);
|
size_t getSampleMemCapacity(int index);
|
||||||
size_t getSampleMemUsage(int index);
|
size_t getSampleMemUsage(int index);
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformSoundUnit();
|
~DivPlatformSoundUnit();
|
||||||
};
|
};
|
||||||
|
|
|
@ -509,7 +509,7 @@ void DivPlatformSwan::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformSwan::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformSwan::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -94,7 +94,7 @@ class DivPlatformSwan: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformSwan();
|
~DivPlatformSwan();
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -350,21 +350,21 @@ void DivPlatformTIA::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformTIA::setFlags(unsigned int flags) {
|
void DivPlatformTIA::setFlags(const DivConfig& flags) {
|
||||||
if (flags&1) {
|
if (flags.getInt("clockSel",0)) {
|
||||||
rate=COLOR_PAL*4.0/5.0;
|
rate=COLOR_PAL*4.0/5.0;
|
||||||
} else {
|
} else {
|
||||||
rate=COLOR_NTSC;
|
rate=COLOR_NTSC;
|
||||||
}
|
}
|
||||||
chipClock=rate;
|
chipClock=rate;
|
||||||
mixingType=(flags>>1)&3;
|
mixingType=flags.getInt("mixingType",0)&3;
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
oscBuf[i]->rate=rate/114;
|
oscBuf[i]->rate=rate/114;
|
||||||
}
|
}
|
||||||
tia.reset(mixingType);
|
tia.reset(mixingType);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformTIA::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformTIA::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -63,7 +63,7 @@ class DivPlatformTIA: public DivDispatch {
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
float getPostAmp();
|
float getPostAmp();
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
|
@ -71,7 +71,7 @@ class DivPlatformTIA: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -914,11 +914,12 @@ void DivPlatformTX81Z::reset() {
|
||||||
extMode=false;
|
extMode=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformTX81Z::setFlags(unsigned int flags) {
|
void DivPlatformTX81Z::setFlags(const DivConfig& flags) {
|
||||||
if (flags==2) {
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
|
if (clockSel==2) {
|
||||||
chipClock=4000000.0;
|
chipClock=4000000.0;
|
||||||
baseFreqOff=-122;
|
baseFreqOff=-122;
|
||||||
} else if (flags==1) {
|
} else if (clockSel==1) {
|
||||||
chipClock=COLOR_PAL*4.0/5.0;
|
chipClock=COLOR_PAL*4.0/5.0;
|
||||||
baseFreqOff=12;
|
baseFreqOff=12;
|
||||||
} else {
|
} else {
|
||||||
|
@ -935,7 +936,7 @@ bool DivPlatformTX81Z::isStereo() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformTX81Z::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformTX81Z::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -104,12 +104,12 @@ class DivPlatformTX81Z: public DivPlatformOPM {
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformTX81Z();
|
~DivPlatformTX81Z();
|
||||||
};
|
};
|
||||||
|
|
|
@ -426,7 +426,7 @@ void DivPlatformVERA::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (auto &i: wlist) poke(i.addr,i.val);
|
for (auto &i: wlist) poke(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformVERA::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformVERA::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
for (int i=0; i<17; i++) {
|
for (int i=0; i<17; i++) {
|
||||||
isMuted[i]=false;
|
isMuted[i]=false;
|
||||||
oscBuf[i]=new DivDispatchOscBuffer;
|
oscBuf[i]=new DivDispatchOscBuffer;
|
||||||
|
|
|
@ -80,7 +80,7 @@ class DivPlatformVERA: public DivDispatch {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformVERA();
|
~DivPlatformVERA();
|
||||||
};
|
};
|
||||||
|
|
|
@ -301,8 +301,8 @@ void DivPlatformVIC20::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformVIC20::setFlags(unsigned int flags) {
|
void DivPlatformVIC20::setFlags(const DivConfig& flags) {
|
||||||
if (flags&1) {
|
if (flags.getInt("clockSel",0)) {
|
||||||
chipClock=COLOR_PAL/4.0;
|
chipClock=COLOR_PAL/4.0;
|
||||||
} else {
|
} else {
|
||||||
chipClock=COLOR_NTSC*2.0/7.0;
|
chipClock=COLOR_NTSC*2.0/7.0;
|
||||||
|
@ -321,7 +321,7 @@ void DivPlatformVIC20::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformVIC20::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformVIC20::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -77,13 +77,13 @@ class DivPlatformVIC20: public DivDispatch {
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformVIC20();
|
~DivPlatformVIC20();
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -479,10 +479,11 @@ bool DivPlatformVRC6::keyOffAffectsArp(int ch) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformVRC6::setFlags(unsigned int flags) {
|
void DivPlatformVRC6::setFlags(const DivConfig& flags) {
|
||||||
if (flags==2) { // Dendy
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
|
if (clockSel==2) { // Dendy
|
||||||
rate=COLOR_PAL*2.0/5.0;
|
rate=COLOR_PAL*2.0/5.0;
|
||||||
} else if (flags==1) { // PAL
|
} else if (clockSel==1) { // PAL
|
||||||
rate=COLOR_PAL*3.0/8.0;
|
rate=COLOR_PAL*3.0/8.0;
|
||||||
} else { // NTSC
|
} else { // NTSC
|
||||||
rate=COLOR_NTSC/2.0;
|
rate=COLOR_NTSC/2.0;
|
||||||
|
@ -507,7 +508,7 @@ void DivPlatformVRC6::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformVRC6::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformVRC6::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -94,12 +94,12 @@ class DivPlatformVRC6: public DivDispatch, public vrcvi_intf {
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
DivPlatformVRC6() : vrc6(*this) {};
|
DivPlatformVRC6() : vrc6(*this) {};
|
||||||
~DivPlatformVRC6();
|
~DivPlatformVRC6();
|
||||||
|
|
|
@ -903,8 +903,8 @@ void DivPlatformX1_010::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformX1_010::setFlags(unsigned int flags) {
|
void DivPlatformX1_010::setFlags(const DivConfig& flags) {
|
||||||
switch (flags&15) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
case 0: // 16MHz (earlier hardwares)
|
case 0: // 16MHz (earlier hardwares)
|
||||||
chipClock=16000000;
|
chipClock=16000000;
|
||||||
break;
|
break;
|
||||||
|
@ -917,7 +917,7 @@ void DivPlatformX1_010::setFlags(unsigned int flags) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rate=chipClock/512;
|
rate=chipClock/512;
|
||||||
stereo=flags&16;
|
stereo=flags.getBool("stereo",false);
|
||||||
for (int i=0; i<16; i++) {
|
for (int i=0; i<16; i++) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->rate=rate;
|
||||||
}
|
}
|
||||||
|
@ -980,7 +980,7 @@ void DivPlatformX1_010::setBanked(bool banked) {
|
||||||
isBanked=banked;
|
isBanked=banked;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformX1_010::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformX1_010::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
|
|
@ -138,7 +138,7 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
void notifyWaveChange(int wave);
|
void notifyWaveChange(int wave);
|
||||||
void notifyInsDeletion(void* ins);
|
void notifyInsDeletion(void* ins);
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
|
@ -149,7 +149,7 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf {
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
void setBanked(bool banked);
|
void setBanked(bool banked);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
DivPlatformX1_010():
|
DivPlatformX1_010():
|
||||||
DivDispatch(),
|
DivDispatch(),
|
||||||
|
|
|
@ -909,13 +909,9 @@ void DivPlatformYM2203::setSkipRegisterWrites(bool value) {
|
||||||
ay->setSkipRegisterWrites(value);
|
ay->setSkipRegisterWrites(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformYM2203::setFlags(unsigned int flags) {
|
void DivPlatformYM2203::setFlags(const DivConfig& flags) {
|
||||||
// Clock flags
|
// Clock flags
|
||||||
switch (flags&0x1f) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
default:
|
|
||||||
case 0x00:
|
|
||||||
chipClock=COLOR_NTSC;
|
|
||||||
break;
|
|
||||||
case 0x01:
|
case 0x01:
|
||||||
chipClock=COLOR_PAL*4.0/5.0;
|
chipClock=COLOR_PAL*4.0/5.0;
|
||||||
break;
|
break;
|
||||||
|
@ -931,16 +927,12 @@ void DivPlatformYM2203::setFlags(unsigned int flags) {
|
||||||
case 0x05:
|
case 0x05:
|
||||||
chipClock=3000000.0/2.0;
|
chipClock=3000000.0/2.0;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
chipClock=COLOR_NTSC;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// Prescaler flags
|
// Prescaler flags
|
||||||
switch ((flags>>5)&0x3) {
|
switch (flags.getInt("prescale",0)) {
|
||||||
default:
|
|
||||||
case 0x00: // /6
|
|
||||||
prescale=0x2d;
|
|
||||||
fmFreqBase=4720270.0,
|
|
||||||
fmDivBase=36,
|
|
||||||
ayDiv=16;
|
|
||||||
break;
|
|
||||||
case 0x01: // /3
|
case 0x01: // /3
|
||||||
prescale=0x2e;
|
prescale=0x2e;
|
||||||
fmFreqBase=4720270.0/2.0,
|
fmFreqBase=4720270.0/2.0,
|
||||||
|
@ -953,6 +945,12 @@ void DivPlatformYM2203::setFlags(unsigned int flags) {
|
||||||
fmDivBase=12,
|
fmDivBase=12,
|
||||||
ayDiv=4;
|
ayDiv=4;
|
||||||
break;
|
break;
|
||||||
|
default: // /6
|
||||||
|
prescale=0x2d;
|
||||||
|
fmFreqBase=4720270.0,
|
||||||
|
fmDivBase=36,
|
||||||
|
ayDiv=16;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
rate=fm->sample_rate(chipClock);
|
rate=fm->sample_rate(chipClock);
|
||||||
for (int i=0; i<6; i++) {
|
for (int i=0; i<6; i++) {
|
||||||
|
@ -961,10 +959,11 @@ void DivPlatformYM2203::setFlags(unsigned int flags) {
|
||||||
immWrite(0x2d,0xff);
|
immWrite(0x2d,0xff);
|
||||||
immWrite(prescale,0xff);
|
immWrite(prescale,0xff);
|
||||||
ay->setExtClockDiv(chipClock,ayDiv);
|
ay->setExtClockDiv(chipClock,ayDiv);
|
||||||
ay->setFlags(16);
|
ay->setFlags(ayFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformYM2203::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformYM2203::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
|
ayFlags.set("chipType",1);
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
|
@ -976,7 +975,7 @@ int DivPlatformYM2203::init(DivEngine* p, int channels, int sugRate, unsigned in
|
||||||
fm->set_fidelity(ymfm::OPN_FIDELITY_MIN);
|
fm->set_fidelity(ymfm::OPN_FIDELITY_MIN);
|
||||||
// YM2149, 2MHz
|
// YM2149, 2MHz
|
||||||
ay=new DivPlatformAY8910(true,chipClock,ayDiv);
|
ay=new DivPlatformAY8910(true,chipClock,ayDiv);
|
||||||
ay->init(p,3,sugRate,16);
|
ay->init(p,3,sugRate,ayFlags);
|
||||||
ay->toggleRegisterDump(true);
|
ay->toggleRegisterDump(true);
|
||||||
setFlags(flags);
|
setFlags(flags);
|
||||||
|
|
||||||
|
|
|
@ -117,8 +117,8 @@ class DivPlatformYM2203: public DivPlatformOPN {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
DivPlatformYM2203():
|
DivPlatformYM2203():
|
||||||
DivPlatformOPN(4720270.0, 36, 16),
|
DivPlatformOPN(4720270.0, 36, 16),
|
||||||
|
|
|
@ -505,7 +505,7 @@ void DivPlatformYM2203Ext::notifyInsChange(int ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformYM2203Ext::init(DivEngine* parent, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformYM2203Ext::init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags) {
|
||||||
DivPlatformYM2203::init(parent,channels,sugRate,flags);
|
DivPlatformYM2203::init(parent,channels,sugRate,flags);
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
isOpMuted[i]=false;
|
isOpMuted[i]=false;
|
||||||
|
|
|
@ -64,7 +64,7 @@ class DivPlatformYM2203Ext: public DivPlatformYM2203 {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformYM2203Ext();
|
~DivPlatformYM2203Ext();
|
||||||
};
|
};
|
||||||
|
|
|
@ -1361,26 +1361,18 @@ void DivPlatformYM2608::renderSamples() {
|
||||||
adpcmBMemLen=memPos+256;
|
adpcmBMemLen=memPos+256;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformYM2608::setFlags(unsigned int flags) {
|
void DivPlatformYM2608::setFlags(const DivConfig& flags) {
|
||||||
// Clock flags
|
// Clock flags
|
||||||
switch (flags&0x1f) {
|
switch (flags.getInt("clockSel",0)) {
|
||||||
default:
|
|
||||||
case 0x00:
|
|
||||||
chipClock=8000000.0;
|
|
||||||
break;
|
|
||||||
case 0x01:
|
case 0x01:
|
||||||
chipClock=38400*13*16; // 31948800/4
|
chipClock=38400*13*16; // 31948800/4
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
chipClock=8000000.0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// Prescaler flags
|
// Prescaler flags
|
||||||
switch ((flags>>5)&0x3) {
|
switch (flags.getInt("prescale",0)) {
|
||||||
default:
|
|
||||||
case 0x00: // /6
|
|
||||||
prescale=0x2d;
|
|
||||||
fmFreqBase=9440540.0,
|
|
||||||
fmDivBase=72,
|
|
||||||
ayDiv=32;
|
|
||||||
break;
|
|
||||||
case 0x01: // /3
|
case 0x01: // /3
|
||||||
prescale=0x2e;
|
prescale=0x2e;
|
||||||
fmFreqBase=9440540.0/2.0,
|
fmFreqBase=9440540.0/2.0,
|
||||||
|
@ -1393,6 +1385,12 @@ void DivPlatformYM2608::setFlags(unsigned int flags) {
|
||||||
fmDivBase=24,
|
fmDivBase=24,
|
||||||
ayDiv=8;
|
ayDiv=8;
|
||||||
break;
|
break;
|
||||||
|
default: // /6
|
||||||
|
prescale=0x2d;
|
||||||
|
fmFreqBase=9440540.0,
|
||||||
|
fmDivBase=72,
|
||||||
|
ayDiv=32;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
rate=fm->sample_rate(chipClock);
|
rate=fm->sample_rate(chipClock);
|
||||||
for (int i=0; i<16; i++) {
|
for (int i=0; i<16; i++) {
|
||||||
|
@ -1401,11 +1399,12 @@ void DivPlatformYM2608::setFlags(unsigned int flags) {
|
||||||
immWrite(0x2d,0xff);
|
immWrite(0x2d,0xff);
|
||||||
immWrite(prescale,0xff);
|
immWrite(prescale,0xff);
|
||||||
ay->setExtClockDiv(chipClock,ayDiv);
|
ay->setExtClockDiv(chipClock,ayDiv);
|
||||||
ay->setFlags(16);
|
ay->setFlags(ayFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformYM2608::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformYM2608::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
|
ayFlags.set("chipType",1);
|
||||||
adpcmBMem=new unsigned char[getSampleMemCapacity(0)];
|
adpcmBMem=new unsigned char[getSampleMemCapacity(0)];
|
||||||
adpcmBMemLen=0;
|
adpcmBMemLen=0;
|
||||||
iface.adpcmBMem=adpcmBMem;
|
iface.adpcmBMem=adpcmBMem;
|
||||||
|
@ -1420,7 +1419,7 @@ int DivPlatformYM2608::init(DivEngine* p, int channels, int sugRate, unsigned in
|
||||||
fm->set_fidelity(ymfm::OPN_FIDELITY_MIN);
|
fm->set_fidelity(ymfm::OPN_FIDELITY_MIN);
|
||||||
// YM2149, 2MHz
|
// YM2149, 2MHz
|
||||||
ay=new DivPlatformAY8910(true,chipClock,ayDiv);
|
ay=new DivPlatformAY8910(true,chipClock,ayDiv);
|
||||||
ay->init(p,3,sugRate,16);
|
ay->init(p,3,sugRate,ayFlags);
|
||||||
ay->toggleRegisterDump(true);
|
ay->toggleRegisterDump(true);
|
||||||
setFlags(flags);
|
setFlags(flags);
|
||||||
reset();
|
reset();
|
||||||
|
|
|
@ -138,8 +138,8 @@ class DivPlatformYM2608: public DivPlatformOPN {
|
||||||
size_t getSampleMemCapacity(int index);
|
size_t getSampleMemCapacity(int index);
|
||||||
size_t getSampleMemUsage(int index);
|
size_t getSampleMemUsage(int index);
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(const DivConfig& flags);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
DivPlatformYM2608():
|
DivPlatformYM2608():
|
||||||
DivPlatformOPN(9440540.0, 72, 32),
|
DivPlatformOPN(9440540.0, 72, 32),
|
||||||
|
|
|
@ -541,7 +541,7 @@ void DivPlatformYM2608Ext::notifyInsChange(int ins) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformYM2608Ext::init(DivEngine* parent, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformYM2608Ext::init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags) {
|
||||||
DivPlatformYM2608::init(parent,channels,sugRate,flags);
|
DivPlatformYM2608::init(parent,channels,sugRate,flags);
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
isOpMuted[i]=false;
|
isOpMuted[i]=false;
|
||||||
|
|
|
@ -66,7 +66,7 @@ class DivPlatformYM2608Ext: public DivPlatformYM2608 {
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
bool keyOffAffectsArp(int ch);
|
bool keyOffAffectsArp(int ch);
|
||||||
void notifyInsChange(int ins);
|
void notifyInsChange(int ins);
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
~DivPlatformYM2608Ext();
|
~DivPlatformYM2608Ext();
|
||||||
};
|
};
|
||||||
|
|
|
@ -1278,7 +1278,7 @@ void DivPlatformYM2610::setSkipRegisterWrites(bool value) {
|
||||||
ay->setSkipRegisterWrites(value);
|
ay->setSkipRegisterWrites(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivPlatformYM2610::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformYM2610::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||||
DivPlatformYM2610Base::init(p, channels, sugRate, flags);
|
DivPlatformYM2610Base::init(p, channels, sugRate, flags);
|
||||||
reset();
|
reset();
|
||||||
return 14;
|
return 14;
|
||||||
|
|
|
@ -58,7 +58,7 @@ class DivPlatformYM2610: public DivPlatformYM2610Base<14> {
|
||||||
void poke(unsigned int addr, unsigned short val);
|
void poke(unsigned int addr, unsigned short val);
|
||||||
void poke(std::vector<DivRegWrite>& wlist);
|
void poke(std::vector<DivRegWrite>& wlist);
|
||||||
const char** getRegisterSheet();
|
const char** getRegisterSheet();
|
||||||
int init(DivEngine* parent, int channels, int sugRate, unsigned int flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
DivPlatformYM2610():
|
DivPlatformYM2610():
|
||||||
DivPlatformYM2610Base<14>(1,4,7,13) {}
|
DivPlatformYM2610Base<14>(1,4,7,13) {}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue