Reduce register spamming(again)
This commit is contained in:
parent
07e0577a36
commit
bf16f8f59e
|
@ -149,10 +149,10 @@ void DivPlatformK007232::tick(bool sysTick) {
|
||||||
if (stereo) {
|
if (stereo) {
|
||||||
chan[i].lvol=isMuted[i]?0:(((chan[i].outVol&0xf)*((chan[i].panning>>0)&0xf))/15);
|
chan[i].lvol=isMuted[i]?0:(((chan[i].outVol&0xf)*((chan[i].panning>>0)&0xf))/15);
|
||||||
chan[i].rvol=isMuted[i]?0:(((chan[i].outVol&0xf)*((chan[i].panning>>4)&0xf))/15);
|
chan[i].rvol=isMuted[i]?0:(((chan[i].outVol&0xf)*((chan[i].panning>>4)&0xf))/15);
|
||||||
const unsigned char prevPan=lastPan[i];
|
const int newPan=(chan[i].lvol&0xf)|((chan[i].rvol&0xf)<<4);
|
||||||
lastPan[i]=(chan[i].lvol&0xf)|((chan[i].rvol&0xf)<<4);
|
if (chan[i].prevPan!=newPan) {
|
||||||
if (prevPan!=lastPan[i]) {
|
|
||||||
rWrite(0x10+i,(chan[i].lvol&0xf)|((chan[i].rvol&0xf)<<4));
|
rWrite(0x10+i,(chan[i].lvol&0xf)|((chan[i].rvol&0xf)<<4));
|
||||||
|
chan[i].prevPan=newPan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -202,8 +202,6 @@ void DivPlatformK007232::tick(bool sysTick) {
|
||||||
start=MIN(start,MIN(getSampleMemCapacity(),131072)-1);
|
start=MIN(start,MIN(getSampleMemCapacity(),131072)-1);
|
||||||
loop=MIN(loop,MIN(getSampleMemCapacity(),131072)-1);
|
loop=MIN(loop,MIN(getSampleMemCapacity(),131072)-1);
|
||||||
// force keyoff first
|
// force keyoff first
|
||||||
chWrite(i,0,0);
|
|
||||||
chWrite(i,1,0);
|
|
||||||
chWrite(i,2,0xff);
|
chWrite(i,2,0xff);
|
||||||
chWrite(i,3,0xff);
|
chWrite(i,3,0xff);
|
||||||
chWrite(i,4,0x1);
|
chWrite(i,4,0x1);
|
||||||
|
@ -219,14 +217,20 @@ void DivPlatformK007232::tick(bool sysTick) {
|
||||||
if (prevLoop!=lastLoop) {
|
if (prevLoop!=lastLoop) {
|
||||||
rWrite(0xd,lastLoop);
|
rWrite(0xd,lastLoop);
|
||||||
}
|
}
|
||||||
|
if (chan[i].prevBank!=bank) {
|
||||||
rWrite(0x12+i,bank);
|
rWrite(0x12+i,bank);
|
||||||
|
chan[i].prevBank=bank;
|
||||||
|
}
|
||||||
|
if (chan[i].prevFreq!=chan[i].freq) {
|
||||||
chWrite(i,0,chan[i].freq&0xff);
|
chWrite(i,0,chan[i].freq&0xff);
|
||||||
chWrite(i,1,(chan[i].freq>>8)&0xf);
|
chWrite(i,1,(chan[i].freq>>8)&0xf);
|
||||||
|
chan[i].prevFreq=chan[i].freq;
|
||||||
|
}
|
||||||
chWrite(i,2,start&0xff);
|
chWrite(i,2,start&0xff);
|
||||||
chWrite(i,3,start>>8);
|
chWrite(i,3,start>>8);
|
||||||
chWrite(i,4,start>>16);
|
chWrite(i,4,start>>16);
|
||||||
chWrite(i,5,0);
|
chWrite(i,5,0);
|
||||||
if (s->isLoopable()) {
|
if (s->isLoopable() && start!=loop) {
|
||||||
chWrite(i,2,loop&0xff);
|
chWrite(i,2,loop&0xff);
|
||||||
chWrite(i,3,loop>>8);
|
chWrite(i,3,loop>>8);
|
||||||
chWrite(i,4,loop>>16);
|
chWrite(i,4,loop>>16);
|
||||||
|
@ -240,19 +244,23 @@ void DivPlatformK007232::tick(bool sysTick) {
|
||||||
chan[i].keyOn=false;
|
chan[i].keyOn=false;
|
||||||
}
|
}
|
||||||
if (chan[i].keyOff) {
|
if (chan[i].keyOff) {
|
||||||
chWrite(i,0,0);
|
|
||||||
chWrite(i,1,0);
|
|
||||||
chWrite(i,2,0xff);
|
chWrite(i,2,0xff);
|
||||||
chWrite(i,3,0xff);
|
chWrite(i,3,0xff);
|
||||||
chWrite(i,4,0x1);
|
chWrite(i,4,0x1);
|
||||||
chWrite(i,5,0);
|
chWrite(i,5,0);
|
||||||
|
const unsigned char prevLoop=lastLoop;
|
||||||
lastLoop&=~(1<<i);
|
lastLoop&=~(1<<i);
|
||||||
|
if (prevLoop!=lastLoop) {
|
||||||
rWrite(0xd,lastLoop);
|
rWrite(0xd,lastLoop);
|
||||||
|
}
|
||||||
chan[i].keyOff=false;
|
chan[i].keyOff=false;
|
||||||
}
|
}
|
||||||
if (chan[i].freqChanged) {
|
if (chan[i].freqChanged) {
|
||||||
|
if (chan[i].prevFreq!=chan[i].freq) {
|
||||||
chWrite(i,0,chan[i].freq&0xff);
|
chWrite(i,0,chan[i].freq&0xff);
|
||||||
chWrite(i,1,(chan[i].freq>>8)&0xf);
|
chWrite(i,1,(chan[i].freq>>8)&0xf);
|
||||||
|
chan[i].prevFreq=chan[i].freq;
|
||||||
|
}
|
||||||
chan[i].freqChanged=false;
|
chan[i].freqChanged=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -413,7 +421,6 @@ void DivPlatformK007232::reset() {
|
||||||
k007232.reset();
|
k007232.reset();
|
||||||
lastLoop=0;
|
lastLoop=0;
|
||||||
lastVolume=0;
|
lastVolume=0;
|
||||||
lastPan[0]=lastPan[1]=0;
|
|
||||||
for (int i=0; i<2; i++) {
|
for (int i=0; i<2; i++) {
|
||||||
chan[i]=DivPlatformK007232::Channel();
|
chan[i]=DivPlatformK007232::Channel();
|
||||||
chan[i].std.setEngine(parent);
|
chan[i].std.setEngine(parent);
|
||||||
|
|
|
@ -27,11 +27,12 @@
|
||||||
|
|
||||||
class DivPlatformK007232: public DivDispatch, public k007232_intf {
|
class DivPlatformK007232: public DivDispatch, public k007232_intf {
|
||||||
struct Channel {
|
struct Channel {
|
||||||
int freq, baseFreq, pitch, pitch2;
|
int freq, prevFreq, baseFreq, pitch, pitch2;
|
||||||
unsigned int audPos;
|
unsigned int audPos;
|
||||||
|
int prevBank;
|
||||||
int sample, wave, ins;
|
int sample, wave, ins;
|
||||||
int note;
|
int note;
|
||||||
int panning;
|
int panning, prevPan;
|
||||||
bool active, insChanged, volumeChanged, freqChanged, keyOn, keyOff, inPorta, setPos;
|
bool active, insChanged, volumeChanged, freqChanged, keyOn, keyOff, inPorta, setPos;
|
||||||
int vol, outVol, lvol, rvol;
|
int vol, outVol, lvol, rvol;
|
||||||
int macroVolMul;
|
int macroVolMul;
|
||||||
|
@ -42,14 +43,17 @@ class DivPlatformK007232: public DivDispatch, public k007232_intf {
|
||||||
}
|
}
|
||||||
Channel():
|
Channel():
|
||||||
freq(0),
|
freq(0),
|
||||||
|
prevFreq(-1),
|
||||||
baseFreq(0),
|
baseFreq(0),
|
||||||
pitch(0),
|
pitch(0),
|
||||||
pitch2(0),
|
pitch2(0),
|
||||||
audPos(0),
|
audPos(0),
|
||||||
|
prevBank(-1),
|
||||||
sample(-1),
|
sample(-1),
|
||||||
ins(-1),
|
ins(-1),
|
||||||
note(0),
|
note(0),
|
||||||
panning(255),
|
panning(255),
|
||||||
|
prevPan(-1),
|
||||||
active(false),
|
active(false),
|
||||||
insChanged(true),
|
insChanged(true),
|
||||||
volumeChanged(false),
|
volumeChanged(false),
|
||||||
|
@ -81,7 +85,7 @@ class DivPlatformK007232: public DivDispatch, public k007232_intf {
|
||||||
bool sampleLoaded[256];
|
bool sampleLoaded[256];
|
||||||
|
|
||||||
int delay;
|
int delay;
|
||||||
unsigned char lastLoop, lastVolume, lastPan[2];
|
unsigned char lastLoop, lastVolume;
|
||||||
bool stereo;
|
bool stereo;
|
||||||
|
|
||||||
unsigned char* sampleMem;
|
unsigned char* sampleMem;
|
||||||
|
|
|
@ -1130,15 +1130,18 @@ void putDispatchChan(void* data, int chanNum, int type) {
|
||||||
DivPlatformK007232::Channel* ch=(DivPlatformK007232::Channel*)data;
|
DivPlatformK007232::Channel* ch=(DivPlatformK007232::Channel*)data;
|
||||||
ImGui::Text("> K007232");
|
ImGui::Text("> K007232");
|
||||||
ImGui::Text("* freq: %d",ch->freq);
|
ImGui::Text("* freq: %d",ch->freq);
|
||||||
|
ImGui::Text(" - prev: %d",ch->prevFreq);
|
||||||
ImGui::Text(" - base: %d",ch->baseFreq);
|
ImGui::Text(" - base: %d",ch->baseFreq);
|
||||||
ImGui::Text(" - pitch: %d",ch->pitch);
|
ImGui::Text(" - pitch: %d",ch->pitch);
|
||||||
ImGui::Text(" - pitch2: %d",ch->pitch2);
|
ImGui::Text(" - pitch2: %d",ch->pitch2);
|
||||||
ImGui::Text("* note: %d",ch->note);
|
ImGui::Text("* note: %d",ch->note);
|
||||||
ImGui::Text("* Sample: %d",ch->sample);
|
ImGui::Text("* Sample: %d",ch->sample);
|
||||||
ImGui::Text(" - pos: %d",ch->audPos);
|
ImGui::Text(" - pos: %d",ch->audPos);
|
||||||
|
ImGui::Text(" - prevBank: %d",ch->prevBank);
|
||||||
ImGui::Text("- wave: %d",ch->wave);
|
ImGui::Text("- wave: %d",ch->wave);
|
||||||
ImGui::Text("- ins: %d",ch->ins);
|
ImGui::Text("- ins: %d",ch->ins);
|
||||||
ImGui::Text("- panning: %d",ch->panning);
|
ImGui::Text("* panning: %d",ch->panning);
|
||||||
|
ImGui::Text(" - prev: %d",ch->prevPan);
|
||||||
ImGui::Text("- vol: %.2x",ch->vol);
|
ImGui::Text("- vol: %.2x",ch->vol);
|
||||||
ImGui::Text("- outVol: %.2x",ch->outVol);
|
ImGui::Text("- outVol: %.2x",ch->outVol);
|
||||||
ImGui::Text("- lvol: %.2x",ch->lvol);
|
ImGui::Text("- lvol: %.2x",ch->lvol);
|
||||||
|
|
Loading…
Reference in New Issue