Combine SC5 & SCA picture

Par NYYRIKKI

Enlighted (5873)

Portrait de NYYRIKKI

15-08-2021, 23:47

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
30 BLOAD"ANIMALS.SCA",S
40 SCREEN 5
50 BLOAD"POOH.SC5",S:COLOR=RESTORE
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

!login ou Inscrivez-vous pour poster

Par turbor

Champion (485)

Portrait de turbor

16-08-2021, 09:41

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

Par Grauw

Ascended (10056)

Portrait de Grauw

16-08-2021, 14:32

Nice trick! Smile

Par NYYRIKKI

Enlighted (5873)

Portrait de NYYRIKKI

17-08-2021, 10:01

Grauw wrote:

Nice trick! Smile

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. Wink

Par NYYRIKKI

Enlighted (5873)

Portrait de NYYRIKKI

06-09-2021, 23:58

(Newer mind)

Par NYYRIKKI

Enlighted (5873)

Portrait de NYYRIKKI

07-09-2021, 00:02

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
30 BLOAD"POOH.SC5",S
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
100 BLOAD"ANIMALS.SCA",S
110 FOR I=0 TO 31:VPOKE I+&HFA80,P(I):NEXT:COLOR=RESTORE 'RESTORE PALETTE
120 FOR I=0 TO 511 STEP 4
130 COPY (I,0)-STEP(0,211),1 TO (I,0),,TPSET
140 COPY (I+2,0)-STEP(0,211),1 TO (I+1,0),,OR
150 COPY (I+1,0)-STEP(0,211),1 TO (I+2,0),,TPSET
160 COPY (I+3,0)-STEP(0,211),1 TO (I+3,0),,OR
170 NEXT
180 BSAVE "RESULT.SCA",0,&HFA9F,S