RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Sat Feb 21, 2026 5:22 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Exploring my ROM
PostPosted: Wed Jun 23, 2010 10:05 am 
Offline
Moderator

Joined: Thu Nov 23, 2006 2:23 am
Posts: 2565
The vast majority of what went into the getting-started thread was things I learned from other people. Since those things worked for me, I figured they would work for anyone. This is a thread for things that I'm finding on my own... if other people can get the same results, them, then I'll add the important parts to the getting-started thread.

I'll start with the SSM write vector. After finding the SSM read vector, I looked at each of the subroutines until I found the last of the simple read routines:

Quote:
mov.l (some offset), r3
rts
mov.b @r3, r0 ; move whatever r3 points at into r0


...followed by the first simple write routine:

Quote:
mov.l (some offset), r3
rts
mov.b r4, @r3 ; move r4 into whatever r3 points at


The pointer to the first write routine is also XREF'd from some code that's closely related to the SSM read code, so I figure that's the start of the SSM write vector. Most of the write vector is pointers to a subroutine that just does an "rts" but there are three interesting function pointers at offsets 0x6F, 0x70, and 0x71.

Sasha_A80 said to expect functions to set a timing offset and idle speeds at those locations. I have only verified the timing offset so far (0x6F).

There's also a group of interesting subroutines at offset 0x80-0x89. Most of them are simple write routines, a couple of them contain some non-trivial logic, and I have no idea what any of them are for. At least, not yet. :)

The variable written to by the 0x6F handler is used in four places:
1) A routine that initializes it (along with the SSM-writeable idle variables and a few other things)
2) A routine that reads the variable, limits it with upper and lower bounds, and stores the result in another variable
3) A routine that reads the variable via an SSM read request
4) The SSM write routine, of course

The variable that gets the bounded version of the timing delta specified by SSM is only used in two places - the code that sets it (described above) and the code that adds it (along with several other things) to the total ignition timing.

A a couple of the other things being added to the total ignition timing are already documented. MRP compensation is in there, and so is a variable that I later found holds the sum of FLKC, FBKC, and ignition advance (already scaled by IAM). There are also a few as-yet-undocumented ignition compensations, which I am still investigating.

If other folks can find the SSM write vector this way, I'll add it to the 'getting started' thread. Maybe the ignition compensations too.

_________________
2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG
Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!


Top
 Profile  
 
 Post subject: Re: Exploring my ROM
PostPosted: Wed Jun 23, 2010 12:40 pm 
Offline
Senior Member

Joined: Mon Jan 19, 2009 6:31 pm
Posts: 1615
Location: Moscow, Russia
NSFW wrote:
If other folks can find the SSM write vector this way, I'll add it to the 'getting started' thread. Maybe the ignition compensations too.


JDM 2003 Forester AG572-1355 I am trying has SSM_Write_LUT just after SSM_Read_LUT.
h'160 SSM bytes (h'580 offset from SSM_Read_LUT location).

A newer version ROM may have another SSM table length.

Alternatively, you may try "Alternative ECU init command" 9F instead of BF, get "Alternative ECUID" and find those ID in the SSM read dump. Those 5 bytes are the end of SSM_Read_LUT and provide you with the SSM table length. Just after that last address SSM ReadSingle (B8) and SSM ReadMemory (B0) commands return 'FF's.

viewtopic.php?f=7&t=5672


Top
 Profile  
 
 Post subject: Re: Exploring my ROM
PostPosted: Fri Jun 25, 2010 2:23 am 
Offline
RomRaider Donator

Joined: Tue Apr 24, 2007 10:49 pm
Posts: 243
Do you think you've found the per-gear ignition timing compensation tables yet?


Top
 Profile  
 
 Post subject: Re: Exploring my ROM
PostPosted: Fri Jun 25, 2010 3:53 am 
Offline
Moderator

Joined: Thu Nov 23, 2006 2:23 am
Posts: 2565
No, but I haven't looked for that specifically. I was just following XREFs to the compensations that I did find, and trying to figure out where they were coming from. Mostly without luck though, I just ran into code that was messing with variables and/or tables that were not defined.

However I was thinking it would be interesting to see what code looks at the 'gear position' parameter so maybe I will soon?

Have you seen that in another ROM, or are you wondering if they exist at all?

_________________
2005 Legacy GT w/ ATP 3076, IWG, MBC, BCS, BC 272, LC, FFS, OMG
Please don't send questions via PM. Post a thread and send me a link to it instead. Thanks!


Top
 Profile  
 
 Post subject: Re: Exploring my ROM
PostPosted: Fri Jun 25, 2010 4:08 am 
Offline
RomRaider Donator

Joined: Tue Apr 24, 2007 10:49 pm
Posts: 243
NSFW wrote:
Have you seen that in another ROM, or are you wondering if they exist at all?


Bill mentioned that he had found them, I believe due to the discussions in this thread.

merchgod wrote:
Thanks Bullwinkle - those logs were very useful. The timing discrepancy that Airboy found appears to be due to a per gear timing compensation. Generally, the higher the RPM and load, the greater the negative compensation, while the higher the gear, the less the negative comp. It is not always active and I have to work on it some more to determine when it active, but it is certainly something I can add to the upcoming defs. During the WOT run in the log, it was active the entire time, while at lower loads, it was more sporadic when it was active.


Right now, I'm focusing on finding out how the KCA Additive A/B work because from what I've seen, they don't work how I expected them to, based on the descriptions in the ECU defs.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl