but if it doesn't work, don't forget Audacity
![Smile :)](./images/smilies/icon_smile.gif)
Moderators: robertisaar, dex
Code: Select all
ROM:692A ld SP+2, #0B4h ; Load SP+2 (INTMEM_1A) with #0B4h (pointer for 0xE67E table)
ROM:692E lcall ROM_20CD ; Call 3d map routine
Code: Select all
ROM:5B61 A1 86 00 1A ld INTMEM_1A, #86h ; Pointer loading for map lookup table (1)
ROM:5B65 B3 01 7B 18 1C ldb INTMEM_1C, RAM_187B[] ; Loading vehicle speed data from SRAM to INTMEM_1C (2)
ROM:5B6A EF 5A C5 lcall ROM_20C7 ; 2D map routine
ROM:5B6D B1 A0 1C ldb INTMEM_1C, #0A0h ; Multiplication factor loading (3)
ROM:5B70 7F 01 49 00 1C mulub INTMEM_1C, (INTMEM_49)[]; Multiplication
ROM:5B75 C3 01 A8 18 1C st INTMEM_1C, RAM_18A8[] ; New rev limiter value is stored in to SRAM: 0x18A8
Code: Select all
ROM:ADE9 8B 01 A8 18 40 cmp INTMEM_40, RAM_18A8[] ; Engine speed is compared to revlimiter value
ROM:ADEE D1 03 jnh ROM_ADF3 ; If engine speed is not higher, jump to ROM_ADF3, program running continues
ROM:ADF0 91 40 C7 orb INTMEM_C7, #40h ; "OR" operation to "INTMEM_C7". 40h is 01000000, so BIT6 is switched to "1" (4)
Code: Select all
ROM:ADD5 8B 69 30 00 40 cmp INTMEM_40, 30h[INTMEM_68] ; D002h+30h=D032h. 0xD032 is where the rev limit value is stored in -623.bin
ROM:ADDA D1 03 jnh ROM_ADDF
ROM:ADDC 91 40 C7 orb INTMEM_C7, #40h
Did you ever manage to make this work?olafu wrote: ↑Mon Nov 30, 2020 12:46 pm Let's dig this thread up again.
Vehicle speed dependent rev limiter in -965.bin
It has two parts:
Part 1 - Get rev limiter value from 2d table and store it in to SRAM:Code: Select all
ROM:5B61 A1 86 00 1A ld INTMEM_1A, #86h ; Pointer loading for map lookup table (1) ROM:5B65 B3 01 7B 18 1C ldb INTMEM_1C, RAM_187B[] ; Loading vehicle speed data from SRAM to INTMEM_1C (2) ROM:5B6A EF 5A C5 lcall ROM_20C7 ; 2D map routine ROM:5B6D B1 A0 1C ldb INTMEM_1C, #0A0h ; Multiplication factor loading (3) ROM:5B70 7F 01 49 00 1C mulub INTMEM_1C, (INTMEM_49)[]; Multiplication ROM:5B75 C3 01 A8 18 1C st INTMEM_1C, RAM_18A8[] ; New rev limiter value is stored in to SRAM: 0x18A8
Part 2 - Actual "rev limiter part". This is similar to -623.bin, but in 623.bin the rev limit is fixed value in ROM. (***)
Code: Select all
ROM:ADE9 8B 01 A8 18 40 cmp INTMEM_40, RAM_18A8[] ; Engine speed is compared to revlimiter value ROM:ADEE D1 03 jnh ROM_ADF3 ; If engine speed is not higher, jump to ROM_ADF3, program running continues ROM:ADF0 91 40 C7 orb INTMEM_C7, #40h ; "OR" operation to "INTMEM_C7". 40h is 01000000, so BIT6 is switched to "1" (4)
NOTES:
1. Referred to "Map lookup table" starting address: E68Ah + 86h = E710h -> ROM_E710 = "99DCh" -> 0xDC99 = Rev limiter map
2. Vehicle speed is stored in RAM_187B. Note! The 0x1C is used in almost everything. Vehicle speed doesn't stay there for long, so it need to load just before the "map routine".
3. RPM values are stored in different form: Rev limiter conversion is x/4, but table values are stored in x*40.
4. 0xC7 BIT6 is "fuel cut" -flag.
*** Rev limiter in -623.binSo...Code: Select all
ROM:ADD5 8B 69 30 00 40 cmp INTMEM_40, 30h[INTMEM_68] ; D002h+30h=D032h. 0xD032 is where the rev limit value is stored in -623.bin ROM:ADDA D1 03 jnh ROM_ADDF ROM:ADDC 91 40 C7 orb INTMEM_C7, #40h
I'm trying to create a "variable launch rev limiter" where the launch rpm is picked from actual engine rpm by pushing a button.
There is flags for "car is moving" and all "switch" input pins from Air conditioning and A/T, they can be used in this.
How it works?: Push a button and hold. Select RPM by using throttle, and release the button. Now your rev limiter is set to this RPM. When car starts moving, rev limiter is changed back to fixed value.
It is also possible to create several different fixed rev limits and select them by those inputs.
This would be a good exercise for programming. And maybe nice feature, if someone wants to try it.![]()