View Single Post
Old 12-27-10, 08:13 AM   #759
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@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.
__________________
My Mediafire page: http://www.mediafire.com/hsie

Last edited by h.sie; 12-27-10 at 06:48 PM.
h.sie is offline   Reply With Quote