it doesn't...
This commit is contained in:
parent
cb1c96ff1d
commit
c5fa0a3d6d
|
@ -614,11 +614,13 @@ void DivEngine::renderSamples() {
|
|||
s->rendLength=(double)s->length/samplePitches[s->pitch];
|
||||
s->rendData=new short[s->rendLength];
|
||||
int k=0;
|
||||
float mult=(float)(s->vol+100)/100.0f;
|
||||
for (double j=0; j<s->length; j+=samplePitches[s->pitch]) {
|
||||
if (k>=s->rendLength) {
|
||||
break;
|
||||
}
|
||||
s->rendData[k++]=s->data[(unsigned int)j];
|
||||
float next=(float)s->data[(unsigned int)j]*mult;
|
||||
s->rendData[k++]=fmin(fmax(next,-32768),32767);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,8 +76,9 @@ static int dacRates[6]={
|
|||
|
||||
void DivPlatformGenesis::tick() {
|
||||
for (int i=0; i<6; i++) {
|
||||
if (chan[i].keyOn) {
|
||||
if (chan[i].keyOn || chan[i].keyOff) {
|
||||
writes.emplace(0x28,0x00|konOffs[i]);
|
||||
chan[i].keyOff=false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,7 +146,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
break;
|
||||
}
|
||||
case DIV_CMD_NOTE_OFF:
|
||||
writes.emplace(0x28,0x00|konOffs[c.chan]);
|
||||
chan[c.chan].keyOff=true;
|
||||
chan[c.chan].active=false;
|
||||
break;
|
||||
case DIV_CMD_VOLUME: {
|
||||
|
|
|
@ -7,10 +7,10 @@ class DivPlatformGenesis: public DivDispatch {
|
|||
unsigned char freqH, freqL;
|
||||
unsigned char ins;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, keyOn;
|
||||
bool active, insChanged, keyOn, keyOff;
|
||||
signed char vol;
|
||||
unsigned char pan;
|
||||
Channel(): freqH(0), freqL(0), ins(0), active(false), insChanged(true), keyOn(false), vol(0), pan(3) {}
|
||||
Channel(): freqH(0), freqL(0), ins(0), active(false), insChanged(true), keyOn(false), keyOff(false), vol(0), pan(3) {}
|
||||
};
|
||||
Channel chan[10];
|
||||
struct QueuedWrite {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "ta-log.h"
|
||||
#include "engine/engine.h"
|
||||
|
||||
#define DIV_VERSION "dev2"
|
||||
#define DIV_VERSION "dev3"
|
||||
|
||||
DivEngine e;
|
||||
|
||||
|
|
Loading…
Reference in New Issue