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

Author: ian.rushforth

Date: 22/11/2016

Subject: Re: Broadsoft Lifts v0.2: Hex-editor type-in

 

I've just noticed another 'glitch' in the Broadsoft Lifts v0.2 Patch.


At xHxL +#53 (recommended JSW48 address: #9750), there is a conditional jump to the 'Kill Willy' code, with an entry point of #90B7 (which is a POP command that removes a Return address from the stack).


However, in the v0.2 arrangement, the Lifts code is a sub-routine that is Called from the 'Move the Guardians' routine, which is in itself Called from the Main Loop.  Therefore the correct entry point into 'Kill Willy' should surely be #90B6, in order to clear both return addresses from the stack via two POP commands?


[Similarly, the sub-routine at #961E - Called from the routine at #95C8 which in turn was Called from the Main Loop - also enters the 'Kill Willy' code at #90B6.  Whereas, in contrast, the routines that Jump to 'Kill Willy' at entry point #90B7 - such as when Willy falls a fatal height, or hits a guardian, an arrow or Maria - are only 'once removed' from the Main Loop.]


Not to do so would mean that the stack would build up with 'relic' return addresses, every time Willy is killed by a Lift.  (I don't think that would harm the running of the game, unless the stack built up beyond its upper limit at #5B00, and started to overwrite the display attribute file for the status bar #5A00-#5AFF!)


Fortunately - and I can't pretend that I thought of this when I devised the fix!, but it's an additional benefit - the amendments which I suggested in my Post No. 6936 (to fix the buggy Rope effects) also mean that the entry point to 'Kill Willy' is automatically corrected!


That's because the Broadsoft Lifts code is Jumped to rather than Called to, and so no return address is dropped onto the stack when the Lifts code is 'summoned' from #91B6.  The only thing that is retained on the stack is the return address back to the Main Loop (i.e. #89C9, left there after the Call to 'Move the Guardians' at #89C6 was executed).


Therefore the #90B7 entry point into 'Kill Willy' (as specified at xHxL +#53), which means that only one POP instruction is encountered, is right and proper once my 'patch of Andrew's patch' is in place!

 

 

arrowleft
arrowright