1986 · Argus Press Software

The Detective

This minisite was contributed by Nico-van-der-Zijden, air. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/the-detective with me to Gold.

The answer to the safe is written on an object in the house, the winning move is made long before the accusation, and the time limit ignores a test meant to spare a player outside.

Every section on this tab gives away part of the mystery.

01 · Secret

Secret: the arrest is won by swapping the bullets

Accusing the right person is not enough. At the accusation, Dingle leads Snide to the cellar at gunpoint and fires. What his gun holds was decided earlier: the last line of Dingle's murder script takes the ammunition from one place in the house, place $18 in the object table, where the bullets start ($B1E6). The arrest runs the same routine again as he draws ($BC5E). Whatever is in that place when he gets there is what he loads: the real bullets (object $33), or the blank bullets (object 1), if the player has swapped them in.

$BC61 lda $1DAD ; the blank bullets' place $BC64 cmp #$F7 ; $F7: Dingle's $BC66 beq $BC6B ; blanks: "PULLS THE TRIGGER, BUT NOTHING HAPPENS.." $BC68 jmp $2042 ; real bullets: the game is over

With the blanks, play goes on with Dingle in the cellar, and Snide can use the gun on him: "DON/T SHOOT! I/LL COME QUIETLY.." and a promotion ($BCAF). The player who waits too long sees "DINGLE HAS ESCAPED..NEVER TO BE SEEN AGAIN" ($B159). Nothing in the game hints that the bullets matter.

02 · Secret

Secret: the safe's combination is inscribed on an object

Behind the picture in the drawing room is a safe. "TYPE IN THE COMBINATION:" waits for six characters, and the game compares them with six bytes at $8AFB: "210319" ($8A62). One object in the house, examined, says "IT/S INSCRIBED: TO ANGUS MCFUNGUS, BORN 21 MARCH 1919" ($9B90). The day, the month and the year are the combination.

Sam Manthorpe has said the safe codes were part of the original's copy protection. In this release, the clue to the code is part of the game.

03 · Secret

Secret: the first victim is the murderer

Mr Dingle goes up to his room, locks the door and, once he is alone, lies down as if dead: a few lines of 6502 code called from his script swap his sprites for a body and add "DINGLE/S BODY!" to the room ($B1CF). The Doctor's script then waits until Snide is in the same room and announces "INSPECTOR..MR. DINGLE/S BEEN STRANGLED!" (opcode 23, $A8D2). After "POOR FELLOW..TERRIBLE", the Doctor's script rewrites Dingle's script pointer (opcode 25), and from then on Dingle's script is the murderer's ($B09C). The Doctor is the second to die, and Dingle explains why at the end: "I PAID THE DOCTOR TO CERTIFY ME DEAD, AND THEN TOOK CARE OF HIM".

04 · Secret

Secret: secret passages keep the border still

The border flashes when Snide first reaches something he can investigate, a door included ($3E32). One kind of door is left out: a door of type 8, the secret passage, gives no flash while it is closed. Closed, it is also invisible, because closing it puts back the picture behind it ($3B8B). Examining the wall in front of one says "A SECRET PASSAGE!" and opens it ($892A). Professor Bull's notebooks are "PLANS OF THE CASTLE AND SHOW SECRET PASSAGES IN THE KITCHEN AND IN THE BEDROOMS".

05 · Bug

Bug: the time limit's test for the room reads the wrong byte

When the clock reaches 11:03, an unseen assassin shoots Snide ($2592). Before it checks the time, the routine skips the shot when Snide is on the stairs, and when the room's type is 3. Type 3 is the type of rooms 26 and 28, outside the house. But the instruction reads $1BC0 without an index: the type of room 0, the drawing room, which is 1 and which nothing in the game ever changes. The test never holds, so the assassin's shot finds Snide outside as well. The intended test was probably LDA $1BC0,X with the player's room in X, as the room builder reads the same table ($38B2).

