Knight Lore's tune player
The tunes are played by Knight Lore's code. PLAY_NOTE is Knight Lore's note player instruction for instruction, the two addresses in it apart (the note table's and a helper's), and NOTES, 61 rows of three bytes, is Knight Lore's table to the byte, with the same odd row 18 that repeats row 17's pitch. Compared byte for byte with Knight Lore's loaded game. The sound effects in play are Pentagram's own: short beeps, one note a turn, from EFFECT_NOTE. See Knight Lore's sounds.
Points are made from a graphic's bits
Shooting down a thing from the sky is the only way to score, and the points are not looked up: SHOOT_DOWN, the only caller of ADD_SCORE, makes them from the thing's graphic number -- the hundreds from bits 5-7, the tens from bits 2-4 and the units from bits 6, 7 and 0 -- so no digit can pass 7 and the sum stays good BCD. A thing's graphic changes as it flies, so what it is worth depends on the frame it is hit in. The eight things SKY_DROP can drop (DROP_GRAPHICS), worked out from the snapshot:
GraphicsUpdate routineChance of fallingPoints, by frame
164-167HOMER1 in 8512, 516, 512, 516
160-163HOMER2 in 8502, 506, 502, 506
48-51HOMER2 in 8140, 144, 140, 144
80-81SKY_ROAMER2 in 8241, 245
168-171SKY_WALKER1 in 8522, 526, 522, 526
Watched in the emulator: in room 30, firing at what fell, six hits scored 241 (graphic 80), 512 (166), 516 (167), 502 (160), 241 (80) and 526 (171), each as the formula says.
A doorway carries its destination
Knight Lore works out the next room from the grid: plus or minus one, or sixteen. Pentagram's rooms are not on a grid. Each arch in a room's scenery list is two bytes, the template and the room it leads to, and BUILD_ROOM copies that second byte into +$08 of every piece of the arch; the arch's first pillar (FIRST_PILLAR) moves the player there. Read from the room data: 139 rooms with 290 doorways, which pair up into 145 links, none of them one-way; only 70 of the links join rooms whose numbers differ by one, and the farthest apart join rooms 2 and 149, 0 and 147, 41 and 140. Room 0 is reached by doorways whose destination byte is 0 -- the value every piece of scenery that is not a doorway has too. 25 rooms have one doorway only, 3 have four, and the numbers 68, 79, 89-90, 104-105, 113-116, 121 are not rooms at all.
A life starts again at the last doorway
When he walks out through an arch, EXIT_LOW_U copies both his records into the player template at PLAYER_TEMPLATE, still marked with the wall he left by, and when a life is lost RESTART_PLAYER copies the template back and the room is built again: he comes back in through the doorway he entered by, facing the way he was walking, and walks in again. Only a new game resets the template (CHOOSE_START). Watched in the emulator: walking out of room 92 into room 91 he arrived at U 195; killed there a few steps in, he started again at U 195, V 128.
Chance is drawn before the menu
START stirs the refresh register R into RANDOM once, just before the menu, and nothing touches RANDOM again until the game has chosen where the five collectables start (NEW_QUEST) and which of rooms 51, 92, 100, 12 it starts in (CHOOSE_START). The time spent on the menu makes no difference, so the first game after loading is decided by R at the moment the game began to run -- in an emulator loading the same file the same way, always the same game. Watched in the emulator: games started after 1, 2, 3, 5 and 8 passes of the menu all began in room 92, with the collectables in rooms 16, 129, 18, 146 and 27; the same game put into a 128K snapshot, which has R at 0, began in room 100. Later games are stirred by the play before them (every object's turn adds R and a byte of the ROM, OBJECT_DONE): forty games started in the simulator after games over of varying length began in all four rooms.
The win names the next game
The fifth collectable put in its place on the pentagram ends the game (COLLECTABLE), and WON congratulates the player and tells him his adventure continues in Mire Mare -- the next Sabreman game, announced and never released. Then the game-over screen follows as after any game, with the percentage (PERCENTAGE).
Left in, never used
Code and data that nothing reaches, each checked by searching the loaded game for its address and by the build's play sessions: a blip pitched by the turn counter with 80 bytes of pitches (BLIP_BY_TURN), two beeps pitched by a graphic number (BEEP_BY_GRAPHIC), a whole tune (TUNE_UNUSED), effects 2 and 3 of the four the sound sequencer has (EFFECTS), a routine that would reverse a homer's height speed (BOUNCE_Z), code that would set the room builder's position nudge (SET_PLACE_NUDGE, so the nudge is always 0), three drawing offsets (UNUSED_OFFSETS), an update routine that makes a thing deadly (DEADLY_AND_DRAW), Knight Lore's printer for strings with a colour byte (PRINT_TEXT_STD_FONT), two lone RETs (STRAY_RET_LEGS, STRAY_RET_OFFSETS), and two sprites no graphic number reaches (SPARE_SPRITEB, SPARE_SPRITEC). The main loop saves the stack pointer every turn in MAIN_SP and never reads it; the menu loads a variable into HL and at once overwrites it. The update-routine table gives graphic 60, a piece of the panel, the bolts' routine (BOLT).
The loading screen ignores its own header
The tape's second block is the loading screen, and its header says CODE 24576,6912 -- $6000, in the middle of where the game will load. The BASIC loader reads it with LOAD ""SCREEN$, which puts 6912 bytes at the screen whatever the header says, and then loads the game over $5E00-$D89D. Read from the tape and confirmed by the simulated load that builds this disassembly.
Each quest item gives a life
When the bucket reaches a quest item, QUEST_ITEM adds a life as well as counting the item done, and redraws the lives at once (DRAW_LIVES). With five lives at the start there are nine in a game. Watched in the emulator: the fourth item done took the lives from 4 to 5.