I analysed this cheat as part of my project - it was the only clue I could find anywhere when it came to the actual code!
Here are the notes I made at the time:
Code: Select all
In R.Revs2 in hack disc, the following get changed:
.PrintGearNumber, &42DE
gears=&42DF - address in this instruction is hacked to load from gear2 instead of gearNumberText
.ApplyEngine, &49F2
ratios=&49F3 - address in this instruction is hacked to load from ratio2 instead of trackData+1798 = trackGearRatio
.ApplyEngine, &4A81
powers=&4A82 - address in this instruction is hacked to load from power2 instead of trackData+1805 = trackGearPower
Then the following hacks change the tests for the max gear number in ProcessDrivingKeys:
higear=&6451 - 0x16d1 in binary, changes LDA #6 before .keys26 to LDA #A%
higear2=&644D - 0x16cd in binary, changes CMP #7 before .keys26 to CMP #A%-1
where A% = new highest gear number
and here's the hack code I'm referring to (ignore the strange characters, they're MODE 7 colours):
Code: Select all
10REM Revs Cheat
20REM
30REM
40DATA 7
50DATA &67,&42,&35,&2E,&2A
60DATA &A1,&68,&52,&48,&41
70
80DATA 7
90DATA &67,&42,&35,&2E,&2A
100DATA &B0,&80,&68,&58,&50
110
120DATA 8
130DATA &56,&45,&3B,&32,&2B,&25
140DATA &E0,&E0,&E0,&D8,&D8,&C8
150
160DATA 5
170DATA &42,&31,&2B
180DATA &D0,&C0,&B0
190
200DATA 4
210DATA &48,&20
220DATA &D5,&F0
230
240oscli =&FFF7
250C$=CHR$13
260
270gear2 =&7F4
280ratio2=&899
290power2=&8AD
300
310gears =&42DF
320ratios=&49F3
330powers=&4A82
340
350higear=&6451
360higear2=&644D
370
380
390FOR I%=0 TO 2 STEP2
400P%=&C00
410[OPT I%
420.cheat PHA
430 LDX #FNl(prog)
440 LDY #FNh(prog):JSR oscli
450
460 PLA:TAX
470 STX higear2
480 DEX:STX higear
490 LDA #0
500 STA ratio+1:STA power+1
510.copyl LDA gear,X:STA gear2,X
520 LDA ratio,X:STA ratio2,X
530 LDA power,X:STA power2,X
540 DEX:BPL copyl
550
560 LDA #FNl(gear2)
570 STA gears
580 LDA #FNh(gear2)
590 STA gears+1
600
610 LDA #FNl(ratio2)
620 STA ratios
630 LDA #FNh(ratio2)
640 STA ratios+1
650
660 LDA #FNl(power2)
670 STA powers
680 LDA #FNh(power2)
690 STA powers+1
700
710 JMP &1200
720
730.gear OPT FNequs("RN1234567T")
740
750.ratio OPT FNequb(&67):OPT FNequd(0)
760 OPT FNequd(0):OPT FNequd(0)
770
780.power OPT FNequb(&A1):OPT FNequd(0)
790 OPT FNequd(0):OPT FNequd(0)
800
810.prog OPT FNequs("LOAD Revs3"+C$)
820]:NEXT
830VDU28,1,24,39,6,12
840PRINT'"ÇWhich REVS mode can you handle :"'
850PRINT'"É1á-ÜA stock standard car"
860PRINT'"É2á-ÜA high performance car Üwith stock gearing"
880PRINT'"É3á-ÜA high performance car Üwith a 6 speed gearbox"
900PRINT'"É4á-ÜA high performance car Üwith a 3 speed gearbox"
920PRINT'"É5á-ÜAn out of this world 2 gear car Üwith FAST and VERY FAST"
940PRINT'"ÖEnter choice of carÑ(1-5)Ü-Å";
950W$=GET$:IFW$<"1"ORW$>"5"THEN950 ELSEPRINTW$;:ONVAL(W$)GOTO960,970,980,990,1000
960RESTORE 40:GOTO1010
970RESTORE 80:GOTO1010
980RESTORE 120:GOTO1010
990RESTORE 160:GOTO1010
1000RESTORE 200:gear?2=ASC"F":gear?3=ASC"V"
1010READ A%
1020FOR I%=2 TO A%-1
1030READ I%?ratio
1040NEXT
1050FOR I%=2 TO A%-1
1060READ I%?power
1070NEXT
1080CALL cheat
1090END
1100
1110DEF FNl(A%)=(A% AND &FF)
1120DEF FNh(A%)=(A% DIV 256)
1130
1140DEF FNr(A%):LOCAL I%
1150FOR I%=3 TO 0 STEP-1
1160I%?&70=FNl(A%):A%=FNh(A%)
1170NEXT
1180=!&70
1190DEFFNequs(string$)
1200$P%=string$:P%=P%+LENstring$
1210=I%
1220DEFFNequb(byte)
1230?P%=byte:P%=P%+1
1240=I%
1250DEFFNequd(word)
1260!P%=word:P%=P%+4
1270=I%
So this hack changes the number shown on the gear stick (PrintGearNumber), the number of the maximum available gear (ProcessDrivingKeys), the gear ratio (trackGearRatio) and the gear power (trackGearPower). The relevant code can be found here:
https://revs.bbcelite.com/source/main/s ... umber.html
https://revs.bbcelite.com/source/main/s ... tml#keys25
https://revs.bbcelite.com/source/silver ... ratio.html
https://revs.bbcelite.com/source/silver ... power.html
It's a very clever hack!
Mark