RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Thu Dec 25, 2025 9:01 pm

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Quick Question: Extending Map Sizes
PostPosted: Sat Feb 06, 2021 7:49 pm 
Offline
RomRaider Donator
User avatar

Joined: Fri Jul 26, 2019 3:35 am
Posts: 789
Location: United States of America
Hello all!

Just a quick question, does anyone have any insight on how to extend a 8x8 map to a 16x16, or a 16x16 to a 32x32? Comparing the Target AFR Map Function to the Fuel Compensation Function (both are uint8) shows "_mov #0x7, param_1" for the 8x8 and "_mov #0xf, param_1" for the 16x16. Which translates to 7 for 8x8 and 15 for 16x16. Then at the end of the function, "_mov #0x8, r5" and "_mov #0x10, r5". Or 8 for 8x8 and 16 for 16x16.

Would you really be able to just change these to whatever you want to specify the size of the map? (Then increasing the actual data for said maps alongside the axes) Or is there more to it than this? I can see that for uint16 functions, the numbers get a bit wonky. A uint16 8x8 is showing #0xe for both axes, while the 16x16 shows #0xf and #0x1e.

Oh and for anyone wondering about the reason, I enjoy fine tuning things. So having RPM increments of 200 rather than 400 would be worth the hassle for me. Plus I have TONS of extra space in my ROM due to figuring out what's currently active and what's not, so might as well put it to use! All that I'd have to change is the storage address' for the map + axes, then call it a day ;)
Attachment:
8vs16.PNG


You do not have the required permissions to view the files attached to this post.

_________________
NissanDefinitions Repository


Top
 Profile  
 
 Post subject: Re: Quick Question: Extending Map Sizes
PostPosted: Sat Feb 06, 2021 8:21 pm 
Offline
Experienced
User avatar

Joined: Wed Jan 08, 2014 11:07 pm
Posts: 652
Pytrex wrote:
extend a 8x8 map to a 16x16, or a 16x16 to a 32x32


No idea if it's ever been tried ? should be possible. I think you're on the right track but you can look one level higher;

Code:
D4 AF       mov.l   #unk_9471, r4
D5 AF       mov.l   #unk_B4AE, r5
D6 B0       mov.l   #unk_B50A, r6
92 B3       mov.w   #h'6FE4, r2
42 0B       jsr     @r2 ; sub_6FE4
67 0D       extu.w  r0, r7


I'd replace that call to 6FE4 to whatever pre-existing function already does the correct interpolation you need. But you need to be really sure you match
- datasize of both axis values
- datasize of output value
- any other weirdness / scaling. I vaguely recall some RDtable funcs were doing stuff like a shll2 to the input value of one of the axis.

You can also modify 6FE4 as you're describing (make sure you understand it well), but then you need to check *all* places where it's called, and convert all those maps+axis, and then make sure they aren't used in other ways, or axis data reused for other maps etc

_________________
If you like nisprog + npkern, you can support me via https://liberapay.com/fenugrec/
For sending me encrypted/secure messages, use PGP key 0xBAC61AEB3A3E6531 available from pool.sks-keyservers.net


Top
 Profile  
 
 Post subject: Re: Quick Question: Extending Map Sizes
PostPosted: Sat Feb 06, 2021 8:41 pm 
Offline
RomRaider Donator
User avatar

Joined: Fri Jul 26, 2019 3:35 am
Posts: 789
Location: United States of America
fenugrec wrote:

I'd replace that call to 6FE4 to whatever pre-existing function already does the correct interpolation you need. But you need to be really sure you match
- datasize of both axis values
- datasize of output value
- any other weirdness / scaling. I vaguely recall some RDtable funcs were doing stuff like a shll2 to the input value of one of the axis.


Ohhhhhh, that makes sense! You're actually 100% right on that one. Even if they are using the same JSR for the axes, the main JSR is actually different. I'd MUCH rather just have it JSR to the right function rather than altering the current one. That way I can ensure that I have complete control over it all. Because not all maps have the space right after their original storage address to JUST extend the axes. So if you would have to alter the storage address for any other maps that use that same JSR, you might as well just change where it JSR's to rather than changing the core function.

Good catch Fenugrec! :) I'm adding the extended maps to my template rn and I'm going to carefully test them out later tonight I think. So far, Fuel Compensation (Unconfirmed on axes) and Target AFR (Confirmed on axes) can be extended from their original storage address'! Not sure if I'll keep the extended maps, but I just want to make sure that I CAN and that I fully understand how it all works.

