dev145 - Namco WSG: new noise strategy for C30
This commit is contained in:
parent
3cede1c2fd
commit
8c706f71a9
5 changed files with 40 additions and 5 deletions
|
|
@ -47,8 +47,8 @@
|
|||
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
|
||||
#define BUSY_END isBusy.unlock(); softLocked=false;
|
||||
|
||||
#define DIV_VERSION "0.6pre4-hotfix"
|
||||
#define DIV_ENGINE_VERSION 144
|
||||
#define DIV_VERSION "dev145"
|
||||
#define DIV_ENGINE_VERSION 145
|
||||
// for imports
|
||||
#define DIV_VERSION_MOD 0xff01
|
||||
#define DIV_VERSION_FC 0xff02
|
||||
|
|
|
|||
|
|
@ -2678,6 +2678,15 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
}
|
||||
}
|
||||
|
||||
// Namco C30 noise compat
|
||||
if (ds.version<145) {
|
||||
for (int i=0; i<ds.systemLen; i++) {
|
||||
if (ds.system[i]==DIV_SYSTEM_NAMCO_CUS30) {
|
||||
ds.systemFlags[i].set("newNoise",false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (active) quitDispatch();
|
||||
BUSY_BEGIN_SOFT;
|
||||
saveLock.lock();
|
||||
|
|
|
|||
|
|
@ -316,9 +316,16 @@ void DivPlatformNamcoWSG::tick(bool sysTick) {
|
|||
rWrite((i<<3)+0x100,0);
|
||||
rWrite((i<<3)+0x104,(chan[(i+1)&7].noise?0x80:0));
|
||||
}
|
||||
rWrite((i<<3)+0x103,chan[i].freq&0xff);
|
||||
rWrite((i<<3)+0x102,(chan[i].freq>>8)&0xff);
|
||||
rWrite((i<<3)+0x101,((chan[i].freq>>16)&15)|(i<<4));
|
||||
if (chan[i].noise && newNoise) {
|
||||
int noiseFreq=chan[i].freq>>9;
|
||||
if (noiseFreq<0) noiseFreq=0;
|
||||
if (noiseFreq>255) noiseFreq=255;
|
||||
rWrite((i<<3)+0x103,noiseFreq);
|
||||
} else {
|
||||
rWrite((i<<3)+0x103,chan[i].freq&0xff);
|
||||
rWrite((i<<3)+0x102,(chan[i].freq>>8)&0xff);
|
||||
rWrite((i<<3)+0x101,((chan[i].freq>>16)&15)|(i<<4));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -544,6 +551,7 @@ void DivPlatformNamcoWSG::setFlags(const DivConfig& flags) {
|
|||
for (int i=0; i<chans; i++) {
|
||||
oscBuf[i]->rate=rate;
|
||||
}
|
||||
newNoise=flags.getBool("newNoise",true);
|
||||
}
|
||||
|
||||
void DivPlatformNamcoWSG::poke(unsigned int addr, unsigned short val) {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class DivPlatformNamcoWSG: public DivDispatch {
|
|||
|
||||
namco_audio_device* namco;
|
||||
int devType, chans;
|
||||
bool newNoise;
|
||||
unsigned char regPool[512];
|
||||
void updateWave(int ch);
|
||||
friend void putDispatchChip(void*,int);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue