Skip to content
Snippets Groups Projects
Verified Commit 84e61c29 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

chore: web support for multiple engines

Including CGB and DMG.
parent 399d03e3
No related branches found
No related tags found
1 merge request!16Support for Game Boy Color (CGB) 😎🖍️
...@@ -357,7 +357,7 @@ export class GameboyEmulator extends EmulatorBase implements Emulator { ...@@ -357,7 +357,7 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
* the emulator engine to use. * the emulator engine to use.
*/ */
async boot({ async boot({
engine = "neo", engine = "cgb",
restore = true, restore = true,
loadRom = false, loadRom = false,
romPath = ROM_PATH, romPath = ROM_PATH,
...@@ -390,9 +390,12 @@ export class GameboyEmulator extends EmulatorBase implements Emulator { ...@@ -390,9 +390,12 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
// selects the proper engine for execution // selects the proper engine for execution
// and builds a new instance of it // and builds a new instance of it
switch (engine) { switch (engine) {
case "neo": case "cgb":
this.gameBoy = new GameBoy(GameBoyMode.Cgb); this.gameBoy = new GameBoy(GameBoyMode.Cgb);
break; break;
case "dmg":
this.gameBoy = new GameBoy(GameBoyMode.Dmg);
break;
default: default:
if (!this.gameBoy) { if (!this.gameBoy) {
throw new Error("No engine requested"); throw new Error("No engine requested");
...@@ -534,11 +537,11 @@ export class GameboyEmulator extends EmulatorBase implements Emulator { ...@@ -534,11 +537,11 @@ export class GameboyEmulator extends EmulatorBase implements Emulator {
} }
get engines(): string[] { get engines(): string[] {
return ["neo"]; return ["cgb", "dmg"];
} }
get engine(): string { get engine(): string {
return this._engine || "neo"; return this._engine || "cgb";
} }
get romExts(): string[] { get romExts(): string[] {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment