home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 4 #3
/
Commodore_Disk_User_Vol.4_3_1991_-.d64
/
intro
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
6KB
|
160 lines
0 l=l+1:ifl=1thenload"multiplexor",8,1
10 sys49316
20 poke53280,0:poke53281,15
30 poke53248+27,255
31 poke53248+37,4:poke53248+38,6
32 fort=0to7:poke16383,2^t:next
40 c=20:fort=0to31:poke50240+t,12:poke50272+t,255:next
41 fort=0to7:poke50272+t,254:poke50272+t+24,254:poke50304+t,8+16
42 poke50304+24+t,8:next
50 ford=0to3:c=87:fort=0to7:poke50176+k,c:c=c+24:poke50208+k,30+d*73:k=k+1
60 nextt,d
65 fort=8to23:poke50304+t,16+8:next
70 sys50688
71 goto20010
90 fort=0to31:d=d+.1:poke50208+t,peek(50208+t)+sin(d)*10:next:sys50688:return
95 poke50208,50:poke50176,23:poke50240,1:sys50688
96 print"[147]hihi[146]_watch this space for the demo hihi[146]_sprite"
97 return
100 print"[147] the control register is very difficult to follow so watch carefully"
101 d=0:gosub90:y=9:x=2:gosub95:gosub102:goto190
102 print"";
110 print"the control register is a mixture of"
120 print"msb,sprite data priority,multicolor-"
130 print"selection,sprite expand x and y and is set out as follows:"
140 print" [176][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][174] [221] [221] [221] [221] [221] [221] [221] [221] [221]"
150 print" [173][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][189]"
170 print" 1 6 3 1 8 4 2 1 2 4 2 6"
180 print" 8"
181 poke1024+y*40+x,160
182 return
190 print"if bit 128 is set to one this means thatthe sprite will appear in the";
200 print" msb area":poke50304,128:sys50688
220 y$="":printy$;"press space to continue";:gosub50000
230 goto260
240 fort=15to24:printleft$(y$,t);" ";:next
245 print"";
250 return
260 gosub240:x=x+2:gosub102
270 print"if bit 64 is set then the sprite will beexpanded in the x direction"
271 poke50304,64:sys50688
280 gosub50000
290 gosub240:x=x+2:gosub102
300 print"if bit 32 is set then the sprite will beexpanded in the y direction"
301 poke50304,32:sys50688
310 gosub50000:gosub240:x=x+2:gosub102
320 print"if bit 16 is set then the sprite will bebehind the screen data"
321 poke50304,16:sys50688
330 gosub50000:gosub240:x=x+2:gosub102
340 print"bit 8 sets the sprite into multicolour"
341 poke50304,8:sys50688
350 gosub50000:gosub240:x=x+2:gosub102
360 print"bit 4 is not used"
361 poke50304,0:sys50688
365 gosub50000:x=x+2:gosub102
366 print"bit 2 is not used":poke50304,0:sys50688
367 gosub50000:x=x+2:gosub102
368 print"bit 1 is not used"
369 gosub50000:print"[147]"
370 k=0:ford=0to3:c=87:fort=0to7:poke50176+k,c:c=c+24:poke50208+k,62+d*50:k=k+1
371 nextt,d
372 fort=0to31:poke50304+t,16:next
373 sys 50688
379 return
400 print"these registers are the raster positions";:gosub90
410 print"for the next block of eight sprites"
420 print"if $c0a0 or 49312 was poked with a $40 or 64"
430 print" then the actual raster position would"
440 print"be $30 or 48 because i have to subtract $10 or 16 so i can display";
450 print" the data"
460 print" this can be done with all four registers"
470 gosub50000:print"[147]"
480 print"the top border can be turned on (i.e"
490 print"normal) by pokeing $c3a3 or 50083 with 0";
500 print"pokeing a 1 will switch it off so sprites can be displayed under it"
510 print"press space":gosub50000:return
20010 print"[147][151] ";
20020 print"[152] ";
20030 print"[155] ";
20040 print"[146] the operating instructions for the ";
20041 print"amazing multiplexor written by balhazar";
20050 print"[155] ";
20060 print"[152] ";
20070 print"[151] ";
20080 print"[144] ";
20160 print" to use this multiplexor is very simple"
20170 print"it is like useing an expanded video chip";
20180 print"but a few rules must be followed"
20190 print"1...no more than eight (8) sprites must be in the same horizontal ";
20200 print"strip or they will flicker!"
20210 print"2...the irq at $0314 and $0315 must not be changed"
20220 print" press space key to continue ";
20221 fort=0to63:poke255*64+t,216:poke254*64+t,254:next
20230 gosub50000
20240 print""
20241 print"do you want decimal or hex numbers?(d/h)"
20242 get a$:ifa$="d"then30000
20243 ifa$<>"h"then20242
20250 print"[151]the locations to used by the multiplexor"
20260 print" $c000-$cfff are used by the program"
20270 print" $c400-$c41f are the 'x' positions of each sprite"
20280 print" $c420-$c43f are the 'y' positions of each sprite"
20290 print" $c440-$c45f are the colours for each sprite"
20300 print" $c460-$c47f are the whats for each sprite"
20310 print" (simalar to $07f8-$07ff)"
20320 print" $c480-$c49f is the control register"
20340 print" to update the sprites sys $c600"
20350 print" this plots their new positions into memory"
20351 print" to start the multiplexor sys$c0a4"
20360 goto40000
30000 :
30250 print"[151]the locations to used by the multiplexor"
30260 print" 49152-53247 are used by the program"
30270 print" 50176-50207 are the 'x' positions of each sprite"
30280 print" 50208-50239 are the 'y' positions of each sprite"
30290 print" 50240-50303 are the colours for each sprite"
30300 print" 50272-50303 are the whats for each sprite"
30310 print" (simalar to 2040-2047)"
30320 print" 50304-50335 is the control register"
30340 print" to update the sprites sys 50688"
30350 print" this plots their new positions into memory"
30360 print" to start the multiplexor sys 49316"
40000 print" press space key to continue ";
40010 gosub50000:gosub100
40011 print" $c0a0-$c0a3 or 49312-49315 a nought means miss out that line"
40012 gosub400
40013 print" numbers can be directly poked into the $c000 or 49152 onwards area"
40014 print" eg. poke 49152,90 (xpos)
40015 [153]" eg. poke 49174,90 (ypos)
40016 print" would print a sprite 90 down and 90 across if $c0a0-$c0a3 are set"
40018 print" press space key to continue ";
40019 gosub50000
40020 print"[147]the name for the routine is 'multiplexor'"
40021 print"this is for the routine you have bought"
40022 print"load it in using load"+chr$(34)+"multiplexor"+chr$(34)+",8,1"
40028 print" press any key to continue ";
40029 gosub50000
40030 print"[147]this bit is for more technical people so";
40040 print"you have been warned"
40050 print"if you wish to byepass the sort routine"
40060 print"you may use the area 49152-49315 or $c000-$c0a3"
40070 print"49152-49311 is an exact image of 50176 or $c400 onwards"
40080 print"but all the y values must be in order 49312-49315 or $c0a0-$c0a3"
40090 print"are the positions of each split that"
40091 print"display the next block of eight sprites"
40092 print""
40100 print"press space key to load the main menu"
40120 gosub50000
40130 poke53248+21,0
40131 poke53280,2
40132 open15,8,15,"i0:":close15:goto40134
40134 s$="menu":load"rtu",8,1
50000 ifa$=""thenstop
50005 readf:iff=-1thenrestore:goto50005
50006 poke16383,f
50010 geta$:ifa$<>" "then50000
50020 return
50030 data 255,1,2,4,8,16,32,64,128,3,6,12,24,48,96,192,96,48,24,12,6,3,128
50040 data 64,32,16,8,4,2,1,255,0,255,0,255,0,255,0,255,0,-1
60000 rem