Lander opens on a splash, with music

The first customer for the player outside the program it was pulled out
of, and the argument for doing it: a splash needs no resident player at
all. Nothing else is happening while the logo is up, so Lander owns the
timer and all four channels exactly as Play does. Music UNDER a running
game is still deferred, and still the harder problem.

It polls the timer rather than being interrupted by it. Lander has no
vector segment and waits for the screen by reading port 0x30, so it waits
for a beat by reading port 0x50 - the same shape, and it brings no
handler that would have to be taken away before the game starts.

The tune is read off the disk. A missing one means the logo and silence
and the game starts anyway, the way a missing /lander.state means the
defaults stand.

FOUR THINGS THIS COST, each found by running it:

A subroutine cannot answer in A. CALL saves and restores it, so splashSkip
handed its caller back the A it already had - the channel number of the
last stepVoice - and the splash ended on its first pass whatever anybody
pressed. Q is what survives a RET, which nextRandom says twenty lines
away and I did not read.

Port 0x3D is how many window rows are SHOWN, and it is two once putGauge
runs and nothing before. A line written to row eleven went somewhere real
and was displayed nowhere.

A nought is not a keypress. It is what a recorded keyboard file holds
while nobody is typing, and a splash that took it for a key is one no
test could ever watch.

And skipping has to be free. Asked after blanking the window and reading
the file, a skipped splash still cost a fifth of a second - enough to
push the thruster test's early capture past the frame it looks at. Asked
first, it costs a pad read.

player.asm no longer asks a caller for Order0 to Order3: the voice records
name NoOrder instead, so a program whose tune comes from a file does not
have to define four order lists it never uses. That was the file case
finding a wart in the contract.

Every other Lander test now skips the splash with a space - a key the
game itself ignores, since it answers to q, z and the arrows - so they go
on testing what they tested. The one in sound.sh presses nothing, which
is what makes it the one that hears the music.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-09-06 10:06:20 -04:00
co-authored by Claude Opus 5
parent 6bb1565dea
commit 00b31b88af
17 changed files with 392 additions and 52 deletions
+16 -6
View File
@@ -16,9 +16,11 @@
; PatchTable one two-byte address per patch
; SequenceTable one two-byte address per sequence
; VoiceStart four bytes, the patch index each voice starts on
; Order0..Order3 one-byte sequence indices each, ending in 0xFF
;
; and must call loadStartPatches once, then stepVoice once a tick for each voice, with A
; and point each voice's order cursor at a list of one-byte sequence indices ending in 0xFF.
; A tune read from a file needs none of that: useTune does all of it out of the header.
;
; It must call loadStartPatches once, then stepVoice once a tick for each voice, with A
; holding the channel and DP1 the voice's record. Playing counts down as voices run out, and
; reaching nought is the piece being over.
;
@@ -424,13 +426,13 @@ loadPatchPair:
; tick runs the count out, finds the end, and goes to the order list for the real first
; sequence - so the beginning of a piece needs no special case anywhere.
Voice0:
Order0 Empty 0d1 0d1
NoOrder Empty 0d1 0d1
Voice1:
Order1 Empty 0d1 0d1
NoOrder Empty 0d1 0d1
Voice2:
Order2 Empty 0d1 0d1
NoOrder Empty 0d1 0d1
Voice3:
Order3 Empty 0d1 0d1
NoOrder Empty 0d1 0d1
Playing:
0d4
@@ -455,6 +457,14 @@ TuneSequences:
TuneMagic:
0x53 0x42 0x54 0x55 0x01 ; "SBTU" and version one.
; An order list of nothing, which every voice starts pointed at. WHOEVER SUPPLIES THE TUNE
; SETS THE REAL ONE - useTune out of a file's header, or a program with a tune of its own in
; eight lines - so the records below name nothing that a caller has to have defined. They used
; to name Order0 to Order3, which made four order lists part of the contract even for a caller
; whose tune comes from a file and never has any.
NoOrder:
0xFF
; The sequence a voice starts on, so that its first tick goes through the order list like
; every other bar does.
Empty: