Mark Wickens

10 CLEAR:CLS:DEFSEG=0:K=PEEK(&H6B4)/4+PEEK(&H6B5)*64
20 IF K<32 THENK1=8:K2=K-K1
30 IF K=32 OR K=64 THENK1=32:K2=K-K1
40 IF K=40THENPOKE&H8000,10:POKE0,0:IFPEEK&HA000=10THENK1=32:K2=8ELSEK1=8:K2=32
50 PRINT"Main";K1;TAB(8);"Kbyte Option";K2;"Kbyte";:PRINT:A=64:D=1:A1=0
70 GOSUB1000:A=A+A:D=(D+D)MOD256:IF A<K*1024 THEN70
80 FORI=1 TO9:A=K*1024-A1-1:IF I=5 OR I=9 THEND=&H80 ELSE D=&H20
100 GOSUB1010:IF A1=0 THENA1=1 ELSEA1=A1*2
110 NEXT
120 A=K*1024-A1-1:GOSUB1000:A1=A1*2:IF A1<K*1024 THEN120
130 PRINT"   OK  RAM";:GOSUB10000:PRINT:DEFSEG=&H4000
160 ROM=(PEEK(4)+1+PEEK(5)*256)*2
170 IF PEEK(0)<>&H43 THENPRINT"NG ROM 1";:GOTO1030
180 IF ROM<>1024 THEN200
190 D1=PEEK(&H5955):D2=PEEK&HA6AA:D3=PEEK&HFFFF:DEFSEG=&H5000
191 D4=PEEK0:D5=PEEK&H5955:D6=PEEK&HA6AA
192 IF PEEK&HFFFF<>&H20 THENPRINT"NG ROM 2";:GOTO1030
193 PRINT"OK 512K*2 ROM?";:PRINT
194 PRINTRIGHT$(HEX$(D1),2);" ";RIGHT$(HEX$(D2),2);" ";RIGHT$(HEX$(D3),2);" ";RIGHT$(HEX$(D4),2);" ";RIGHT$(HEX$(D5),2);" ";RIGHT$(HEX$(D6),2);" ";:GOTO210
200 IF PEEK(ROM*128-1)<>&H20 THENPRINT"NG ROM 1";:GOTO1030
201 D1=PEEK&H5955:IF ROM=256 THEND2=PEEK&H26AA ELSE D2=PEEK&HA6AA
202 PRINT"OK";STR$(ROM);"K ROM?";:PRINT
203 PRINTRIGHT$(HEX$(D1),2);" ";RIGHT$(HEX$(D2),2);" ";
210 GOSUB10000
220 CLS:FOR I=0 TO 63:PRINTCHR$(&HFF);:NEXT:LOCATE 0,0
230 DEFCHR$(&HFF)="FFFFFFFFFF":GOSUB10000:DEFCHR$(&HFF)="0000000000":GOSUB10000
250 DEFCHR$(&HFF)="AA55AA55AA":GOSUB10000:DEFCHR$(&HFF)="55AA55AA55":TRON:GOSUB10000:TROFF
280 CLS:PRINT"Printer CHECK";:PRINT:GOSUB10000
290 LPRINT"Main";K1;"Kbyte Option";K2;"Kbyte"
320 FOR I=32 TO 255:IF I=&H7F THENI=&H80
330 LPRINTCHR$(I);:NEXT:LPRINT
350 PRINT"RS 232C CHECK";:PRINT:GOSUB10000
360 OPEN "COM0:5,E,8,2,C,D,C,B,N" AS #1:PRINT#1,123:INPUT #1,D
390 CLOSE:IF D<> 123 THENPRINT"NG RS 232C";:GOTO1030
410 PRINT"OK RS 232C";:GOSUB10000:PRINT
420 PRINT"MT CHECK  <REC>";:PRINT:GOSUB10000
430 OPEN "CAS0:TEST" FOR OUTPUT AS #1:PRINT#1,"ABC":CLOSE
460 PRINT"MT <REW> and <PLAY>";:PRINT:GOSUB10000
470 OPEN "CAS0:TEST" FOR INPUT AS #1:INPUT #1,A$:CLOSE
490 IF A$<>"ABC" THENPRINT"NG MT";:PRINT:GOTO1030
510 PRINT"OK MT";:PRINT
520 END
1000 POKE A,D
1010 IF PEEKA=D THENRETURN
1020 IF A>=K1 THENPRINT"NG RAM 2"; ELSE PRINT "NG RAM 1";
1030  BEEP:GOTO1030
10000 BEEP:IF INPUT$(1,@)=CHR$(0) THEN10000ELSE RETURN