Mini Turbo Charge Meter [Vega]
#9
(01-22-2019, 03:46 AM)TheCape Wrote:
(01-19-2019, 03:17 AM)Vega Wrote: Went ahead and upgraded the code to include Orange MT reading for karts. Even though you are new to ASM, please read the source. You may have somewhat of an understanding of how I made the code work.

For a visual perspective... view the following image...
https://i.ibb.co/Yc5WsCx/meterdynamic.png

Dolphin was running when I took the screenshot, hence why the Code View is disabled. Anyway, address 0x80E495A2 holds the halfword value for Blue MT. Address 0x80E495A4 holds the halfword value for Orange MT. Also, address 0x80E495A1 holds a byte indicator (which I didn't need to use at all for the code, this is just a little fyi if you ever need it) which shows 0 for no charging of an MT, 1 for charging blue MT, 2 for blue MT charge full/charging orange MT, and 3 for orange MT charge full.

If at that moment of the screenshot, I set an instruction breakpoint (NTSC-U) for static function address 0x80590F20 (address of second ASM), Register 3 would hold the value of 0x80E494A4. If you add 0xFE to that address, you get 0x80E495A2 (location of blue MT). Hopefully that will help you understand the source for the second ASM, of why I added 0xFE to r3.

Ofc, these MT value locations/addresses are all dynamic (as I mentioned earlier). The very next race, all the MT values will be at a different spot (still high mem80 though).

I was actually playing around with the code on multiple occasions and working on learning how this works, but the dynamic nature of the values makes this difficult.

It seems to me that the 270 value for a blue MT and the 300 value for an orange MT should have hard coded values. The amount it currently has of that 270 or 300 I can see changing, but it's top limit I feel should have a hardcoded amount somewhere. Essentially changing 270 to 150 would make anytime you hit 150 with the drift it would generate the blue MT.

There is no hardcoded set limit that this code/function is reading from (like a number simply listed somewhere in RAM) as a means to set a maximum. The functions (list of addresses in subroutines responsible for writing/reading the increase/decrease of MT) is hardcoded. These functions have some sort of equation done to prevent a number higher than 270 for blue MT and a number higher than 300 for orange MT.

To manipulate this responsible equation would be tricky. It would probably be a code of multiple semi-complex ASMs. Definitely something I have no desire to solve. There's probably an easier way, but it's late right now lol.

Edit 4/16/19

final revision on source
Reply


Messages In This Thread
Mini Turbo Charge Meter [Vega] - by Vega - 12-16-2018, 07:20 PM
RE: Mini Turbo Meter - by TheCape - 01-18-2019, 04:33 AM
RE: Mini Turbo Meter - by SwareJonge - 01-18-2019, 01:24 PM
RE: Mini Turbo Meter - by TheCape - 01-18-2019, 04:35 PM
RE: Mini Turbo Meter - by Vega - 01-18-2019, 08:47 PM
RE: Mini Turbo Meter - by TheCape - 01-18-2019, 10:34 PM
RE: Mini Turbo Meter - by Vega - 01-19-2019, 03:17 AM
RE: Mini Turbo Meter - by TheCape - 01-22-2019, 03:46 AM
RE: Mini Turbo Charge Meter - by Vega - 01-22-2019, 04:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)