gt-innovation
|
|
« on: May 08, 2019, 03:49:52 AM »
|
|
|
This post is for someone that likes to experiment into building a simple launch control function using ignition retard on any med17 ecu .Be aware that most of those ecus have an already built in function that you can utilize with various ways including requests from a DSG gearbox.The oem function is using minimum ignition angle maps such a zwlate etc.
Now if you need to force such a function based on some simple conditions to build boost or have some fun here is how :
The code was done on a tc1766 med17.5.5 1.4 tsi engine and it does not need a "free" memory space to function".The hook up is done through zwout_syns and hijacks zwcalcar+array.
--------------------------------------------------------------------------------------------------------------------------------------------------------
PFLASH:8011EDA6 loc_8011EDA6: ; CODE XREF: sub_8011ECE4+B6↑j PFLASH:8011EDA6 add16 d2, #1 PFLASH:8011EDA8 movh.a a2, #@HIS(zwcalcar) PFLASH:8011EDAC extr.u d2, d2, #0, #8 PFLASH:8011EDB0 lea a2, [a2]@LOS(zwcalcar) PFLASH:8011EDB4 addsc32.a a15, a2, d4, #0 PFLASH:8011EDB8 st16.b [a15]0, d0 PFLASH:8011EDBA jlt.u d2, #2, loc_8011ED1A PFLASH:8011EDBE j32 loc_80170052 <----------------------Jump to als nls function PFLASH:8011EDC2 ; --------------------------------------------------------------------------- PFLASH:8011EDC2 PFLASH:8011EDC2 loc_8011EDC2: ; CODE XREF: PFLASH:80170064↓j PFLASH:8011EDC2 st32.b zwkrafld, d3 PFLASH:8011EDC6 addsc16.a a15, a2, d15, #0 PFLASH:8011EDC8 ld16.bu d15, [a15]0 PFLASH:8011EDCA st32.b zwist, d15 PFLASH:8011EDCE st32.b zwout, d15 PFLASH:8011EDD2 nor16 d15, #0 PFLASH:8011EDD4 st32.b zwoutcpl, d15 PFLASH:8011EDD8 ld32.bu d15, zwcalcar PFLASH:8011EDDC st32.b zwzyl1, d15 PFLASH:8011EDE0 ret16
--------------------------------------------------------------------------------------------------------------------------------------------------------
Main function for launch control
--------------------------------------------------------------------------------------------------------------------------------------------------------
PFLASH:80170000 alsnls: ; CODE XREF: PFLASH:8017005A↓p PFLASH:80170000 ld32.bu d15, byte_D00000E9 ; b_brems PFLASH:80170004 jz32.t d15:6, locret_80170050 PFLASH:80170008 movh.a a15, #@HIS(speed_deactivate) PFLASH:8017000C lea a15, [a15]@LOS(speed_deactivate) PFLASH:80170010 ld16.bu d15, [a15]0 ; unk_8016FC26 PFLASH:80170012 ld32.bu d2, vfzg PFLASH:80170016 jge.u d2, d15, locret_80170050 PFLASH:8017001A movh.a a15, #@HIS(lc_rpm_activation) PFLASH:8017001E lea a15, [a15]@LOS(lc_rpm_activation) PFLASH:80170022 ld.hu d15, [a15]0 ; unk_8016FC22 PFLASH:80170026 ld.hu d2, nmot_w PFLASH:8017002A jlt.u d2, d15, locret_80170050 PFLASH:8017002E mov16 d15, #1 PFLASH:80170030 movh.a a15, #@HIS(Lc_retard_degrees) PFLASH:80170034 lea a15, [a15]@LOS(Lc_retard_degrees) PFLASH:80170038 movh.a a2, #@HIS(zwcalcar) PFLASH:8017003C lea a2, [a2]@LOS(zwcalcar) PFLASH:80170040 ld16.bu d15, [a15]0 ; unk_8016FC20 PFLASH:80170042 st32.b [a2](unk_D00024C3 - 0xD00024C0), d15 PFLASH:80170046 st16.b [a2], d15 PFLASH:80170048 st32.b [a2](unk_D00024C1 - 0xD00024C0), d15 PFLASH:8017004C st32.b [a2](unk_D00024C2 - 0xD00024C0), d15 PFLASH:80170050 PFLASH:80170050 locret_80170050: ; CODE XREF: PFLASH:80170004↑j PFLASH:80170050 ; PFLASH:80170016↑j ... PFLASH:80170050 ret16 PFLASH:80170052 ; --------------------------------------------------------------------------- PFLASH:80170052 PFLASH:80170052 loc_80170052: ; CODE XREF: sub_8011ECE4+DA↑j PFLASH:80170052 ld32.bu d15, zzylzue PFLASH:80170056 svlcx PFLASH:8017005A calla alsnls PFLASH:8017005E rslcx PFLASH:80170062 nop16 PFLASH:80170064 ja loc_8011EDC2 PFLASH:80170068 ; --------------------------------------------------------------------------- PFLASH:80170068 ret16 PFLASH:8017006A ; --------------------------------------------------------------------------- PFLASH:8017006A nop16
--------------------------------------------------------------------------------------------------------------------------------------------------------
Since my code after several months is now far more advanced and works on several med17 platforms i decided to give something back to the community. Remember that this code is tc1766 1.4 tsi specific and you might need some minor changes due to some differences on the factory zwout_syns and due to some silicon bugs that involve rslcx , ja , calla etc...
Once you understand the function you can brake it up and call the main function directly from the raster but that will require a non used memory address for triggering which might take you a while to figure out.
Questions regarding this post can be done here and NOT in PM..
|