diff --git a/TECHNICAL.md b/TECHNICAL.md index ec03c6c2..2a083665 100644 --- a/TECHNICAL.md +++ b/TECHNICAL.md @@ -39,11 +39,11 @@ copy of the rom (which it loads from examples/1943.zip). null, new MAMELoader(MAMELoader.driver("1943"), MAMELoader.nativeResolution(224, 256), + MAMELoader.scale(3), MAMELoader.emulatorJS("emulators/mess1943.js"), MAMELoader.mountFile("1943.zip", MAMELoader.fetchFile("Game File", "examples/1943.zip")))) - emulator.setScale(3); emulator.start({ waitAfterDownloading: true }); ### Console game for Atari 2600 ### @@ -58,6 +58,7 @@ keybindings needed to use the 2600. null, new MAMELoader(MAMELoader.driver("a2600"), MAMELoader.nativeResolution(352, 223), + MAMELoader.scale(3), MAMELoader.emulatorJS("emulators/messa2600.js"), MAMELoader.mountFile("Pitfall_Activision_1982.bin", MAMELoader.fetchFile("Game File", @@ -66,7 +67,7 @@ keybindings needed to use the 2600. MAMELoader.fetchFile("Config File", "examples/a2600.cfg")), MAMELoader.peripheral("cart", "Pitfall_Activision_1982.bin"))) - emulator.setScale(3).start({ waitAfterDownloading: true }); + emulator.start({ waitAfterDownloading: true }); ### DOS game ### @@ -95,6 +96,7 @@ provide their names in the right order. new SAELoader(SAELoader.model("A500"), SAELoader.fastMemory(2), SAELoader.nativeResolution(720, 568), + SAELoader.scale(2), SAELoader.emulatorJS("emulators/sae/scriptedamigaemulator.js"), SAELoader.mountFile("aros-amiga-m68k-rom.bin", SAELoader.fetchFile("Bios", @@ -107,7 +109,7 @@ provide their names in the right order. SAELoader.fetchFile("Game", "examples/Cool_Demos_17.2_1989_Razor_1911.adf")), SAELoader.floppy(0, "Cool_Demos_17.2_1989_Razor_1911"))) - emulator.setScale(3).start({ waitAfterDownloading: true }); + emulator.start({ waitAfterDownloading: true }); ## Configuration API ## diff --git a/example_amiga.html b/example_amiga.html index c1e4a218..b172b6ea 100644 --- a/example_amiga.html +++ b/example_amiga.html @@ -14,6 +14,7 @@ new SAELoader(SAELoader.model("A500"), SAELoader.fastMemory(2), SAELoader.nativeResolution(720, 568), + SAELoader.scale(2), SAELoader.emulatorJS("emulators/sae/scriptedamigaemulator.js"), SAELoader.mountFile("aros-amiga-m68k-rom.bin", SAELoader.fetchFile("Bios", @@ -26,7 +27,7 @@ SAELoader.fetchFile("Game", "examples/Cool_Demos_17.2_1989_Razor_1911.adf")), SAELoader.floppy(0, "Cool_Demos_17.2_1989_Razor_1911"))) - emulator.setScale(3).start({ waitAfterDownloading: true }); + emulator.start({ waitAfterDownloading: true }); diff --git a/example_arcade.html b/example_arcade.html index f5f10e49..30c3c600 100644 --- a/example_arcade.html +++ b/example_arcade.html @@ -32,11 +32,11 @@ null, new JSMAMELoader(JSMAMELoader.driver("targ"), JSMAMELoader.nativeResolution(256, 256), + JSMAMELoader.scale(3), JSMAMELoader.emulatorJS("emulators/jsmess/mameexidy.js"), JSMAMELoader.mountFile("targ.zip", JSMAMELoader.fetchFile("Game File", "examples/targ.zip")))) - emulator.setScale(2); emulator.start({ waitAfterDownloading: true }); diff --git a/example_computer.html b/example_computer.html index 741d4c5b..9cb7688f 100644 --- a/example_computer.html +++ b/example_computer.html @@ -47,6 +47,7 @@ null, new JSMESSLoader(JSMESSLoader.driver("apple2e"), JSMESSLoader.nativeResolution(560, 384), + JSMESSLoader.scale(2), JSMESSLoader.emulatorJS("emulators/jsmess/messnapple2e.js"), JSMESSLoader.mountFile("apple2e.zip", JSMESSLoader.fetchFile("Bios", @@ -59,7 +60,7 @@ "examples/apple2e.cfg")), JSMESSLoader.peripheral("flop1", "Beagle_Bag_1982_Beagle_Bros.do"), JSMESSLoader.extraArgs(["-sl6", "diskii", "-sl4", '""']))) - emulator.setScale(3).start({ waitAfterDownloading: true }); + emulator.start({ waitAfterDownloading: true }); diff --git a/example_console.html b/example_console.html index 794edfb5..f83f68f6 100644 --- a/example_console.html +++ b/example_console.html @@ -30,6 +30,7 @@ null, new JSMESSLoader(JSMESSLoader.driver("a2600"), JSMESSLoader.nativeResolution(352, 223), + JSMAMELoader.scale(3), JSMESSLoader.emulatorJS("emulators/jsmess/messa2600.js"), JSMESSLoader.mountFile("atari_2600_halo_2600.bin", JSMESSLoader.fetchFile("Game File", @@ -38,7 +39,7 @@ JSMESSLoader.fetchFile("Config File", "examples/a2600.cfg")), JSMESSLoader.peripheral("cart", "atari_2600_halo_2600.bin"))) - emulator.setScale(3).start({ waitAfterDownloading: true }); + emulator.start({ waitAfterDownloading: true }); diff --git a/example_ia.html b/example_ia.html index 3e1021cb..b4076944 100644 --- a/example_ia.html +++ b/example_ia.html @@ -11,7 +11,6 @@ diff --git a/example_macplus.html b/example_macplus.html index 6238595b..719279a4 100644 --- a/example_macplus.html +++ b/example_macplus.html @@ -13,6 +13,7 @@ null, new PCELoader(PCELoader.model("macclassic"), PCELoader.nativeResolution(512, 342), + PCELoader.scale(2), PCELoader.mountFile("pce-mac-classic.rom", PCELoader.fetchFile("ROM 1/2", "examples/pce/pce-mac-classic.rom")), @@ -29,7 +30,6 @@ PCELoader.fetchFile("PCE Config", "examples/pce/pce-macclassic.cfg")), PCELoader.emulatorJS("emulators/pce/pce-macplus.js"))) - emulator.setScale(2); emulator.start({ waitAfterDownloading: true }); diff --git a/example_minivmac.html b/example_minivmac.html index e26690f7..6027ef58 100644 --- a/example_minivmac.html +++ b/example_minivmac.html @@ -44,6 +44,7 @@ var emulator = new Emulator(document.querySelector("#canvas"), null, new NP2Loader(NP2Loader.nativeResolution(512, 342), + NP2Loader.scale(2), NP2Loader.emulatorJS("emulators/minivmac.js"), NP2Loader.emulatorWASM("emulators/minivmac.wasm"), NP2Loader.mountZip("minivmac", @@ -54,7 +55,7 @@ "examples/test7.dsk")), NP2Loader.extraArgs(["/emulator/test7.dsk"]), )); - emulator.setScale(3).start({ waitAfterDownloading: true }); + emulator.start({ waitAfterDownloading: true }); diff --git a/example_minivmacii.html b/example_minivmacii.html index 3e5213c1..6d12a344 100644 --- a/example_minivmacii.html +++ b/example_minivmacii.html @@ -44,6 +44,7 @@ var emulator = new Emulator(document.querySelector("#canvas"), null, new NP2Loader(NP2Loader.nativeResolution(640, 480), + NP2Loader.scale(2), NP2Loader.emulatorJS("emulators/minivmacII.js"), NP2Loader.emulatorWASM("emulators/minivmacII.wasm"), NP2Loader.mountZip("minivmac", @@ -54,7 +55,7 @@ "examples/test7.dsk")), NP2Loader.extraArgs(["/emulator/test7.dsk"]), )); - emulator.setScale(3).start({ waitAfterDownloading: true }); + emulator.start({ waitAfterDownloading: true }); diff --git a/example_np2.html b/example_np2.html index 5f68035e..cc2cb9b4 100644 --- a/example_np2.html +++ b/example_np2.html @@ -46,6 +46,7 @@ var emulator = new Emulator(document.querySelector("#canvas"), null, new NP2Loader(NP2Loader.nativeResolution(640, 400), + NP2Loader.scale(2), NP2Loader.emulatorJS("emulators/np2-386.js"), NP2Loader.emulatorWASM("emulators/np2-386.wasm"), NP2Loader.mountZip("np2", @@ -58,7 +59,7 @@ NP2Loader.fetchFile("Configuration file", "examples/np2/np2.cfg")), )); - emulator.setScale(3).start({ waitAfterDownloading: true }); + emulator.start({ waitAfterDownloading: true }); diff --git a/example_xmil.html b/example_xmil.html index 6999c009..3c2e60ba 100644 --- a/example_xmil.html +++ b/example_xmil.html @@ -43,6 +43,7 @@ var emulator = new Emulator(document.querySelector("#canvas"), null, new NP2Loader(NP2Loader.nativeResolution(320, 200), + NP2Loader.scale(3), NP2Loader.emulatorJS("emulators/xmil.js"), NP2Loader.emulatorWASM("emulators/xmil.wasm"), NP2Loader.mountZip("xmil-em", @@ -53,7 +54,6 @@ "examples/np2/Gradius.2d")), NP2Loader.extraArgs(["/emulator/Gradius.2d"]), )); - emulator.setScale(3).start({ waitAfterDownloading: true }); diff --git a/loader.js b/loader.js index 4a4cae5f..b0ffa21b 100644 --- a/loader.js +++ b/loader.js @@ -94,8 +94,7 @@ var Module = null; }()); var metadata, filelist, module, modulecfg, config_args, emulator_logo, - emulator = new Emulator(canvas).setScale(scale) - .setSplashImage(images.ia) + emulator = new Emulator(canvas).setSplashImage(images.ia) .setLoad(loadFiles) .setCallbacks(callbacks); @@ -199,7 +198,7 @@ var Module = null; cfgr.fileSystemKey(game), cfgr.nativeResolution(nr[0], nr[1]), cfgr.aspectRatio(nr[0] / nr[1]), - cfgr.scale(scale), + cfgr.scale(scale || modulecfg.scale || 2), cfgr.sampleRate(SAMPLE_RATE)]; if ('keepAspect' in cfgr) { @@ -1290,7 +1289,7 @@ var Module = null; document.getElementById("gofullscreen").addEventListener("click", this.requestFullScreen); } - var css_resolution, scale, aspectRatio; + var css_resolution, aspectRatio; // right off the bat we set the canvas's inner dimensions to // whatever it's current css dimensions are; this isn't likely to be // the same size that dosbox/jsmame will set it to, but it avoids @@ -1302,7 +1301,7 @@ var Module = null; } this.setScale = function(_scale) { - scale = _scale; + console.warn("setScale method is deprecated; use the BaseLoader.scale method instead"); return this; }; @@ -1568,7 +1567,7 @@ var Module = null; function setup_runner() { var runner = new game_data.runner(canvas, game_data); - resizeCanvas(canvas, scale, game_data.nativeResolution, game_data.aspectRatio); + resizeCanvas(canvas, game_data.scale, game_data.nativeResolution, game_data.aspectRatio); runner.onStarted(function () { splash.finished_loading = true; splash.hide();