1>REM MODESWITCHER 2 RELION SOFTWARE ENCELADUS 3 2 3 REM IN A PROGRAM DO A 'POW' OR SOMETHING BEFORE CALLING THE MC. 4 5 REM PICCIES - FROM PD 6 7 REM REMEMBER THAT IN MODE 3 YOU CAN ONLY USE 4 COLOURS - THESE ARE THE 1ST 4 COLOURS OF A MODE 4 PALETTE. 8 10 SCREEN 1 20 MODE 3: CLS #: WINDOW : CSIZE 8,8 25 LET code$=STRING$(50,"f"): LET ad=LENGTH(0,code$) 26 LOAD "modes.c"CODE ad 30 PUT 0,175,dr1$ 35 PUT 0,78,dr2$ 40 POKE &55d8,dpal$ 50 WINDOW 32,63,0,21 70 DEF PROC ms 71 PRINT #0; PEN 2; AT 1,40;"PRESS SPACE" 72 LET ad=LENGTH(0,code$) 80 POKE ad+3,12 90 POKE ad+5,1 100 CALL ad 110 END PROC 120 DEF PROC echo a$ 125 LET a$=a$+STRING$(64," ") 130 LET n=1 135 LET m=n +31 140 FOR f=m TO n STEP -1 150 IF a$(f)=" " THEN GO TO 160 155 NEXT f 160 PRINT a$(n TO f) 170 LET n=f+1 175 IF (n+63)>LEN a$ THEN GO TO 200 180 GO TO 135 200 END PROC 210 PRINT PEN 2; " MODE SWITCHER V2.0" 215 WINDOW 32,63,2,21 220 PRINT 230 echo "This is a rather crude adaptation of the original MODE SWITCHER prog am featured on ENCELADUS 2. That program split the screen vertically; this version splits it horizontally!!" 240 PRINT : echo "This is extremely useful in that it allows you to mix MODE 3 text with MODE 4 graphics - excellent for presentational purposes." 250 PRINT :echo "If for some reason you want to mix eg, MODE 1 and MODE 3 grap hics, the program will oblige happily." 260 ms 270 SCROLL CLEAR 280 FOR n=0 TO 20: PRINT : NEXT n: PRINT AT 0,0; 300 echo "There are however a few disadvantages to this version. Firstly, you can't use palette LINES - they wouldn't work because the screen is split h orizontally, and also because the program disables interrupts. Secondly, y ou have less choice over where the screen is to be split. MODESWITCHER 1 w as 'tidy' - it checked when to switch mode. This is not possible when swit ching horizontally, as here, so a different method is used." 305 POW : ms 310 FOR n=0 TO 20: PRINT : NEXT n: PRINT AT 0,0; 315 echo "What happens is that the program just switches between the modes as quickly as possible - hence the disabled interrupts. By trial and error, w e can determine how much of a delay is required to create the effect of a split screen." 325 echo "Two variables are used. If 'AD' is the address of the code (relocata ble), then POKE AD+3 and AD+5 with numbers such that they total 13. For ex ample, to make the left half of the screen MODE 4, as here, do POKE AD+3,1 2: POKE AD+5,1." 330 echo "You may have to experiment to get different results, but there is a fair amount of flexibility." 400 POW : ms 410 FOR n=0 TO 20: PRINT : NEXT n: PRINT AT 0,0; 415 echo "If these two numbers total less than or more than 13, you can create some interesting effects, such as bands of different modes rolling down t he screen." 420 PRINT 425 echo "HOW TO MAKE MODE 3+4 PICTURES: There are several ways to do this. Th e easiest is to do what this example program uses. That is to first create the graphics, GRAB them, then go into the other MODE, PUT the graphics ba ck and PRINT the text." 426 echo "Then experiment with the values of AD+3 and AD+5 to split the screen up as required, and CALL AD to split it!" 450 POW :ms 455 FOR n=0 TO 20: PRINT : NEXT n: PRINT AT 0,0; 460 echo "Alternatively, use SVAR 64. This holds the current screen mode minus 1, so that when you type MODE 4, PEEKING SVAR 64 gives 3. If you POKE SVA R 64, you can force graphics and text to be printed AS IF a different mode was being displayed." 467 echo "For example. Type MODE 4. Print or draw some multi-coloured graphics . Then type POKE SVAR 64,2 to use MODE 3 graphics, and draw some more grap hics/text. Be careful of XRG limits etc, and don't worry about the strange appearance of the text. Then CALL AD and the different areas will be disp layed in their relevant MODES!" 480 POW :ms 490 CLS # : CSIZE 8,8: 494 POKE &55d8,rpal$ 495 PAPER 1: BORDER 1: CLS 496 PUT 0,175,r1$: PUT 0,78,r2$ 497 WINDOW 32,63,2,21 500 PRINT PEN 2; AT 0,0;" MODE SWITCHER V2.0" 505 PRINT : PEN 3 510 echo "Anyway, I think this program is very very brilliant (especially seei ng as I wrote it - and the rest of the entire disk in fact...) and you sho uld start using at once and sending the results to me at:" 519 PRINT : PRINT 520 PRINT " ENCELADUS" 521 PRINT " 6 RAWLINS AVENUE"'" WESTON-SUPER-MARE"'" AVON "'" BS22 0FN" 550 POW :MS 555 CLS #: WINDOW : LIST