From 2574ef56bcc96722c85859b58e58f57d9820330e Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Fri, 18 Oct 2024 08:55:33 -0700 Subject: [PATCH] Add web demo instructions, clean up confusing inputs in streamer rom --- emulator-patches/web-demo.html | 37 +++++++++++++++++-- .../stream-with-special-hardware/src/main.c | 8 ++-- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/emulator-patches/web-demo.html b/emulator-patches/web-demo.html index 510566a..2875a22 100644 --- a/emulator-patches/web-demo.html +++ b/emulator-patches/web-demo.html @@ -38,7 +38,7 @@ background: black; } -#clickToStart { +#clickToStart, #instructions { background: black; color: white; border: none; @@ -46,11 +46,22 @@ font-family: "Kode Mono"; font-optical-sizing: auto; font-weight: bold; - font-style: italic; font-size: calc(min(6vw, 20vh)); display: block; margin: auto; + margin-top: 1em; +} + +#clickToStart { + border: 1px white solid; + padding: 0.5em; + font-style: italic; +} + +#instructions { + font-size: calc(min(5vw, 16vh)); + margin-top: 2em; } @@ -65,6 +76,14 @@ async function main() { // Change the click-to-start label to a loading indicator. clickToStart.innerText = 'Loading...' + clickToStart.disabled = true; + + // We haven't finished loading JS, try again in 1s. + if (!window.Nostalgist) { + console.log('Waiting for Nostalgist...'); + setTimeout(main, 1000); + return; + } // Launch the emulator, which will create its own canvas. const nostalgist = await Nostalgist.launch({ @@ -75,8 +94,9 @@ }, rom: 'kinetoscope-streamer.rom', onLaunch: () => { - // Once loaded, hide the click-to-start button. + // Once loaded, hide the click-to-start button and instructions. clickToStart.style.display = 'none'; + instructions.style.display = 'none'; }, }); @@ -108,6 +128,15 @@ - + +
+ +
diff --git a/software/stream-with-special-hardware/src/main.c b/software/stream-with-special-hardware/src/main.c index 62cd369..c58dc00 100644 --- a/software/stream-with-special-hardware/src/main.c +++ b/software/stream-with-special-hardware/src/main.c @@ -15,8 +15,8 @@ static void onJoystickEvent(u16 joystick, u16 changed, u16 state) { if (segavideo_getState() == Error) { - // Error: press start|A|B|C to continue. - if (state & (BUTTON_START | BUTTON_A | BUTTON_B | BUTTON_C)) { + // Error: press start|A to continue. + if (state & (BUTTON_START | BUTTON_A)) { segavideo_menu_clearError(); } } else if (segavideo_getState() == Player) { @@ -28,8 +28,8 @@ static void onJoystickEvent(u16 joystick, u16 changed, u16 state) { segavideo_stop(); } } else if (segavideo_getState() == Menu) { - // Menu: press start|A|B|C to choose, up/down to navigate. - if (state & (BUTTON_START | BUTTON_A | BUTTON_B | BUTTON_C)) { + // Menu: press start|A to choose, up/down to navigate. + if (state & (BUTTON_START | BUTTON_A)) { segavideo_menu_select(/* loop= */ false); } if (state & BUTTON_UP) {