jataka5000
New member
Hello,
I've been studying the doHandlePhysics script carefully, and I don't quite understand how Object_v_speed_lo and Object_v_speed_hi really work. I get the analogy of Object_v_speed_lo being like the minute hand and Object_v_speed_hi the hour hand, but I don't see anywhere in this script (or any other) where the math is actually being done to then calculate the speed. Is there a script somewhere which says that once Object_v_speed_lo goes beyond #$ff then Object_v_speed_hi increases by 1?
That's what I want to get at. Weird things happen if I just try to ignore updating the _lo or _hi... seems that we need both.
There is one strange piece of code that I cannot make sense of what happens in doHandlePhysics_Gravity under 'notJumpThruPlat:' --
It seems like it is setting the minute hand to zero each time if the max speed has not been reached. I was expecting there to be a clause that says to skip updating the speed once the speed has reached the max value. But I don't see anything like that. This comparison (CMP #MAX_FALL_SPEED) actually shows up *after* the position and speed are updated, very strange.
I'm trying to dig into these details because I am wanting to do essentially the same thing but with the direction of gravity reversed. In ASM, turns out I need to deeply understand what's going on, there is no way to "put a minus sign" in there
I've been studying the doHandlePhysics script carefully, and I don't quite understand how Object_v_speed_lo and Object_v_speed_hi really work. I get the analogy of Object_v_speed_lo being like the minute hand and Object_v_speed_hi the hour hand, but I don't see anywhere in this script (or any other) where the math is actually being done to then calculate the speed. Is there a script somewhere which says that once Object_v_speed_lo goes beyond #$ff then Object_v_speed_hi increases by 1?
That's what I want to get at. Weird things happen if I just try to ignore updating the _lo or _hi... seems that we need both.
There is one strange piece of code that I cannot make sense of what happens in doHandlePhysics_Gravity under 'notJumpThruPlat:' --
Code:
LDA Object_v_speed_hi,x
CMP #MAX_FALL_SPEED
BNE notOverFallSpeed
; is at least max fall speed.
LDA #$00
STA Object_v_speed_lo,x
notOverFallSpeed:
JMP doneWithGravity
It seems like it is setting the minute hand to zero each time if the max speed has not been reached. I was expecting there to be a clause that says to skip updating the speed once the speed has reached the max value. But I don't see anything like that. This comparison (CMP #MAX_FALL_SPEED) actually shows up *after* the position and speed are updated, very strange.
I'm trying to dig into these details because I am wanting to do essentially the same thing but with the direction of gravity reversed. In ASM, turns out I need to deeply understand what's going on, there is no way to "put a minus sign" in there