Jump to content


Photo

Too many lives scenario

lives manic miner count

  • Please log in to reply
7 replies to this topic

#1 Spider

Spider

    DEC (HL)

  • Administrator
  • 2,779 posts

Posted 09 July 2017 - 05:49 PM

While looking at something else (different sprite for lives) but that did not quite work out as I intended as it seems not as easy as you'd think to change the sprite properly although I did not look *too* closely at this.

 

Anyway the 'too many lives' scenario generally there are two usual options here:

 

1. Do not display them as per the 'fix'  in the disassembly

2. Change the scoring code to only give them at 100,000 instead of 10,000 (a bit mean?) or reduce the scoring down instead

 

I'd like to suggest an alternative:

 

Option 3. At the code to add a life jump out into a bit of spare space and see how many lives are actually present. Rather than complicate it by jumping back further down the code without adding if there are more than x, simply see if there are more than ideal, reduce it to x instead then return.

 

The advantage of this should be that its slightly simpler and potentially less messy, a simple check of the value of 33879 / #8457 should be enough. If for example (lets say max 7) that contains 6 or more, reduce it by one then return. That way the 'extra add' will only ever take it to 7 in total...


Changing order to chaos since 1984

#2 IRF

IRF

    Advanced Member

  • Contributor
  • 3,272 posts

Posted 11 July 2017 - 04:42 PM

You could insert an AND #0F just before the LD B, A at #8717.  That way, no more than fifteen remaining lives would be displayed.

 

You'd need to check whether that leaves room for the 'Cheat Mode' Boot sprite - I think it would, but if not, then using an AND #07 would work instead.

 

******

 

Either way, it would require two more bytes to be inserted near the start of the Main Loop, which is quite a tight part of the code.  The simplest way I can think of to do that (with minimal code-shuffling) would be to replace the three-byte command at #8711 with a CALL to a subroutine located elsewhere (e.g. the spare addresses that are filled with source code remnants).

 

Then at the remote location, insert the following six bytes:

 

AND #0F (to bring A within the range 00-0F)

LD HL, #50A0 (to replace the command which was displaced from #8711(

RET


Edited by IRF, 11 July 2017 - 04:55 PM.


#3 Spider

Spider

    DEC (HL)

  • Administrator
  • 2,779 posts

Posted 11 July 2017 - 04:56 PM

Its similar to what I had (sort of!) thought.

 

I'd planned on where the part of the code starts to add the life, simply jump out elsewhere (there's plenty of free space) and the 'new routine' will check the total and return without if its already too high, if its not then it will do the add then call the screen-flash if needed then return.

 

The existing few bytes of the routine to check it would be empty apart from three bytes to do a 'call' to the new routine. :)

 

I must admit I am having an odd issue with getting it to display a different sprite for lives for some reason, :unsure: but I need to look at this in detail really.


Changing order to chaos since 1984

#4 IRF

IRF

    Advanced Member

  • Contributor
  • 3,272 posts

Posted 11 July 2017 - 04:56 PM


but if not, then using an AND #0F would work instead.

 

That should of course read "AND #07 would work instead"!

 

(Original post corrected.)


Edited by IRF, 11 July 2017 - 04:57 PM.


#5 Spider

Spider

    DEC (HL)

  • Administrator
  • 2,779 posts

Posted 11 July 2017 - 04:57 PM

That should of course read AND #07 would work instead!

 

(Original post corrected.)

I was going to say 7 is enough :D rather than 'filling' the display although I can see why you said that as that's the 'full screen' as such minus 'boot'


Changing order to chaos since 1984

#6 IRF

IRF

    Advanced Member

  • Contributor
  • 3,272 posts

Posted 11 July 2017 - 05:02 PM

Its similar to what I had (sort of!) thought.

 

I'd planned on where the part of the code starts to add the life, simply jump out elsewhere (there's plenty of free space) and the 'new routine' will check the total and return without if its already too high, if its not then it will do the add then call the screen-flash if needed then return.

 

The existing few bytes of the routine to check it would be empty apart from three bytes to do a 'call' to the new routine. :)

 

I must admit I am having an odd issue with getting it to display a different sprite for lives for some reason, :unsure: but I need to look at this in detail really.

 

Try the method I suggested, your new subroutine would only need to be six bytes I think.   ;)

 

Alternative sprite - have you tried replacing the value of #8726, from the default '82' to '81'.  That should work, although the sprites picked up in some caverns might look a bit odd. :o


Edited by IRF, 11 July 2017 - 05:03 PM.


#7 Spider

Spider

    DEC (HL)

  • Administrator
  • 2,779 posts

Posted 11 July 2017 - 06:37 PM

That sort of works. :) I'll prepare a new topic tomorrow time permitting explaining all this in more detail as I've substantially modified quite a bit of the game code for various other things...


  • IRF likes this
Changing order to chaos since 1984

#8 Spider

Spider

    DEC (HL)

  • Administrator
  • 2,779 posts

Posted 11 July 2017 - 08:14 PM

I should point out I have a static sprite to use but that's not an issue as I can (test it) by disabling the piece of code to pick up the note to decide what frame to use, well probably :unsure:

 

I did this once before and it was easy to pick the sprite this time it is being slightly annoying for some reason I'll have another look at it then see if I do need further intervention or otherwise.


Changing order to chaos since 1984





Also tagged with one or more of these keywords: lives, manic, miner, count

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users