Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Regulars » Regulars/RunTheRISC/Racer2

Regulars/RunTheRISC/Racer2

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Regulars
Filename: Regulars/RunTheRISC/Racer2
Read OK:
File size: 0625 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM>Racer2
   20ON ERROR PRINT REPORT$" at line ";ERL:END
   30
   40PRINT"Two Car Slot Racer"
   50PRINT"By Mike Cook"
   60PRINT"See 'RUN THE RISC' for the hardware needed"
   70
   80SYS"XParallel_Op",0 TO ,,D% ;F%
   90IF (F% AND 1)=1 THEN
  100PRINT"Mono direction printer port"
  110PRINT"You need to load the Mono_D module"
  120END
  130ENDIF
  140
  150REPEAT
  160SYS"Parallel_Op",1,0 :REM Put all lights off
  170PRINT"Place both Cars on the starting line"
  180REM Hold until the switch is triped
  190REPEAT
  200SYS"Parallel_Op",0 TO ,,D%
  210UNTIL((D% AND &C0)EOR &40) <>0
  220PRINT"Count down to start"
  230FOR A%=10 TO 1 STEP -1
  240PRINTA%
  250IF A%=5 THEN SYS"Parallel_Op",1,3 : REM Red lights on
  260PROC_sec
  270NEXT
  280
  290REM Check if switch still triped if not then false start
  300SYS"Parallel_Op",0 TO ,,D%
  310IF ((D% AND &80)EOR &40)<>0 THEN
  320SYS"Parallel_Op",1,&C :REM Red lights off Green lights on
  330PRINT"GO"
  340VDU 7
  350
  360C1_lap%=1:C2_lap%=1
  370C1%=0:C2%=0:LC1%=0:LC2%=0
  380C1_T%=TIME:C2_T%=TIME
  390REPEAT
  400
  410SYS"Parallel_Op",0 TO ,,D%
  420C1%=D% AND &80
  430C2%=(D% AND &40) EOR &40
  440
  450IF LC1%<>C1% AND C1%=0 THEN
  460PROC_LAP(1,C1_T%,C1_lap%)
  470C1_T%=TIME
  480C1_lap%+=1
  490ENDIF
  500LC1%=C1%
  520
  530IF LC2%<>C2% AND C2%=0 THEN
  540PROC_LAP(2,C2_T%,C2_lap%)
  550C2_T%=TIME
  560C2_lap%+=1
  570ENDIF
  580LC2%=C2%
  650
  660UNTIL C1_lap%=10 OR C2_lap%=10
  670
  680SYS"Parallel_Op",1,0 :REM Turn all lights off
  690PRINT"Race over"
  700IF C1_lap%>C2_lap% THEN PRINT"Car 1 is the winner" ELSE PRINT"Car 2 is the winner"
  710PRINT"Press Space for another race"
  720REPEAT UNTIL INKEY(-99)
  730ELSE
  740FOR A%=1 TO 5
  750VDU7
  760T%=TIME+10
  770REPEAT UNTIL TIME>T%
  780NEXT
  790PRINT"False Start "
  800ENDIF
  810
  820UNTIL FALSE
  830END
  840
  850DEF PROC_LAP(C%,T%,L%)
  860LT=(TIME-T%)/100
  870PRINT"Car";C%;" Lap ";L%;" time ";LT
  880ENDPROC
  890
  900DEF PROC_sec
  910LOCAL T%
  920T%=TIME+100
  930REPEAT UNTIL TIME>T%
  940ENDPROC

�>Racer2
� � � �$" at line ";�:�

(�"Two Car Slot Racer"
2�"By Mike Cook"
<1�"See 'RUN THE RISC' for the hardware needed"
F
P!ș"XParallel_Op",0 � ,,D% ;F%
Z� (F% � 1)=1 �
d"�"Mono direction printer port"
n)�"You need to load the Mono_D module"
x�
��
�
��
�-ș"Parallel_Op",1,0 :� Put all lights off
�+�"Place both Cars on the starting line"
�%� Hold until the switch is triped
��
�ș"Parallel_Op",0 � ,,D%
��((D% � &C0)� &40) <>0
��"Count down to start"
�� A%=10 � 1 � -1
��A%
�2� A%=5 � ș"Parallel_Op",1,3 : � Red lights on
	�_sec
�

":� Check if switch still triped if not then false start
,ș"Parallel_Op",0 � ,,D%
6� ((D% � &80)� &40)<>0 �
@:ș"Parallel_Op",1,&C :� Red lights off Green lights on
J	�"GO"
T� 7
^
hC1_lap%=1:C2_lap%=1
rC1%=0:C2%=0:LC1%=0:LC2%=0
|C1_T%=�:C2_T%=�
��
�
�ș"Parallel_Op",0 � ,,D%
�C1%=D% � &80
�C2%=(D% � &40) � &40
�
�� LC1%<>C1% � C1%=0 �
��_LAP(1,C1_T%,C1_lap%)
�C1_T%=�
�C1_lap%+=1
��
�LC1%=C1%

