z zooms too, so a keyboard is not shut out of it

B was the only way to swap the view, and the game is meant to be flyable
without a controller - the arrows fly it when there is no pad. Somebody
without one had no way to zoom at all.

Tested ABOVE the pad test rather than beside the arrows, and that is the
distinction: which way the lander is flown is a question a controller
answers better, so the arrows stand aside for one. How much of the moon
is on the screen is not that kind of question, and a player with a pad
may still have a keyboard in front of them.

No edge to remember here either. The console delivers a key ONCE, which
is the whole difference between a key and a held button.

The check puts the z forty bytes into the keyboard file, because the
console hands over one key a frame: a z two hundred bytes in is a z two
hundred frames away, which is past the end of the capture and reads
exactly like a key that does nothing. It cost a wrong answer first time.
This commit is contained in:
Anachronaut
2026-09-03 21:54:12 -04:00
parent a02d701efe
commit 437ddf8ebe
13 changed files with 51 additions and 11 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ Mode.sbx 48
Flip.sbx 173
Sprite.sbx 442
Depth.sbx 672
Lander.sbx 5291
Lander.sbx 5304
Pad.sbx 264
Crash.sbx 632
vars.script 50
+1 -1
View File
@@ -15,7 +15,7 @@ Mode.sbx 48
Flip.sbx 173
Sprite.sbx 442
Depth.sbx 672
Lander.sbx 5291
Lander.sbx 5304
Pad.sbx 264
Crash.sbx 632
vars.script 50
+1 -1
View File
@@ -32,7 +32,7 @@ Mode.sbx 48
Flip.sbx 173
Sprite.sbx 442
Depth.sbx 672
Lander.sbx 5291
Lander.sbx 5304
Pad.sbx 264
Crash.sbx 632
vars.script 50
+1 -1
View File
@@ -22,7 +22,7 @@ Mode.sbx 48
Flip.sbx 173
Sprite.sbx 442
Depth.sbx 672
Lander.sbx 5291
Lander.sbx 5304
Pad.sbx 264
Crash.sbx 632
vars.script 50
+1 -1
View File
@@ -22,7 +22,7 @@ Mode.sbx 48
Flip.sbx 173
Sprite.sbx 442
Depth.sbx 672
Lander.sbx 5291
Lander.sbx 5304
Pad.sbx 264
Crash.sbx 632
vars.script 50
+1 -1
View File
@@ -108,7 +108,7 @@ Mode.sbx 48
Flip.sbx 173
Sprite.sbx 442
Depth.sbx 672
Lander.sbx 5291
Lander.sbx 5304
Pad.sbx 264
Crash.sbx 632
vars.script 50
+1 -1
View File
@@ -27,7 +27,7 @@ Mode.sbx 48
Flip.sbx 173
Sprite.sbx 442
Depth.sbx 672
Lander.sbx 5291
Lander.sbx 5304
Pad.sbx 264
Crash.sbx 632
vars.script 50
+1 -1
View File
@@ -15,7 +15,7 @@ Mode.sbx 48
Flip.sbx 173
Sprite.sbx 442
Depth.sbx 672
Lander.sbx 5291
Lander.sbx 5304
Pad.sbx 264
Crash.sbx 632
vars.script 50
+1 -1
View File
@@ -13,7 +13,7 @@ Mode.sbx 48
Flip.sbx 173
Sprite.sbx 442
Depth.sbx 672
Lander.sbx 5291
Lander.sbx 5304
Pad.sbx 264
Crash.sbx 632
vars.script 50
+1 -1
View File
@@ -22,7 +22,7 @@ Mode.sbx 48
Flip.sbx 173
Sprite.sbx 442
Depth.sbx 672
Lander.sbx 5291
Lander.sbx 5304
Pad.sbx 264
Crash.sbx 632
vars.script 50
+20
View File
@@ -2093,6 +2093,26 @@ EOT
# One press is one swap. A level triggered one would flip every frame and redraw the moon
# every frame with it, which costs about a frame and a half each time: the lander would be
# somewhere else entirely by now.
# ---- And z does it from a keyboard, with no controller plugged in at all ----
#
# The zoom key is tested ABOVE the pad test in the program, unlike the arrows: which way the
# lander is flown is a question a controller answers better, but how much of the moon is on
# the screen is not, and somebody without a pad would otherwise have no way to zoom at all.
#
# Forty zeroes before the z, because the console hands over ONE KEY A FRAME - a z two hundred
# bytes in is a z two hundred frames away, which is past the end of this capture and reads
# exactly like a key that does nothing.
python3 -c "open('$BUILD/zoom.keys','wb').write(b'Lander\n' + b'\x00' * 40 + b'z' + b'\x00' * 8000)"
timeout 60 "$EMU" --fast --cycles 2200000 --keyboard "$BUILD/zoom.keys" \
--screen "$BUILD/zoomkey.ppm" --disk "$ROOT/Tests/build/disks/cosmos.img" \
--ram-disk 2048 "$BUILD/cosmos.bin" > "$BUILD/zoomkey.out" 2>&1 || true
KEYED="$(python3 -c "
d = open('$BUILD/zoomkey.ppm', 'rb').read()
print(int(d[:40].split()[1]))
" 2>/dev/null || echo 0)"
[ "$KEYED" = "640" ] \
&& result ok "and z does it from the keyboard" "no controller, and the view still swapped" \
|| result no "and z does it from the keyboard" "$KEYED across"
[ "$TAPY" = "$HELDY" ] && [ "$HELD" = "640" ] \
&& result ok "and holding it swaps once, not sixty times a second" "held lands where tapped did" \
|| result no "and holding it swaps once, not sixty times a second" "tapped $TAPY, held $HELDY at $HELD across"