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

Author: ian.rushforth

Date: 04/02/2019

Subject: Re: Completing "Maria vs. Some Bastards"

 

I have investigated the item-collecting code in 'Maria vs. Some Bastards', and have discovered the cause of the bug which makes the game non-completable.
In the normal JSW game engine, the following sequence determines when the game progresses on to Game Mode 1 (the point when 'Maria' has disappeared):
; An item has just been collected (at this point, the sound effect has just been executed) #941E     LD A, (#85DE) #9421     INC A                    ; Increment the item count (which is best consider as a negative number) #9422     LD (#85DE), A #9425    JR NZ, #942C        ; Has the item count been incremented from -1 to 0? #9427    LD A, #01               ; If so, then... #9429    LD (#85DF), A        ; ...set the Game Mode Indicator to 1 #942C   RES 6, (HL)            ; Mark the item as collected
In the equivalent part of the item-handling routine in 'Maria vs. Some Bastards', at #9425 there is a JUMP to #9A30, followed by four NOPped out bytes, before normal service resumes at #942C.  At #9A30 we have:
#9A30    LD A, (#85C2)        ; The address #85C2 is reset to zero at the start of the game; it counts the number of items collected as a positive number #9A33    ADD A, #01            ; Increment the Accumulator #9A35    CP [operand]          ; Has the 'number of items collected' reached the target number?  [The operand of this command is set by the BASIC loader to #78/#F0/#F6 for Easy/Normal/Hard Mode, or #01 for Cheat Mode.] #9A37    JR NZ, #9A3E        ; If the 'number of items collected' hasn't reached the target, then jump past the next two commands #9A39    LD A, #01               ; If the 'number of items collected' has reached the target, then... #9A3B    LD (#85DE), A       ; ...set the Game Mode Indicator to 1 #9A3E    JP #942C              ; Jump back into the regular item-handling routine, at the point where the item will be marked as collected
There is a logical flaw in the above code - you will note that on three occasions in the above, I have put the phrase 'number of items collected' in quotation marks.  Just prior to the CP command, there should be a command to update the value held at address #85C2: LD (#85C2), A
Since this command is missing, the address #85C2 never gets incremented from zero.  So it doesn't actually serve its intended purpose of counting the number of items collected!
Now, as it happens, in Cheat Mode the target number of items is 1, and so the value in A (after being incremented once from zero upon collecting an item) matches the target (the operand of the CP command at #9A35), and thus the game proceeds to Game Mode 1 and the 'Maria' entity disappears.  But for all other modes (i.e. if any value other than 1 is stored at #9A36), then this will never occur, making the game incompletable!


An afterthought: if there is an item located along the path of the 'toilet run' (i.e. Game Mode 2), then when Maria collects it en route to the 'toilet' (which in this game is replaced by a captive Willy), the Game Mode Indicator is reset back to a value of 1 (as a result of the same bug identified above), and this brings the 'toilet run' to a premature end before Maria has reached the 'toilet'!
I just tried this - after creating a test file by POKING an item into a location halfway through the 'toilet run', I found that I had to go back to the 'master bed' (the magenta button on the wall behind the creature which stands in for 'Maria') for a second time, in order to restart the 'toilet run' again, before I eventually reached the 'toilet' (i.e. the Game Mode 3 end sequence - which in this case involves Maria and the formerly captive Willy in a loving embrace!)

 

 

arrowleft
arrowright