5 DEF PROC modes m,l,c0,c1,c2,c3 7 DEFAULT c0=0,c1=29,c2=46,c3=120 8 IF m<>4 AND m<>3 THEN LET m=3 10 LABEL modedata: DATA 219,252,203,239,211,252,1,248,1,237,120,254,(175-yos) -l,40,11,33,84,171,6,4,14,248,237,187,24,236,219,252,203,175,211,252,201,0 ,44,64,29 20 RESTORE modedata 25 DPOKE &5ae2,0 30 FOR n=16384 TO 16420 40 READ a 45 POKE n,a 50 NEXT n 60 DPOKE 16400,16420 70 IF m=4 THEN POKE 16387,175: POKE 16413,239: ELSE POKE 16387,239: POKE 1641 3,175 80 IF m=3 THEN POKE 16417,MEM$(&55d8 TO &55d8+4): PALETTE 0,c0: PALETTE 1,c1: PALETTE 2,c2: PALETTE 3,c3: GO TO 95 90 POKE 16417,c0,c1,c2,c3 95 DPOKE &5ae2,16384 100 END PROC 110 120 DEF PROC norm 130 DPOKE &5ae2,0 135 SCROLL RESTORE 140 END PROC 150 norm 160 MODE 4: CLS #: CSIZE 8,8 170 DATA 0,0,8,5,7,13,15,82,112,90,120,117,119,32,38,98 180 RESTORE 170: FOR n=0 TO 15: READ a: PALETTE n,a: NEXT n 185 LET xrg=256 186 ON ERROR GO SUB 9000 190 LET b=1,a=0: FOR n=255 TO 0 STEP -1 191 LET a=a+b: IF a=12 THEN LET b=-1: ELSE IF a=0 THEN LET b=1 195 PEN a: PLOT n,175: DRAW -50,-50 200 NEXT n 205 LET a=0,b=1: FOR n=206 TO 255 210 PEN a: PLOT n,125: DRAW 50,50 211 LET a=a+b 212 IF a=12 THEN LET b=-1: ELSE IF a=0 THEN LET b=1 215 NEXT n 216 PEN 7: FOR n=0 TO 7: PRINT AT n,0;" ": NEXT n 230 FOR n=15 TO 13 STEP -1: PEN n: FOR m=0 TO 255: PLOT m,95: DRAW 0,RND((n-12 )*8)+4: NEXT m: NEXT n 235 LET sc=(1+IN 252 BAND 31)*16384: LET a$=MEM$(sc TO sc+128*80) 240 MODE 3: CLS #: CSIZE 8,8 241 RESTORE 170: FOR n=0 TO 15: READ a: PALETTE n,a: NEXT n 242 ON ERROR STOP 245 WINDOW 0,63,11,21 246 POKE sc,a$ 250 modes 3,90 260 PALETTE 2,53: PRINT PEN 2;" RETURN OF THE MODESWITCHER " 270 PRINT '"Well, this version is more or less the same as the last, except th at I've made it more user-friendly by incorporating it into a procedure an d there's a simple facility to allow >16 colours." 275 PRINT '"The thing at the top of the screen is just to prove that it's inMO DE 4 without having to load a graphic. It should be obvious that this bi t's in MODE 3 via interrupts." 277 PRINT "Also note that the colours for this bit are separate from the top MODE 4 graphics." 280 LET xrg=256 285 SCROLL CLEAR :rol 490 DEF PROC rol 495 DO 500 ROLL 1,1,16,175,240,52: ROLL 1,2,0,123,256,28 510 LOOP UNTIL INKEY$<>"" 515 END PROC 516 CLS 1 520 PRINT '"To use the procedure, extract the procedures MODES and NORM, sa ve them if you want. They are used thus:" 525 PALETTE 1,70: PRINT ' PEN 1;" MODES m,l,c0,c1,c2,c3" 530 PRINT PEN 1'"m "; PEN 3;"is the mode (3 or 4) that you want to switch to a t line "; PEN 1;"l"; PEN 3;" (0-175). So, eg, "; PEN 2;" MODES 3,80"; PEN 3;" would give the same effect as this demo. "; PEN 2;"MODES 4,140"; P EN 3;" would give a small mode 3 strip at the top of the screen." 540 rol: CLS 1 550 PRINT PEN 1;" MODES m,1,c0,c1,c2,c3" 560 PRINT PEN 1'"c0, c1, c2 "; PEN 3;"and"; PEN 1;" c3"; PEN 3;" are optional, and if you don't specify them some standard values will be used. They s pecify the colours thatyou want to be used for the mode 3 part of the scre en. You can also use the PALETTE command to change the colours of the bot tompart of the screen." 565 PRINT "This means that you can have the 16 colours of the MODE 4 graphic or whatever whilst having 4 separate mode 3 colours. This is useful, because colours 0-4 of mode 4 graphics are oftentoo dark to us e for text." 570 rol: CLS 1 580 PRINT "The best way to get graphics of a different mode onto the screenis to use either GRAB & PUT, or as in this demo, use the MEM$ function and POKE. " 585 PRINT "The "; PEN 1;"NORM"; PEN 3;" procedure simply switches off the inte rrupts." 588 PALETTE 2,29: PEN 2 590 PRINT ''"1) READ AGAIN"'"2) DELETE ALL BUT PROCEDURES"'"3) QUIT" 595 GET a 600 IF a=3 THEN norm: BOOT 610 IF a=1 THEN CLS : GO TO 240 620 norm 630 GO TO 9500 9000 RETURN 9500 DELETE 150 TO