Programming exercise for today:
I played around a little bit more with P23 and rarely, but often enough to annoy me, I got a CTD. So I let Visual Studio run NASSP in debug mode and I now know where a problem occurs:
while(fabs(fabs(OpticsShaft)-fabs(ShaftMoved)) >= OCDU_SHAFT_STEP) {
sat->agc.vagc.Erasable[0][RegOPTX]++;
sat->agc.vagc.Erasable[0][RegOPTX] &= 077777;
ShaftMoved += OCDU_SHAFT_STEP;
}
The simulation is stuck in this loop in CSMComputer.cpp. When I stopped Orbiter it had these values:
OpticsShaft = -0.00010406345
ShaftMoved = 391501.66411046032
The issue seems obvious: The evaluation of the while condition is always positive and so ShaftMoved always gets increased and it can never escape the loop. Now the challenging part: why does that start in the first place and how to prevent it? I have the feeling that is has something to do with OpticsShaft being a smaller value than OCDU_SHAFT_STEP. I can't immediately come up with the solution, mabye someone else has an idea...