This update brings
sprites to BASIC 83C!
By default, BASIC 83 sets the VDP to have a sprite pattern table at $800 (used for DATA temp work) and a sprite attribute table at $1300 (is erased when screen scrolls up!).
To allow sprites, the VDP initialisation has been changed to give the sprite pattern table at $0000 and the sprite attribute table at $0180. This gives 44 characters to use as sprites.
However, you don't get something for nothing. We lose
CHAR 96 to 160(remember the SAT is $80 bytes), but that's a small price in my opinion, as these are non-printing and most likely would not be used.
Conveniently, you can use the
CHAR command to define your sprite patterns too.
The
VPOKE function is the same as
POKE, but for video RAM.
Here's an example, showing how to use some sprites
Code: Select all
10 CHAR 96,0103030301030305
20 CHAR 97,0F030307070E0C06
30 CHAR 98,C0A0E0C080C0F0F8
40 CHAR 99,C0C0F07060300000
50 CHAR100,0103030301030307
60 CHAR101,030303070E0C0800
70 CHAR102,C0A0E0C080C0E0A0
80 CHAR103,C0C0C0C0C0C0C060
90 CHAR104,0103030301030305
100 CHAR105,0503030705030303
110 CHAR106,C0A0E0C080C0C0A0
120 CHAR107,A0C0E0E080800080
200 CHAR108,0003070F07A3F1F0
210 CHAR109,F0E0801C0C020000
220 CHAR110,000080980C412303
230 CHAR111,075F3F1E3E1C0800
240 CHAR112,000001030168FCFC
250 CHAR113,FCF8E00703000000
260 CHAR114,00C0E0E6C2D04800
270 CHAR115,01170F060E840000
280 CHAR116,00000000401A3F3F
290 CHAR117,7EFEF86061000000
300 CHAR118,003078F870341200
310 CHAR119,00050300C2C02000
320 CHAR120,0000006030068F0F
330 CHAR121,1F7FFE7878300000
340 CHAR122,00081C3E1C8DC4C0
350 CHAR123,C181000070300800
360 CHAR124,000000180C412303
370 CHAR125,075F3F1E3E1C0800
380 CHAR126,0000040E06A3F1F0
390 CHAR127,F0E080001C0C0000
400 CHAR128,0000206043D04800
410 CHAR129,01170F070F070200
420 CHAR130,000000020068FCFC
430 CHAR131,FCF8E08086000000
440 CHAR132,0010387970341200
450 CHAR133,0005030103010000
460 CHAR134,00000080C01A3F3F
470 CHAR135,7FFEF8E0E0C08000
480 CHAR136,000C1E3E1C8DC4C0
490 CHAR137,C081000070300800
500 CHAR138,0000006030068F0F
510 CHAR139,1F7FFE78F8702000
520 CHAR140,071F3F7F7FFFFFFF
530 CHAR141,FFFFFF7F7F3F1F07
540 CHAR142,E0F8FCFEFEFFFFFF
550 CHAR143,FFFFFFFEFEFCF8E0
900 N=12
910 VPOKE 388,88
920 VPOKE 389,120
930 VPOKE 390,N
940 VPOKE 391,4
950 VPOKE 392,88
960 VPOKE 393,120
970 VPOKE 394,44
980 VPOKE 395,1
1000 X=0
1010 Y=0
1020 M=0
1030 X=X+4
1040 VPOKE 387,15
1050 IF X < 240 THEN GOTO 1090
1060 X=0
1070 Y=Y+16
1080 IF Y>192 THEN Y=0
1090 VPOKE 384,Y
1100 VPOKE 385,X
1110 VPOKE 386,M
1120 M=M+4
1130 IF M>8 THEN M=0
1140 N=N+4
1150 IF N>40 THEN N=12
1160 VPOKE 390,N
1170 GOTO 1030
You will need to grab the binary from the first post to check it out.
You do not have the required permissions to view the files attached to this post.