When you consider that the Archimedes offers all the screen modes provided by the original model B, one might naively think that a screen could be saved from the Beeb and loaded directly into the Archimedes. However, this is simply not possible because while the modes are compatible in terms of resolution and colour, the way the data is stored in screen memory is totally different.
The accompanying program overcomes this barrier by taking a Beeb screen (in the form of a file), and converting it directly into an Archimedes screen, which can then be saved if desired. To use the program, type in the listing and save it. When you run it, you are asked to enter the screen mode (in the range 0 to 7), the filename of the saved Beeb screen, and the filename with which to save the converted screen. If this last name is omitted (by pressing Return alone) then the picture will be displayed but not saved.
10 REM >BBCscrCON
20 REM Program Screen Converter
30 REM Version A1.0
40 REM Author Dag Haakon Myrdal
50 REM RISC User July/August 1989
60 REM Program Subject to Copyright
70 :
80 MODE 0:DIM B% 30:Z%=FNaddr
90 PRINT"BBC TO ARCHIE SCREEN FILE CONVERTER"'''
100 *CAT
110 PRINT
120 INPUT"Screen Mode (0-7) :"Mode%
130 INPUT"Filename to convert :"file$
140 INPUT"Filename of file to create or <Return> :"arcfile$
150 MODE Mode%
160 PROCread(file$,Mode%)
170 IF arcfile$<>"" THEN OSCLI"SCREENSAVE "+arcfile$
180 END
190 :
200 DEF FNaddr
210 !B%=148:B%!4=-1
220 SYS"OS_ReadVduVariables",B%,B%+&10
230 =B%!&10
240 :
250 DEF PROCread(file$,Mode%)
260 offset%=0
270 handle%=OPENIN file$
280 ON ERROR CLOSE#handle%:REPORT:END
290 IF Mode%=7 THEN
300 VDU 30,23,16,1|
310 FOR F%=1 TO 1000
320 G%=BGET#handle%
330 IF G%<32 THEN G%+=128
340 VDU G%
350 NEXT:VDU 30
360 ELSE
370 WHILE NOT EOF#handle%
380 FOR Y%=0 TO 79
390 FOR X%=0 TO 7
400 addr%=Z%+(X%*80)+offset%+Y%
410 ?addr%=FNGetInv(Mode%)
420 NEXT:NEXT
430 offset%=offset%+80*8
440 ENDWHILE
450 ENDIF
460 CLOSE#handle%
470 ON ERROR OFF
480 ENDPROC
490 :
500 DEF FNGetInv(M%)
510 out%=0:in%=BGET#handle%
520 CASE M% OF
530 WHEN 0,3,4,6
540 IF(in% AND 1) out%=out% OR 128
550 IF(in% AND 2) out%=out% OR 64
560 IF(in% AND 4) out%=out% OR 32
570 IF(in% AND 8) out%=out% OR 16
580 IF(in% AND 16) out%=out% OR 8
590 IF(in% AND 32) out%=out% OR 4
600 IF(in% AND 64) out%=out% OR 2
610 IF(in% AND 128) out%=out% OR 1
620 =out%
630 WHEN 1,5
640 IF(in% AND 128) out%=out% OR 1
650 IF(in% AND 8) out%=out% OR 2
660 IF(in% AND 64) out%=out% OR 4
670 IF(in% AND 4) out%=out% OR 8
680 IF(in% AND 32) out%=out% OR 16
690 IF(in% AND 2) out%=out% OR 32
700 IF(in% AND 16) out%=out% OR 64
710 IF(in% AND 1) out%=out% OR 128
720 =out%
730 WHEN 2
740 IF(in% AND 128) out%=out% OR 1
750 IF(in% AND 32) out%=out% OR 2
760 IF(in% AND 8) out%=out% OR 4
770 IF(in% AND 2) out%=out% OR 8
780 IF(in% AND 64) out%=out% OR 16
790 IF(in% AND 16) out%=out% OR 32
800 IF(in% AND 4) out%=out% OR 64
810 IF(in% AND 1) out%=out% OR 128
820 =out%