Controllers: four pads that say what is held
The console says WHICH KEY WENT DOWN, which is the right shape for typing and the wrong one for playing. A game wants to know what is being held, this frame, possibly several things at once, and a stream of presses cannot say that: a key that is down and staying down sends nothing at all. Lunar Porter's thrust is a burn per press for exactly that reason. So a pad is its own device on ports 0x60 to 0x6F, reporting a LEVEL. One read gives every button at once, holding is the natural thing to express, two directions together cost nothing, and reading does not consume it - a game may ask twice in a frame and be told the same thing both times. Four of them, because a party is four. They cost a port each and nothing at all when unused. The directions are the low nibble so "which way" is an AND with 0x0F; the buttons are the high nibble for the same reason. 0x64 says which are really there, so a game can ask for a controller rather than sitting silent while somebody presses things at it. They never interrupt: a game polls once a frame because that is when it draws. KEY-UP ON THE CONSOLE WAS THE OTHER WAY TO DO THIS AND WAS REJECTED. A terminal hands over characters and can never report a key coming up however it is asked, so it would have been a thing that worked behind a window and silently did not down a wire. A separate device can honestly say it is not there. Voyager drives pad nought from the keyboard as well as from any real controller, OR-ed rather than chosen between, so a game written for a pad is playable on a machine with none and unplugging one mid-game does not leave somebody holding nothing. And a recorded path, which is what makes any of it testable: --pad names a file of one byte a frame, and the manifest has an eighth column for it. A BYTE A FRAME AND NOT A BYTE A READ - a level asked twice in one frame has to answer the same both times, and a file that advanced per read would depend on how the program happened to be written. Voyager's own tests run headless with nobody holding anything, so without this the device would be exercised only by somebody playing: the state the console's line editing was in when it broke twice in two days. 0x50 is the timer, not free. The block this went in was chosen after looking rather than before. 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
88ecb208f4
commit
fed1453e6e
+16
-1
@@ -101,7 +101,7 @@ from `make`, not from here.
|
||||
### 1. Recorded output
|
||||
|
||||
`Tests/run.sh` assembles each program named in `Tests/manifest`, runs it, and compares
|
||||
everything it printed against a file in `Tests/expected`. 206 tests, of which 144 run, 35
|
||||
everything it printed against a file in `Tests/expected`. 207 tests, of which 145 run, 35
|
||||
only assemble, 16 are expected to fail to assemble, and 11 boot from ROM with no image
|
||||
given at all.
|
||||
|
||||
@@ -404,6 +404,21 @@ A keyboard file installs the same hook a window does, so the same path runs. It
|
||||
test the window: Voyager's own key queue is still out of reach, and so is anything about
|
||||
presenting frames. It tests the console, which is where the logic is.
|
||||
|
||||
**pad** names a file in `Tests/input` to be held on a controller, one byte a frame, each
|
||||
byte the buttons held during it. It exists for the same reason as **keys** and matters more:
|
||||
a pad reports what is *held*, and a suite has no hands.
|
||||
|
||||
**A byte a frame, not a byte a read.** A pad is a level, so a game that asks twice in one
|
||||
frame has to be told the same thing both times, and a file that advanced per read would
|
||||
answer differently depending on how the program happened to be written. The frame is the
|
||||
machine's own, so a recording plays back the same over the same cycles however fast the host
|
||||
ran.
|
||||
|
||||
It is also the only way this device is reachable at all. Voyager reads a real controller and
|
||||
its own tests run `--headless`, with no window and nobody holding anything - so without a
|
||||
recorded path a pad would be exercised only by somebody playing, which is exactly the state
|
||||
the console's line editing was in when it broke twice in two days.
|
||||
|
||||
## Fixture Disks:
|
||||
|
||||
`Tests/makedisks.sh` builds 27 images with SplitDisk before anything runs, into
|
||||
|
||||
Reference in New Issue
Block a user