I want to try a lean cruise patch for myself in my own chip. Before anyone asks I do not want to buy a chip to do this. I have written most of this but am having trouble figuring out how to set the A/F properly.
Assumptions
1. I will only allow lean cruise when highway spark mode is active (4th gear, TCC locked, LV8<128)
2. I will further constrain it so it won't be active with LV8<40-50 or so, (TBD)
3. I use the highway A/F ratio at $324B and set it to $66 = 16.1:1 as a start for 40<LV8<70.
4. I will add a bit of fuel for 70<LV8<100. ~15.5:1
5. I will add still more for 100<LV8<128. ~15.0:1
6. To prevent screwing up my BLMs I will turn off C/L when using lean mixtures. Kind of like the O/L code built into the car already.
I wrote a patch that intercepted what I thought was the final A/F calculation at $3C3D and jumped to my patch. I did all of the above and jumped back again. For 16:1 I wrote the value $0066 (102 decimal) into location $91,$92 which is what I thought I had to do.
It mostly worked, DS showed highway spark mode enabling and then a couple of frames later it went into O/L but the A/F ratio according to DS was 0.1:1! Obviously screwy, on top of that the injector PW went to 173%!!!, the O2 did not show it going rich but I only let it do it for a second or 2. I let off on the gas and the normal fueling picked up again. If I stepped on the gas it would kick out of highway mode just fine and worked normally. I am somehow modifying the A/F ratio incorrectly.
Have I picked the wrong location to set the A/F ratio? Is my value getting modified further in the code somewhere? I assumed that no matter what A/F ratio was calculated, mine would overwrite it.
Assumptions
1. I will only allow lean cruise when highway spark mode is active (4th gear, TCC locked, LV8<128)
2. I will further constrain it so it won't be active with LV8<40-50 or so, (TBD)
3. I use the highway A/F ratio at $324B and set it to $66 = 16.1:1 as a start for 40<LV8<70.
4. I will add a bit of fuel for 70<LV8<100. ~15.5:1
5. I will add still more for 100<LV8<128. ~15.0:1
6. To prevent screwing up my BLMs I will turn off C/L when using lean mixtures. Kind of like the O/L code built into the car already.
I wrote a patch that intercepted what I thought was the final A/F calculation at $3C3D and jumped to my patch. I did all of the above and jumped back again. For 16:1 I wrote the value $0066 (102 decimal) into location $91,$92 which is what I thought I had to do.
It mostly worked, DS showed highway spark mode enabling and then a couple of frames later it went into O/L but the A/F ratio according to DS was 0.1:1! Obviously screwy, on top of that the injector PW went to 173%!!!, the O2 did not show it going rich but I only let it do it for a second or 2. I let off on the gas and the normal fueling picked up again. If I stepped on the gas it would kick out of highway mode just fine and worked normally. I am somehow modifying the A/F ratio incorrectly.
Have I picked the wrong location to set the A/F ratio? Is my value getting modified further in the code somewhere? I assumed that no matter what A/F ratio was calculated, mine would overwrite it.