Jump to content


Photo

'Long Distance Nasties' Bug Fix


  • Please log in to reply
6 replies to this topic

#1 IRF

IRF

    Advanced Member

  • Contributor
  • 4,273 posts

Posted 23 June 2016 - 12:37 AM

See the attached file - I have added five bytes to the 'Set Willy's attributes' routine, immediately after the ADD HL, DE command which - prior to the code changes - used to be at #9614.

 

The five bytes in question are:

 

7C       -    LD A, H

FE 5E  -   CP #5E

30 07   -   JR NC 07

 

The effect of this intervention is to disable the 'bug/quirky feature' that causes Willy to die if he tries to fall off the bottom of a screen which has a Fire cell located above him at the top of the screen.

 

The starting point in the file is set to A Bit of Tree, and I have inserted a Fire cell nearby to demonstrate that falling onto a Fire cell within a screen still kills Willy as per usual.

 

However, if you jump Willy up to the screen above, Under the Roof, and then walk rightwards off the platform that he lands on, you will see that he falls off the bottom of Under the Roof without being killed by the Fire cells at the top of that screen due to the 'bug' - only to land (repeatedly!) onto the newly-inserted Fire cell in A Bit of Tree!

Attached Files


Edited by IRF, 23 June 2016 - 12:38 AM.


#2 Spider

Spider

    DEC (HL)

  • Administrator
  • 3,961 posts

Posted 23 June 2016 - 05:30 AM

:) That's quite a neat fix.


  • IRF likes this
Changing order to chaos since 1984

#3 IRF

IRF

    Advanced Member

  • Contributor
  • 4,273 posts

Posted 23 June 2016 - 06:50 AM

Although it's one that it might be best not to fix, as it's a useful feature for reducing Infinite Death Scenario falls off the bottom of screens!

 

It took a fair bit of 'unavoidable drudgery' shifting code about to achieve it, too!


Edited by IRF, 23 June 2016 - 06:51 AM.


#4 jetsetdanny

jetsetdanny

    Advanced Member

  • Contributor
  • 2,130 posts

Posted 24 June 2016 - 11:10 AM

Congratulations on this fix, Ian!  :)


  • IRF likes this

#5 IRF

IRF

    Advanced Member

  • Contributor
  • 4,273 posts

Posted 24 June 2016 - 12:23 PM

I thought it could be done with four bytes, so in the file attached above I shifted the four bytes that reset the 'tick' counter when Willy reaches the toilet at the end of the game.

 

Unfortunately (and rather annoyingly!) that didn't work, so I had to consolidate one more byte, which I acquired from the 'Draw Willy to the screen buffer' routine:  There are four bytes which ensure that 'Flying Pig Willy' moves forwards in The Nightmare Room (they are NOPped out in JSW The Nightmare Edition, so that Flying Pig Willy moves backwards); in the attached file I used one of those (and NOPped out the other three).

 

So I had to apply consolidation in two directions to achieve the fix (from 'above' and from 'below'), and then ensure that all the relative and absolute jumps were in order.  But I got there in the end!


Edited by IRF, 24 June 2016 - 12:39 PM.


#6 IRF

IRF

    Advanced Member

  • Contributor
  • 4,273 posts

Posted 15 July 2016 - 05:27 PM

Andy, I believe it would be more appropriate if this topic was located in the 'JSW' rather than 'Remakes' category (along with topics on other Bug Fixes that we've created there), what do you think?  Could it be moved?

 

Also, I've just noticed that Richard (SkoolKid) provided an even more efficient way of fixing the bug in his disassembly:

 

http://skoolkid.gith...DistanceNasties

 

I think if it was inserted via consolidation, then only four bytes would need to be found, which could be done by raiding either the Toilet code or the Flying Pig code - it wouldn't be necessary to do both!



#7 Spider

Spider

    DEC (HL)

  • Administrator
  • 3,961 posts

Posted 15 July 2016 - 06:11 PM

The appropriate topics were moved. :)


Changing order to chaos since 1984




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users