diff --git a/src/disp/disp_qy.mjs b/src/disp/disp_qy.mjs index 9d4c283..1044cbb 100644 --- a/src/disp/disp_qy.mjs +++ b/src/disp/disp_qy.mjs @@ -416,18 +416,20 @@ let QyDisplay = class extends RootDisplay { }; }; for (let tch = 0; tch < 8; tch ++) { // target channel - let rch = curSeg * 8 + tch, + let rch = (curSeg << 3) + tch, textTarget = 1; upThis.qyRsrc.getBm("CTabOff")?.render((e, x, y) => { upThis.#nmdb[preCal + 12 * tch + x + y * 128] = e; }); - let cVelo = Math.floor(sum.strength[rch] / 51); - upThis.#renderFill(31 + 12 * tch, preCalY + 11 - cVelo, 9, cVelo + 1); - if (this.#ch == rch) { - textTarget = 0; - upThis.#renderFill(31 + 12 * tch, preCalY, 9, 5); - if (mixerView) { - upThis.#renderFill(30 + 12 * tch, preCalY + 14, 13, 8); + if (sum.chInUse[rch]) { + let cVelo = Math.floor(sum.strength[rch] / 51); + upThis.#renderFill(31 + 12 * tch, preCalY + 11 - cVelo, 9, cVelo + 1); + if (this.#ch == rch) { + textTarget = 0; + upThis.#renderFill(31 + 12 * tch, preCalY, 9, 5); + if (mixerView) { + upThis.#renderFill(30 + 12 * tch, preCalY + 14, 13, 8); + }; }; }; if (rch < 19) { diff --git a/src/state/index.mjs b/src/state/index.mjs index 803be28..c9a64f8 100644 --- a/src/state/index.mjs +++ b/src/state/index.mjs @@ -3983,7 +3983,7 @@ let OctaviaDevice = class extends CustomEventSource { let desiredByteTail = boundOff + workArr.length, desiredLengthHead = boundOff * 6 - ((boundOff * 2428 >> 16) << 1), desiredLengthTail = desiredByteTail * 6 - ((desiredByteTail * 2428 >> 16) << 1); // That's an integer division of 27, then a multiple of 2. - if (desiredLengthHead >= 640) { + if (desiredLengthHead > 640) { console.warn(`SC-8850 partial screen dump out of bounds: invalid buffer range.\n`, msg); return; }; @@ -4005,6 +4005,7 @@ let OctaviaDevice = class extends CustomEventSource { let byteOffset = bundleId * 108 + boundOff, offset = byteOffset * 6 - ((byteOffset * 2428 >> 16) << 1); // Used for emitting events than for internal processing. upThis.dispatchEvent("screen", {type: "sc8850", offset, data: screenBuffer}); + getDebugState() && console.debug(`SC-8850 screen dump: bundle ${bundleId + 1}, range ${desiredLengthHead}~${desiredLengthTail}`); }); // GS Part setup // I wanted this to also be written in a circular structure