1990 · Activision · Commodore 64

Hammerfist

This minisite was contributed by 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/hammerfist with me to Gold.

A page of the programmer’s source code, two unfinished rooms, three tunes nobody hears, and a level skip hidden behind three initials.

01 · source code

Secret: the first load still holds a page of the programmer’s source code

Source code is what a programmer types: instructions in words, with names for everything and notes to themselves. A program called an assembler turns it into the numbers the C64 runs. Games almost never ship with any of it. Hammerfist’s first load does. Inside it sit 478 characters of plain text: the middle of a source file, cut off in mid-word.

The text is not left over from some other program. Its 22 lines assemble to the very bytes at $158A, the routine that gets the next picture of each of the eight sprites ready, the movable pictures the video chip draws over the scenery. Line for line, the two match below.

The source text at $1200The game’s code at $158A
MULTISETUPLDX #$07;Repeat for all sprites$158AA2 07LDX #$07
!1LDA S.SWAPNOW,X;Is it time for new values for that sprite$158CBD 50 03LDA $0350,X
BEQ !3$158FF0 55BEQ $15E6
LDA S.XPOS,X$1591BD 00 03LDA $0300,X
STA CS.XPOS,X$15949D 58 03STA $0358,X
LDA S.XPOSMSB,X$1597BD 08 03LDA $0308,X
STA CS.XPOSMSB,X$159A9D 60 03STA $0360,X
LDA S.YPOS,X$159DBD 10 03LDA $0310,X
STA CS.YPOS,X$15A09D 68 03STA $0368,X
LDA S.COLR,X$15A3BD 18 03LDA $0318,X
STA CS.COLR,X$15A69D 70 03STA $0370,X
LDA S.DEFNUM,X$15A9BD 20 03LDA $0320,X
STA CS.DEFNUM,X$15AC9D 78 03STA $0378,X
LDA S.DEFNUM2,X$15AFBD 28 03LDA $0328,X
STA CS.DEFNUM2,X$15B29D 80 03STA $0380,X
LDA S.PRIOR,X$15B5BD 30 03LDA $0330,X
STA CS.PRIOR,X$15B89D 88 03STA $0388,X
LDA S.MUX,X$15BBBD 40 03LDA $0340,X
STA CS.MUX,X$15BE9D 90 03STA $0390,X
LDA S.SAMEDATA,X;Use same data so don't swap bank yet$15C1BD 48 03LDA $0348,X
BNE !10$15C4D0 09BNE $15CF
LDA #BANKNUMBER;Swap bank s$15C6A9 14LDA #$14

So the page tells us the programmer’s own names for things. MULTISETUP is the routine. A name starting with S. holds a sprite’s next values, waiting to be shown: S.XPOS is its next position across the screen, S.COLR its colour, S.DEFNUM its picture. CS.XPOS and the other CS. names hold the values on screen now. BANKNUMBER is 20. The note “Use same data so don’t swap bank yet” explains a test that a listing alone could only describe.

The text ended up there because nothing cleared that stretch of memory before the game was saved, and the game only uses it later, for things that change during play. Each line ends with a carriage return and a line feed, the pair a PC uses in its text files, so the source was probably typed on a PC and not on a C64.

The text runs from $1200 to $13DD. The game first uses that memory once play starts, for what it remembers about rooms and enemies.

02 · unfinished rooms

Secret: the docking area was planned with ten rooms, and two were never finished

Every load has eight rooms, and the docking area plays with eight like the rest. Its tables, though, have room for ten: ten room layouts, ten choices of character set, ten sets of colours. Rooms 8 and 9 have an entry in every one of them. Each of their layouts fills its first three or four columns with scenery and stops there. The rest of the room is empty.

There is no doorway into either room. The game picks the room you are in from its list of 22 doorway entrances, and every one of them is in rooms 0 to 7. The only other time the game sets the room is at the start of a game, when it sets room 0. The lists of exits, enemies, and security systems have places for rooms 8 and 9 too, and all of them are empty.

Drawn from the room data with each room’s own character set and colours. The layouts are at $3E17 and $3E53; the doorway list is at $6547; the room number is set at $63ED and $A7DC. The finished rooms are on the Maps tab.

03 · unused music

Secret: the loading disk carries three tunes that nothing plays

The first disk side holds a music routine with seven tunes. While the game loads, it plays tune 4 behind the loading picture. Tunes 1, 6, and 7 are the title tune, the in-play tune and the area-complete jingle, the same three that the game carries in its own loads. Tunes 2, 3, and 5 are heard nowhere: the game’s own loads hold no copy of them, and the loading screen plays only tune 4. They are Wally Beben’s, written in the same style, and they play here from the disk’s own bytes.

Sound effects have spares too. Four of the game’s eighteen effects, numbers 3, 5, 12, and 17, are never asked for by any of the four loads, and number 17 makes no sound at all. They play with the others on How it works.

Each button runs the loading disk’s own music routine at $EC4F. Tunes 1, 6, and 7 write the same notes to the sound chip as the game’s copies, frame for frame.

04 · room shortcut

Secret: typing YCY into the high-score table turns F3 into a room skip

The manual says F3 selects “no weapon”, the plain punch. Straight after that bit of code, the game keeps a second one that moves you on to the next doorway of the area. A single instruction skips past it. Typing the right initials into the high-score table rewrites that instruction, so the shortcut runs.

  1. Score enough to reach the high-score table. The lowest entry starts at 2,000.
  2. Enter your initials as:
    YCY
  3. Start the next game. Each press of F3 now puts you at the next doorway entrance in the area’s list, without walking there. Keep pressing to go round them all.

The change is to the code in memory, so it lasts through further game overs. Each load brings a fresh copy of the code from disk, so the shortcut is gone once the next area loads. Every load has its own copy of the check, though, so a new high score with YCY turns it on again.

The initials check is at $8325. It changes the byte at $98C1 from $F0, “branch if equal”, which skips the shortcut, to $D0, “branch if not equal”, which lets it run. The shortcut itself is at $98C3.

05 · safe final charge

Secret: in the very last room, overcharging a body is safe

A recharge point adds two energy points a step, up to 224. One step more and the body explodes: its energy drops to zero and the game swaps you to the other body. Every step also costs two points of score. The last room of the game is different. There, a charge past the top leaves the body full at 224, swaps you over without an explosion, and costs nothing.

Any other room

The last room

The last room is room 7 of the fourth load. Its test is at $913C and $9162; the other loads’ recharge step is at $9159.