Lynx/Arena/Mosaic friendly version

International Conference on Manic Miner & Jet Set Willy

Analysis of Henry's Hoard

This file is mainly based on HENRYSHO.SNA, the earlier (1985) version. Differences in the later (1986) version are pointed out where they occur. If you want to write a game based on Henry's Hoard, you will need to use the 1986 version as the 1985 one has a buggy victory sequence.

Henry's Hoard is based on a modified Jet Set Willy engine; gameplay is almost identical to JSW, while the title screen, game over screen and lives display have been extensively modified. This document is intended to help people writing JSW editors or who want to base JSW games on Henry's Hoard.

It's a nuisance for me in one respect; my programs look for the "AIR" or "WRITETYPER" strings to detect a valid JSW snapshot, and Henry's Hoard has neither.

Detailed Guide

Address Versions Comments
6000h 1985 Title screen, only shown before the game runs (since afterwards, the game buffers will have overwritten it).
7B00h 1986 The string "1 for joystick 0 for keyboard".
7B20h-7B4Ah 1986 Code to ask whether or not a joystick is present, and set the joystick flag accordingly.
8404h Both Game start code is at 8886h, not 869Fh.
840Ch Both The game code is stored on the tape in obfuscated form, and is unobfuscated by the code here. Therefore if you want do do any editing or disassembly, make sure you get a .SNA of the game after this has run.
8420h Both Normal JSW code resumes, but not for long...
8450h Both In JSW, this normally contains "AIR" and then the scrolling message.
In HH, this looks up a character in the font at 85E0h.
845Ah Both The code to play the new "treasure picked up" sound.
8475h Both This routine waits for a keypress while the second title screen is displayed.
848Eh Both Apparently unused
848Fh Both The frame count for the animated lives counter.
8490h Both The count of items collected - three ASCII bytes.
8493h Both Apparently unused
8494h Both Routine to clear the attributes to bright yellow on black. This overflows by one byte - see the printer buffer in HENRYSHO.SNA.
84A2h Both 14 spare bytes
84B0h Both An orphaned code fragment, or so it seems.
84B5h Both 75 spare bytes
8500h Both Change the sprite depending on the room number - more elaborate than the Nightmare Room or storing the sprite number in the room definition. Overrides are:
Room 0 AF00h (Manic Miner clockwork bird monster)
Rooms 1,3 AD00h (Chuckie Egg protagonist
Room 26 BE00h (reversed player sprite)
Room 14 A600h (Upside-down player sprite, 4 frames only)
8525h Both Save a screen shot
853Ch Both Tape header for saved screens
854Dh Both 126 spare bytes. Not only has the title screen scrolling message been overwritten, but also the "Items collected 000 Time 00:00 m" message, the "Game Over" message, the "7:00a" message and the "Enter code at grid location" messages.
85CBh Both Back to JSW.
85CEh 1986 Kempston joystick flag. In the early version this is always zero and the joystick support cannot be accessed; while in JSW proper the joystick is auto-detected.
85E0h Both Where you would normally expect to see the WRITETYPER check, title screen tune, game tune and copy protection code, there's a font, covering SPACE to Z.
87CAh Both Original JSW entry point. There's some orphaned code here to disable the standard infinite lives POKE. The original JSW title screen code has been completely overwritten.
87D7h Both The current character being scrolled into the title screen message.
87DFh Both Scroll the title screen message left by one pixel.
87F5h Both Bring the next row of pixels into the right-hand end of the scrolling message.
8812h Both Set the next character to be scrolled into the title screen message.
8825h Both Title screen loop - draw a scrolling message, lie back and think of England. If SPACE is pressed, jumps into the game. Returns at the end of the message.
8870h 1985 HH has three title screens, the first two only appearing the first time. The code here calls 9866h to draw the first, and waits for a keypress; then copies the second one from 6000h.
8870h 1986 This version of HH has two title screens. The code calls 9866h to draw the first, and then 7B20h to get the joystick choice. The code to draw what was the second title screen is NOPped out.
8886h Both The game is entered here from 8400h. It calls 8870h to do the initial sequence; disables the standard infinite lives POKE; and then we get the code that used to be at 87CAh. The initial room number is now at 88B6h, and Willy's Henry's start position is at 88B1h (Y) / 88BBh (X).
888Fh 1986 The game reset code has been slightly rearranged. After the user chose keyboard / joystick, the game waits for a keypress (perhaps while the second title screen was supposed to be displayed). If this key is "C", there is a call to 8C01h.
88DEh Both Still initialising the game, clear the screen, set the border to 0, and call three subroutines. The first (9999h) resets some "room visited" flags, the second (989Dh) draws the final title screen, and the third (970Eh) draws the scrolling messages in k succession.
88FBh Both 12 spare bytes
8907h Both Copy in attributes for the bottom third of the screen, from 0F330h.
8912h Both JSW code resumes.
896Ch Both The code to draw the room name draws on a different screen line.
8971h Both Different code to draw the bottom third of the screen.
8984h Both Back to JSW code.
898Fh Both Animate the extra lives in a different place.
8999h Both Use the lives counter at 848Fh.
89A2h Both Use a different sprite to illustrate lives.
89A3h Both Back to JSW code.
8A3Ah Both The call to print the game clock has been NOPped out.
8A3Fh Both The code to increment the game clock has been removed.
8AABh Both Back to JSW code.
8ABBh Both The entire JSW "automatic pause" mechanism has been removed, and the death check which is at 8B17h in true JSW is now here. The remainder of this code is related to playing the in-game tune.
8AE4h 1985 187 spare bytes
8AE4h 1986 The player death code (this is at 8C01h in the 1985 version and in JSW)
8B9Fh Both Back to JSW code, at the (now disused) WRITETYPER check.
8C1Ah 1985 These two changes are probably related to the change in the "lose a life" special effect.
8C01h 1986 Code to check for the string "AROL" (ie: the cheat word is "CAROL"). If it is present, POKE the game engine for infinite lives and fall-any-height ability.
Note: Once the user has pressed the initial "C", they cannot continue until they type "AROL". Other letters are ignored!
8C34h 1986 Display a title-screen scrolling message - see 972Fh below.
8C39h Both The Game Over sequence is now in a different place. The following code replaces the original JSW game over sequence.
8C4Ah Both If 'G' is pressed, toggle the in-game tune (using self-modifying code).
8C65h Both 7 free bytes.
8C6Ch Both Check for the enable/disable in-game tune command; if it's enabled, play a note.
8C73h Both 7 free bytes.
8C86h Both A set of routines to play the GAME OVER tune, using the same jumptable technique as at 979Fh - 983Dh.
8D16h Both Redundant code to play the GAME OVER tune - not used.
8D33h Both Back to JSW code.
8E17h Both For playing some sound: border is always black, sound is shorter.
8E1Ah Both Back to JSW code.
8E86h Both Same as 8E17h.
8E8Ah Both Back to JSW code.
9252h Both Same as 8E17h.
9256h Both Back to JSW code.
9345h Both Don't know what this does.
93EEh Both The Willy Henry / object collision detection has been made more forgiving.
93F7h Both Back to JSW code.
9409h Both Call to new treasure beep, old treasure beep NOPped out.
941Eh Both Back to JSW code.
9433h Both Treasures don't colour-cycle.
9538h Both The special-case code that draws Maria and the Bathroom toilet has been replaced with the following:
Room 14 Set lives to 1
Room 26 If player has all items, set the upward exit to room 24.
Room 25 If player touches guardian, go to victory routine.
9566h 1985 The first byte of the victory code is overwritten by a RET instruction. This causes the initial scrolling message to display repeatedly until the computer is reset.
What the code would have done is copied the image at F734h into the screen, then copied in attributes from the start of the ROM(!), waited for a keypress and saved the screen out to tape.
9566h 1986 Victory code. Copies the image at F734h into the top third of the screen, and sets the attributes to 6 (yellow on black). Waits for a keypress, saves the screen to tape, and then stops until the computer is reset.
958Bh Both Normal JSW code resumes (though it is unused until 95C8h).
962Dh Both Change in the attribute used for something - ropes?
9653h Both When generating the player sprite, call the check routines at 8500h (new sprites) and 99A7h (restore player lives).
9680h Both The JSW "print string" code has been adapted to use the custom font. JSW code replaced from here on includes: The original in-game tune playing code, the routine to reset the computer on incorrect code entry, and the title screen attributes.
96A2h Both Draw the pillar to the left of the lives display.
96D8h Both Draw the pillar to the right of the lives display.
970Eh Both Display three scrolling messages (one at 9F00h, one at AC80h, one at 9731h) in succession. More of this code is at AE44h. For some reason this routine uses the two-byte version of the LD (nn),HL opcodes.
972F 1986 In the 1985 version, the code at 971Bh drew a message at AC80h. It now draws one at FF34h. It then jumps to 8C34h to draw the message at AC80h.
9731h Both Scrolling message as mentioned above.
979Fh Both A table of BEEP routines, each 8 bytes long. The in-game tune at F200h consists of indexes into this table.
980Fh Both Get the next note of the in-game tune, and play it.
9852h Both Draw the bottom third of the screen.
9866h Both Clear the screen and draw the first title screen.
989Dh Both Clear the screen and draw the third title screen. Rather than returning, jumps to AE51h which changes the attributes to yellow and magenta. AE51h in turn jumps to AEA7h which draws some more messages at the top.
98BCh Both Draw the Game Over screen.
9908h Both Print "CHOW". Not used.
991Eh Both Clear the screen to black.
992Ch Both Does nothing more than call 8494h - clear attributes.
9937h Both Set the top two-thirds of the screen to bright green on black, and the bottom third to cyan. As 8494h, overflows its buffer.
9999h Both Resets "room visited" flags used by next routine.
99A7h Both The first time the player visits rooms 41, 35, 27 or 18, their lives are restored.
99F2h Both Title screen scrolling message; first byte is its length, and the rest is the text; add 32 to get the correct ASCII value.
9AB6h Both Spare up to 9B00h.
9B00h Both Three sprite pages:
  • 9B00h = "lives remaining" in first 4 frames; second 4 seem unused.
  • 9C00h = "AJB" in first 4 frames; Bathroom guardian from JSW in second 4.
  • 9D00h = normal player sprite.
9E00h Both Don't know.
9F00h Both First scrolling message for routine at 970Eh
A000h Both Guardian table
A3FFh Both Object table
A600h Both Sprite pages:
  • A600 = upside-down player (4 frames only)
  • A700 = misc guardians
  • A800 = Miner Willy
  • A900 = Cage & moth
  • AA00 = Atari logo, programmers' initials
  • AB00 = Flightless bird
  • AC00 = JSW toilet (4 frames only).
AC80h Both Second scrolling message for routine at 970Eh.
AD00h Both Sprite page (first frame blank in 1985 version) for Chuckie Egg protagonist
AE00h Both Sprite for bell (2 frames only)
AE44h Both Wedged into a sprite page, code there wasn't room for elsewhere. The routine at AE44h (along with that at 970Eh) displays three scrolling messages while waiting for a keypress.
AE51h Both Part of drawing the third and final title screen.
AE70h Both Third title screen, messages
AEA7h Both Third title screen, code to print the messages at AE70h.
AF00h Both Remaining sprites
C000h Both Rooms 0-49.
F200h Both In-game tune. Note numbers are indexes into a table of calls to the BEEP routine in the ROM; that table being at 979Fh. Each call is 8 bytes long, so these numbers will usually be a multiple of 8. The tune ends with 0FFh.
F2F5h Both Tune for GAME OVER screen.
F330h Both Bottom third of screen: Attributes to use in the game.
F430h Both Seems to be unused.
F500h Both Room 53.
F600h Both Seems to be unused.
F606h Both Text messages used by the game.
F722h Both The gnomic message "EALLY LIKE DARK S" - unused.
F734h Both Victory screen (top third, in Spectrum format); displayed only in the later version.
FF34h 1986 Another scrolling message for the title screen (1986 version); unused in the 1985 version.
FFFEh Both Border colour is saved here during beeps.
FFFFh Both Index into the in-game tune.