From afc2d3de6d330563ced9a58540ca0e3cbc76d27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= Date: Mon, 15 Jul 2024 22:22:40 +0100 Subject: [PATCH] chore: support for tuning display frequency --- frontends/web/ts/gb.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontends/web/ts/gb.ts b/frontends/web/ts/gb.ts index 1c6bc14d..0ce4696e 100644 --- a/frontends/web/ts/gb.ts +++ b/frontends/web/ts/gb.ts @@ -455,6 +455,7 @@ export class GameboyEmulator extends EmulatorLogic implements Emulator { ...(this.extraSettings?.debug ?? false ? [ Feature.LoopMode, + Feature.DisplayFrequency, Feature.BootRomInfo, Feature.RomTypeInfo, Feature.Cyclerate, @@ -592,6 +593,16 @@ export class GameboyEmulator extends EmulatorLogic implements Emulator { this.trigger("frequency", value); } + get displayFrequency(): number { + return this.visualFrequency; + } + + set displayFrequency(value: number) { + value = Math.max(value, 0); + this.visualFrequency = value; + this.trigger("display-frequency", value); + } + get frequencySpecs(): FrequencySpecs { return { unit: Frequency.MHz,