mrpubnight Posted May 19, 2008 Report Posted May 19, 2008 Hello everyone, I was wondering if anyone has experienced anything like this: In trying to debug a problem I noticed that the values that I'm writing to an offset appear to be different when I read them immediately after. Initially I thought, because the difference in value is so small that it was either a rounding problem or the FS engine was actually moving the plane (I'm setting Lat/Long) but I tried it again last night in Slew Mode which I would think should keep the plane stationary. Anyway, below is the log. Specifically look at the 0x0560 and 0x0568 offsets. I've included all the READs in case there is something else there that hints at why this is going on. You'll see that the READ values after the WRITE commands are differnt. I would have hoped to believe that the value I write (assuming it's a legal value) would be the value that is actually set. Please note: The differences here do not amount to any real spatial differnce, however, this discovery was made during the development of a workaround for a problem I'm having with WRITE commands not processing at all - which will be a different post :). Any help would be appreciated. Thanks, Frank. ********* FSUIPC, Version 3.75 by Pete Dowson ********* Running inside FS2004(original release) FSUIPC Key is provided WideFS Key is provided [Continuation log requested by user] Module base=61000000 ClassOptions: UIPCMAIN=FF7F, FS98MAIN=FF7F, FS2KMAIN=FF5E WeatherOptions(Orig)=40003605[40003605] InitDelay: 0 seconds WeatherReadInterval=4 LogOptions=0000000D 47950078 READ0 0570, 8 bytes: 00 00 45 FB FB 00 00 00 47950078 READ0 0020, 4 bytes: 9B 7C 00 00 47950078 READ0 02B4, 4 bytes: 00 00 00 00 47950078 READ0 0580, 4 bytes: 01 42 00 FA 47950078 READ0 02BC, 4 bytes: 00 00 00 00 47950078 READ0 0560, 8 bytes: 00 00 49 36 65 1C C0 FF 47950078 READ0 0568, 8 bytes: 00 00 A4 4F FA 64 13 67 47950078 READ0 02A0, 2 bytes: 06 08 47950078 READ0 0578, 4 bytes: 39 31 DA FD 47950078 READ0 057C, 4 bytes: 3B B1 03 00 47950078 READ0 02C8, 2 bytes: 00 00 47950078 READ0 0264, 2 bytes: 00 00 47950078 READ0 05DC, 2 bytes: 01 00 47950141 WRITE0 0560, 8 bytes: 8E 63 82 7E B3 41 C0 FF 47950187 WRITE0 0568, 8 bytes: 00 04 5B B0 05 1B FC 66 47950234 READ0 0568, 8 bytes: 00 00 5B B0 05 1B FC 66 47953859 READ0 0570, 8 bytes: 00 00 45 FB FB 00 00 00 47953859 READ0 0020, 4 bytes: 6D B7 00 00 47953859 READ0 02B4, 4 bytes: 00 00 00 00 47953859 READ0 0580, 4 bytes: 7F 36 00 FA 47953859 READ0 02BC, 4 bytes: 00 00 00 00 47953859 READ0 0560, 8 bytes: 00 00 82 7E B3 41 C0 FF 47953859 READ0 0568, 8 bytes: 00 00 5B B0 05 1B FC 66 47953859 READ0 02A0, 2 bytes: F7 07 47953859 READ0 0578, 4 bytes: EE 2C DA FD 47953859 READ0 057C, 4 bytes: 4D 99 04 00 47953859 READ0 02C8, 2 bytes: 00 00 47953859 READ0 0264, 2 bytes: 00 00 47953859 READ0 05DC, 2 bytes: 01 00 47953906 READ0 0238, 2 bytes: 00 27 47953969 READ0 0238, 2 bytes: 00 27 47954219 READ0 0570, 8 bytes: 00 00 45 FB FB 00 00 00 47954219 READ0 0020, 4 bytes: 6D B7 00 00 47954219 READ0 02B4, 4 bytes: 00 00 00 00 47954219 READ0 0580, 4 bytes: 7F 36 00 FA 47954219 READ0 02BC, 4 bytes: 00 00 00 00 47954219 READ0 0560, 8 bytes: 00 00 82 7E B3 41 C0 FF 47954219 READ0 0568, 8 bytes: 00 00 5B B0 05 1B FC 66 47954219 READ0 02A0, 2 bytes: F7 07 47954219 READ0 0578, 4 bytes: EE 2C DA FD 47954219 READ0 057C, 4 bytes: 4D 99 04 00 47954219 READ0 02C8, 2 bytes: 00 00 47954219 READ0 0264, 2 bytes: 00 00 47954219 READ0 05DC, 2 bytes: 01 00
Pete Dowson Posted May 20, 2008 Report Posted May 20, 2008 In trying to debug a problem I noticed that the values that I'm writing to an offset appear to be different when I read them immediately after. Yes, that can be correct with many of them -- the write goes to one place, a procedure or further computation, or converted into an Event/ control which goes via a message queue, whilst the read reads whatever FS set last. If your write had the exact effect you asked, then you'd expect the read to match it at some stage later, but not necessarily immediately. Of course some locations are not really "writeable" to any useful effect, and the read back will then often merely give you what FS decided, not what you decide. Please do not be fooled by the view of it as a memory area being written to and read. The "offset" values are, these days, nearly all merely "tokens". This is all to preserve the operation as it was in FS98 days, when, yes, it was an area (much smaller of course, then) in "GLOBALS.DLL". FS hasn't worked like that for a long long time. ********* FSUIPC, Version 3.75 by Pete Dowson ********* Please note that version 3.75 is very much out of date and is unsupported. Refer to the Announcements above to keep abreast of supported version numbers. In FS2004 (it varies from FS to FS), your 0560/0568 values are actually written to FS via a routine I know as "SetLLAPBH", in the Aircraft container part of SIM1.DLL. Looking at the differences in the values you are reading from those you are writing it looks clear that the lower 16 bits are simply ignored in this routine, presumably as being of little consequence? Regards Pete
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now