� LC2%<>C2% � C2%=0 �
�_LAP(2,C2_T%,C2_lap%)
&C2_T%=�
0C2_lap%+=1
:�
DLC2%=C2%
�
�� C1_lap%=10 � C2_lap%=10
�
�.ș"Parallel_Op",1,0 :� Turn all lights off
��"Race over"
�G� C1_lap%>C2_lap% � �"Car 1 is the winner" � �"Car 2 is the winner"
�#�"Press Space for another race"
�� � �(-99)
��
�� A%=1 � 5
��7
�T%=�+10
� � �>T%
�
�"False Start "
 �
*
4� �
>�
H
R� �_LAP(C%,T%,L%)
\LT=(�-T%)/100
f$�"Car";C%;" Lap ";L%;" time ";LT
p�
z
�� �_sec
�� T%
�T%=�+100
�� � �>T%
��
�
00000000  0d 00 0a 0c f4 3e 52 61  63 65 72 32 0d 00 14 1b  |.....>Racer2....|
00000010  ee 20 85 20 f1 20 f6 24  22 20 61 74 20 6c 69 6e  |. . . .$" at lin|
00000020  65 20 22 3b 9e 3a e0 0d  00 1e 04 0d 00 28 19 f1  |e ";.:.......(..|
00000030  22 54 77 6f 20 43 61 72  20 53 6c 6f 74 20 52 61  |"Two Car Slot Ra|
00000040  63 65 72 22 0d 00 32 13  f1 22 42 79 20 4d 69 6b  |cer"..2.."By Mik|
00000050  65 20 43 6f 6f 6b 22 0d  00 3c 31 f1 22 53 65 65  |e Cook"..<1."See|
00000060  20 27 52 55 4e 20 54 48  45 20 52 49 53 43 27 20  | 'RUN THE RISC' |
00000070  66 6f 72 20 74 68 65 20  68 61 72 64 77 61 72 65  |for the hardware|
00000080  20 6e 65 65 64 65 64 22  0d 00 46 04 0d 00 50 21  | needed"..F...P!|
00000090  c8 99 22 58 50 61 72 61  6c 6c 65 6c 5f 4f 70 22  |.."XParallel_Op"|
000000a0  2c 30 20 b8 20 2c 2c 44  25 20 3b 46 25 0d 00 5a  |,0 . ,,D% ;F%..Z|
000000b0  12 e7 20 28 46 25 20 80  20 31 29 3d 31 20 8c 0d  |.. (F% . 1)=1 ..|
000000c0  00 64 22 f1 22 4d 6f 6e  6f 20 64 69 72 65 63 74  |.d"."Mono direct|
000000d0  69 6f 6e 20 70 72 69 6e  74 65 72 20 70 6f 72 74  |ion printer port|
000000e0  22 0d 00 6e 29 f1 22 59  6f 75 20 6e 65 65 64 20  |"..n)."You need |
000000f0  74 6f 20 6c 6f 61 64 20  74 68 65 20 4d 6f 6e 6f  |to load the Mono|
00000100  5f 44 20 6d 6f 64 75 6c  65 22 0d 00 78 05 e0 0d  |_D module"..x...|
00000110  00 82 05 cd 0d 00 8c 04  0d 00 96 05 f5 0d 00 a0  |................|
00000120  2d c8 99 22 50 61 72 61  6c 6c 65 6c 5f 4f 70 22  |-.."Parallel_Op"|
00000130  2c 31 2c 30 20 3a f4 20  50 75 74 20 61 6c 6c 20  |,1,0 :. Put all |
00000140  6c 69 67 68 74 73 20 6f  66 66 0d 00 aa 2b f1 22  |lights off...+."|
00000150  50 6c 61 63 65 20 62 6f  74 68 20 43 61 72 73 20  |Place both Cars |
00000160  6f 6e 20 74 68 65 20 73  74 61 72 74 69 6e 67 20  |on the starting |
00000170  6c 69 6e 65 22 0d 00 b4  25 f4 20 48 6f 6c 64 20  |line"...%. Hold |
00000180  75 6e 74 69 6c 20 74 68  65 20 73 77 69 74 63 68  |until the switch|
00000190  20 69 73 20 74 72 69 70  65 64 0d 00 be 05 f5 0d  | is triped......|
000001a0  00 c8 1c c8 99 22 50 61  72 61 6c 6c 65 6c 5f 4f  |....."Parallel_O|
000001b0  70 22 2c 30 20 b8 20 2c  2c 44 25 0d 00 d2 1a fd  |p",0 . ,,D%.....|
000001c0  28 28 44 25 20 80 20 26  43 30 29 82 20 26 34 30  |((D% . &C0). &40|
000001d0  29 20 3c 3e 30 0d 00 dc  1a f1 22 43 6f 75 6e 74  |) <>0....."Count|
000001e0  20 64 6f 77 6e 20 74 6f  20 73 74 61 72 74 22 0d  | down to start".|
000001f0  00 e6 14 e3 20 41 25 3d  31 30 20 b8 20 31 20 88  |.... A%=10 . 1 .|
00000200  20 2d 31 0d 00 f0 07 f1  41 25 0d 00 fa 32 e7 20  | -1.....A%...2. |
00000210  41 25 3d 35 20 8c 20 c8  99 22 50 61 72 61 6c 6c  |A%=5 . .."Parall|
00000220  65 6c 5f 4f 70 22 2c 31  2c 33 20 3a 20 f4 20 52  |el_Op",1,3 : . R|
00000230  65 64 20 6c 69 67 68 74  73 20 6f 6e 0d 01 04 09  |ed lights on....|
00000240  f2 5f 73 65 63 0d 01 0e  05 ed 0d 01 18 04 0d 01  |._sec...........|
00000250  22 3a f4 20 43 68 65 63  6b 20 69 66 20 73 77 69  |":. Check if swi|
00000260  74 63 68 20 73 74 69 6c  6c 20 74 72 69 70 65 64  |tch still triped|
00000270  20 69 66 20 6e 6f 74 20  74 68 65 6e 20 66 61 6c  | if not then fal|
00000280  73 65 20 73 74 61 72 74  0d 01 2c 1c c8 99 22 50  |se start..,..."P|
00000290  61 72 61 6c 6c 65 6c 5f  4f 70 22 2c 30 20 b8 20  |arallel_Op",0 . |
000002a0  2c 2c 44 25 0d 01 36 1c  e7 20 28 28 44 25 20 80  |,,D%..6.. ((D% .|
000002b0  20 26 38 30 29 82 20 26  34 30 29 3c 3e 30 20 8c  | &80). &40)<>0 .|
000002c0  0d 01 40 3a c8 99 22 50  61 72 61 6c 6c 65 6c 5f  |..@:.."Parallel_|
000002d0  4f 70 22 2c 31 2c 26 43  20 3a f4 20 52 65 64 20  |Op",1,&C :. Red |
000002e0  6c 69 67 68 74 73 20 6f  66 66 20 47 72 65 65 6e  |lights off Green|
000002f0  20 6c 69 67 68 74 73 20  6f 6e 0d 01 4a 09 f1 22  | lights on..J.."|
00000300  47 4f 22 0d 01 54 07 ef  20 37 0d 01 5e 04 0d 01  |GO"..T.. 7..^...|
00000310  68 17 43 31 5f 6c 61 70  25 3d 31 3a 43 32 5f 6c  |h.C1_lap%=1:C2_l|
00000320  61 70 25 3d 31 0d 01 72  1d 43 31 25 3d 30 3a 43  |ap%=1..r.C1%=0:C|
00000330  32 25 3d 30 3a 4c 43 31  25 3d 30 3a 4c 43 32 25  |2%=0:LC1%=0:LC2%|
00000340  3d 30 0d 01 7c 13 43 31  5f 54 25 3d 91 3a 43 32  |=0..|.C1_T%=.:C2|
00000350  5f 54 25 3d 91 0d 01 86  05 f5 0d 01 90 04 0d 01  |_T%=............|
00000360  9a 1c c8 99 22 50 61 72  61 6c 6c 65 6c 5f 4f 70  |...."Parallel_Op|
00000370  22 2c 30 20 b8 20 2c 2c  44 25 0d 01 a4 10 43 31  |",0 . ,,D%....C1|
00000380  25 3d 44 25 20 80 20 26  38 30 0d 01 ae 18 43 32  |%=D% . &80....C2|
00000390  25 3d 28 44 25 20 80 20  26 34 30 29 20 82 20 26  |%=(D% . &40) . &|
000003a0  34 30 0d 01 b8 04 0d 01  c2 19 e7 20 4c 43 31 25  |40......... LC1%|
000003b0  3c 3e 43 31 25 20 80 20  43 31 25 3d 30 20 8c 0d  |<>C1% . C1%=0 ..|
000003c0  01 cc 1a f2 5f 4c 41 50  28 31 2c 43 31 5f 54 25  |...._LAP(1,C1_T%|
000003d0  2c 43 31 5f 6c 61 70 25  29 0d 01 d6 0b 43 31 5f  |,C1_lap%)....C1_|
000003e0  54 25 3d 91 0d 01 e0 0e  43 31 5f 6c 61 70 25 2b  |T%=.....C1_lap%+|
000003f0  3d 31 0d 01 ea 05 cd 0d  01 f4 0c 4c 43 31 25 3d  |=1.........LC1%=|
00000400  43 31 25 0d 02 08 04 0d  02 12 19 e7 20 4c 43 32  |C1%......... LC2|
00000410  25 3c 3e 43 32 25 20 80  20 43 32 25 3d 30 20 8c  |%<>C2% . C2%=0 .|
00000420  0d 02 1c 1a f2 5f 4c 41  50 28 32 2c 43 32 5f 54  |....._LAP(2,C2_T|
00000430  25 2c 43 32 5f 6c 61 70  25 29 0d 02 26 0b 43 32  |%,C2_lap%)..&.C2|
00000440  5f 54 25 3d 91 0d 02 30  0e 43 32 5f 6c 61 70 25  |_T%=...0.C2_lap%|
00000450  2b 3d 31 0d 02 3a 05 cd  0d 02 44 0c 4c 43 32 25  |+=1..:....D.LC2%|
00000460  3d 43 32 25 0d 02 8a 04  0d 02 94 1d fd 20 43 31  |=C2%......... C1|
00000470  5f 6c 61 70 25 3d 31 30  20 84 20 43 32 5f 6c 61  |_lap%=10 . C2_la|
00000480  70 25 3d 31 30 0d 02 9e  04 0d 02 a8 2e c8 99 22  |p%=10.........."|
00000490  50 61 72 61 6c 6c 65 6c  5f 4f 70 22 2c 31 2c 30  |Parallel_Op",1,0|
000004a0  20 3a f4 20 54 75 72 6e  20 61 6c 6c 20 6c 69 67  | :. Turn all lig|
000004b0  68 74 73 20 6f 66 66 0d  02 b2 10 f1 22 52 61 63  |hts off....."Rac|
000004c0  65 20 6f 76 65 72 22 0d  02 bc 47 e7 20 43 31 5f  |e over"...G. C1_|
000004d0  6c 61 70 25 3e 43 32 5f  6c 61 70 25 20 8c 20 f1  |lap%>C2_lap% . .|
000004e0  22 43 61 72 20 31 20 69  73 20 74 68 65 20 77 69  |"Car 1 is the wi|
000004f0  6e 6e 65 72 22 20 8b 20  f1 22 43 61 72 20 32 20  |nner" . ."Car 2 |
00000500  69 73 20 74 68 65 20 77  69 6e 6e 65 72 22 0d 02  |is the winner"..|
00000510  c6 23 f1 22 50 72 65 73  73 20 53 70 61 63 65 20  |.#."Press Space |
00000520  66 6f 72 20 61 6e 6f 74  68 65 72 20 72 61 63 65  |for another race|
00000530  22 0d 02 d0 0e f5 20 fd  20 a6 28 2d 39 39 29 0d  |"..... . .(-99).|
00000540  02 da 05 cc 0d 02 e4 0e  e3 20 41 25 3d 31 20 b8  |......... A%=1 .|
00000550  20 35 0d 02 ee 06 ef 37  0d 02 f8 0b 54 25 3d 91  | 5.....7....T%=.|
00000560  2b 31 30 0d 03 02 0c f5  20 fd 20 91 3e 54 25 0d  |+10..... . .>T%.|
00000570  03 0c 05 ed 0d 03 16 13  f1 22 46 61 6c 73 65 20  |........."False |
00000580  53 74 61 72 74 20 22 0d  03 20 05 cd 0d 03 2a 04  |Start ".. ....*.|
00000590  0d 03 34 07 fd 20 a3 0d  03 3e 05 e0 0d 03 48 04  |..4.. ...>....H.|
000005a0  0d 03 52 15 dd 20 f2 5f  4c 41 50 28 43 25 2c 54  |..R.. ._LAP(C%,T|
000005b0  25 2c 4c 25 29 0d 03 5c  11 4c 54 3d 28 91 2d 54  |%,L%)..\.LT=(.-T|
000005c0  25 29 2f 31 30 30 0d 03  66 24 f1 22 43 61 72 22  |%)/100..f$."Car"|
000005d0  3b 43 25 3b 22 20 4c 61  70 20 22 3b 4c 25 3b 22  |;C%;" Lap ";L%;"|
000005e0  20 74 69 6d 65 20 22 3b  4c 54 0d 03 70 05 e1 0d  | time ";LT..p...|
000005f0  03 7a 04 0d 03 84 0b dd  20 f2 5f 73 65 63 0d 03  |.z...... ._sec..|
00000600  8e 08 ea 20 54 25 0d 03  98 0c 54 25 3d 91 2b 31  |... T%....T%=.+1|
00000610  30 30 0d 03 a2 0c f5 20  fd 20 91 3e 54 25 0d 03  |00..... . .>T%..|
00000620  ac 05 e1 0d ff                                    |.....|
00000625