06 · Bug

Bug: about one press of fire in three is lost

Fire in play opens the investigation menu, but often it does nothing and has to be pressed again. A press reaches the menu through a latch at $0129, which read_joystick ($2200) sets when it finds fire newly pressed. The same routine clears the latch every time it runs, and two callers run it: the main loop, once a pass, and the raster interrupt, once a frame ($2A88). The main loop also tests and throws away the latch at the top of every pass ($2224). The menu's own test ($3FAE) comes later in the pass. A latch set by one caller and cleared by another, or thrown away at the top of the pass, before that test reads it is a press lost.

Measured in the emulator, in the hall: 60 presses of fire, each held for six frames and started at a random moment, opened the menu 37 times. In each of the other 23, the game read the press and set the latch once, and the menu's test never found it set.

It happens all over the house. Forty presses in each of eight places along a played game (the hall, the Major's, Dingle's and the Doctor's rooms, the corridor downstairs, the study, the library and the drawing room) opened the menu between 13 and 24 times, 143 of 320 in all. With forty presses a place, a spread that wide is about what chance alone gives, so these counts do not show that some rooms lose more presses than others.

07 · Trap

Dingle's room locks for good, with evidence inside

Two of the ten pieces of evidence, the cravat and the small key that opens the briefcase with the note, lie on Dingle's "body". They appear only after he has faked his death ($B1CF), and his room is unlocked from then ($B096). Once the Doctor has reported the death, Dingle's script waits for Snide to walk into the corridor downstairs or the corridor upstairs (rooms 1 and 15), and then locks his room ($B0A7) and vanishes.

Nothing opens that door again. No script unlocks it, and the player can unlock a door only with an object whose menu offers the key icon: the bunch of keys and the big iron key are the only two (the icon masks at $87A5). The door's key byte is 0 ($1F87), and object 0, the hot water bottle, has no key icon. A player who walks into either corridor before searching the body can no longer win, and the game does not say so: the accusation just keeps answering "YOU DO NOT HAVE THE EVIDENCE TO PROVE IT."

The emulator showed both halves. In one game, Snide passed through the corridor downstairs before going to Dingle's room, and found its door locked with the hot water bottle's menu offering only look, put in and open. In another, he searched the body straight after the fake death, and that game was won.

08 · Quirk

Five things in Snide's hands, not six

Zzap!64's review says Snide can carry six items. The code counts what he holds and refuses the next one at five: "YOU CAN/T CARRY ANY MORE!" ($30CF, counting through $883B). Carrying more means putting things inside other things: a briefcase, a jacket or a bag holds five more ($8856), and the evidence envelopes hold ten.

09 · Quirk

Ten script pointers from a table of nine

At the start of a game, init_scripts ($A7E6) copies each character's script start from the table at $A7FB. The loop counts from 9 down to 0, which is ten entries for nine characters. The tenth start is read from the two bytes after the table, the first instruction of the next routine ($A80D: LDY #$01), as the address $01A0. Its low byte lands in character 0's pointer high byte, which the loop's last pass then overwrites, and its high byte, 1, in character 0's chosen door ($1E7F), which the Reverend's script replaces before he first uses a door.

10 · Quirk

Old word lists under the icons

The icon characters at $4E00, where the panel's icon pictures are copied when a menu opens ($873F), hold leftovers of the game's development until then: two older copies of the word list, one spelling the vicar's title "THE REVERAND". The first menu overwrites them.

Three pictures in the icon set are never given an action. Icons 4, 5 and 17 have pictures at $FA00 like the others, but their entries in the table of icon handlers point at a lone RTS ($883A), so choosing one does nothing. The How it works page draws all eighteen.

11 · Quirk

"GUEST ERROR.."

When a script asks a character to walk to a room that no door leads to from where they stand, or to use a door it never chose, the screen flashes red and the game prints "GUEST ERROR.." in that character's voice ($A618). It is a check the author left in for his scripts.