Pages: 1 2 [3]
Author Topic: Utilizing kfzw1 as switchable map for non-VVT engine  (Read 23772 times)
prj
Hero Member
*****

Karma: +1072/-480
Offline Offline

Posts: 6035


« Reply #30 on: November 02, 2016, 04:36:39 AM »

Add timing until it knocks, LPG has higher octane so add lots.
Logged

PM's will not be answered, so don't even try.
Log your car properly - WinOLS database - Tools/patches
TijnCU
Hero Member
*****

Karma: +60/-4
Offline Offline

Posts: 690


flying brick


« Reply #31 on: December 03, 2016, 01:12:25 PM »

Here is my current code, maybe someone likes some inspiration.
I relocated the function and maps since I needed more space. After moving the code I realized I needed the extp command when calling from different sections of code  Smiley

Code:
	;krkte1
extp #0E1h, #1 ;D7 40 E1 00
mov r5, word_381B1A ;F2 F5 1A 9B
cmp r5, #1C2h ;46 F5 C2 01
jmpr cc_c switched ;8D 05
extp #207h, #1 ;D7 40 07 02
mov r5, #0D80h ;F2 F5 80 0D
rets ;DB 00
;switched
extp #229h, #1 ;D7 40 29 02
mov r5, #0DC4h ;F2 F5 C4 0D
rets ;DB 00

;krkte2
extp #0E1h, #1 ;D7 40 E1 00
mov r4, word_381B1A ;F2 F4 1A 9B
cmp r4, #1C2h ;46 F4 C2 01
jmpr cc_c switched ;8D 05
extp #207h, #1 ;D7 40 07 02
mov r4, #0D80h ;F2 F4 80 0D
rets ;DB 00
;switched
extp #229h, #1 ;D7 40 29 02
mov r4, #0DC4h ;F2 F4 C4 0D
rets ;DB 00

;krkte3
extp #0E1h, #1 ;D7 40 E1 00
mov r2, word_381B1A ;F2 F2 1A 9B
cmp r2, #1C2h ;46 F2 C2 01
jmpr cc_c switched ;8D 05
extp #207h, #1 ;D7 40 07 02
mov r2, #0D80h ;F2 F2 80 0D
rets ;DB 00
;switched
extp #229h, #1 ;D7 40 29 02
mov r2, #0DC4h ;F2 F2 C4 0D
rets ;DB 00

;fkkvs
extp #0E1h, #1 ;D7 40 E1 00
mov r5, word_381B1A ;F2 F5 1A 9B
cmp r5, #1C2h ;46 F5 C2 01
jmpr cc_c switched ;8D 03
mov r5, #207h ;E6 F5 07 02
rets ;DB 00
;switched
mov r4, #0B32h ;E6 F4 32 0B
mov r5, #229h ;E6 F5 29 02
rets ;DB 00

;kflbts
extp #0E1h, #1 ;D7 40 E1 00
mov r13, word_81B1A ;F2 FD 1A 9B
cmp r13, #1C2h ;46 FD C2 01
jmpr cc_c switched ;8D 03
mov r13, #206h ;E6 FD 06 02
rets ;DB 00
;switched
mov r12, #0B00h ;E6 FC 00 0B
mov r13, #229h ;E6 FD 29 02
rets ;DB 00

;kfzw1
extp #0E1h, #1 ;D7 40 E1 00
mov r12, word_81B1A ;F2 FC 1A 9B
cmp r12, #1C2h ;46 FC C2 01
jmpr cc_c switched ;8D 03
mov r12, #2390h ;E6 FC 90 23
rets ;DB 00
;switched
mov r12, #2450h ;E6 FC 50 24
rets ;DB 00
« Last Edit: December 05, 2016, 06:49:35 AM by TijnCU » Logged

TijnCU
Hero Member
*****

Karma: +60/-4
Offline Offline

Posts: 690


flying brick


« Reply #32 on: December 09, 2016, 06:24:14 AM »

Here is an experimental section for switching LALIUS conditional:
Basically it looks for the lpg switch input first, and then checks if rl_w is in between of 50 and 120. If so, it uses an alternative map.
Code:
	    ;LALIUS call from 0x51ED0 
extp #0E1h, #1
mov r12, word_81B1A
cmp r12, #1C2h
jmpr cc_c switched
mov r12, #382Ah
rets      

switched:
mov r13, rl_w
cmp r13, #855h          
cc_ULE, not_set
cmp r13, #1400h
cc_UGT, not_set
mov r12, #E550h              ;lalius lpg map
rets        

not_set:
mov r12, #382Ah
rets        
« Last Edit: December 09, 2016, 06:37:16 AM by TijnCU » Logged

Pages: 1 2 [3]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.013 seconds with 16 queries. (Pretty URLs adds 0s, 0q)