LS1 Boost OS - Development

For discussion and distribution of custom code and hacks
Posts: 231
Joined: Wed Apr 11, 2018 8:50 am

Re: LS1 Boost OS - Development

Postby bubba2533 » Tue Nov 09, 2021 11:19 am

Upload your tune file.
LS1 Boost OS: If you have Questions about the current release post Here. If you have feature suggestions post in the Development Thread

Posts: 231
Joined: Wed Apr 11, 2018 8:50 am

Re: LS1 Boost OS - Development

Postby bubba2533 » Tue Nov 16, 2021 12:03 pm

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.
Last edited by bubba2533 on Fri Nov 19, 2021 1:44 pm, edited 1 time in total.
LS1 Boost OS: If you have Questions about the current release post Here. If you have feature suggestions post in the Development Thread

Posts: 231
Joined: Wed Apr 11, 2018 8:50 am

Re: LS1 Boost OS - Development

Postby bubba2533 » Wed Nov 17, 2021 5:16 am

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.
LS1 Boost OS: If you have Questions about the current release post Here. If you have feature suggestions post in the Development Thread

Posts: 231
Joined: Wed Apr 11, 2018 8:50 am

Re: LS1 Boost OS - Development

Postby bubba2533 » Fri Nov 19, 2021 1:44 pm

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.
LS1 Boost OS: If you have Questions about the current release post Here. If you have feature suggestions post in the Development Thread

User avatar
Posts: 550
Joined: Fri Feb 02, 2018 3:13 pm

Re: LS1 Boost OS - Development

Postby NSFW » Sun Nov 21, 2021 12:07 pm

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.
Please don't PM me with technical questions - start a thread instead, and send me a link to it. That way I can answer in public, and help other people who have the same question. Thanks!

Posts: 231
Joined: Wed Apr 11, 2018 8:50 am

Re: LS1 Boost OS - Development

Postby bubba2533 » Sun Nov 21, 2021 4:22 pm

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.
LS1 Boost OS: If you have Questions about the current release post Here. If you have feature suggestions post in the Development Thread

Posts: 425
Joined: Mon Mar 09, 2020 4:35 pm
Location: California

Re: LS1 Boost OS - Development

Postby In-Tech » Sun Nov 21, 2021 11:36 pm

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

Posts: 231
Joined: Wed Apr 11, 2018 8:50 am

Re: LS1 Boost OS - Development

Postby bubba2533 » Mon Nov 22, 2021 3:37 am

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.
LS1 Boost OS: If you have Questions about the current release post Here. If you have feature suggestions post in the Development Thread

Posts: 56
Joined: Sun May 11, 2014 6:36 pm

Re: LS1 Boost OS - Development

Postby Highlander » Wed Nov 24, 2021 7:34 am

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.

Posts: 231
Joined: Wed Apr 11, 2018 8:50 am

Re: LS1 Boost OS - Development

Postby bubba2533 » Wed Nov 24, 2021 7:39 am

Highlander wrote:P01 is also slower.


How do you know that?
LS1 Boost OS: If you have Questions about the current release post Here. If you have feature suggestions post in the Development Thread

PreviousNext

Return to Custom Code

Who is online

Users browsing this forum: v6bucket and 3 guests