diff --git a/images/archon-ii.png b/images/archon-ii.png
new file mode 100644
index 0000000..99d4926
Binary files /dev/null and b/images/archon-ii.png differ
diff --git a/images/archon.png b/images/archon.png
new file mode 100644
index 0000000..40e09cc
Binary files /dev/null and b/images/archon.png differ
diff --git a/images/lode-runner.png b/images/lode-runner.png
new file mode 100644
index 0000000..17eb0e6
Binary files /dev/null and b/images/lode-runner.png differ
diff --git a/images/marty-reader.png b/images/marty-reader.png
new file mode 100644
index 0000000..687da3e
Binary files /dev/null and b/images/marty-reader.png differ
diff --git a/index.html b/index.html
index c4b643c..159c5fa 100644
--- a/index.html
+++ b/index.html
@@ -30,6 +30,17 @@
@@ -153,12 +164,12 @@
config.videoSaturation = Number(document.getElementById('videoSaturation').value);
config.videoHue = Number(document.getElementById('videoHue').value);
config.videoCenter = new screenEmu.Point(
- Number(document.getElementById('videoHorizontalCenter').value),
- Number(document.getElementById('videoVerticalCenter').value)
+ Number(document.getElementById('videoHorizontalCenter').value),
+ Number(document.getElementById('videoVerticalCenter').value)
);
config.videoSize = new screenEmu.Size(
- Number(document.getElementById('videoHorizontalSize').value),
- Number(document.getElementById('videoVerticalSize').value)
+ Number(document.getElementById('videoHorizontalSize').value),
+ Number(document.getElementById('videoVerticalSize').value)
);
config.videoBandwidth = Number(document.getElementById('videoBandwidth').value);
config.videoLumaBandwidth = Number(document.getElementById('videoLumaBandwidth').value);
@@ -175,20 +186,40 @@
}
async function setupScreenView() {
- const image = await screenEmu.loadImage("images/airheart-560x192.png");
- // const image = await screenEmu.loadImage("images/battle-chess.png");
- const [imageCanvas, imageData] = screenEmu.screenData(image, screenEmu.C.NTSC_DETAILS);
+ const images = [
+ ["images/airheart-560x192.png", "Airheart", true ],
+ ["images/battle-chess.png", "Battle Chess", true ],
+ ["images/archon.png", "Archon", false],
+ ["images/archon-ii.png", "Archon II", true ],
+ ["images/lode-runner.png", "Lode Runner", true ],
+ ["images/marty-reader.png", "Marty's Family Reader", true ],
+ ];
+
+ const image1 = await screenEmu.loadImage("images/airheart-560x192.png");
+ const image2 = await screenEmu.loadImage("images/battle-chess.png");
+ const image3 = await screenEmu.loadImage("images/archon.png");
+ const image4 = await screenEmu.loadImage("images/archon-ii.png");
+ const image5 = await screenEmu.loadImage("images/lode-runner.png");
+ const image6 = await screenEmu.loadImage("images/marty-reader.png");
+
+ const imsel = document.getElementById('input-image');
+
+ for (let i = 0; i < images.length; i++) {
+ const image = await screenEmu.loadImage(images[i][0]);
+ images[i].push(image);
+ const option = document.createElement("option");
+ option.text = images[i][1];
+ option.value = i;
+ imsel.appendChild(option);
+ }
let canvas = document.getElementById("d");
let sv = new screenEmu.ScreenView(canvas);
await sv.initOpenGL();
- let imageInfo = new screenEmu.ImageInfo(imageData);
let displayConfig = new screenEmu.DisplayConfiguration();
displayConfig.displayResolution = new screenEmu.Size(d.width, d.height);
- sv.image = imageInfo;
sv.displayConfiguration = displayConfig;
- sv.vsync();
update = () => {
updateDisplayConfig(displayConfig);
@@ -200,10 +231,30 @@
elem.onchange = update;
}
+ updateImage = () => {
+ const index = Number(imsel.value);
+ const [imageCanvas, imageData] = screenEmu.screenData(images[index][3],
+ screenEmu.C.NTSC_DETAILS,
+ images[index][2]);
+ let imageInfo = new screenEmu.ImageInfo(imageData);
+ sv.image = imageInfo;
+ sv.vsync();
+ }
+
+ updateImage();
+ imsel.onchange = updateImage;
+
+ document.getElementById('reset').onclick = () => {
+ setTimeout(() => {
+ update();
+ updateImage();
+ }, 0);
+ }
+
// sv.freeOpenGL();
}
- setupScreenView().then(() => console.log('setupScreenView: success'));
+ setupScreenView();