@Stiebler: I already found the memory addresses where the sub's mass and displacemant are stored after the readin process from NSS_UboatXX.sim file. But changing these variables in-game in the debugger does not change the sub's depth position. So things are a little bit harder than you initially thought.
I think the most important thing is to find out how the current depth of the sub is calculated and so to find out from what parameters it depends.
In Sh3.exe+A1D97 depth is calculated from a value which is taken from the stack. This could be a starting point.
h.sie
Edit: In Sh3Sim.act+30DF5 one can find some interesting code. According to this code the current depth of the Sub is coded in float format and gets more negative when sub is deeper under water, so it's something like a Z-position. if you set it to +10, the sub can fly. Cool. There is also a depth change value dZ. If it's positive, the z-value is rising, otherwise falling.
Sh3Sim.act+30DF5:
fld [esp+30] // Loads depth change value dZ
fadd [esi+b4] // Adds dZ to current Z value, Z := Z + dZ
fstp [esi+b4] // stores new Z-value.
Now I need to know how this depth change value dZ in [esp+30] is calculated.
Last edited by h.sie; 12-27-10 at 06:48 PM.
|