From 84e61c29a4176b464beaee2f5a2384600f76c30d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com>
Date: Mon, 1 May 2023 00:28:21 +0100
Subject: [PATCH] chore: web support for multiple engines Including CGB and
 DMG.

---
 frontends/web/ts/gb.ts | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/frontends/web/ts/gb.ts b/frontends/web/ts/gb.ts
index 9de4879c..c734938d 100644
--- a/frontends/web/ts/gb.ts
+++ b/frontends/web/ts/gb.ts
@@ -357,7 +357,7 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
      * the emulator engine to use.
      */
     async boot({
-        engine = "neo",
+        engine = "cgb",
         restore = true,
         loadRom = false,
         romPath = ROM_PATH,
@@ -390,9 +390,12 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
         // selects the proper engine for execution
         // and builds a new instance of it
         switch (engine) {
-            case "neo":
+            case "cgb":
                 this.gameBoy = new GameBoy(GameBoyMode.Cgb);
                 break;
+            case "dmg":
+                this.gameBoy = new GameBoy(GameBoyMode.Dmg);
+                break;
             default:
                 if (!this.gameBoy) {
                     throw new Error("No engine requested");
@@ -534,11 +537,11 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
     }
 
     get engines(): string[] {
-        return ["neo"];
+        return ["cgb", "dmg"];
     }
 
     get engine(): string {
-        return this._engine || "neo";
+        return this._engine || "cgb";
     }
 
     get romExts(): string[] {
-- 
GitLab