Somewhat off topic, but if you can JUST alter the JSR, that would open up an endless world of possibilities. The Engine Torque Map (16x16) that controls line pressure, has fixed axes. I personally hate this design because they waste half the map due to it being 0-150% ITAC. If I just had the axes be set to the QH0 map axes or custom ones, then JSR to the QH0 maps' JSR, then I could have full control over the axes for that map without having to alter much at all. Definitely some really cool stuff lol

Let's just hope it's as simple as it's appearing and that no nonsense complicates things.

Edit; The easiest way so far is to change the hex value of the address used to set the JSR address. So rather than changing DAT_00038602 to try being DAT_000233F4 (not possible), I just changed the hex value from "6F78" to "6FE4". This is okay because this DAT address is only referenced once. Won't ring true for every map, however.

_________________
NissanDefinitions Repository


Top
 Profile  
 
 Post subject: Re: Quick Question: Extending Map Sizes
PostPosted: Sun Feb 07, 2021 5:00 am 
Offline
RomRaider Donator
User avatar

Joined: Fri Jul 26, 2019 3:35 am
Posts: 789
Location: United States of America
Boom! Target AFR is officially a 16x16 now and Fuel Compensation is a 22x22! If you wanted to, you could even convert either x-axis to the other. So if you wanted Fuel Compensation to be ITAC (BFS) based, you could with ease.

Gosh, I’m just so happy because I HATE code. So to have it workout is just such a great feeling. This was more of a motivational project more than anything. Just so I know that I can do it. The issue is adding axes to fixed axis maps. Still haven’t figured that one out yet.

_________________
NissanDefinitions Repository


Top
 Profile  
 
 Post subject: Re: Quick Question: Extending Map Sizes
PostPosted: Sun Feb 07, 2021 9:12 am 
Offline
Experienced
User avatar

Joined: Wed Jan 08, 2014 11:07 pm
Posts: 652
Pytrex wrote:
Fuel Compensation is a 22x22!

22x22 is an strange number... does the stock ROM even use that or you modified the RDtable function ?

Quote:
So if you wanted Fuel Compensation to be ITAC (BFS) based, you could with ease.


To use a different axis, don't forget you need to also change the input value too... i.e. a 2D RDtable takes 5 arguments:
Code:
rdtable_6FE4(tbl_address, axis0_addr, axis1_addr, axis0_value, axis1_value) // possibly wrong order, doesn't matter


so only changing the table contents (of course) and axis0_addr isn't enough, you also have to give it the correct new axis0_value. I think I talk about that in one of my vids.

_________________
If you like nisprog + npkern, you can support me via https://liberapay.com/fenugrec/
For sending me encrypted/secure messages, use PGP key 0xBAC61AEB3A3E6531 available from pool.sks-keyservers.net


Top
 Profile  
 
 Post subject: Re: Quick Question: Extending Map Sizes
PostPosted: Sun Feb 07, 2021 9:20 am 
Offline
RomRaider Donator
User avatar

Joined: Fri Jul 26, 2019 3:35 am
Posts: 789
Location: United States of America
I just modified it haha In the stock fuel compensation location, 22x22 was the largest (same axis size for X and Y) that could fit! To be honest, I could’ve just shifted it back a few rows and gotten it to be quite large, but I was too worried about getting the thing to even work in the first place! I wasn’t too focused on maximizing the map or anything haha Things might get quirky when the axes are different sizes from one another, so I decided to just make them the same size. Interestingly enough, all I changed was the stuff mentioned about and it supported it! So I guess the main thing that determines axis size is those numbers.

Yup! I’m well aware of having to change the axis trace as well, luckily ;) It would be quite funny seeing someone get confused over their axis not tracing properly when they didn’t convert the axis trace as well lol

Below is a photo comparing stock 8x8 / 16x16 and modified 16x16 / 22x22. Don’t mind the axis or data, it was purely just to act as base maps + RR doesn’t like when you reuse the same axis haha Gonna have to utilize a different axis for the “Target AFR Table (High Detonation)” because RR hates it.


You do not have the required permissions to view the files attached to this post.

_________________
NissanDefinitions Repository


Top
 Profile  
 
 Post subject: Re: Quick Question: Extending Map Sizes
PostPosted: Thu Feb 18, 2021 9:41 pm 
Offline
RomRaider Donator
User avatar

Joined: Fri Jul 26, 2019 3:35 am
Posts: 789
Location: United States of America
These are CF48D exclusive, but this should just give you an idea of what to expect for presumably the majority of 350z ROM's (SH7058). As for those with SH7055, good luck lol Any map that uses the same function either NEEDS to be extended as well, OR you can just copy and paste the function somewhere else in the ROM and reference that one, as you need to alter the functions code to extend the map.

Attachment:
mapextensions.PNG


You do not have the required permissions to view the files attached to this post.

_________________
NissanDefinitions Repository


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

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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