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: 7128

Author: ian.rushforth

Date: 03/08/2017

Subject: Re: Manic Miner Air Supply - a more refined approach

 

There is another glitch which occurs in a room with a limited air supply in a JSW64 game.  Just after the air supply runs out, the final character of air is briefly filled in again just before Willy is killed.

 

I believe this happens because the JSW64 game engine signifies that the air supply has run out by jumping to the 'Kill Willy' code, which assigns a value of #FF to the Airborne Status Indicator #85D1 (the same method which is used to signify Willy has hit a Fire cell, a guardian or Maria, or has fallen from a fatal height).

 

However, unlike the routines which detect a fatal fall or a collision with Fire cells/guardians/Maria, the code in JSW64 which depletes the air supply is located in the Main Loop after the re-entry point from the 'Kill Willy' code back into the Main Loop, i.e. after #89F5.  (The air supply is depleted at the same time as the remaining air supply is drawn, just after other messages are printed onto the status bar, via a CALL to a subroutine from #8A49.)

 

As a result, when the air supply runs out, the program doesn't react to it immediately (the check for a value of #FF at #85D1 is made later still in the Main Loop, at #8B17; if that condition is met then it jumps to the 'Lose a life' routine at #8C01); but only after the air supply on the status bar has been updated one more time - causing the glitch described above.

 

 

In contrast, in the original Manic Miner code, when the program detects that the air supply has run out, it jumps straight to #88FF, which is the equivalent to the 'Lose a Life' routine at #8C01 in original JSW.  Because of this, the glitch referred to above does not occur.

 

A similar solution could be applied to JSW64 to prevent the glitch, by ensuring that when the air supply runs out, the program jumps out of the Main Loop to 'Lose a life' at #8C01 (although it would be necessary to go via one or more POP commands, to clear Return address(es) from the stack first).

 

 

arrowleft
arrowright