Jump to content


Photo

Moving the air bar


  • Please log in to reply
7 replies to this topic

#1 Spider

Spider

    DEC (HL)

  • Administrator
  • 2,773 posts

Posted 07 July 2017 - 10:42 AM

Are there any MM variants with the 'air' bar in a different location ? :unsure:

 

It does not (at first glance) appear that simple to move it as its using the game clock to set the LSB and / or the MSB

 

The MSB is set at 34517 to 82

 

I did do this once quite a long time ago but I can't quite remember how exactly. Just wondered if there are any games with it in a slightly different place. I need to shift it down one row as such. I've not spent a lot of time looking** however as there may be a game already with it done to look at

 

**apart from a few tweaks as if you attempt to adjust the values without care you can cause a crash too but that's partly expected as it will attempt to 'draw' where it should not.

 


Changing order to chaos since 1984

#2 IRF

IRF

    Advanced Member

  • Contributor
  • 3,268 posts

Posted 07 July 2017 - 11:44 AM

It isn't the #52 at #86D6 which you need to change.  That just determines the height of the air supply pixel-rows within the chosen character-row.

 

I think you would need to do the following:

 

At #86DA: replace the #24 with #44

At #86DC: replace the #25 with #45

At #86E2: replace the #24 with #44

At #8A4C: replace the #24 with #44

 

Then in each individual cavern definition, add #20 to the relevant Offset Byte (#xBC, where x = 2,6,A or E). e.g. For the Central Cavern, edit #B2BC to replace the value #3F with #5F.

 

******

 

Warning: That might do odd things to the sound effect when the remaining air supply is counted down after Willy has completed a cavern!

 

If you wanted to preserve the sound effect, then I suspect you would have to insert a SUB A, #20 immediately before the CPL instruction at #90D1.

 

Fortunately, I have just identified two inefficiencies in the vicinity of that part of Matthew's code, which would free up the necessary two bytes to allow you to insert the SUB A, #20 with minimal code-shuffling:

 

- At #90D4, there is a two-byte RLC A command which could be replaced with a single-byte RLCA;

- At #90D7, there is a two-byte LD A, #00 command which could be replaced with a single-byte XOR A.  (Don't forget to adjust the operand of the relative jump at #90E6 accordingly.)

 

******

 

Er, good luck!!!



#3 Spider

Spider

    DEC (HL)

  • Administrator
  • 2,773 posts

Posted 07 July 2017 - 12:26 PM

Thanks. I'll have a play with this later. Its more complex that it first appeared though as the MSB for the display is set at 34517 LDA,82 and there's some minor sub going on. I really should just put a few breakpoints into that routine and the one around 35388 to determine exactly what is going on.

 

I'll try your code shortly to see. I have a 'quick test' file which simply has all the lower screen area set to black paper / white ink on all of it so its very easy to see where exactly its 'drawing'

 

I did have it drawing attribute blocks on the playing area at one point due to too high an MSB which then caused some concerns. :D


  • IRF likes this
Changing order to chaos since 1984

#4 Spider

Spider

    DEC (HL)

  • Administrator
  • 2,773 posts

Posted 07 July 2017 - 12:42 PM

Very quick test and it worked :D Thank you.

 

I 'forgot' the cavern supply one first which resulted in a near full lower third of air bar, but once I'd applied that and reset it was straightforward. Quick pic:

 

airbar.gif

 

More about why I wanted to do this over the next few days. Its not what you may think though. :)


Changing order to chaos since 1984

#5 IRF

IRF

    Advanced Member

  • Contributor
  • 3,268 posts

Posted 07 July 2017 - 12:51 PM

Did you apply the fix for the sound effect, when Willy clears a cavern?

 

And I should emphasise: you'd have to change the value of the appropriate Offset Byte in the data for all twenty caverns, not just for Central Cavern.



#6 Spider

Spider

    DEC (HL)

  • Administrator
  • 2,773 posts

Posted 07 July 2017 - 12:54 PM

Did you apply the fix for the sound effect, when Willy clears a cavern?

 

And I should emphasise: you'd have to change the value of the appropriate Offset Byte in the data for all twenty caverns, not just for Central Cavern.

No not tried the sound effects yet. :)

 

Yes understood as its the 'supply' for the room:

The next byte is copied to 32956 and specifies the initial air supply in the cavern.
45756     DEFB 63

That's from the Central Cavern but I see exactly what to do with those anyway :thumbsup: In decimal I'm changing the 'supply' byte to 95. Simples (famous last words!)


Edited by Spider, 07 July 2017 - 12:55 PM.

  • IRF likes this
Changing order to chaos since 1984

#7 IRF

IRF

    Advanced Member

  • Contributor
  • 3,268 posts

Posted 10 July 2017 - 08:38 AM

You would also need to change the value of #86D0 from #20 to #40 (that's to print the word 'AIR' in the right character-row).



#8 Spider

Spider

    DEC (HL)

  • Administrator
  • 2,773 posts

Posted 10 July 2017 - 03:47 PM

You would also need to change the value of #86D0 from #20 to #40 (that's to print the word 'AIR' in the right character-row).

Its OK I have something else there ;) As I have the bar 'start' a bit further to the right too. :D


  • IRF likes this
Changing order to chaos since 1984




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users