Spider Posted July 9, 2017 Report Share Posted July 9, 2017 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... Quote Link to comment Share on other sites More sharing options...
IRF Posted July 11, 2017 Report Share Posted July 11, 2017 (edited) 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 July 11, 2017 by IRF jetsetdanny and Spider 2 Quote Link to comment Share on other sites More sharing options...
Spider Posted July 11, 2017 Author Report Share Posted July 11, 2017 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. Quote Link to comment Share on other sites More sharing options...
IRF Posted July 11, 2017 Report Share Posted July 11, 2017 (edited) 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 July 11, 2017 by IRF Spider 1 Quote Link to comment Share on other sites More sharing options...
Spider Posted July 11, 2017 Author Report Share Posted July 11, 2017 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' Quote Link to comment Share on other sites More sharing options...
IRF Posted July 11, 2017 Report Share Posted July 11, 2017 (edited) 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 July 11, 2017 by IRF Spider and jetsetdanny 2 Quote Link to comment Share on other sites More sharing options...
Spider Posted July 11, 2017 Author Report Share Posted July 11, 2017 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 1 Quote Link to comment Share on other sites More sharing options...
Spider Posted July 11, 2017 Author Report Share Posted July 11, 2017 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.