Skip to content

Commit 0abfd82

Browse files
committed
Add web demo instructions, clean up confusing inputs in streamer rom
1 parent 04e6f46 commit 0abfd82

File tree

2 files changed

+37
-8
lines changed

2 files changed

+37
-8
lines changed

emulator-patches/web-demo.html

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,30 @@
3838
background: black;
3939
}
4040

41-
#clickToStart {
41+
#clickToStart, #instructions {
4242
background: black;
4343
color: white;
4444
border: none;
4545

4646
font-family: "Kode Mono";
4747
font-optical-sizing: auto;
4848
font-weight: bold;
49-
font-style: italic;
5049

5150
font-size: calc(min(6vw, 20vh));
5251
display: block;
5352
margin: auto;
53+
margin-top: 1em;
54+
}
55+
56+
#clickToStart {
57+
border: 1px white solid;
58+
padding: 0.5em;
59+
font-style: italic;
60+
}
61+
62+
#instructions {
63+
font-size: calc(min(5vw, 16vh));
64+
padding: 1em;
5465
}
5566

5667
</style>
@@ -65,6 +76,14 @@
6576
async function main() {
6677
// Change the click-to-start label to a loading indicator.
6778
clickToStart.innerText = 'Loading...'
79+
clickToStart.disabled = true;
80+
81+
// We haven't finished loading JS, try again in 1s.
82+
if (!window.Nostalgist) {
83+
console.log('Waiting for Nostalgist...');
84+
setTimeout(main, 1000);
85+
return;
86+
}
6887

6988
// Launch the emulator, which will create its own canvas.
7089
const nostalgist = await Nostalgist.launch({
@@ -75,8 +94,9 @@
7594
},
7695
rom: 'kinetoscope-streamer.rom',
7796
onLaunch: () => {
78-
// Once loaded, hide the click-to-start button.
97+
// Once loaded, hide the click-to-start button and instructions.
7998
clickToStart.style.display = 'none';
99+
instructions.style.display = 'none';
80100
},
81101
});
82102

@@ -108,6 +128,15 @@
108128
</script>
109129

110130
<body>
111-
<button id="clickToStart" onclick="main()">Click to start<br>Kinetoscope Emulator</button>
131+
<button id="clickToStart" onclick="main()">Click here to start<br>Kinetoscope Emulator</button>
132+
<div id="instructions">
133+
<ul>
134+
<li>up: ↑ / swipe up</li>
135+
<li>down: ↓ / swipe down</li>
136+
<li>start: enter / tap</li>
137+
<li>pause: enter / tap</li>
138+
<li>stop: X / swipe left</li>
139+
</ul>
140+
</div>
112141
</body>
113142
</html>

software/stream-with-special-hardware/src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
static void onJoystickEvent(u16 joystick, u16 changed, u16 state) {
1717
if (segavideo_getState() == Error) {
18-
// Error: press start|A|B|C to continue.
19-
if (state & (BUTTON_START | BUTTON_A | BUTTON_B | BUTTON_C)) {
18+
// Error: press start|A to continue.
19+
if (state & (BUTTON_START | BUTTON_A)) {
2020
segavideo_menu_clearError();
2121
}
2222
} else if (segavideo_getState() == Player) {
@@ -28,8 +28,8 @@ static void onJoystickEvent(u16 joystick, u16 changed, u16 state) {
2828
segavideo_stop();
2929
}
3030
} else if (segavideo_getState() == Menu) {
31-
// Menu: press start|A|B|C to choose, up/down to navigate.
32-
if (state & (BUTTON_START | BUTTON_A | BUTTON_B | BUTTON_C)) {
31+
// Menu: press start|A to choose, up/down to navigate.
32+
if (state & (BUTTON_START | BUTTON_A)) {
3333
segavideo_menu_select(/* loop= */ false);
3434
}
3535
if (state & BUTTON_UP) {

0 commit comments

Comments
 (0)