diff --git a/README.md b/README.md index fea8a40..4652136 100644 --- a/README.md +++ b/README.md @@ -35,13 +35,16 @@ of a config. Loads the emulator for the arcade game 1943, and gives it a compressed copy of the rom (which it loads from examples/1943.zip). - var emulator = new Emulator(document.querySelector("#canvas"), - null, - new JSMAMELoader(JSMAMELoader.driver("1943"), - JSMAMELoader.emulatorJS("emulators/mess1943.js"), - JSMAMELoader.mountFile("1943.zip", - JSMAMELoader.fetchFile("Game File", - "examples/1943.zip")))) + var emulator = new Emulator(document.querySelector("#canvas"), + null, + new JSMAMELoader(JSMAMELoader.driver("1943"), + JSMAMELoader.nativeResolution(224, 256), + JSMAMELoader.emulatorJS("emulators/mess1943.js"), + JSMAMELoader.mountFile("1943.zip", + JSMAMELoader.fetchFile("Game File", + "examples/1943.zip")))) + emulator.setScale(3); + emulator.start({ waitAfterDownloading: true }); ### Console game for Atari 2600 ### @@ -51,17 +54,19 @@ a file, then set up a "cart" peripheral so that the emulator can find it. We also load a configuration file that preconfigures some keybindings needed to use the 2600. - var emulator = new Emulator(document.querySelector("#canvas"), - null, - new JSMESSLoader(JSMESSLoader.driver("a2600"), - JSMESSLoader.emulatorJS("emulators/messa2600.js"), - JSMESSLoader.mountFile("Pitfall_Activision_1982.bin", - JSMESSLoader.fetchFile("Game File", - "examples/Pitfall_Activision_1982.bin")), - JSMESSLoader.mountFile("a2600.cfg", - JSMESSLoader.fetchFile("Config File", - "emulators/a2600.cfg")), - JSMESSLoader.peripheral("cart", "Pitfall_Activision_1982.bin"))) + var emulator = new Emulator(document.querySelector("#canvas"), + null, + new JSMESSLoader(JSMESSLoader.driver("a2600"), + JSMESSLoader.nativeResolution(352, 223), + JSMESSLoader.emulatorJS("emulators/messa2600.js"), + JSMESSLoader.mountFile("Pitfall_Activision_1982.bin", + JSMESSLoader.fetchFile("Game File", + "examples/Pitfall_Activision_1982.bin")), + JSMESSLoader.mountFile("a2600.cfg", + JSMESSLoader.fetchFile("Config File", + "examples/a2600.cfg")), + JSMESSLoader.peripheral("cart", "Pitfall_Activision_1982.bin"))) + emulator.setScale(3).start({ waitAfterDownloading: true }); ### DOS game ### @@ -69,13 +74,16 @@ Here we load the dosbox emulator, and a zip file containing the game ZZT which we decompress and then mount as the C drive. We also tell DosBox to immediately start running zzt.exe, which is inside the zip. - var emulator = new Emulator(document.querySelector("#canvas"), - null, - new DosBoxLoader(DosBoxLoader.emulatorJS("emulators/dosbox.js"), - DosBoxLoader.mountZip("c", - DosBoxLoader.fetchFile("Game File", - "examples/Zzt_1991_Epic_Megagames_Inc.zip")), - DosBoxLoader.startExe("zzt.exe"))) + var emulator = new Emulator(document.querySelector("#canvas"), + null, + new DosBoxLoader(DosBoxLoader.emulatorJS("emulators/dosbox.js"), + DosBoxLoader.nativeResolution(640, 400), + DosBoxLoader.mountZip("c", + DosBoxLoader.fetchFile("Game File", + "examples/Zzt_1991_Epic_Megagames_Inc.zip")), + DosBoxLoader.startExe("zzt.exe"))) + emulator.start({ waitAfterDownloading: true }); + ## Configuration API ## Currently there are two supported emulators, JSMESS and diff --git a/example_arcade.html b/example_arcade.html index f171036..078eb5c 100644 --- a/example_arcade.html +++ b/example_arcade.html @@ -18,7 +18,7 @@ JSMAMELoader.fetchFile("Game File", "examples/1943.zip")))) emulator.setScale(3); - emulator.start(); + emulator.start({ waitAfterDownloading: true }); diff --git a/example_console.html b/example_console.html index 86b48cf..5f03ceb 100644 --- a/example_console.html +++ b/example_console.html @@ -12,15 +12,16 @@ var emulator = new Emulator(document.querySelector("#canvas"), null, new JSMESSLoader(JSMESSLoader.driver("a2600"), + JSMESSLoader.nativeResolution(352, 223), JSMESSLoader.emulatorJS("emulators/messa2600.js"), JSMESSLoader.mountFile("Pitfall_Activision_1982.bin", JSMESSLoader.fetchFile("Game File", "examples/Pitfall_Activision_1982.bin")), JSMESSLoader.mountFile("a2600.cfg", JSMESSLoader.fetchFile("Config File", - "emulators/a2600.cfg")), + "examples/a2600.cfg")), JSMESSLoader.peripheral("cart", "Pitfall_Activision_1982.bin"))) - emulator.start(); + emulator.setScale(3).start({ waitAfterDownloading: true }); diff --git a/example_dosbox.html b/example_dosbox.html index b96e3ca..8eeb261 100644 --- a/example_dosbox.html +++ b/example_dosbox.html @@ -12,11 +12,12 @@ var emulator = new Emulator(document.querySelector("#canvas"), null, new DosBoxLoader(DosBoxLoader.emulatorJS("emulators/dosbox.js"), + DosBoxLoader.nativeResolution(640, 400), DosBoxLoader.mountZip("c", DosBoxLoader.fetchFile("Game File", "examples/Zzt_1991_Epic_Megagames_Inc.zip")), DosBoxLoader.startExe("zzt.exe"))) - emulator.start(); + emulator.start({ waitAfterDownloading: true });