Skip to content

Commit

Permalink
Remove wasm turbo mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pipe01 committed Jan 29, 2025
1 parent 79c3248 commit d7c1f95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
6 changes: 0 additions & 6 deletions frontend/wasm/src/components/Emulator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ template(v-if="!isReady")
.card
.card-body
h3.card-title Performance
.form-check.form-switch
input.form-check-input(type="checkbox" v-model="turboMode" id="turboMode")
label.form-check-label(for="turboMode") Turbo mode
div {{ numberFmt.format(performance.cps.value.toFixed(0)) }} Hz ({{speedPercentage.toFixed(0)}}%)
div Loop time: {{ performance.loopTime.value.toFixed(0) }} ms
div CPU: {{ isCpuSleeping ? "Sleeping" : "Running" }}
Expand Down Expand Up @@ -103,9 +100,6 @@ const isStarted = ref(false);
const isRunning = ref(false);
const isAborted = ref(false);
const turboMode = ref(false);
watch(turboMode, value => sendMessage(worker, "turboMode", value));
const wasRunningBeforeLoad = ref(false);
const isLcdOff = ref(true);
Expand Down
15 changes: 2 additions & 13 deletions frontend/wasm/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ class Emulator {
private isLcdSleeping = false;
private isCPUSleeping = false;

turboMode = false;

private rttFoundBlock = false;

private cycleCount = 0;
Expand Down Expand Up @@ -129,13 +127,8 @@ class Emulator {
const cycleCountStart = this.cycleCount;
let screenUpdated = false;

if (this.turboMode) {
screenUpdated = this.doLoop(10000000);
}
else {
while (this.isRunning && !screenUpdated && performance.now() - start < 20) {
screenUpdated ||= this.doLoop(iterations);
}
while (this.isRunning && !screenUpdated && performance.now() - start < 20) {
screenUpdated ||= this.doLoop(iterations);
}

if (this.cycleCount < 10000000 && !this.rttFoundBlock) {
Expand Down Expand Up @@ -558,10 +551,6 @@ async function handleMessage(msg: MessageToWorkerType) {
emulator.restoreFS(data);
break;

case "turboMode":
emulator.turboMode = data;
break;

case "reset":
emulator.reset();
break;
Expand Down

0 comments on commit d7c1f95

Please sign in to comment.