New translation: Stock-Car
-
- Posts: 177
- Joined: Fri Oct 19, 2018 2:22 am
New translation: Stock-Car
This is a great little racer by Informatique Service with a bit of a Monaco GP vibe, most notably in the latter section where you're in a tunnel and sometimes have only your headlights illuminating the track ahead of you.
It was a bit of a bugger to translate because of a tendency to crash if you change the text, but I eventually figured out a way to do it a line at a time. I ended up simplifying the instructions a lot, down to a single screen, because the way they're displayed in the original is very pretty but is hard to understand in the code and takes far too long onscreen anyway for what is a really straightforward "drive fast and don't crash into stuff" game. The ingame text is in the machine code and so untranslated but "ACCIDENTS" and "KMS" are the same in English and French anyway
Your racecar has five gears but you only really need 1st and 5th, operating like Hi and Lo in the arcade game - you want to go full tilt most of the time but slow down briefly for tricky bits.
Original French and translated English versions:
It was a bit of a bugger to translate because of a tendency to crash if you change the text, but I eventually figured out a way to do it a line at a time. I ended up simplifying the instructions a lot, down to a single screen, because the way they're displayed in the original is very pretty but is hard to understand in the code and takes far too long onscreen anyway for what is a really straightforward "drive fast and don't crash into stuff" game. The ingame text is in the machine code and so untranslated but "ACCIDENTS" and "KMS" are the same in English and French anyway
Your racecar has five gears but you only really need 1st and 5th, operating like Hi and Lo in the arcade game - you want to go full tilt most of the time but slow down briefly for tricky bits.
Original French and translated English versions:
Re: New translation: Stock-Car
Change "TEMPS: MN SEC VITESSE" to
" TIME: MN SEC SCORE"
8100 LET A=17750
8110 LET X$=" TIME: MN SEC SCORE"
8120 FOR N=1 TO LEN X$
8130 POKE A+N,CODE X$(N)
8140 NEXT N
8150 STOP
Run 8100 then deleted lines 8100 to 8150
then RUN 9900 to save with changes.
" TIME: MN SEC SCORE"
8100 LET A=17750
8110 LET X$=" TIME: MN SEC SCORE"
8120 FOR N=1 TO LEN X$
8130 POKE A+N,CODE X$(N)
8140 NEXT N
8150 STOP
Run 8100 then deleted lines 8100 to 8150
then RUN 9900 to save with changes.
-
- Posts: 177
- Joined: Fri Oct 19, 2018 2:22 am
Re: New translation: Stock-Car
VITESSE means SPEED, not SCORE, but nice work
Re: New translation: Stock-Car
"Vitesse"="Gear"
("boîte de vitesse"= gearbox)
Thanks JohnsBargs.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
-
- Posts: 177
- Joined: Fri Oct 19, 2018 2:22 am
Re: New translation: Stock-Car
Here's the version with those POKEs applied.
There's only one thing left stumping me. I tried to improve the game by adding a high score, displayed on the instructions screen. It only took a few lines of code, seen here (NH is New Hiscore):
We set up BM and BS (best minutes and seconds) straight after the save so that they don't get reset after you beat the high score. Then if you complete the course (lines 440 and 450) we add a line at 460 to go to the little routine at 8800 and check for a new high score.
We can add the routine at 8800 no bother, but as soon as we add the 460 GOTO 8800, the game will no longer run. As soon as the race starts it crashes with a C error at a random line (often a line that doesn't exist in the code, in this case 7196).
The code REALLY doesn't seem to like you changing stuff anywhere between lines 1 and 3100.
And there's another problem. After you have one game, the BM and BS values get wiped, presumably by the CLEAR command in line 1000 that I can see no purpose for, and then the game crashes when it tries to display the high score. If you delete or REM out line 1000, or move it to line 890, or add 999 GOTO 1001, you get a 2/1100 error at the start of the race, which makes no sense. (Line 1100 is just a NEXT X.)
So I tried replicating lines 900-970 at 8700-8770, changing all the RUN 900 lines in the code to GOTO 8700, and adding 8780 GOTO 1005 to skip the CLEAR line, but when you change line 3080 to a GOTO 8700 you get the 2/1100 error at the start of the race. (You can change all the other RUN 900s to GOTO 8700 and it's fine, it's only this one that screws it up.)
I've tried everything I can think of, but I'm defeated now.
There's only one thing left stumping me. I tried to improve the game by adding a high score, displayed on the instructions screen. It only took a few lines of code, seen here (NH is New Hiscore):
We set up BM and BS (best minutes and seconds) straight after the save so that they don't get reset after you beat the high score. Then if you complete the course (lines 440 and 450) we add a line at 460 to go to the little routine at 8800 and check for a new high score.
We can add the routine at 8800 no bother, but as soon as we add the 460 GOTO 8800, the game will no longer run. As soon as the race starts it crashes with a C error at a random line (often a line that doesn't exist in the code, in this case 7196).
The code REALLY doesn't seem to like you changing stuff anywhere between lines 1 and 3100.
And there's another problem. After you have one game, the BM and BS values get wiped, presumably by the CLEAR command in line 1000 that I can see no purpose for, and then the game crashes when it tries to display the high score. If you delete or REM out line 1000, or move it to line 890, or add 999 GOTO 1001, you get a 2/1100 error at the start of the race, which makes no sense. (Line 1100 is just a NEXT X.)
So I tried replicating lines 900-970 at 8700-8770, changing all the RUN 900 lines in the code to GOTO 8700, and adding 8780 GOTO 1005 to skip the CLEAR line, but when you change line 3080 to a GOTO 8700 you get the 2/1100 error at the start of the race. (You can change all the other RUN 900s to GOTO 8700 and it's fine, it's only this one that screws it up.)
I've tried everything I can think of, but I'm defeated now.
-
- Posts: 177
- Joined: Fri Oct 19, 2018 2:22 am
Re: New translation: Stock-Car
You are of course correct, but here in the UK the two words are interchangeable in the context of gears - that's why we talk about a "10-speed" bicycle or a car with a "six-speed" gearbox
https://www.gearboxspecialistsbournemou ... ansmission
-
- Posts: 177
- Joined: Fri Oct 19, 2018 2:22 am
Re: New translation: Stock-Car
To express all the above more simply: the version of the game attached to that post works perfectly. However, if you add just one line to it:
460 GOTO 8800
then it will crash at the start of the race with a C/7196 error, even if line 8800 is just
8800 GOTO 461
(and even though there IS no line 7196.)
It doesn't actually matter what's in line 460. It can be
460 REM HELLO
and it'll still break the game. (The error will be C/0 this time.)
Yet I can add or delete any code I want after line 3100 without breaking anything.
Any insight into what's going on would be most welcome.
Re: New translation: Stock-Car
These instructions in the MC cause the problem...
43F8 LD HL,$52DC ;21,212
43FB LD ($4029),HL ;Set NXT-LINE to 21,212
NXT-LINE is the address of the next line to be executed.
Address 21,212 is the address of line 1500 LET A=USR 17400
Essentially this is a game loop, on return to BASIC line 1500
will be executed. This means any line placed BEFORE 1500 will mess
up the loop and cause the error. Lines after 1500 are OK.
It could be patched with something like this...
LD HL,+1500 ;Line number 1500
CALL $09D8 ;Locate line address ROM routine
LD ($XXXX),HL ;Save the address
43F8 LD HL,($XXXX) ;Get line 1500 address
43FB LD ($4029),HL ;Set NXT-LINE to line 1500 address
Another thought, you could prune some bytes from above line 1500, maybe use a VAL here and there then add your GOTO line just make sure line 1500 starts at 21,212. Use PEEK 21212 to track your pruning. It should match before and after pruning.
43F8 LD HL,$52DC ;21,212
43FB LD ($4029),HL ;Set NXT-LINE to 21,212
NXT-LINE is the address of the next line to be executed.
Address 21,212 is the address of line 1500 LET A=USR 17400
Essentially this is a game loop, on return to BASIC line 1500
will be executed. This means any line placed BEFORE 1500 will mess
up the loop and cause the error. Lines after 1500 are OK.
It could be patched with something like this...
LD HL,+1500 ;Line number 1500
CALL $09D8 ;Locate line address ROM routine
LD ($XXXX),HL ;Save the address
43F8 LD HL,($XXXX) ;Get line 1500 address
43FB LD ($4029),HL ;Set NXT-LINE to line 1500 address
Another thought, you could prune some bytes from above line 1500, maybe use a VAL here and there then add your GOTO line just make sure line 1500 starts at 21,212. Use PEEK 21212 to track your pruning. It should match before and after pruning.
-
- Posts: 177
- Joined: Fri Oct 19, 2018 2:22 am
Re: New translation: Stock-Car
I'd already thought that, eg I tried replacing the problematic CLEAR in line 1000 with a PRINT, assuming that would be the same size, but had no joy. Your PEEK should be very helpful, though, will experiment.
-
- Posts: 177
- Joined: Fri Oct 19, 2018 2:22 am
Re: New translation: Stock-Car
So here's a version with the highscore code lines in, and line 1000 changed from CLEAR to PRINT. If I print PEEK 21212 it's still 5, which is what I get from the working version, but when the race starts I get a 2/8010 error.
(Line 8010 is a simple NEXT Y.)
So it looks like that's not the solution
(Line 8010 is a simple NEXT Y.)
So it looks like that's not the solution