Added better initialization. Added skipping decodes while not monitoring.

This commit is contained in:
Jordan Sherer 2019-11-14 14:29:17 -05:00
parent cd1f961cac
commit 9e761ba144

View File

@ -3983,8 +3983,8 @@ bool MainWindow::isDecodeReady(int submode, qint32 k, qint32 k0, qint32 *pCurren
if(JS8_DEBUG_DECODE) qDebug() << "-->" << submodeName(submode) << "buffer advance delta" << delta; if(JS8_DEBUG_DECODE) qDebug() << "-->" << submodeName(submode) << "buffer advance delta" << delta;
} }
// on buffer loop, prepare proper next decode start // on buffer loop or init, prepare proper next decode start
if(k < k0 || delta > cycleFrames){ if(k < k0 || delta > cycleFrames || *pCurrentDecodeStart == -1 || *pNextDecodeStart == -1){
*pCurrentDecodeStart = currentCycle * cycleFrames; *pCurrentDecodeStart = currentCycle * cycleFrames;
*pNextDecodeStart = *pCurrentDecodeStart + cycleFrames; *pNextDecodeStart = *pCurrentDecodeStart + cycleFrames;
} }
@ -4024,6 +4024,11 @@ bool MainWindow::decode(){
return false; return false;
} }
if(!m_monitoring && !m_diskData){
if(JS8_DEBUG_DECODE) qDebug() << "--> decoder stream is not active";
return false;
}
if(m_transmitting || !m_txFrameQueue.isEmpty()){ if(m_transmitting || !m_txFrameQueue.isEmpty()){
// we used to use isMessageQueuedForTransmit, but it checks total frames, not queued frames // we used to use isMessageQueuedForTransmit, but it checks total frames, not queued frames
if(JS8_DEBUG_DECODE) qDebug() << "--> decoder paused during transmit"; if(JS8_DEBUG_DECODE) qDebug() << "--> decoder paused during transmit";
@ -4070,6 +4075,7 @@ bool MainWindow::decodeEnqueueReady(qint32 k, qint32 k0){
qint32 startA = -1; qint32 startA = -1;
qint32 szA = -1; qint32 szA = -1;
qint32 cycleA = -1; qint32 cycleA = -1;
if(JS8_DEBUG_DECODE) qDebug() << "? NORMAL " << currentDecodeStartA << nextDecodeStartA;
bool couldDecodeA = isDecodeReady(Varicode::JS8CallNormal, k, k0, &currentDecodeStartA, &nextDecodeStartA, &startA, &szA, &cycleA); bool couldDecodeA = isDecodeReady(Varicode::JS8CallNormal, k, k0, &currentDecodeStartA, &nextDecodeStartA, &startA, &szA, &cycleA);
if(m_diskData){ if(m_diskData){
startA = 0; startA = 0;
@ -4082,6 +4088,7 @@ bool MainWindow::decodeEnqueueReady(qint32 k, qint32 k0){
qint32 startB = -1; qint32 startB = -1;
qint32 szB = -1; qint32 szB = -1;
qint32 cycleB = -1; qint32 cycleB = -1;
if(JS8_DEBUG_DECODE) qDebug() << "? FAST " << currentDecodeStartB << nextDecodeStartB;
bool couldDecodeB = isDecodeReady(Varicode::JS8CallFast, k, k0, &currentDecodeStartB, &nextDecodeStartB, &startB, &szB, &cycleB); bool couldDecodeB = isDecodeReady(Varicode::JS8CallFast, k, k0, &currentDecodeStartB, &nextDecodeStartB, &startB, &szB, &cycleB);
if(m_diskData){ if(m_diskData){
startB = 0; startB = 0;
@ -4094,6 +4101,7 @@ bool MainWindow::decodeEnqueueReady(qint32 k, qint32 k0){
qint32 startC = -1; qint32 startC = -1;
qint32 szC = -1; qint32 szC = -1;
qint32 cycleC = -1; qint32 cycleC = -1;
if(JS8_DEBUG_DECODE) qDebug() << "? TURBO " << currentDecodeStartC << nextDecodeStartC;
bool couldDecodeC = isDecodeReady(Varicode::JS8CallTurbo, k, k0, &currentDecodeStartC, &nextDecodeStartC, &startC, &szC, &cycleC); bool couldDecodeC = isDecodeReady(Varicode::JS8CallTurbo, k, k0, &currentDecodeStartC, &nextDecodeStartC, &startC, &szC, &cycleC);
if(m_diskData){ if(m_diskData){
startC = 0; startC = 0;
@ -4107,6 +4115,7 @@ bool MainWindow::decodeEnqueueReady(qint32 k, qint32 k0){
qint32 startE = -1; qint32 startE = -1;
qint32 szE = -1; qint32 szE = -1;
qint32 cycleE = -1; qint32 cycleE = -1;
if(JS8_DEBUG_DECODE) qDebug() << "? ULTRASLOW" << currentDecodeStartE << nextDecodeStartE;
bool couldDecodeE = isDecodeReady(Varicode::JS8CallUltraSlow, k, k0, &currentDecodeStartE, &nextDecodeStartE, &startE, &szE, &cycleE); bool couldDecodeE = isDecodeReady(Varicode::JS8CallUltraSlow, k, k0, &currentDecodeStartE, &nextDecodeStartE, &startE, &szE, &cycleE);
if(m_diskData){ if(m_diskData){
startE = 0; startE = 0;