Merge branch 'master' of https://github.com/tildearrow/furnace into nmk112
This commit is contained in:
commit
4a92bf088f
352 changed files with 5714 additions and 1977 deletions
|
|
@ -197,10 +197,10 @@ void DivPlatformArcade::tick(bool sysTick) {
|
|||
|
||||
if (chan[i].std.pitch.had) {
|
||||
if (chan[i].std.pitch.mode) {
|
||||
chan[i].pitch2+=chan[i].std.pitch.val;
|
||||
chan[i].pitch2+=chan[i].std.pitch.val*(brokenPitch?2:1);
|
||||
CLAMP_VAR(chan[i].pitch2,-32768,32767);
|
||||
} else {
|
||||
chan[i].pitch2=chan[i].std.pitch.val;
|
||||
chan[i].pitch2=chan[i].std.pitch.val*(brokenPitch?2:1);
|
||||
}
|
||||
chan[i].freqChanged=true;
|
||||
}
|
||||
|
|
@ -354,18 +354,18 @@ void DivPlatformArcade::tick(bool sysTick) {
|
|||
|
||||
for (int i=0; i<8; i++) {
|
||||
if (chan[i].freqChanged) {
|
||||
chan[i].freq=chan[i].baseFreq+(chan[i].pitch>>1)-64+chan[i].pitch2;
|
||||
chan[i].freq=chan[i].baseFreq+chan[i].pitch-128+chan[i].pitch2;
|
||||
if (!parent->song.oldArpStrategy) {
|
||||
if (chan[i].fixedArp) {
|
||||
chan[i].freq=(chan[i].baseNoteOverride<<6)+(chan[i].pitch>>1)-64+chan[i].pitch2;
|
||||
chan[i].freq=(chan[i].baseNoteOverride<<7)+chan[i].pitch-128+chan[i].pitch2;
|
||||
} else {
|
||||
chan[i].freq+=chan[i].arpOff<<6;
|
||||
chan[i].freq+=chan[i].arpOff<<7;
|
||||
}
|
||||
}
|
||||
if (chan[i].freq<0) chan[i].freq=0;
|
||||
if (chan[i].freq>=(95<<6)) chan[i].freq=(95<<6)-1;
|
||||
immWrite(i+0x28,hScale(chan[i].freq>>6));
|
||||
immWrite(i+0x30,chan[i].freq<<2);
|
||||
if (chan[i].freq>=(95<<7)) chan[i].freq=(95<<7)-1;
|
||||
immWrite(i+0x28,hScale(chan[i].freq>>7));
|
||||
immWrite(i+0x30,((chan[i].freq<<1)&0xfc));
|
||||
hardResetElapsed+=2;
|
||||
chan[i].freqChanged=false;
|
||||
}
|
||||
|
|
@ -534,13 +534,13 @@ int DivPlatformArcade::dispatch(DivCommand c) {
|
|||
int newFreq;
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
newFreq=chan[c.chan].baseFreq+c.value;
|
||||
newFreq=chan[c.chan].baseFreq+c.value*(brokenPitch?2:1);
|
||||
if (newFreq>=destFreq) {
|
||||
newFreq=destFreq;
|
||||
return2=true;
|
||||
}
|
||||
} else {
|
||||
newFreq=chan[c.chan].baseFreq-c.value;
|
||||
newFreq=chan[c.chan].baseFreq-c.value*(brokenPitch?2:1);
|
||||
if (newFreq<=destFreq) {
|
||||
newFreq=destFreq;
|
||||
return2=true;
|
||||
|
|
@ -932,7 +932,9 @@ void DivPlatformArcade::setFlags(const DivConfig& flags) {
|
|||
}
|
||||
CHECK_CUSTOM_CLOCK;
|
||||
|
||||
baseFreqOff=round(768.0*(log((COLOR_NTSC/(double)chipClock))/log(2.0)));
|
||||
baseFreqOff=round(1536.0*(log((COLOR_NTSC/(double)chipClock))/log(2.0)));
|
||||
|
||||
brokenPitch=flags.getBool("brokenPitch",false);
|
||||
|
||||
rate=chipClock/64;
|
||||
for (int i=0; i<8; i++) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef _AY_H
|
||||
#define _AY_H
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
class DivPlatformAY8910: public DivDispatch {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef _AY8930_H
|
||||
#define _AY8930_H
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
class DivPlatformAY8930: public DivDispatch {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#include "../engine.h"
|
||||
#include "../../ta-log.h"
|
||||
#include <math.h>
|
||||
#include <map>
|
||||
|
||||
#define CHIP_FREQBASE (is219?74448896:12582912)
|
||||
|
||||
|
|
@ -152,11 +151,18 @@ void DivPlatformC140::tick(bool sysTick) {
|
|||
}
|
||||
if (is219) {
|
||||
if (chan[i].std.duty.had) {
|
||||
chan[i].noise=chan[i].std.duty.val&1;
|
||||
chan[i].invert=chan[i].std.duty.val&2;
|
||||
chan[i].surround=chan[i].std.duty.val&4;
|
||||
chan[i].freqChanged=true;
|
||||
chan[i].writeCtrl=true;
|
||||
unsigned char singleByte=(
|
||||
(chan[i].noise?1:0)|
|
||||
(chan[i].invert?2:0)|
|
||||
(chan[i].surround?4:0)
|
||||
);
|
||||
if (singleByte!=(chan[i].std.duty.val&7)) {
|
||||
chan[i].noise=chan[i].std.duty.val&1;
|
||||
chan[i].invert=chan[i].std.duty.val&2;
|
||||
chan[i].surround=chan[i].std.duty.val&4;
|
||||
chan[i].freqChanged=true;
|
||||
chan[i].writeCtrl=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (chan[i].std.pitch.had) {
|
||||
|
|
@ -209,7 +215,7 @@ void DivPlatformC140::tick(bool sysTick) {
|
|||
if (chan[i].freq<0) chan[i].freq=0;
|
||||
if (chan[i].freq>65535) chan[i].freq=65535;
|
||||
if (is219) {
|
||||
ctrl|=(chan[i].active?0x80:0)|((s->isLoopable())?0x10:0)|((s->depth==DIV_SAMPLE_DEPTH_C219)?1:0)|(chan[i].invert?0x40:0)|(chan[i].surround?8:0)|(chan[i].noise?4:0);
|
||||
ctrl|=(chan[i].active?0x80:0)|((s->isLoopable() || chan[i].noise)?0x10:0)|((s->depth==DIV_SAMPLE_DEPTH_C219)?1:0)|(chan[i].invert?0x40:0)|(chan[i].surround?8:0)|(chan[i].noise?4:0);
|
||||
} else {
|
||||
ctrl|=(chan[i].active?0x80:0)|((s->isLoopable())?0x10:0)|((s->depth==DIV_SAMPLE_DEPTH_MULAW)?0x08:0);
|
||||
}
|
||||
|
|
@ -228,11 +234,15 @@ void DivPlatformC140::tick(bool sysTick) {
|
|||
start=sampleOff[chan[i].sample]&0xffff;
|
||||
end=MIN(start+s->length8-1,65535);
|
||||
}
|
||||
} else if (chan[i].noise && is219) {
|
||||
bank=groupBank[i>>2];
|
||||
start=0;
|
||||
end=1;
|
||||
}
|
||||
if (chan[i].audPos>0) {
|
||||
start=MIN(start+(MIN(chan[i].audPos,s->length8)>>1),65535);
|
||||
}
|
||||
if (s->isLoopable()) {
|
||||
if (chan[i].sample>=0 && chan[i].sample<parent->song.sampleLen && s->isLoopable()) {
|
||||
if (is219) {
|
||||
loop=MIN(start+(s->loopStart>>1),65535);
|
||||
end=MIN(start+(s->loopEnd>>1)-1,65535);
|
||||
|
|
@ -240,6 +250,8 @@ void DivPlatformC140::tick(bool sysTick) {
|
|||
loop=MIN(start+s->loopStart,65535);
|
||||
end=MIN(start+s->loopEnd-1,65535);
|
||||
}
|
||||
} else if (chan[i].noise && is219) {
|
||||
loop=0;
|
||||
}
|
||||
rWrite(0x05+(i<<4),0); // force keyoff first
|
||||
if (is219) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "../dispatch.h"
|
||||
#include "sound/c140_c219.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
|
||||
class DivPlatformC140: public DivDispatch {
|
||||
struct Channel: public SharedChannel<int> {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _C64_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "sound/c64/sid.h"
|
||||
#include "sound/c64_fp/SID.h"
|
||||
#include "sound/c64_d/dsid.h"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#include "../engine.h"
|
||||
#include "../../ta-log.h"
|
||||
#include <math.h>
|
||||
#include <map>
|
||||
|
||||
#define PITCH_OFFSET ((double)(16*2048*(chanMax+1)))
|
||||
#define NOTE_ES5506(c,note) (parent->calcBaseFreq(chipClock,chan[c].pcm.freqOffs,note,false))
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "../dispatch.h"
|
||||
#include "../engine.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../macroInt.h"
|
||||
#include "../sample.h"
|
||||
#include "vgsound_emu/src/es550x/es5506.hpp"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "fmsharedbase.h"
|
||||
|
||||
#define NOTE_LINEAR(x) (((x)<<6)+baseFreqOff+log2(parent->song.tuning/440.0)*12.0*64.0)
|
||||
#define NOTE_LINEAR(x) (((x)<<7)+baseFreqOff+log2(parent->song.tuning/440.0)*12.0*128.0)
|
||||
|
||||
class DivPlatformOPM: public DivPlatformFMBase {
|
||||
protected:
|
||||
|
|
@ -42,13 +42,15 @@ class DivPlatformOPM: public DivPlatformFMBase {
|
|||
};
|
||||
|
||||
unsigned char lfoValue, lfoValue2, lfoShape, lfoShape2;
|
||||
bool brokenPitch;
|
||||
|
||||
DivPlatformOPM():
|
||||
DivPlatformFMBase(),
|
||||
lfoValue(0),
|
||||
lfoValue2(0),
|
||||
lfoShape(0),
|
||||
lfoShape2(0) {}
|
||||
lfoShape2(0),
|
||||
brokenPitch(false) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "../dispatch.h"
|
||||
#include "../instrument.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
|
||||
#define KVS(x,y) ((chan[x].state.op[y].kvs==2 && isOutput[chan[x].state.alg][y]) || chan[x].state.op[y].kvs==1)
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _GA20_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../macroInt.h"
|
||||
#include "sound/ga20/iremga20.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "../dispatch.h"
|
||||
#include "../waveSynth.h"
|
||||
#include "sound/gb/gb.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
|
||||
class DivPlatformGB: public DivDispatch {
|
||||
struct Channel: public SharedChannel<signed char> {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _K007232_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../macroInt.h"
|
||||
#include "vgsound_emu/src/k007232/k007232.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ int DivPlatformK053260::dispatch(DivCommand c) {
|
|||
break;
|
||||
}
|
||||
case DIV_CMD_LEGATO: {
|
||||
chan[c.chan].baseFreq=NOTE_PERIODIC(c.value+((HACKY_LEGATO_MESS)?(chan[c.chan].std.arp.val-12):(0)));
|
||||
chan[c.chan].baseFreq=NOTE_PERIODIC(c.value+((HACKY_LEGATO_MESS)?(chan[c.chan].std.arp.val):(0)));
|
||||
chan[c.chan].freqChanged=true;
|
||||
chan[c.chan].note=c.value;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _MSM5232_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "sound/oki/msm5232.h"
|
||||
|
||||
class DivPlatformMSM5232: public DivDispatch {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,16 @@ const char** DivPlatformMSM6258::getRegisterSheet() {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static const int msmRates[4]={
|
||||
4, 3, 2, 2
|
||||
};
|
||||
|
||||
int DivPlatformMSM6258::calcVGMRate() {
|
||||
int ret=chipClock/((clockSel+1)*512*msmRates[rateSel&3]);
|
||||
logD("MSM rate: %d",ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void DivPlatformMSM6258::acquire(short** buf, size_t len) {
|
||||
for (size_t h=0; h<len; h++) {
|
||||
if (--msmClockCount<0) {
|
||||
|
|
@ -93,6 +103,7 @@ void DivPlatformMSM6258::tick(bool sysTick) {
|
|||
if (rateSel!=(chan[i].std.duty.val&3)) {
|
||||
rateSel=chan[i].std.duty.val&3;
|
||||
rWrite(12,rateSel);
|
||||
updateSampleFreq=true;
|
||||
}
|
||||
}
|
||||
if (chan[i].std.panL.had) {
|
||||
|
|
@ -105,6 +116,7 @@ void DivPlatformMSM6258::tick(bool sysTick) {
|
|||
if (clockSel!=(chan[i].std.ex1.val&1)) {
|
||||
clockSel=chan[i].std.ex1.val&1;
|
||||
rWrite(8,clockSel);
|
||||
updateSampleFreq=true;
|
||||
}
|
||||
}
|
||||
if (chan[i].std.phaseReset.had) {
|
||||
|
|
@ -113,12 +125,23 @@ void DivPlatformMSM6258::tick(bool sysTick) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (updateSampleFreq) {
|
||||
int newRate=calcVGMRate();
|
||||
if (dumpWrites) addWrite(0xffff0001,newRate);
|
||||
updateSampleFreq=false;
|
||||
}
|
||||
if (chan[i].keyOn || chan[i].keyOff) {
|
||||
samplePos=0;
|
||||
rWrite(0,1); // turn off
|
||||
// turn off
|
||||
if (dumpWrites) addWrite(0xffff0002,0);
|
||||
rWrite(0,1);
|
||||
if (chan[i].active && !chan[i].keyOff) {
|
||||
if (sample>=0 && sample<parent->song.sampleLen) {
|
||||
// turn on
|
||||
rWrite(0,2);
|
||||
if (dumpWrites) addWrite(0xffff0000,sample);
|
||||
int newRate=calcVGMRate();
|
||||
if (dumpWrites) addWrite(0xffff0001,newRate);
|
||||
} else {
|
||||
sample=-1;
|
||||
}
|
||||
|
|
@ -220,10 +243,12 @@ int DivPlatformMSM6258::dispatch(DivCommand c) {
|
|||
case DIV_CMD_SAMPLE_FREQ:
|
||||
rateSel=c.value&3;
|
||||
rWrite(12,rateSel);
|
||||
updateSampleFreq=true;
|
||||
break;
|
||||
case DIV_CMD_SAMPLE_MODE:
|
||||
clockSel=c.value&1;
|
||||
rWrite(8,clockSel);
|
||||
updateSampleFreq=true;
|
||||
break;
|
||||
case DIV_CMD_PANNING: {
|
||||
if (c.value==0 && c.value2==0) {
|
||||
|
|
@ -317,8 +342,10 @@ void DivPlatformMSM6258::reset() {
|
|||
msmPan=3;
|
||||
rateSel=2;
|
||||
clockSel=0;
|
||||
updateSampleFreq=true;
|
||||
if (dumpWrites) {
|
||||
addWrite(0xffffffff,0);
|
||||
addWrite(0xffff0001,calcVGMRate());
|
||||
}
|
||||
for (int i=0; i<1; i++) {
|
||||
chan[i]=DivPlatformMSM6258::Channel();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _MSM6258_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "sound/oki/okim6258.h"
|
||||
|
||||
class DivPlatformMSM6258: public DivDispatch {
|
||||
|
|
@ -50,12 +50,15 @@ class DivPlatformMSM6258: public DivDispatch {
|
|||
|
||||
unsigned char sampleBank, msmPan, msmDivider, rateSel, msmClock, clockSel;
|
||||
signed char msmDividerCount, msmClockCount;
|
||||
bool updateSampleFreq;
|
||||
short msmOut;
|
||||
|
||||
int delay, updateOsc, sample, samplePos;
|
||||
|
||||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
int calcVGMRate();
|
||||
|
||||
public:
|
||||
void acquire(short** buf, size_t len);
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ int DivPlatformMSM6295::dispatch(DivCommand c) {
|
|||
chan[c.chan].std.release();
|
||||
break;
|
||||
case DIV_CMD_VOLUME: {
|
||||
chan[c.chan].vol=c.value;
|
||||
chan[c.chan].vol=MIN(8,c.value);
|
||||
if (!chan[c.chan].std.vol.has) {
|
||||
chan[c.chan].outVol=c.value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _MSM6295_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "vgsound_emu/src/msm6295/msm6295.hpp"
|
||||
|
||||
class DivPlatformMSM6295: public DivDispatch, public vgsound_emu_mem_intf {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _N163_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../waveSynth.h"
|
||||
#include "vgsound_emu/src/n163/n163.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _NAMCOWSG_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../waveSynth.h"
|
||||
#include "sound/namco.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -722,6 +722,10 @@ void DivPlatformOPL::muteChannel(int ch, bool mute) {
|
|||
}
|
||||
}
|
||||
|
||||
if (properDrums && ch>melodicChans) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMuted[ch]) {
|
||||
rWrite(chanMap[ch]+ADDR_LR_FB_ALG,(chan[ch].state.alg&1)|(chan[ch].state.fb<<1));
|
||||
if (ops==4) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _OPL_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../../../extern/opl/opl3.h"
|
||||
#include "sound/ymfm/ymfm_adpcm.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _OPLL_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
|
||||
extern "C" {
|
||||
#include "../../../extern/Nuked-OPLL/opll.h"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _PCE_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../waveSynth.h"
|
||||
#include "sound/pce_psg.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,8 @@
|
|||
#define _PCSPKR_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
|
||||
class DivPlatformPCSpeaker: public DivDispatch {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _POKEY_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
|
||||
extern "C" {
|
||||
#include "sound/pokey/mzpokeysnd.h"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#include "../engine.h"
|
||||
#include "../../ta-log.h"
|
||||
#include <math.h>
|
||||
#include <map>
|
||||
|
||||
#define CHIP_DIVIDER (1248*2)
|
||||
#define QS_NOTE_FREQUENCY(x) parent->calcBaseFreq(440,4096,(x)-3,false)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _SAA_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../../../extern/SAASound/src/SAASound.h"
|
||||
|
||||
class DivPlatformSAA1099: public DivDispatch {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "../dispatch.h"
|
||||
#include "../instrument.h"
|
||||
#include "sound/segapcm.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
|
||||
class DivPlatformSegaPCM: public DivDispatch {
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _SM8521_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../waveSynth.h"
|
||||
#include "sound/sm8521.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
extern "C" {
|
||||
#include "../../../extern/Nuked-PSG/ympsg.h"
|
||||
}
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
|
||||
class DivPlatformSMS: public DivDispatch {
|
||||
struct Channel: public SharedChannel<signed char> {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "../dispatch.h"
|
||||
#include "../waveSynth.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "sound/snes/SPC_DSP.h"
|
||||
|
||||
class DivPlatformSNES: public DivDispatch {
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ DivMacroInt* DivPlatformSoundUnit::getChanMacroInt(int ch) {
|
|||
}
|
||||
|
||||
unsigned short DivPlatformSoundUnit::getPan(int ch) {
|
||||
return parent->convertPanLinearToSplit(chan[ch].pan^0x80,8,255);
|
||||
return parent->convertPanLinearToSplit(chan[ch].pan+127,8,255);
|
||||
}
|
||||
|
||||
DivDispatchOscBuffer* DivPlatformSoundUnit::getOscBuffer(int ch) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _SU_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "sound/su.h"
|
||||
|
||||
class DivPlatformSoundUnit: public DivDispatch {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "../dispatch.h"
|
||||
#include "../waveSynth.h"
|
||||
#include "sound/swan.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
|
||||
class DivPlatformSwan: public DivDispatch {
|
||||
struct Channel: public SharedChannel<int> {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _T6W28_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "sound/t6w28/T6W28_Apu.h"
|
||||
|
||||
class DivPlatformT6W28: public DivDispatch {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _TED_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "sound/ted-sound.h"
|
||||
|
||||
class DivPlatformTED: public DivDispatch {
|
||||
|
|
|
|||
|
|
@ -147,10 +147,10 @@ void DivPlatformTX81Z::tick(bool sysTick) {
|
|||
|
||||
if (chan[i].std.pitch.had) {
|
||||
if (chan[i].std.pitch.mode) {
|
||||
chan[i].pitch2+=chan[i].std.pitch.val;
|
||||
chan[i].pitch2+=chan[i].std.pitch.val*(brokenPitch?2:1);
|
||||
CLAMP_VAR(chan[i].pitch2,-32768,32767);
|
||||
} else {
|
||||
chan[i].pitch2=chan[i].std.pitch.val;
|
||||
chan[i].pitch2=chan[i].std.pitch.val*(brokenPitch?2:1);
|
||||
}
|
||||
chan[i].freqChanged=true;
|
||||
}
|
||||
|
|
@ -337,18 +337,18 @@ void DivPlatformTX81Z::tick(bool sysTick) {
|
|||
|
||||
for (int i=0; i<8; i++) {
|
||||
if (chan[i].freqChanged) {
|
||||
chan[i].freq=chan[i].baseFreq+(chan[i].pitch>>1)-64+chan[i].pitch2;
|
||||
chan[i].freq=chan[i].baseFreq+chan[i].pitch-128+chan[i].pitch2;
|
||||
if (!parent->song.oldArpStrategy) {
|
||||
if (chan[i].fixedArp) {
|
||||
chan[i].freq=(chan[i].baseNoteOverride<<6)+(chan[i].pitch>>1)-64+chan[i].pitch2;
|
||||
chan[i].freq=(chan[i].baseNoteOverride<<7)+chan[i].pitch-128+chan[i].pitch2;
|
||||
} else {
|
||||
chan[i].freq+=chan[i].arpOff<<6;
|
||||
chan[i].freq+=chan[i].arpOff<<7;
|
||||
}
|
||||
}
|
||||
if (chan[i].freq<0) chan[i].freq=0;
|
||||
if (chan[i].freq>=(95<<6)) chan[i].freq=(95<<6)-1;
|
||||
immWrite(i+0x28,hScale(chan[i].freq>>6));
|
||||
immWrite(i+0x30,(chan[i].freq<<2)|(chan[i].chVolL==chan[i].chVolR));
|
||||
if (chan[i].freq>=(95<<7)) chan[i].freq=(95<<7)-1;
|
||||
immWrite(i+0x28,hScale(chan[i].freq>>7));
|
||||
immWrite(i+0x30,((chan[i].freq<<1)&0xfc)|(chan[i].chVolL==chan[i].chVolR));
|
||||
hardResetElapsed+=2;
|
||||
chan[i].freqChanged=false;
|
||||
}
|
||||
|
|
@ -523,13 +523,13 @@ int DivPlatformTX81Z::dispatch(DivCommand c) {
|
|||
int newFreq;
|
||||
bool return2=false;
|
||||
if (destFreq>chan[c.chan].baseFreq) {
|
||||
newFreq=chan[c.chan].baseFreq+c.value;
|
||||
newFreq=chan[c.chan].baseFreq+c.value*(brokenPitch?2:1);
|
||||
if (newFreq>=destFreq) {
|
||||
newFreq=destFreq;
|
||||
return2=true;
|
||||
}
|
||||
} else {
|
||||
newFreq=chan[c.chan].baseFreq-c.value;
|
||||
newFreq=chan[c.chan].baseFreq-c.value*(brokenPitch?2:1);
|
||||
if (newFreq<=destFreq) {
|
||||
newFreq=destFreq;
|
||||
return2=true;
|
||||
|
|
@ -1043,7 +1043,9 @@ void DivPlatformTX81Z::setFlags(const DivConfig& flags) {
|
|||
}
|
||||
CHECK_CUSTOM_CLOCK;
|
||||
|
||||
baseFreqOff=round(768.0*(log((COLOR_NTSC/(double)chipClock))/log(2.0)));
|
||||
baseFreqOff=round(1536.0*(log((COLOR_NTSC/(double)chipClock))/log(2.0)));
|
||||
|
||||
brokenPitch=flags.getBool("brokenPitch",false);
|
||||
|
||||
rate=chipClock/64;
|
||||
for (int i=0; i<8; i++) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _TX81Z_H
|
||||
|
||||
#include "fmshared_OPM.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "sound/ymfm/ymfm_opz.h"
|
||||
|
||||
class DivTXInterface: public ymfm::ymfm_interface {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define _PLATFORM_VB_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../waveSynth.h"
|
||||
#include "sound/vsu.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef _VRC6_H
|
||||
#define _VRC6_H
|
||||
|
||||
#include "../fixedQueue.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../dispatch.h"
|
||||
#include "vgsound_emu/src/vrcvi/vrcvi.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ void DivPlatformYM2203::acquire_combo(short** buf, size_t len) {
|
|||
buf[0][h]=os;
|
||||
|
||||
for (int i=0; i<3; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i]<<1;
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm_nuked.ch_out[i]<<1,-32768,32767);
|
||||
}
|
||||
|
||||
for (int i=3; i<6; i++) {
|
||||
|
|
@ -282,7 +282,8 @@ void DivPlatformYM2203::acquire_ymfm(short** buf, size_t len) {
|
|||
|
||||
|
||||
for (int i=0; i<3; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1;
|
||||
int out=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1;
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(out,-32768,32767);
|
||||
}
|
||||
|
||||
for (int i=3; i<6; i++) {
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ void DivPlatformYM2608::acquire_combo(short** buf, size_t len) {
|
|||
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i]<<1;
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm_nuked.ch_out[i]<<1,-32768,32767);
|
||||
}
|
||||
|
||||
ssge->get_last_out(ssgOut);
|
||||
|
|
@ -471,7 +471,8 @@ void DivPlatformYM2608::acquire_ymfm(short** buf, size_t len) {
|
|||
buf[1][h]=os[1];
|
||||
|
||||
for (int i=0; i<6; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1;
|
||||
int out=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1;
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(out,-32768,32767);
|
||||
}
|
||||
|
||||
ssge->get_last_out(ssgOut);
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ void DivPlatformYM2610::acquire_combo(short** buf, size_t len) {
|
|||
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[bchOffs[i]]<<1;
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm_nuked.ch_out[bchOffs[i]]<<1,-32768,32767);
|
||||
}
|
||||
|
||||
ssge->get_last_out(ssgOut);
|
||||
|
|
@ -404,7 +404,8 @@ void DivPlatformYM2610::acquire_ymfm(short** buf, size_t len) {
|
|||
buf[1][h]=os[1];
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1;
|
||||
int out=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1;
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(out,-32768,32767);
|
||||
}
|
||||
|
||||
ssge->get_last_out(ssgOut);
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ void DivPlatformYM2610B::acquire_combo(short** buf, size_t len) {
|
|||
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i]<<1;
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(fm_nuked.ch_out[i]<<1,-32768,32767);
|
||||
}
|
||||
|
||||
ssge->get_last_out(ssgOut);
|
||||
|
|
@ -471,7 +471,8 @@ void DivPlatformYM2610B::acquire_ymfm(short** buf, size_t len) {
|
|||
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1;
|
||||
int out=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1))<<1;
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(out,-32768,32767);
|
||||
}
|
||||
|
||||
ssge->get_last_out(ssgOut);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#include "../engine.h"
|
||||
#include "../../ta-log.h"
|
||||
#include <math.h>
|
||||
#include <map>
|
||||
|
||||
#define CHIP_FREQBASE 25165824
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue