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: 6962
Author: rushforthian
Date: 08/12/2016
Subject: Re: Start-frames for MM-rooms and (not) for portals in JSW64
Andrew Broad wrote:
> As explained in my Manic Miner Room-Format
<http://geocities.com/andrewbroad/spectrum/willy/mm_format.html>,
the original MM stores each room's start-position in Offsets 616-622,
with Willy's start-frame in Offset 617 - this overrides whatever
sprite-frame he entered the portal of the previous room with.
> JSW (including JSW64), however, has no notion of each room having a
(statically-specified) start-position (it does store a dynamic start-
position whenever you enter a room, to which Willy reverts after
losing a life). JSW has only a /global/ start-position for when you
start the game - this consists of a room-number and cell-coordinates,
but not a start-frame (which is why, whenever you restart a JSW-game,
Willy starts in whatever sprite-frame he finished the last go in).
> In JSW64, it's the portal, not the destination-room, that specifies
the start-position. Since each room can have at most one portal, each
room specifies the portal-destination room-number in Offset #F5, the
portal-destination cell-coordinates in Offsets #F6-F7, and the portal-
destination pixel-row in #F8.
> But JSW64 doesn't specify a portal-destination /start-frame/, and is
not, therefore, fully faithful to the original 48K MM. You're not
supposed to be able to jump the yellow HG in "Amoebatrons' Revenge"
at the first attempt!
The same consideration also applies to Willy's Direction and Movement Flags, which are stored in Offset 618 for each cavern.
Andrew's Manic Miner Room-Format webpage has an entry thus:
"Offset 618 represents the direction Willy faces when he starts the room: 0=right, 1=left."
But that only tells half of the story! Bit 0 of Offset 618 determines Willy's facing direction, as detailed above, but Bit 1 is also used to signify if Willy is moving (left or right, depending on the value of Bit 0). Thus the overall value of Offset 618 can theoretically hold values of 2 or 3.
Now, in all the caverns in original MM, the movement flag is initially reset to zero. However, the fact that this is not 'globally initialised' in JSW64 MM games is apparent in some circumstances.
For example, in Andrew's 'JSW64 MM James Bond', I believe that the layout means that James can only enter the portal in 'You Only Live Twice' by walking rightwards into it. A consequence of this is that, when James enters the next level: 'On Her Majesty's Secret Service', he is facing rightwards and moving rightwards.
Now, he enters that level on a down-left conveyor-ramp (i.e. the ski-slope escalator). Because of the way the Direction and Movement Flags have been set upon entry, iff the player keeps the right key depressed then James can set off straight up the slope (towards the first item), against the flow of the conveyor's action.
However, if you edit the code such that the game proceeds from the Title Screen straight into 'On Her Majesty's Secret Service' (and with James at the correct coordinates for that level, as specified by the previous 'You Only Live Twice' portal), and if you then start up the game with the right-key depressed, then James is frozen on the spot - the Right key and the Conveying action are cancelling each other out. You then have to let go of the Right key, allow the Escalator to take you down to its base, before returning back up the slope. (Whereas of course, if you start up the game without keeping the Right key depressed, then James heads off leftwards straight down the slope.)
Therefore, Andrew has very cleverly* designed the transition through the portal from 'You Only Live Twice' into 'On Her Majesty's Secret Service' - taking into account the peculiarities of JSW64 (as compared with the original MM game engine) - to allow James to 'hit the ground running' upon entry to '...Secret Service'!
(*Either that, or the way it turned out was a happy accident!)
