Still need to change some things around, but I think it should work with the next revision

Exactly, the end of the bin has tons of unused space for code & parameter data. The more difficult part was finding unused RAM.Gampy wrote:How do you find space to put additional code??
Is this just empty space in the bin, add your code, hijack a jump point to your location, at that point you have control, thus you can either run your code or the original code in the order you choose??
Thank ya sir!bubba2533 wrote:Exactly, the end of the bin has tons of unused space for code & parameter data. The more difficult part was finding unused RAM.
Code: Select all
ROM:0008A900
ROM:0008A900 ; =============== S U B R O U T I N E =======================================
ROM:0008A900
ROM:0008A900
ROM:0008A900 sub_8A900: ; CODE XREF: sub_3B82A+E8p
ROM:0008A900 jsr sub_2696E
ROM:0008A906 tst.b ($FFFFB370).w //DBW Enable
ROM:0008A90A beq.s loc_8A912
ROM:0008A90C move.w ($FFFFA598).w,d4 //DBW TPS
ROM:0008A910 bra.s loc_8A916
ROM:0008A912 ; ---------------------------------------------------------------------------
ROM:0008A912
ROM:0008A912 loc_8A912: ; CODE XREF: sub_8A900+Aj
ROM:0008A912 move.w ($FFFFAB64).w,d4 //NON-DBW TPS
ROM:0008A916
ROM:0008A916 loc_8A916: ; CODE XREF: sub_8A900+10j
(Engine speed needs to be the last variable before spark cut.)
ROM:0008A916 move.w ($FFFFA562).w,d3 //------------------Engine Speed Constant?
ROM:0008A91A cmp.w (word_8AB00).l,d3 // -----------------Engine speed in RAM?
ROM:0008A920 bcc.w loc_8A9CC
ROM:0008A924 tst.b ($FFFF819E).w // LC Status
ROM:0008A928 beq.s loc_8A97E
ROM:0008A92A tst.b ($FFFFAF3A).w // Brake Pedal
ROM:0008A92E beq.s loc_8A94A
ROM:0008A930 tst.b ($FFFFAF3A).w // Brake Pedal (Need to confirm clutch ram address before changing this)
ROM:0008A934 beq.s loc_8A94A
(VSS needs to be flipped, read constant first than compare)
ROM:0008A936 move.w ($FFFFAEBC).w,d3 // ----------------Vehicle Speed Filtered in RAM?
ROM:0008A93A cmp.w (word_8AB02).l,d3 //-----------------Added VSS constant?
ROM:0008A940 bhi.s loc_8A94A
ROM:0008A942 cmp.w (word_8AB04).l,d4//------------Not sure what is being compared here.
ROM:0008A948 bhi.s loc_8A970
ROM:0008A94A
ROM:0008A94A loc_8A94A: ; CODE XREF: sub_8A900+2Ej
ROM:0008A94A ; sub_8A900+34j ...
ROM:0008A94A clr.b ($FFFF819E).w // Disable LC if a parameter is no longer satisfied
ROM:0008A94E move.w ($FFFFAEBC).w,d3 // Vehicle Speed
ROM:0008A952 cmp.w (word_8AB02).l,d3
ROM:0008A958 bhi.s locret_8A9CE
ROM:0008A95A cmp.w (word_8AB04).l,d4
ROM:0008A960 bcs.s locret_8A9CE
ROM:0008A962 move.b #1,($FFFF819F).w // Enable timed spark retard
ROM:0008A968 move.w ($FFFFB544).w,($FFFF81A0).w // Move cycle counter to a local copy when timed retard is enabled
ROM:0008A96E bra.s locret_8A9CE
ROM:0008A970 ; ---------------------------------------------------------------------------
ROM:0008A970
ROM:0008A970 loc_8A970: ; CODE XREF: sub_8A900+48j
ROM:0008A970 move.w ($FFFFA562).w,d3 // Engine speed
ROM:0008A974 cmp.w (word_8AB06).l,d3
ROM:0008A97A bcc.s loc_8A9CC
ROM:0008A97C bra.s locret_8A9CE
ROM:0008A97E ; ---------------------------------------------------------------------------
ROM:0008A97E
ROM:0008A97E loc_8A97E: ; CODE XREF: sub_8A900+28j
ROM:0008A97E tst.b ($FFFFAF3A).w // Brake Pedal
ROM:0008A982 beq.s loc_8A9A6
ROM:0008A984 tst.b ($FFFFAF3A).w // Brake Pedal (Need to confirm clutch ram address before changing this)
ROM:0008A988 beq.s loc_8A9A6
ROM:0008A98A move.w ($FFFFAEBC).w,d3 // Vehicle Speed
ROM:0008A98E cmp.w (word_8AB02).l,d3
ROM:0008A994 bhi.s loc_8A9A6
ROM:0008A996 cmp.w (word_8AB04).l,d4
ROM:0008A99C bcs.s loc_8A9A6
ROM:0008A99E move.b #1,($FFFF819E).w // Enable LC if all parameters are satisifed
ROM:0008A9A4 bra.s locret_8A9CE
ROM:0008A9A6 ; ---------------------------------------------------------------------------
ROM:0008A9A6
ROM:0008A9A6 loc_8A9A6: ; CODE XREF: sub_8A900+82j
ROM:0008A9A6 ; sub_8A900+88j ...
ROM:0008A9A6 tst.b ($FFFFAF3A).w // FFS Brake Pedal (Need to confirm clutch ram address before changing this)
ROM:0008A9AA beq.s locret_8A9CE
ROM:0008A9AC move.w ($FFFFAEBC).w,d3 // Compare vehicle speed for FFS
ROM:0008A9B0 cmp.w (word_8AB08).l,d3
ROM:0008A9B6 bcs.s locret_8A9CE
ROM:0008A9B8 cmp.w (word_8AB04).l,d4 // Compare TPS for FFS
ROM:0008A9BE bcs.s locret_8A9CE
ROM:0008A9C0 move.w ($FFFFA562).w,d3 // Compare engine speed for FFS
ROM:0008A9C4 cmp.w (word_8AB0C).l,d3
ROM:0008A9CA bcs.s locret_8A9CE
ROM:0008A9CC
ROM:0008A9CC loc_8A9CC: ; CODE XREF: sub_8A900+20j
ROM:0008A9CC ; sub_8A900+7Aj
ROM:0008A9CC clr.l d6 // Clear dwell value
ROM:0008A9CE
ROM:0008A9CE locret_8A9CE: ; CODE XREF: sub_8A900+58j
ROM:0008A9CE ; sub_8A900+60j ...
ROM:0008A9CE rts
ROM:0008A9CE ; End of function sub_8A900
ROM:0008A9CE
Code: Select all
ROM:0008A9D0
ROM:0008A9D0 ; =============== S U B R O U T I N E =======================================
ROM:0008A9D0
ROM:0008A9D0
ROM:0008A9D0 sub_8A9D0: ; CODE XREF: sub_3A436+58p
ROM:0008A9D0 jsr sub_26994
ROM:0008A9D6 tst.b ($FFFF819F).w // Test if timed retard active
ROM:0008A9DA beq.s locret_8AA22
ROM:0008A9DC tst.b ($FFFFB370).w // DBW Enable
ROM:0008A9E0 beq.s loc_8A9E8
ROM:0008A9E2 move.w ($FFFFA598).w,d3 // DBW TPS
ROM:0008A9E6 bra.s loc_8A9EC
ROM:0008A9E8 ; ---------------------------------------------------------------------------
ROM:0008A9E8
ROM:0008A9E8 loc_8A9E8: ; CODE XREF: sub_8A9D0+10j
ROM:0008A9E8 move.w ($FFFFAB64).w,d3 // Non-DBW TPS
ROM:0008A9EC
ROM:0008A9EC loc_8A9EC: ; CODE XREF: sub_8A9D0+16j
ROM:0008A9EC cmp.w (word_8AB04).l,d3
ROM:0008A9F2 bcs.s loc_8AA1E
ROM:0008A9F4 clr.l d3
ROM:0008A9F6 move.w ($FFFF81A0).w,d1 // Cycle counter when timed retard was activated
ROM:0008A9FA move.w ($FFFFB544).w,d3 // Cycle counter
ROM:0008A9FE sub.w d1,d3
ROM:0008AA00 move.w d3,($FFFF81A4).w // Delta cycles
ROM:0008AA04 mulu.w #$10,d3
ROM:0008AA08 cmpi.w #$2800,d3
ROM:0008AA0C bcc.s loc_8AA1E
ROM:0008AA0E tbls.w (word_8AB0E).l,d3
ROM:0008AA16 add.w d3,d0
ROM:0008AA18 move.w d3,($FFFF81A2).w // Save result from table lookup
ROM:0008AA1C bra.s locret_8AA22
ROM:0008AA1E ; ---------------------------------------------------------------------------
ROM:0008AA1E
ROM:0008AA1E loc_8AA1E: ; CODE XREF: sub_8A9D0+22j
ROM:0008AA1E ; sub_8A9D0+3Cj
ROM:0008AA1E clr.b ($FFFF819F).w // Clear timed retard status
ROM:0008AA22
ROM:0008AA22 locret_8AA22: ; CODE XREF: sub_8A9D0+Aj
ROM:0008AA22 ; sub_8A9D0+4Cj
ROM:0008AA22 rts
ROM:0008AA22 ; End of function sub_8A9D0
ROM:0008AA22
Maybe, but why not add features now vs trying to re-do the whole thing. I think the hardest part I'm dealing with is how long it takes me to code this up in ASM. I'm not a programmer, but I have read that some people have written in higher level languages and then compiling to ASM. That would help a lot, but it would probably take me some time to learn it.vwnut8392 wrote:your sort of over complicating the process of this bubba by trying to achieve so much so early in the development.
I got the spark cut working days ago when I posted the chart of the dwell going to zero. I'm not doing a spark retard for the limiter, I don't think there is much use for that other than changing the sound and maybe it could make it a little smoother.vwnut8392 wrote:have you got the retard and spark cut parts working yet?
I want to be able to let the user rev past the LC limiter when stopped if they want to. That's why I am adding the clutch switch. I can always add parameters to disable the use of the brake/clutch input for people that don't have them. If the user has it wired in already then I imagine it could helpful.vwnut8392 wrote:it can be that simple to start. the manual transmission one can be TPS and wheel speed only. doesnt need a clutch switch to detect technically to have just launch control because the decider weather launch is active will be the wheel speed sensor as it can only activate if below 2mph.
I already have some open RAM that I found and I'm using it to do spark retard. It's one single value that can be modified, which I believe I've done successfully. There is a little more testing that I want to do as I think I was having some other issue with my tune that was getting in the way of testing my logic.vwnut8392 wrote: to add the timing retard you will need to source some open RAM and create your flags because where the spark cut will happen in code the timing read will be in a totally different sub routine most likely. the first thing to look for in the code for the timing is if its actually sequential like if the ECU has its own RAM position for each cylinder or if the ECU takes a single timing value and breaks it up into being sequential on a hardware level. on some VAG ECU's like MED9 it has per cylinder ignition angle in RAM so i have to hijack all 4 of those to make the timing retard work. but basically i would place the code for the checks for wheel speed, TPS, brake/clutch etc where the timing retard happens than when it gets to the part in custom code to set the timing retard it also sets a flag in RAM that the spark cut code elsewhere is looking for. when the flag is set and the RPM is met spark cut will follow the timing retard.
These are the added constant values i suggest.
-Wheel speed- this is very effective for turning launch control on/off.-----to not use wheel speed if desired set wheel speed to maximum
-TPS %-if above say 90% than your LC can go active -----
-X2 RPM variables- 1 added constant for retard RPM start and 1 for Spark cut RPM.
I will elaborate on adding flat shift code to this once i see a working launch control routine.