mirror of
https://github.com/db48x/emularity.git
synced 2026-09-14 10:32:37 +00:00
add native resolutions and waitAfterDownloading option to the examples
This commit is contained in:
@@ -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
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
JSMAMELoader.fetchFile("Game File",
|
||||
"examples/1943.zip"))))
|
||||
emulator.setScale(3);
|
||||
emulator.start();
|
||||
emulator.start({ waitAfterDownloading: true });
|
||||
</script>
|
||||
</body>
|
||||
</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 });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-1
@@ -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 });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user