Page 15 of 33

Re: LS1 Boost OS - Development

Posted: Tue Nov 09, 2021 11:19 am
by bubba2533
Upload your tune file.

Re: LS1 Boost OS - Development

Posted: Tue Nov 16, 2021 12:03 pm
by bubba2533
Ok, so I did some looking at the EQ ratio blending code and I believe I found a fairly simple way to modify it to allow leaner mixtures for E80 (Alcohol) fuel.

Here is the factory code (7603 OS) along with my comments:

Code: Select all

ROM:00032198 sub.w   a1, d3                                          ; Determine EQ ratio delta (E0_EQ_Ratio - E80_EQ_Ratio)
ROM:0003219A bcc.s   loc_3219E                                     ; Branch to 3219E if result is not negative
ROM:0003219C clr.w   d3                                                 ; Clear delta if result is negative
ROM:0003219E mulu.w  (word_FF9FC6).w, d3                  ; Multiply EQ ratio delta by EQ blend factor
ROM:000321A2 lsr.l   #8, d3                                            ; Logical shifts to bring the value back to a normal EQ value
ROM:000321A4 lsr.l   #4, d3                                            ; 
ROM:000321A6 add.w   a1, d3                                         ; Add E0_EQ_ratio to the blended E80_EQ_Ratio
Here is my proposed code:

Code: Select all

ROM:00032198 sub.w   a1, d3                                          ; Determine EQ ratio delta (E0_EQ_Ratio - E80_EQ_Ratio)
ROM:0003219A bra.s   loc_3219E                                     ; Branch to 3219E no matter the result
ROM:0003219C clr.w   d3                                                 ; Not needed (could replace with NOP)
ROM:0003219E muls.w  (word_FF9FC6).w, d3                  ; Multiply EQ ratio delta by EQ blend factor (Changed to signed multiply)
ROM:000321A2 asr.l   #8, d3                                            ; Logical shifts to bring the value back to a normal EQ value (Changed to Arithmetic Shift)
ROM:000321A4 asr.l   #4, d3                                            ; 
ROM:000321A6 add.w   a1, d3                                         ; Add E0_EQ_ratio to the blended E80_EQ_Ratio
This is my first time doing this type of modification so I'm not positive it will work, but it seems like it will just looking at it. I'll do some testing on the bench to verify before releasing anything.

Re: LS1 Boost OS - Development

Posted: Wed Nov 17, 2021 5:16 am
by bubba2533
Ok, so I'm starting to work on the Wideband Closed Loop Control and I'm wondering if I should allow the Long Term Trims to be active under WOT?

The way the current code is when the Desired EQ Ratio is NOT equal to 1 then the LTFT's are not updated. I'm thinking of changing this to update the LTFT's no matter the Desired EQ Ratio.

Re: LS1 Boost OS - Development

Posted: Fri Nov 19, 2021 1:44 pm
by bubba2533
More changes:

I'm planning on making one VE table instead of 2. The main reason why I was doing two was for the P01 PCM because there isn't much unused space for new tables. For the P59 I can put all the parameters in unused address space (0x8A83E and up).

Not sure if I'll want to continue to mess around with the P01 since it's that much more difficult to find free space.

Re: LS1 Boost OS - Development

Posted: Sun Nov 21, 2021 12:07 pm
by NSFW
The code change looks good. Why the change from lsr.l to asr.l? (I'm not even sure what the difference is between the two.)

I've been meaning to switch my car from a P01 to P59 soon, before it goes in for a motor swap and retune, just on theory that the extra unused flash memory in the P59 would make it easier to modify the code.

Re: LS1 Boost OS - Development

Posted: Sun Nov 21, 2021 4:22 pm
by bubba2533
NSFW wrote:The code change looks good. Why the change from lsr.l to asr.l? (I'm not even sure what the difference is between the two.)

I've been meaning to switch my car from a P01 to P59 soon, before it goes in for a motor swap and retune, just on theory that the extra unused flash memory in the P59 would make it easier to modify the code.
It’s for signed values. It duplicates the highest bit instead of appending zeros which is what lsr.l does.

Yeah the extra space is really nice.

Re: LS1 Boost OS - Development

Posted: Sun Nov 21, 2021 11:36 pm
by In-Tech
I was looking at that too, does it affect the stack? I'm not sure if these GM one's do, but plenty have a "protected" stack

Re: LS1 Boost OS - Development

Posted: Mon Nov 22, 2021 3:37 am
by bubba2533
Does what affect the stack? The extra space?

No, the extra space is in the ROM section which can be used for code and parameters. The stack is in the RAM section, which is another problem if you need to save intermediate values for new code that was added. I was able to create 90 bytes of free RAM space by disabling the EGR code, so that's one way of doing it.

As for a protected stack I don't know, but I'm doing what I can to avoid interfering with it.

Re: LS1 Boost OS - Development

Posted: Wed Nov 24, 2021 7:34 am
by Highlander
bubba2533 wrote:More changes:

I'm planning on making one VE table instead of 2. The main reason why I was doing two was for the P01 PCM because there isn't much unused space for new tables. For the P59 I can put all the parameters in unused address space (0x8A83E and up).

Not sure if I'll want to continue to mess around with the P01 since it's that much more difficult to find free space.
P01 is also slower.

Re: LS1 Boost OS - Development

Posted: Wed Nov 24, 2021 7:39 am
by bubba2533
Highlander wrote: P01 is also slower.
How do you know that?