Resource centre for ZX Spectrum games
using Manic Miner and Jet Set Willy game engines
Archive of the
Manic Miner & Jet Set Willy Yahoo! Group
messages
|
|
||
|
|
Message: 3854
Author: andrewbroad
Date: 22/12/2003
Subject: Editing the Toilet in Jet Set Willy
I know this has been done before (e.g. in Lee Tatlock's _Willy vs the
Vampire Lord_), but it was only yesterday that I finally unravelled
the complicated mystery of how to edit the position of the toilet! ;-)
The room and position at which Willy in running-mode is detected to
reach the toilet, are stored separately from the room and position at
which the toilet is displayed:
1. The room in which Willy is detected to hit the toilet is held at
address 38280.
2. The position at which Willy is detected to hit the toilet is held
at 38286 - this byte should have the same value as the one at 38338
(see Point 6 below).
Points 3-7 pertain to the room and position at which the toilet
is /displayed/:
3. The room in which the toilet is displayed is held at 38302. This
can be any room EXCEPT the Master Bedroom (whose room-number -
usually 35 - is stored at 38200), because the code that checks if
Willy is in the Master Bedroom only jumps to the toilet-display
routine if he is NOT in the Master Bedroom.
Points 4 & 5 pertain to the position at which the /pixels/ of the
toilet are drawn:
4. The vertical position of the toilet is held at 38326, as a byte in
the following binary format: YYYYyyy0, where YYYY are the character-
row (0-15) and yyy are the number of pixels below that row (0-7). In
other words, the byte at 38326 is 16*YYYY + yyy.
5. The horizontal position of the toilet (0-31) is held at 38329.
Points 6-7 pertain to the position at which the /colour-attributes/
of the toilet are drawn:
6. The position of the toilet's /top/ character-row is held at
38338/38339 as a 16-bit word in the following format:
38338: YYYXXXXX
where XXXXX are the column (0-31)
and YYY are the lower three bits of the row
38339: 0101110Y
where Y is the most significant bit of the row
In other words, take the row (0-15), and:
- IF row < 8 THEN POKE 38338, 32*row + column: POKE 38339,92
- IF row >= 8 THEN POKE 38338, 32*(row-8) + column: POKE 38339,93
7. The position of the toilet's /bottom/ character-row is held at
38341/38342 as a 16-bit word in the following format:
38341: YYYXXXXX
where XXXXX are the column (0-31)
and YYY are the lower three bits of the row
38342: 0101110Y
where Y is the most significant bit of the row
In other words, take the row (0-15), and:
- IF row < 8 THEN POKE 38341, 32*row + column: POKE 38342,92
- IF row >= 8 THEN POKE 38341, 32*(row-8) + column: POKE 38342,93
Obviously, the value of row in Point 6 should be row+1 in Point 7.
To recap previously-published results concerning the toilet:
8. The colour-attribute of the left column of the toilet is held at
38335.
9. The colour-attribute of the right column of the toilet is held at
38336.
10. The four toilet-sprites are held in the top half of Sprite-Page
166 (42496-42623).
It's just another Manic Monday
I wish it was Sunday
'Cause that's my fun-day
My `I don't have to run' day
It's just another Manic Monday
[The Bangles, "Manic Monday" - now I do have a copy, and very nice it
is too!]
--
Dr. Andrew Broad
http://www.geocities.com/andrewbroad/
http://www.geocities.com/andrewbroad/spectrum/
http://www.geocities.com/andrewbroad/spectrum/willy/
P.S. Party Willy (Part 2) is currently 31/64.
