diff --git a/README.md b/README.md index 7f16a2b..776eebf 100644 --- a/README.md +++ b/README.md @@ -47,16 +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. +**Control, Alt and Delete is the reset button.** On real hardware it is not a key at all - a +Voyager has a button on the case, and what a window has instead of a case is a gesture. Two +things follow from that. It must not be a key software might want, because a machine with a +keyboard has function keys and something will eventually have a use for them. And it must not +be reachable by accident, because restarting throws away everything in memory and a single +key that does that sits one mistake away from losing work. + +It does exactly what writing to the machine port does: the machine starts the way it started, +so 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. +gesture 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 diff --git a/Source/Emulator/voyager.c b/Source/Emulator/voyager.c index 5eedbbd..5e7309a 100644 --- a/Source/Emulator/voyager.c +++ b/Source/Emulator/voyager.c @@ -128,19 +128,32 @@ static void drainKeyboard(void) { // ---- The reset button ---- // -// F12, because 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. What it does is -// exactly what writing MACHINE_RESET does - the machine starts the way it started, which -// means the boot chain runs again and finds whatever the disk now says to run. +// ON REAL HARDWARE THIS IS NOT A KEY AT ALL. A Voyager has a button on the case, and what a +// window has instead of a case is a gesture. So the gesture wants two properties a single +// key does not have. // -// 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 away from the system coming back - and nobody has to close the window and -// open it again to get there. +// It must not be a key SOFTWARE MIGHT WANT. A machine with a keyboard has function keys on +// it, and something will eventually have a use for F12 - which is where this was, and which +// would have meant taking it away again later. +// +// And it must not be reachable BY ACCIDENT. Restarting the machine throws away everything in +// memory, and a single key that does that sits one mistake away from losing work. Three keys +// together are not pressed by mistake. +// +// Control, Alt and Delete, which has meant this since 1981 and is the one gesture nobody has +// to be told the meaning of. +// +// What it does is what writing MACHINE_RESET does: the machine starts the way it started, so +// 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 gesture from +// the system coming back, rather than closing the window and opening it again. static int resetPending = 0; static void checkResetButton(void) { - if (IsKeyPressed(KEY_F12)) { + const int control = IsKeyDown(KEY_LEFT_CONTROL) || IsKeyDown(KEY_RIGHT_CONTROL); + const int alt = IsKeyDown(KEY_LEFT_ALT) || IsKeyDown(KEY_RIGHT_ALT); + if (control && alt && IsKeyPressed(KEY_DELETE)) { requestReset(); // Remembered as well as asked for, so that a machine waiting on a key can be woken // to go and notice it. See voyagerKey.