Just hold on there Razor. There's more to come.
Isnt boost spark advance loc $0065?
Yes it is, and it's value is the product from the multiply of $3270 and $66.
So you make $3270 = # degrees retard (as per previous post)
While you're there, make $3272 = 00. This will prevent the fuel trim from getting "hosed".
Now, what follows is code to do what you're looking for. The addresses I used can certainly be changed. I just picked a convenient portion of garbage code that can be over written.
<Determine if in 3rd or 4th gear>
37DF: 4F CLRA A = 00
37E0: D6 03 LDAB $03 (Flags03)
37E2: 58 ASLB shift B left, b7 to carry
37E3: 2A 03 BPL $37E8 if bit 6 = 0 [4th Gear On] goto $37E8
<not in 4th gear, so check if 3rd>
37E5: 58 ASLB shift $03 left again
37E6: 2B 18 BMI $3800 if bit 5 = 1 [3rd gear not On] must be in 1st or 2nd gear
**** in 3rd or 4th gear so check RPM
37E8: D6 18 LDAB $18 (ntRPM)
37EA: C1 D0 CMPB #$D0 (3600 RPM)
37EC: 22 02 BHI $37F0 if (RPM > 3600) goto $37F0
37EE: 20 10 BRA $3800 done
**** check LV8
37F0: D6 23 LDAB $23 (LV8)
37F2: C1 FA CMPB #$FA (250)
37F4: 22 02 BHI $37F8 if (LV8 > 250) goto $37F8
37F6: 20 08 BRA $3800 done
**** check MAF
37F8: D6 AB LDAB $AB (MAF)
37FA: C1 EB CMPB #$EB (235)
37FC: 23 02 BLS $3800 if (MAF <= 235) goto $3800
37FE: 86 FF LDAA #$FF A = FF (multiplier for advance reduction)
**** done
3800: 97 66 STAA $66 store Advance scaler (00 = no reduction, FF = reduction)
3802: 20 04 BRA $3808
This code doesn't look so good without the tabs.
You might be able to remove the LV8 check for 250 since I'm pretty sure it will be there when the other conditions are met.
Disclaimer: I haven't tried this yet in the car, but it sure looks good on paper.
The way it should work is, the ROM code calculates advance and if you're in boost ...
How does the ecm know your in boost?
It sets a flag when the airflow exceeds the $3457 #.
Where was I? Oh yea, the ROM code will try to add advance during boost, but we'll give it a negative number so it ends up subtracting.
If this works, you owe me a beer.