Put a reset button on the case, and stop Escape closing the window
ESCAPE WAS A BUG I LEFT. This machine sends Escape to the console like any other key, and Raylib closes a window on Escape unless it is told not to - so a program reading keys could be ended by one of them, taking whatever was in memory with it. SetExitKey(KEY_NULL), and it is a byte again. F12 is the reset button. A button on the case rather than a key the machine can see: nothing sends a function key to the console, so nothing can be surprised by one. It does what writing MACHINE_RESET does, which is that the machine starts the way it started - the boot chain runs again and finds whatever the disk now says to run. Which is what makes a bare metal program escapable. Once puts a demo in front of the next start and deletes the request before jumping, so a demo that has taken the whole machine is one keypress from the system coming back, instead of closing the window and opening it again. IT HAD TO REACH A MACHINE THAT IS WAITING, and that took two more things. A reset is acted on between instructions, and a machine blocked on a key is part way through one - so the button would have set a flag that nothing ever came along to notice, in exactly the situation a reset button is for. The wait ends now: the console is told its input is over, which it is for a machine about to stop existing. And the reset puts the console's input back - nothing pushed back, no line half gathered, and not at the end of input. That was already wrong before the button existed: a reset after the input ran out left a console that had run out afterwards, so a machine could be restarted once and then never typed at again. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
13b20c8834
commit
f7657081be
@@ -47,6 +47,21 @@ The suite holds the two to being the same machine rather than taking it on trust
|
||||
the entire manifest through Voyager as well, with `--headless`, and requires it to satisfy
|
||||
every recorded result byte for byte.
|
||||
|
||||
**F12 is the reset button**, and it is a button on the case rather than a key the machine
|
||||
can see: nothing sends a function key to the console, so nothing can be surprised by one. It
|
||||
does exactly what writing to the machine port does - the machine starts the way it started,
|
||||
which means the boot chain runs again and finds whatever the disk now says to run.
|
||||
|
||||
That is what makes a bare metal program escapable. `Once` puts one in front of the next start
|
||||
and deletes the request before jumping, so a demo that has taken the whole machine is one
|
||||
keypress away from the system coming back, without closing the window and opening it again.
|
||||
It works on a machine that is stuck waiting for a key, too, which is when a reset button
|
||||
earns its keep.
|
||||
|
||||
**Escape reaches the machine.** Raylib closes a window on Escape unless it is told not to,
|
||||
and this machine sends Escape to the console like any other key - so a program reading keys
|
||||
could be ended by one of them, taking whatever was in memory with it.
|
||||
|
||||
**The screen belongs to the machine, not to the window.** The video device is a tile engine
|
||||
on ports 0x30 to 0x3F that brings its own bank of video memory, and it renders into a buffer
|
||||
that is a pure function of that memory - so the same program draws the same picture whether
|
||||
|
||||
Reference in New Issue
Block a user