Merge branch 'master' of https://github.com/tildearrow/furnace into k053260
This commit is contained in:
commit
7aaa52297e
36 changed files with 783 additions and 141 deletions
|
|
@ -63,7 +63,7 @@ void DivPlatformGenesis::processDAC(int iRate) {
|
|||
for (int i=5; i<7; i++) {
|
||||
if (chan[i].dacSample!=-1) {
|
||||
DivSample* s=parent->getSample(chan[i].dacSample);
|
||||
if (!isMuted[i] && s->samples>0) {
|
||||
if (!isMuted[i] && s->samples>0 && chan[i].dacPos<s->samples) {
|
||||
if (parent->song.noOPN2Vol) {
|
||||
chan[i].dacOutput=s->data8[chan[i].dacDirection?(s->samples-chan[i].dacPos-1):chan[i].dacPos];
|
||||
} else {
|
||||
|
|
@ -110,7 +110,7 @@ void DivPlatformGenesis::processDAC(int iRate) {
|
|||
chan[5].dacPeriod+=chan[5].dacRate;
|
||||
if (chan[5].dacPeriod>=iRate) {
|
||||
DivSample* s=parent->getSample(chan[5].dacSample);
|
||||
if (s->samples>0) {
|
||||
if (s->samples>0 && chan[5].dacPos<s->samples) {
|
||||
if (!isMuted[5]) {
|
||||
if (chan[5].dacReady && writes.size()<16) {
|
||||
int sample;
|
||||
|
|
@ -122,10 +122,6 @@ void DivPlatformGenesis::processDAC(int iRate) {
|
|||
urgentWrite(0x2a,(unsigned char)sample+0x80);
|
||||
chan[5].dacReady=false;
|
||||
}
|
||||
} else {
|
||||
if (chan[5].dacReady && writes.size()<16) {
|
||||
urgentWrite(0x2a,0x80);
|
||||
}
|
||||
}
|
||||
chan[5].dacPos++;
|
||||
if (!chan[5].dacDirection && (s->isLoopable() && chan[5].dacPos>=(unsigned int)s->loopEnd)) {
|
||||
|
|
@ -597,6 +593,7 @@ void DivPlatformGenesis::muteChannel(int ch, bool mute) {
|
|||
isMuted[ch]=mute;
|
||||
if (ch>6) return;
|
||||
if (ch<6) {
|
||||
if (ch==5) immWrite(0x2a,0x80);
|
||||
for (int j=0; j<4; j++) {
|
||||
unsigned short baseAddr=chanOffs[ch]|opOffs[j];
|
||||
DivInstrumentFM::Operator& op=chan[ch].state.op[j];
|
||||
|
|
@ -704,7 +701,11 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
addWrite(0xffff0003,chan[c.chan].dacDirection);
|
||||
}
|
||||
}
|
||||
chan[c.chan].dacPos=0;
|
||||
if (chan[c.chan].setPos) {
|
||||
chan[c.chan].setPos=false;
|
||||
} else {
|
||||
chan[c.chan].dacPos=0;
|
||||
}
|
||||
chan[c.chan].dacPeriod=0;
|
||||
if (c.value!=DIV_NOTE_NULL) {
|
||||
chan[c.chan].baseFreq=parent->calcBaseFreq(1,1,c.value,false);
|
||||
|
|
@ -927,6 +928,12 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
if (dumpWrites) addWrite(0xffff0003,chan[c.chan].dacDirection);
|
||||
break;
|
||||
}
|
||||
case DIV_CMD_SAMPLE_POS:
|
||||
if (c.chan<5) c.chan=5;
|
||||
chan[c.chan].dacPos=c.value;
|
||||
chan[c.chan].setPos=true;
|
||||
if (dumpWrites) addWrite(0xffff0005,chan[c.chan].dacPos);
|
||||
break;
|
||||
case DIV_CMD_LEGATO: {
|
||||
if (c.chan==csmChan) {
|
||||
chan[c.chan].baseFreq=NOTE_PERIODIC(c.value);
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ class DivPlatformGenesis: public DivPlatformOPN {
|
|||
int dacDelay;
|
||||
bool dacReady;
|
||||
bool dacDirection;
|
||||
bool setPos;
|
||||
unsigned char sampleBank;
|
||||
signed char dacOutput;
|
||||
Channel():
|
||||
|
|
@ -70,6 +71,7 @@ class DivPlatformGenesis: public DivPlatformOPN {
|
|||
dacDelay(0),
|
||||
dacReady(true),
|
||||
dacDirection(false),
|
||||
setPos(false),
|
||||
sampleBank(0),
|
||||
dacOutput(0) {}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ void DivPlatformPV1000::acquire(short** buf, size_t len) {
|
|||
short samp=d65010g031_sound_tick(&d65010g031,1);
|
||||
buf[0][h]=samp;
|
||||
for (int i=0; i<3; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=d65010g031.out[i]<<1;
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=MAX(d65010g031.out[i]<<2,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ template<bool IsOpnA>
|
|||
bool opn_registers_base<IsOpnA>::write(uint16_t index, uint8_t data, uint32_t &channel, uint32_t &opmask)
|
||||
{
|
||||
assert(index < REGISTERS);
|
||||
if (index >= REGISTERS) return false;
|
||||
|
||||
// writes in the 0xa0-af/0x1a0-af region are handled as latched pairs
|
||||
// borrow unused registers 0xb8-bf/0x1b8-bf as temporary holding locations
|
||||
|
|
|
|||
|
|
@ -236,9 +236,12 @@ void DivPlatformVERA::tick(bool sysTick) {
|
|||
if (s->samples>0) {
|
||||
if (s->isLoopable()) {
|
||||
// Inform the export process of the loop point for this sample
|
||||
addWrite(67,s->loopStart&0xff);
|
||||
addWrite(67,(s->loopStart>>8)&0xff);
|
||||
addWrite(67,(s->loopStart>>16)&0xff);
|
||||
int tmp_ls=(s->loopStart<<1); // for stereo
|
||||
if (chan[16].pcm.depth16)
|
||||
tmp_ls<<=1; // for 16 bit
|
||||
addWrite(67,tmp_ls&0xff);
|
||||
addWrite(67,(tmp_ls>>8)&0xff);
|
||||
addWrite(67,(tmp_ls>>16)&0xff);
|
||||
}
|
||||
while (true) {
|
||||
short tmp_l=0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue