mirror of
https://github.com/tildearrow/furnace.git
synced 2025-01-06 23:51:21 +00:00
ES5506: I am blowing up now
This commit is contained in:
parent
c9eb4482b0
commit
11154923b0
2 changed files with 17 additions and 16 deletions
|
@ -190,7 +190,8 @@ void DivPlatformES5506::tick(bool sysTick) {
|
|||
signed int k1=chan[i].k1Prev,k2=chan[i].k2Prev;
|
||||
// volume/panning macros
|
||||
if (chan[i].std.vol.had) {
|
||||
const unsigned int nextVol=VOL_SCALE_LOG((0xfff*chan[i].vol)/0xff,(0xfff*(unsigned int)chan[i].std.vol.val)/chan[i].volMacroMax,0xfff);
|
||||
const int nextVol=VOL_SCALE_LOG((0xfff*chan[i].vol)/0xff,(0xfff*chan[i].std.vol.val)/chan[i].volMacroMax,0xfff);
|
||||
logV("nextVol[%d]: %d (%d,%d,%d)",i,nextVol,chan[i].vol,chan[i].std.vol.val,chan[i].volMacroMax);
|
||||
if (chan[i].outVol!=nextVol) {
|
||||
chan[i].outVol=nextVol;
|
||||
chan[i].volChanged.lVol=1;
|
||||
|
@ -198,14 +199,14 @@ void DivPlatformES5506::tick(bool sysTick) {
|
|||
}
|
||||
}
|
||||
if (chan[i].std.panL.had) {
|
||||
const unsigned int nextLVol=VOL_SCALE_LOG((0xfff*chan[i].lVol)/0xff,(0xfff*(unsigned int)chan[i].std.panL.val)/chan[i].panMacroMax,0xfff);
|
||||
const int nextLVol=VOL_SCALE_LOG((0xfff*chan[i].lVol)/0xff,(0xfff*chan[i].std.panL.val)/chan[i].panMacroMax,0xfff);
|
||||
if (chan[i].outLVol!=nextLVol) {
|
||||
chan[i].outLVol=nextLVol;
|
||||
chan[i].volChanged.lVol=1;
|
||||
}
|
||||
}
|
||||
if (chan[i].std.panR.had) {
|
||||
const unsigned int nextRVol=VOL_SCALE_LOG((0xfff*chan[i].rVol)/0xff,(0xfff*(unsigned int)chan[i].std.panR.val)/chan[i].panMacroMax,0xfff);
|
||||
const int nextRVol=VOL_SCALE_LOG((0xfff*chan[i].rVol)/0xff,(0xfff*chan[i].std.panR.val)/chan[i].panMacroMax,0xfff);
|
||||
if (chan[i].outRVol!=nextRVol) {
|
||||
chan[i].outRVol=nextRVol;
|
||||
chan[i].volChanged.rVol=1;
|
||||
|
@ -790,7 +791,7 @@ int DivPlatformES5506::dispatch(DivCommand c) {
|
|||
}
|
||||
break;
|
||||
case DIV_CMD_VOLUME:
|
||||
if (chan[c.chan].vol!=(unsigned int)(c.value)) {
|
||||
if (chan[c.chan].vol!=c.value) {
|
||||
chan[c.chan].vol=c.value;
|
||||
if (!chan[c.chan].std.vol.has) {
|
||||
chan[c.chan].outVol=(0xfff*c.value)/0xff;
|
||||
|
@ -807,7 +808,7 @@ int DivPlatformES5506::dispatch(DivCommand c) {
|
|||
chan[c.chan].volChanged.ca=1;
|
||||
}
|
||||
// Left volume
|
||||
if (chan[c.chan].lVol!=(unsigned int)(c.value)) {
|
||||
if (chan[c.chan].lVol!=c.value) {
|
||||
chan[c.chan].lVol=c.value;
|
||||
if (!chan[c.chan].std.panL.has) {
|
||||
chan[c.chan].outLVol=(0xfff*c.value)/0xff;
|
||||
|
@ -815,7 +816,7 @@ int DivPlatformES5506::dispatch(DivCommand c) {
|
|||
}
|
||||
}
|
||||
// Right volume
|
||||
if (chan[c.chan].rVol!=(unsigned int)(c.value2)) {
|
||||
if (chan[c.chan].rVol!=c.value2) {
|
||||
chan[c.chan].rVol=c.value2;
|
||||
if (!chan[c.chan].std.panR.has) {
|
||||
chan[c.chan].outRVol=(0xfff*c.value2)/0xff;
|
||||
|
@ -832,20 +833,20 @@ int DivPlatformES5506::dispatch(DivCommand c) {
|
|||
}
|
||||
if ((c.value&1)==0) {
|
||||
// Left volume
|
||||
if (chan[c.chan].lVol!=(unsigned int)(c.value2)) {
|
||||
if (chan[c.chan].lVol!=c.value2) {
|
||||
chan[c.chan].lVol=c.value2;
|
||||
if (!chan[c.chan].std.panL.has) {
|
||||
chan[c.chan].outLVol=(0xffff*c.value2)/0xff;
|
||||
chan[c.chan].outLVol=(0xfff*c.value2)/0xff;
|
||||
chan[c.chan].volChanged.lVol=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((c.value&1)==1) {
|
||||
// Right volume
|
||||
if (chan[c.chan].rVol!=(unsigned int)(c.value2)) {
|
||||
if (chan[c.chan].rVol!=c.value2) {
|
||||
chan[c.chan].rVol=c.value2;
|
||||
if (!chan[c.chan].std.panR.has) {
|
||||
chan[c.chan].outRVol=(0xffff*c.value2)/0xff;
|
||||
chan[c.chan].outRVol=(0xfff*c.value2)/0xff;
|
||||
chan[c.chan].volChanged.rVol=1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "vgsound_emu/src/es550x/es5506.hpp"
|
||||
|
||||
class DivPlatformES5506: public DivDispatch, public es550x_intf {
|
||||
struct Channel : public SharedChannel<unsigned int> {
|
||||
struct Channel : public SharedChannel<int> {
|
||||
struct PCM {
|
||||
bool isNoteMap;
|
||||
int index, next;
|
||||
|
@ -63,7 +63,7 @@ class DivPlatformES5506: public DivDispatch, public es550x_intf {
|
|||
loopMode(DIV_SAMPLE_LOOP_MAX) {}
|
||||
} pcm;
|
||||
int nextFreq, nextNote, currNote, wave;
|
||||
unsigned int volMacroMax, panMacroMax;
|
||||
int volMacroMax, panMacroMax;
|
||||
bool useWave, isReverseLoop;
|
||||
unsigned int cr;
|
||||
|
||||
|
@ -177,14 +177,14 @@ class DivPlatformES5506: public DivDispatch, public es550x_intf {
|
|||
signed int k1Offs, k2Offs;
|
||||
signed int k1Slide, k2Slide;
|
||||
signed int k1Prev, k2Prev;
|
||||
unsigned int lVol, rVol;
|
||||
unsigned int outLVol, outRVol;
|
||||
unsigned int resLVol, resRVol;
|
||||
int lVol, rVol;
|
||||
int outLVol, outRVol;
|
||||
int resLVol, resRVol;
|
||||
signed int oscOut;
|
||||
DivInstrumentES5506::Filter filter;
|
||||
DivInstrumentES5506::Envelope envelope;
|
||||
Channel():
|
||||
SharedChannel<unsigned int>(0xff),
|
||||
SharedChannel<int>(0xff),
|
||||
pcm(PCM()),
|
||||
nextFreq(0),
|
||||
nextNote(0),
|
||||
|
|
Loading…
Reference in a new issue