Software sprites on a VIC-20
The VIC-20 has no hardware sprites, and the processor is to slow to draw a bitmap image. If you would like to have sprites floating around on the screen, how can you create them?
The VIC-20 lacks the ability to present a bitmap. Normally this can be solved by redefining the bitmap of the character set. One way to display this is by creating a bitmap by arranging characters like:
ABCDEFG
HIJKLMN
OPQRSTU
and we will get a 7x3 char= 7*8 x 3*8 = 56 x 21 pixels bitmap.
If we use 2 characters we can let a ”sprite” float in x OR y direction by changing the patterns in these characters. We can place the 2 characters like:
AB OR A
B
If we instead use 4
characters we can let the sprite float in directions x AND y by
changing the patterns. We can place the 4 characters like:
AC
BD
The figure 1 and 2 demonstrate how a letter A can float like a sprite on a display that does not actually have sprites.
Figure 1: Original A in middle Figure 2: A moved 1 pixel in both x and y.
Link to a demo program I wrote in 6502 assembler:
Run able file: vic20sprites.prg (at least 8k expanded)
Source file: vic20sprites.asm
Project in zip-file: vic20_sprites_v3.9_Floats in x and y.zip
Link to development tool: CBM .prg Studio Link to WinVice: WinVICE-2.4-x86
Figure 3: Screenshot when the program is running
Use keys the following keys to move the “A”:
A=up ; Z=down; N=left; M=right