Skip to content

Commit

Permalink
Added midline-effects option
Browse files Browse the repository at this point in the history
This should address this issue:
X16Community#287
  • Loading branch information
JimmyDansbo committed Oct 8, 2024
1 parent a04e3ed commit 7334f8a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,21 +199,21 @@ The following options are available for the WebEmulator. With the exception of m
* `longpwron`
* `widescreen`
* `capture`
* `midlineeffects`

#### The Address Line
`manifest` tells the emulator what should be loaded as a startup program. If the file is a .bas or .prg, the emulator will load it and try to execute it. If the file is a .zip, the WebEmulator will get access to all the files inside that zip-file. When using a zip-file you may add a manifest file to provide additional information - See section below for more information on `manifest.json`

On the Commander X16 forums, a link to the webemulator could look something like this:
https://cx16forum.org/webemu/x16emu.html?manifest=/forum/download/file.php?id=1218&ram=2048&cpu=c816&mhz=10&keymap=da&widescreen&capture&longpwron
https://cx16forum.org/webemu/x16emu.html?manifest=/forum/download/file.php?id=1218&ram=2048&cpu=c816&mhz=10&keymap=da&widescreen&capture
This will load the forum file with id 1218 into the emulator.
Give the emulator 2MB of RAM
Set the CPU type to 65C816
Set the CPU speed at 10 MHz
Set the keyboard layout to Danish
Show the emulator in widescreen mode
Capture the mouse and keyboard input
Start the emulator in RAM diagnostics mode
The last 3 options do not have any values, it is enough to have them on the address line to enable the feature.
Capture the mouse and keyboard input
The options `longpwron`, `widescreen`, `capture` & `midlineeffects` do not have any values, it is enough to have them on the address line to enable the feature.

#### The manifest.json File
If an application requires more than a single file to function, for example graphics or audio assets, it is necessary to package the needed files in a zip file. If there are more than one start file (BAS or PRG) the `manifest.json` file can be used to specify the default start file with `start_prg` or `start_bas` otherwise the WebEmulator will start the .prg or .bas it finds in the zip file.
Expand All @@ -233,6 +233,7 @@ Here is an example of the optional `manifest.json` file
"widescreen": true,
"capture": true,
"longpwron": false,
"midlineeffects": false,
"start_prg": "MYPROG.PRG",
"resources": [
"MYPROG.PRG",
Expand Down
8 changes: 8 additions & 0 deletions webassembly/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ var lang_val = url.searchParams.get("keymap");
var diag = url.searchParams.get("longpwron");
var wide = url.searchParams.get("widescreen");
var capture = url.searchParams.get("capture");
var midline = url.searchParams.get("midlineeffects");

var emuArguments = ['-keymap', lang, '-rtc'];

Expand All @@ -103,6 +104,9 @@ if (wide != null) {
if (capture != null) {
emuArguments.push('-capture');
}
if (midline != null) {
emuArguments.push('-midline-effects');
}

if (manifest_link) {
openFs();
Expand Down Expand Up @@ -356,6 +360,10 @@ function extractManifestFromBuffer(zip) {
console.log('Found capture variable');
emuArguments.push('-capture');
}
if (manifestObject.midlineeffects) {
console.log('Found midlineeffects variable');
emuArguments.push('-midline-effects');
}

const promises = [];
if (manifestObject.resources) {
Expand Down

0 comments on commit 7334f8a

Please sign in to comment.