VIC-20 Hi-Res Graphics

The Vic20 has a high resolution graphics mode, but few users know how to access it. The following subroutines allow a program to use high resolution graphics. The first line of the program should be GOSUB 1000. To plot a pixel, set X and Y to the x and y co-ordinates respectively (valid values range from 0 to 175) and GOSUB 1100.

999 END
1000 REM INITIALISE HI-RES
1001 PRINT CHR$(147)
1002 POKE 36879,8
1003 IF PEEK(36869)=253 THEN GOTO 1015
1004 POKE 36869,253
1005 POKE 36867,PEEK(36867) OR 128
1006 POKE 55,0
1007 POKE 56,19
1008 POKE 51,0
1009 POKE 52,19
1010 CLR
1011 PRINT CHR$(147);"INITIALISING HI-RES"
1012 FOR I=0 TO 2047
1013 POKE 5120+I,PEEK(32768+I)
1014 NEXT I
1015 RETURN
1100 REM PLOT PIXEL
1101 X%=X/8
1102 Y%=Y/8
1103 P=7680+X%+22*Y%
1104 Q=PEEK(P)
1105 IF Q>127 THEN GOTO 1114
1106 CN=CN+1
1107 S=5120+8*(127+CN)
1108 T=5120+8*Q
1109 FOR I=0 TO 7
1110 POKE I+S,PEEK(I+T)
1111 NEXT
1112 Q=127+CN
1113 POKE P,Q
1114 C=5120+8*Q+(Y AND 7)
1115 POKE C,PEEK(C) OR (2^(7-(X AND 7)))
1116 RETURN
This article was last edited on 11th September 2006. The author can be contacted using the form below.
Back to home page
Bookmark with: