Pages: [1]
Author Topic: Where are the SY_* values stored?  (Read 8659 times)
elRey
Hero Member
*****

Karma: +32/-1
Offline Offline

Posts: 565


« on: March 19, 2011, 04:56:30 PM »

Where are the SY_* values stored?

SY_NWS
SY_TURBO

etc.


Thanks,
Rey
Logged
Rick
Hero Member
*****

Karma: +62/-4
Offline Offline

Posts: 704


« Reply #1 on: March 21, 2011, 05:03:42 AM »

Are you talking about the system constants?  If so I don't think they are stored in the ecu.  They are selected at compile stage, and then the hex is generated to suit.  If only we had the source code!

Rick
Logged
Tony@NefMoto
Administrator
Hero Member
*****

Karma: +130/-4
Offline Offline

Posts: 1389


2001.5 Audi S4 Stage 3


« Reply #2 on: March 21, 2011, 10:47:17 AM »

One really tricky thing about modifying tuned ECUs, is all of the constants are compiled into the code. If we had the source code we could change a ton of stuff.
Logged

Remember you have to log in if you want to see the file attachments!
Info or questions, please add to the wiki: http://www.nefariousmotorsports.com/wiki
Follow NefMoto developments on Twitter: http://twitter.com/nefmoto
elRey
Hero Member
*****

Karma: +32/-1
Offline Offline

Posts: 565


« Reply #3 on: March 21, 2011, 05:26:02 PM »

I don't understand. Aren't the other maps values (1D maps) also 'complied'? But we can find the byte or bytes to modify them. What's difference with the system constants? Are there not bytes in the bin that corresponds to them?
Logged
Tony@NefMoto
Administrator
Hero Member
*****

Karma: +130/-4
Offline Offline

Posts: 1389


2001.5 Audi S4 Stage 3


« Reply #4 on: March 21, 2011, 06:42:28 PM »

Some constants defined in code compiled in and removed by the compiler. If there is a constant in the code, then the compiler will "hard code" the value into the compiled code instead of storing it at an address in memory.
Logged

Remember you have to log in if you want to see the file attachments!
Info or questions, please add to the wiki: http://www.nefariousmotorsports.com/wiki
Follow NefMoto developments on Twitter: http://twitter.com/nefmoto
elRey
Hero Member
*****

Karma: +32/-1
Offline Offline

Posts: 565


« Reply #5 on: April 08, 2011, 09:35:17 AM »

Some constants defined in code compiled in and removed by the compiler. If there is a constant in the code, then the compiler will "hard code" the value into the compiled code instead of storing it at an address in memory.

Meaning if I look at the function that compares the SYS constant to 00 I will see something like
cmp 00, 00  #each value is hard coded right there
instead of
cmp 00, some_ref_to_address
?

Thanks,
Rey
Logged
ArgDub
Full Member
***

Karma: +60/-1
Offline Offline

Posts: 202


« Reply #6 on: April 08, 2011, 01:11:50 PM »

No, comparing a constant with 00 makes no sense, because the result of that comparison never changes (both are constants)
Logged
elRey
Hero Member
*****

Karma: +32/-1
Offline Offline

Posts: 565


« Reply #7 on: April 08, 2011, 01:16:53 PM »

OK, then the alternative (according to Tony's comment) would be a complete function rewrite depending on the SY_* constant.

i.e.
SY_* = 0
then complile
function X is hard coded one way

else

SY_* = 1
the complie
function X is hard coded a completely different way.
Logged
ArgDub
Full Member
***

Karma: +60/-1
Offline Offline

Posts: 202


« Reply #8 on: April 09, 2011, 05:26:37 AM »

yes, changing a sys_constant generates a different binary.
Logged
elRey
Hero Member
*****

Karma: +32/-1
Offline Offline

Posts: 565


« Reply #9 on: April 09, 2011, 07:45:46 AM »

Because the complier recongizes that with a SY_* constant set one way, parts of the function will never be used, so it never writes those parts to the bin?
Logged
Tony@NefMoto
Administrator
Hero Member
*****

Karma: +130/-4
Offline Offline

Posts: 1389


2001.5 Audi S4 Stage 3


« Reply #10 on: April 11, 2011, 04:11:03 PM »

The compiler is free to remove code that is unreachable. So it is entirely possible that the code you want to enable has already been removed from the binary.
Logged

Remember you have to log in if you want to see the file attachments!
Info or questions, please add to the wiki: http://www.nefariousmotorsports.com/wiki
Follow NefMoto developments on Twitter: http://twitter.com/nefmoto
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.018 seconds with 16 queries. (Pretty URLs adds 0s, 0q)