implement phase reset macro on supported systems
This commit is contained in:
parent
c76e719371
commit
c743a9e96a
|
@ -195,6 +195,11 @@ void DivPlatformAmiga::tick() {
|
||||||
if (chan[i].useWave && chan[i].active) {
|
if (chan[i].useWave && chan[i].active) {
|
||||||
chan[i].ws.tick();
|
chan[i].ws.tick();
|
||||||
}
|
}
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].audPos=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
||||||
//DivInstrument* ins=parent->getIns(chan[i].ins);
|
//DivInstrument* ins=parent->getIns(chan[i].ins);
|
||||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true);
|
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true);
|
||||||
|
|
|
@ -264,6 +264,12 @@ void DivPlatformArcade::tick() {
|
||||||
rWrite(0x1b,chan[i].std.wave.val&3);
|
rWrite(0x1b,chan[i].std.wave.val&3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].keyOn=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chan[i].std.ex1.had) {
|
if (chan[i].std.ex1.had) {
|
||||||
amDepth=chan[i].std.ex1.val;
|
amDepth=chan[i].std.ex1.val;
|
||||||
immWrite(0x19,amDepth);
|
immWrite(0x19,amDepth);
|
||||||
|
|
|
@ -215,6 +215,12 @@ void DivPlatformAY8910::tick() {
|
||||||
rWrite(0x08+i,(chan[i].outVol&15)|((chan[i].psgMode&4)<<2));
|
rWrite(0x08+i,(chan[i].outVol&15)|((chan[i].psgMode&4)<<2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
oldWrites[0x08+i]=-1;
|
||||||
|
oldWrites[0x0d]=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (chan[i].std.ex2.had) {
|
if (chan[i].std.ex2.had) {
|
||||||
ayEnvMode=chan[i].std.ex2.val;
|
ayEnvMode=chan[i].std.ex2.val;
|
||||||
rWrite(0x0d,ayEnvMode);
|
rWrite(0x0d,ayEnvMode);
|
||||||
|
|
|
@ -226,6 +226,12 @@ void DivPlatformAY8930::tick() {
|
||||||
rWrite(0x08+i,(chan[i].outVol&31)|((chan[i].psgMode&4)<<3));
|
rWrite(0x08+i,(chan[i].outVol&31)|((chan[i].psgMode&4)<<3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
oldWrites[0x08+i]=-1;
|
||||||
|
oldWrites[regMode[i]]=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (chan[i].std.ex1.had) { // duty
|
if (chan[i].std.ex1.had) { // duty
|
||||||
rWrite(0x16+i,chan[i].std.ex1.val);
|
rWrite(0x16+i,chan[i].std.ex1.val);
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,6 +192,11 @@ void DivPlatformGB::tick() {
|
||||||
if (!chan[i].keyOff) chan[i].keyOn=true;
|
if (!chan[i].keyOff) chan[i].keyOn=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].keyOn=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (i==2) {
|
if (i==2) {
|
||||||
if (chan[i].active) {
|
if (chan[i].active) {
|
||||||
if (ws.tick()) {
|
if (ws.tick()) {
|
||||||
|
|
|
@ -258,6 +258,12 @@ void DivPlatformGenesis::tick() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].keyOn=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chan[i].std.alg.had) {
|
if (chan[i].std.alg.had) {
|
||||||
chan[i].state.alg=chan[i].std.alg.val;
|
chan[i].state.alg=chan[i].std.alg.val;
|
||||||
rWrite(chanOffs[i]+ADDR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3));
|
rWrite(chanOffs[i]+ADDR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3));
|
||||||
|
|
|
@ -123,6 +123,12 @@ void DivPlatformMMC5::tick() {
|
||||||
chan[i].duty=chan[i].std.duty.val;
|
chan[i].duty=chan[i].std.duty.val;
|
||||||
rWrite(0x5000+i*4,0x30|chan[i].outVol|((chan[i].duty&3)<<6));
|
rWrite(0x5000+i*4,0x30|chan[i].outVol|((chan[i].duty&3)<<6));
|
||||||
}
|
}
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].freqChanged=true;
|
||||||
|
chan[i].prevFreq=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
||||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true)-1;
|
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true)-1;
|
||||||
if (chan[i].freq>2047) chan[i].freq=2047;
|
if (chan[i].freq>2047) chan[i].freq=2047;
|
||||||
|
|
|
@ -201,6 +201,12 @@ void DivPlatformNES::tick() {
|
||||||
//rWrite(16+i*5,chan[i].sweep);
|
//rWrite(16+i*5,chan[i].sweep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (i<2) if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].freqChanged=true;
|
||||||
|
chan[i].prevFreq=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
||||||
if (i==3) { // noise
|
if (i==3) { // noise
|
||||||
int ntPos=chan[i].baseFreq;
|
int ntPos=chan[i].baseFreq;
|
||||||
|
|
|
@ -269,6 +269,12 @@ void DivPlatformOPL::tick() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].keyOn=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chan[i].std.alg.had) {
|
if (chan[i].std.alg.had) {
|
||||||
chan[i].state.alg=chan[i].std.alg.val;
|
chan[i].state.alg=chan[i].std.alg.val;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,12 @@ void DivPlatformOPLL::tick() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].keyOn=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chan[i].state.opllPreset==0) {
|
if (chan[i].state.opllPreset==0) {
|
||||||
if (chan[i].std.alg.had) { // SUS
|
if (chan[i].std.alg.had) { // SUS
|
||||||
chan[i].state.alg=chan[i].std.alg.val;
|
chan[i].state.alg=chan[i].std.alg.val;
|
||||||
|
|
|
@ -197,7 +197,7 @@ void DivPlatformPCE::tick() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chan[i].active) {
|
if (chan[i].active) {
|
||||||
if (chan[i].ws.tick()) {
|
if (chan[i].ws.tick() || (chan[i].std.phaseReset.had && chan[i].std.phaseReset.val==1)) {
|
||||||
updateWave(i);
|
updateWave(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,13 +84,20 @@ void DivPlatformSMS::tick() {
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i==3) if (chan[i].std.duty.had) {
|
if (i==3) {
|
||||||
|
if (chan[i].std.duty.had) {
|
||||||
snNoiseMode=chan[i].std.duty.val;
|
snNoiseMode=chan[i].std.duty.val;
|
||||||
if (chan[i].std.duty.val<2) {
|
if (chan[i].std.duty.val<2) {
|
||||||
chan[3].freqChanged=false;
|
chan[3].freqChanged=false;
|
||||||
}
|
}
|
||||||
updateSNMode=true;
|
updateSNMode=true;
|
||||||
}
|
}
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
updateSNMode=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int i=0; i<3; i++) {
|
for (int i=0; i<3; i++) {
|
||||||
if (chan[i].freqChanged) {
|
if (chan[i].freqChanged) {
|
||||||
|
|
|
@ -228,6 +228,12 @@ void DivPlatformTX81Z::tick() {
|
||||||
rWrite(0x1b,chan[i].std.wave.val&3);
|
rWrite(0x1b,chan[i].std.wave.val&3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].keyOn=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chan[i].std.ex1.had) {
|
if (chan[i].std.ex1.had) {
|
||||||
amDepth=chan[i].std.ex1.val;
|
amDepth=chan[i].std.ex1.val;
|
||||||
immWrite(0x19,amDepth);
|
immWrite(0x19,amDepth);
|
||||||
|
|
|
@ -408,6 +408,12 @@ void DivPlatformYM2610::tick() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].keyOn=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chan[i].std.alg.had) {
|
if (chan[i].std.alg.had) {
|
||||||
chan[i].state.alg=chan[i].std.alg.val;
|
chan[i].state.alg=chan[i].std.alg.val;
|
||||||
rWrite(chanOffs[i]+ADDR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3));
|
rWrite(chanOffs[i]+ADDR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3));
|
||||||
|
|
|
@ -472,6 +472,12 @@ void DivPlatformYM2610B::tick() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chan[i].std.phaseReset.had) {
|
||||||
|
if (chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].keyOn=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chan[i].std.alg.had) {
|
if (chan[i].std.alg.had) {
|
||||||
chan[i].state.alg=chan[i].std.alg.val;
|
chan[i].state.alg=chan[i].std.alg.val;
|
||||||
rWrite(chanOffs[i]+ADDR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3));
|
rWrite(chanOffs[i]+ADDR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3));
|
||||||
|
|
|
@ -2758,7 +2758,6 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
ins->type==DIV_INS_GB ||
|
ins->type==DIV_INS_GB ||
|
||||||
ins->type==DIV_INS_AMIGA ||
|
ins->type==DIV_INS_AMIGA ||
|
||||||
ins->type==DIV_INS_OPLL ||
|
ins->type==DIV_INS_OPLL ||
|
||||||
ins->type==DIV_INS_FDS ||
|
|
||||||
ins->type==DIV_INS_AY ||
|
ins->type==DIV_INS_AY ||
|
||||||
ins->type==DIV_INS_AY8930 ||
|
ins->type==DIV_INS_AY8930 ||
|
||||||
ins->type==DIV_INS_SWAN) {
|
ins->type==DIV_INS_SWAN) {
|
||||||
|
|
Loading…
Reference in New Issue