News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

[SM] Addresses/Pointers, and the Gravity Hex Tweak

Started by dewhi100, April 23, 2017, 02:57:31 PM

Previous topic - Next topic

dewhi100

I'm trying to find where/how the value for gravity (listed in the Hex Tweaks) is used. It's at 81EA2 in the ROM, meaning that it should be at 10:9EA2 in the memory map (I think).

But I just can't seem to find that address used anywhere, at least not in a way that looks like it makes sense. I've tried searching for "A29E", and the most reasonable thing I could find was "79 A2 9E" (ADC addr,Y)... which still doesn't sound right.

Now I'm full of doubts. Maybe I should be looking for "9EA2"; Does the address read this way when pointing to a 24-bit address? Even if it is, I don't think that the address is pointed to that way. Wouldn't there be a "10" before or after the "9EA2/A29E"? I've tried looking up how 24-bit addresses work, but haven't had much luck. Or is this just not working because of the nature of a hex tweak? Could the actual constant for gravity be somewhere else, with this byte just happening to modify it?

I just want to understand gravity!

P.JBoy

Look for $9EA1, you'll find references in $90:9C5B and $91:E00D which are both pretty deep in the physics engine
...

dewhi100

Thanks P.J. The fact that the hex tweak is for the second byte in the constant never occurred to me. It's turning up now.