Skip to content

Commit

Permalink
oh yes more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tildearrow committed Jan 19, 2022
1 parent f98662d commit aa1a3f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/engine/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct DivChannelState {
int vibratoDepth, vibratoRate, vibratoPos, vibratoDir, vibratoFine;
int tremoloDepth, tremoloRate, tremoloPos;
unsigned char arp, arpStage, arpTicks;
bool doNote, legato, portaStop, keyOn, nowYouCanStop, stopOnOff, arpYield, delayLocked, inPorta, scheduledSlideReset;
bool doNote, legato, portaStop, keyOn, keyOff, nowYouCanStop, stopOnOff, arpYield, delayLocked, inPorta, scheduledSlideReset;

DivChannelState():
note(-1),
Expand Down Expand Up @@ -70,6 +70,7 @@ struct DivChannelState {
legato(false),
portaStop(false),
keyOn(false),
keyOff(false),
nowYouCanStop(true),
stopOnOff(false),
arpYield(false),
Expand Down
12 changes: 3 additions & 9 deletions src/engine/playback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
if (pat->data[whatRow][0]==100) {
//chan[i].note=-1;
chan[i].keyOn=false;
chan[i].keyOff=true;
if (chan[i].stopOnOff) {
chan[i].portaNote=-1;
chan[i].portaSpeed=-1;
Expand Down Expand Up @@ -671,6 +672,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
dispatchCmd(DivCommand(DIV_CMD_VOLUME,i,chan[i].volume>>8));
}
chan[i].keyOn=true;
chan[i].keyOff=false;
}
chan[i].nowYouCanStop=true;

Expand Down Expand Up @@ -849,8 +851,7 @@ bool DivEngine::nextTick(bool noAccum) {
}

}
// TODO: RE-ENABLE IF BROKE YET AGAIN!
if (/*chan[i].keyOn && */chan[i].portaSpeed>0) {
if ((chan[i].keyOn || chan[i].keyOff) && chan[i].portaSpeed>0) {
if (dispatchCmd(DivCommand(DIV_CMD_NOTE_PORTA,i,chan[i].portaSpeed,chan[i].portaNote))==2 && chan[i].portaStop) {
chan[i].portaSpeed=0;
chan[i].oldNote=chan[i].note;
Expand Down Expand Up @@ -910,13 +911,6 @@ bool DivEngine::nextTick(bool noAccum) {
return ret;
}

// TODO: all of this!
// PLAYBACK LOGIC:
// 1. end of buffer for all chips? if so quit
// 2. are all chips clocked yet?
// if not clock them until possible and try again
// 3. engine tick

void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsigned int size) {
if (out!=NULL) {
memset(out[0],0,size*sizeof(float));
Expand Down

0 comments on commit aa1a3f8

Please sign in to comment.