woj
|
|
« Reply #38 on: June 29, 2017, 06:35:32 AM »
|
|
|
So much talk about nothing. Talk, talk talk. Take the car and do something with it. Here, let me get out my spoon:
Let's go to BGWLM module and check some pressure scalars: PBRINTMN, PBRINTMX - factor 0.0390625
Multiply by 65535, what do you get?
I decided not to take for granted what you said and I made the effort to look into the code. This is work in progress and I also use my own home-made disassembler, so spare me the comments of the sort "this is not exactly right". No, it is not, not yet at least. First, the DSS sensor reading conversion routine, one of them, here you can see there are two kinds of variables set, ones named with "full" have the range 5120 hPa, the ones names "trunc", 2560 hPa: sub_05A75E: flash_05A75E:[88,80] mov [-r0], r8 flash_05A760:[F2,FC,3E,88] mov r12, ramext_word_0F083E flash_05A764:[42,FC,5C,3B] cmp r12, UADPSRMX_0ABB5C flash_05A768:[9D,06] jmpr [cc_NC,cc_UGE], loc_05A776 loc_05A76A: flash_05A76A:[42,FC,5A,3B] cmp r12, UADPSRMN_0ABB5A flash_05A76E:[FD,03] jmpr cc_ULE, loc_05A776 loc_05A770: flash_05A770:[FF,20] bset iram_word_FD40.15 flash_05A772:[8F,20] bset iram_word_FD40.8 flash_05A774:[0D,02] jmpr cc_UC, loc_05A77A loc_05A776: flash_05A776:[FE,20] bclr iram_word_FD40.15 flash_05A778:[8E,20] bclr iram_word_FD40.8 loc_05A77A: flash_05A77A:[5C,6C] shl r12, #6 flash_05A77C:[F6,FC,04,99] mov DSS_raw_0F1904, r12 flash_05A780:[F0,CC] mov r12, r12 flash_05A782:[F2,FD,3A,3B] mov r13, DSSGRAD_0ABB3A flash_05A786:[DA,00,34,4F] calls multiply_4F34 flash_05A78A:[F0,C4] mov r12, r4 flash_05A78C:[F2,FD,3C,3B] mov r13, DSSOFS_0ABB3C flash_05A790:[DA,00,DC,4C] calls add_4CDC flash_05A794:[F0,84] mov r8, r4 flash_05A796:[F6,F8,00,99] mov DSS_full_0F1900, r8 flash_05A79A:[46,F8,00,80] cmp r8, #0x8000 flash_05A79E:[FD,03] jmpr cc_ULE, loc_05A7A6 loc_05A7A0: flash_05A7A0:[E6,FC,FF,FF] mov r12, #0xFFFF flash_05A7A4:[0D,02] jmpr cc_UC, loc_05A7AA loc_05A7A6: flash_05A7A6:[F0,C8] mov r12, r8 flash_05A7A8:[5C,1C] shl r12, #1 loc_05A7AA: flash_05A7AA:[F6,FC,F2,98] mov DSS_trunc_0F18F2, r12 flash_05A7AE:[F6,F8,FC,98] mov DSS_full_0F18FC, r8 flash_05A7B2:[F6,F8,F8,98] mov DSS_full_0F18F8, r8 flash_05A7B6:[F6,F8,FA,98] mov DSS_full_0F18FA, r8 flash_05A7BA:[F6,FC,F6,98] mov DSS_trunc_0F18F6, r12 flash_05A7BE:[98,80] mov r8, [r0+] flash_05A7C0:[DB,00] rets
I will spare the code calculating PRINT and related things, the main point is that this one is indeed in the range of up to 2560 hPa. And then, a place (there are other similar ones, but looking almost exactly the same) where pbrintX, fupsrlX, and psX (not yet sure which X is what yet) are used to calculate load related things: flash_05A9D2:[F2,F9,22,A7] mov r9, pbrint1_0F2722 flash_05A9D6:[7C,19] shr r9, #1 flash_05A9D8:[F2,F8,06,A7] mov r8, fupsrl1_0F2706 flash_05A9DC:[F2,FC,F8,98] mov r12, DSS_full_0F18F8 flash_05A9E0:[F0,D9] mov r13, r9 flash_05A9E2:[DA,00,06,4E] calls subtract_4E06 flash_05A9E6:[F0,D4] mov r13, r4 flash_05A9E8:[F0,C8] mov r12, r8 flash_05A9EA:[DA,00,34,4F] calls multiply_4F34 flash_05A9EE:[F6,F4,10,99] mov ramext_word_0F1910, r4 flash_05A9F2:[F2,FC,FA,98] mov r12, DSS_full_0F18FA flash_05A9F6:[F0,D9] mov r13, r9 flash_05A9F8:[DA,00,06,4E] calls subtract_4E06 flash_05A9FC:[F0,D4] mov r13, r4 flash_05A9FE:[F0,C8] mov r12, r8 flash_05AA00:[DA,00,34,4F] calls multiply_4F34 flash_05AA04:[F6,F4,0E,99] mov ramext_word_0F190E, r4 flash_05AA08:[F6,F4,14,99] mov ramext_word_0F1914, r4 flash_05AA0C:[F2,F8,10,99] mov r8, ramext_word_0F1910 flash_05AA10:[F6,F8,12,99] mov ramext_word_0F1912, r8 flash_05AA14:[98,80] mov r8, [r0+] flash_05AA16:[98,90] mov r9, [r0+] flash_05AA18:[DB,00] rets
Do I see a 5120 hack? Surprising, considering it is factory code, isn't it? Now, I do not yet know if that holds for all ME7.9.10 versions, so far I only looked at the Abarth and family program code, perhaps the weak 120 hp version of the code have this done differently. Will see with time, to be continued... PS. I am not sure how to make this code look nicer with a mono spaced font...
|