# Combine SC5 & SCA picture

Once in every 10 years I feel the need to combine 16-color SCREEN 5 picture to SCREEN 10/11, 12499 color YJK-picture. How ever it seems that each time I do, I can't find the tool for it... Now I will post it here, so that hopefully next time I will find it with Google. Maybe some of you will find this also useful...

Some more keywords: SC52SCA.BAS , SC5TOSCA.BAS , SC5&A2A.BAS , SC5&ATOA.BAS

Example:

ANIMALS.SCA

POOH.SC5

Conversion:

```10 DEFINT A-Z:DIM P(31):COLOR 15,0,0
20 SCREEN 11:SET PAGE 1,1:CLS
40 SCREEN 5
60 FOR I=0 TO 31:P(I)=VPEEK(I+&H7680):NEXT ' SAVE SC5 PALETTE
70 COPY (1,0)-(255,211) TO (0,0),2
80 A=POINT(0,0) ' WAIT
90 VDP(0)=10:POKE &HFCAF,7 ' SCREEN 7, NO CLS
100 FOR I=1 TO 511 STEP 2
110 LINE (I,0)-STEP(0,211),0
120 COPY (I-1,0)-STEP(0,211) TO (I,0),,TPRESET
130 COPY (I-1,0)-STEP(0,211) TO (I,0),,OR
140 LINE (I,0)-STEP(0,211),8,,AND
150 COPY (I-1,0)-STEP(0,211) TO (I-1,0),1,TPSET
160 COPY (I,0)-STEP(0,211) TO (I,0),1,OR
170 NEXT
180 SCREEN 11
190 SET PAGE 1,1
200 FOR I=0 TO 31:VPOKE I+&HFA80,P(I):NEXT ' RESTORE PALETTE
210 COLOR=RESTORE
220 BSAVE "RESULT.SCA",0,&HFA9F,S
```

RESULT.SCA

Using MRC as a personal algorithm backup storage. Now that's savage

Nice trick!

Grauw wrote:

Nice trick!

Yes, I also feel that I've found quite clever way to do it... Seems that you can do this in reasonable speed even on pure MSX-BASIC as long as you leave all the bit shifting & manipulation work for VDP.

Here is alternative version that uses my new findings of "SCREEN 9" (this is a bit faster)

```10 DEFINT A-Z:DIM P(31):COLOR 15,0,0
20 SCREEN 5:SET PAGE 1,1:CLS
40 COLOR=RESTORE:FOR I=0 TO 31:P(I)=VPEEK(I+&H7680):NEXT 'SAVE SC5 PALETTE
50 SET PAGE ,3:CLS
60 COPY (0,0)-(255,211),1 TO (0,0),,TPRESET
70 COPY (0,0)-(255,211),1 TO (0,0),,OR
80 LINE (0,0)-(255,211),8,BF,AND
90 SCREEN 7:VDP(26)=VDP(26)OR24