VIC-20 Memory bank test program

This is a saved backup of original information that is gone from the original source. All credits go to those who have originally created this. I only want to preserve this information for the future. Have fun with it. šŸ™‚

Program by Ward Shrake:
This is an ascii text file of a BASIC program I wrote. It is used
to see whether RAM or ROM (or nothing) is plugged into a real Vic20. You can use it to play with and set the switches insideĀ a RAM expander, or useĀ it to help archiveĀ 
romĀ images.

10 PRINT"  cartridge archiver"
15 PRINT"   for vic20   v1.0"
20 PRINT" (c) 1996 ward shrake"
30 :
35 REM cart there?
40 GOSUB110
45 :
48 REM test all memory banks
49 PRINT"testing memory..."
50 x=1:z=8192:GOSUB500
51 x=2:z=16384:GOSUB500
52 x=3:z=24576:GOSUB500
53 x=5:z=40960:GOSUB500
99 END
100 :
101 :
105 REM autostart cart detection
107 :
110 cn=0:REM reset counter
120 IFPEEK(40964)=65THENcn=cn+1
130 IFPEEK(40965)=48THENcn=cn+1
140 IFPEEK(40966)=195THENcn=cn+1
150 IFPEEK(40967)=194THENcn=cn+1
160 IFPEEK(40968)=205THENcn=cn+1
170 IFcn<5THENPRINT"no autostart cart here":GOTO250:REM no cart
175 :
180 PRINT"autostart cart found."
210 PRINT"cold start: sys";
220 PRINTPEEK(40960)+PEEK(40961)*256
230 PRINT"warm start: sys";
240 PRINTPEEK(40962)+PEEK(40963)*256
250 RETURN
495 :
496 :
497 REM test memory banks,
498 REM see what is in them
499 :
500 ro=0:ra=0:rn=0
505 PRINT"now testing bank";x
510 FORj=zTOz+9
511 ov=PEEK(j)
512 nv=ABS(ov-255)
513 IFnv>244THENnv=244
520 FORi=1TO10
535 POKEj,nv+i
540 z3=PEEK(j)
550 IFz3=ovTHENro=ro+1
553 IFz3=nv+iTHENra=ra+1
555 NEXT
560 POKEj,ov
562 NEXT
570 IFro=100THENbk$=" is rom.     "
575 IFra=100THENbk$=" is ram.     "
580 IFro+ra<100THENbk$=" is unstable."
585 PRINT"bank";x;bk$
590 RETURN