SCREEN 2 tutorial

by aorante on 14-04-2010, 23:12
Topic: Development
Languages:

Spanish MSX friend aorante has published a tutorial in his blog, to create SCREEN 2 graphics. There you will find different techniques to, e.g., apply dithering and to combine sprites. The information in his blog is in Spanish.

Relevant link: SCREEN 2 tutorial part 1 & part 2

Comments (14)

By Leo

Paragon (1236)

Leo's picture

15-04-2010, 20:21

msx 1 can prosuce very nice gfx , i discovered this only recently, i like this tuto ..

By MäSäXi

Paragon (1884)

MäSäXi's picture

15-04-2010, 20:51

Very nicely done! Big smile

I have just one wish:

180 BSAVE"BENDER_S.SC2",0,&H3FFF,S

20 BLOAD"BENDERSX.SC2",S

Please add a solution for cassette users too.

,S is for disk drive owners. (read: LUXURY in the 1980s)

I know, many already has disk drive and/or MSX2 nowadays, but there are still many who use cassette drive Smile and real MSX1 without disk drive. Smile

By the way, Jannone, have you got my email about a bug in Tinysprite? (thought to say, as Jannone´s tinysprite was mentioned in this article)

By Hrothgar

Champion (479)

Hrothgar's picture

15-04-2010, 21:40

,S is disk-only?

Am I hallucinating that I used that command with tapes back in the days? Or am I confusing that with loading and saving graphics from the built-in Philips MSX Designer?

By NYYRIKKI

Enlighted (5385)

NYYRIKKI's picture

23-04-2010, 13:26

Yes, ",S" is disk only and not implemented in MSX1

By NYYRIKKI

Enlighted (5385)

NYYRIKKI's picture

23-04-2010, 17:24

This looks like way too hard way to make proper SCREEN 2 pictures...

Here is my suggestion:

1) Make your picture in your favorite picture tool
2) Convert your picture to SC2 using your favorite tool (Like Jannones converter)
3) Convert your SC2 picture to SC5 (Tool here doesn't really matter)
4) Edit the worst SC2 conversion bugs away using your favorite SC5 editor (like DD-graphics)
5) Convert the result back to SC2 using the X-BASIC tool below
6) When you see the result with artifacts, push SPACE
7) Move mouse over the artifact blocks and use button 1 to remove them.
8) When you have removed the artifacts you wanted to remove, press mouse button 2
9) Now you see the final result
10) Press SPACE to save the result on disk.

10 '******** SC5-SC2.BAS
20 '*** converts a screen 5 picture to screen 2
30 '*** take care of using only 2 colors per 8 pixel
40 '*** the sc5-picture will be cut from 212 to 192 lines
50 '***
60 '*** made '94 by MI-CHI   -   this program is FREEWARE
70 '*** Fixed for sprite support By NYYRIKKI
80 '***
90 CLEAR 200,&H9FFF
100 SCREEN 0:FILES"*.sc5":LOCATE0,20:INPUT "Filename (without EXT)";N$:COLOR 15,0,0
110 SCREEN5,0:IFN$<>""THENSETPAGE,1:BLOADN$+".sc5",S:SETPAGE,2:CLS:SETPAGE,0
120 SPRITE$(0)=STRING$(8,255):PUTSPRITE0,(0,-1),15,0
130 COPY(0,0)-(255,191),1TO(0,0),0
140 _TURBO ON
150 DEFINT A-Z
160 DIMS(7),D(7),C(15):FORI=0TO7:S(7-I)=2^I:NEXTI
170 P=0:Y=0:X=0:O=0
180 A=0:C1=16:C2=16:FOR N=0 TO 7
190 CO=POINT(X+N,Y):D(N)=CO:IF CO		

By Manuel

Ascended (15756)

Manuel's picture

23-04-2010, 18:37

Why convert back and forth from 2 -> 5 -> 2?

By NYYRIKKI

Enlighted (5385)

NYYRIKKI's picture

23-04-2010, 19:15

The reason is that real screen converters do much better job in the actual conversion than this crappy BASIC listing. This program is meant only to make the sprites more automatically.

I'm really not a graphics expert, but here is an example picture I used for testing the method I described. (Sprites flicker on and off)

www.msx.fi/temp/sprites.gif

By JohnHassink

Ambassador (5413)

JohnHassink's picture

23-04-2010, 21:11

Hey NYYRIKKI, looks sweeeeet!

By spacemoai1973

Expert (96)

spacemoai1973's picture

14-04-2016, 00:15

I don't get it.

By Grauw

Ascended (8456)

Grauw's picture

14-04-2016, 00:23

The listing is cut off, press QUOTE on NYYRIKKI’s post to get the full listing.

By ARTRAG

Enlighted (6250)

ARTRAG's picture

14-04-2017, 21:55

NYYRIKKI wrote:

This looks like way too hard way to make proper SCREEN 2 pictures...

Here is my suggestion:

1) Make your picture in your favorite picture tool
2) Convert your picture to SC2 using your favorite tool (Like Jannones converter)
3) Convert your SC2 picture to SC5 (Tool here doesn't really matter)
4) Edit the worst SC2 conversion bugs away using your favorite SC5 editor (like DD-graphics)
5) Convert the result back to SC2 using the X-BASIC tool below
6) When you see the result with artifacts, push SPACE
7) Move mouse over the artifact blocks and use button 1 to remove them.
8) When you have removed the artifacts you wanted to remove, press mouse button 2
9) Now you see the final result
10) Press SPACE to save the result on disk.

10 '******** SC5-SC2.BAS
20 '*** converts a screen 5 picture to screen 2
30 '*** take care of using only 2 colors per 8 pixel
40 '*** the sc5-picture will be cut from 212 to 192 lines
50 '***
60 '*** made '94 by MI-CHI   -   this program is FREEWARE
70 '*** Fixed for sprite support By NYYRIKKI
80 '***
90 CLEAR 200,&H9FFF
100 SCREEN 0:FILES"*.sc5":LOCATE0,20:INPUT "Filename (without EXT)";N$:COLOR 15,0,0
110 SCREEN5,0:IFN$<>""THENSETPAGE,1:BLOADN$+".sc5",S:SETPAGE,2:CLS:SETPAGE,0
120 SPRITE$(0)=STRING$(8,255):PUTSPRITE0,(0,-1),15,0
130 COPY(0,0)-(255,191),1TO(0,0),0
140 _TURBO ON
150 DEFINT A-Z
160 DIMS(7),D(7),C(15):FORI=0TO7:S(7-I)=2^I:NEXTI
170 P=0:Y=0:X=0:O=0
180 A=0:C1=16:C2=16:FOR N=0 TO 7
190 CO=POINT(X+N,Y):D(N)=CO:IF CO

By Grauw

Ascended (8456)

Grauw's picture

27-09-2018, 10:00

Reposting NYYRIKKI’s listing with <’s escaped so that it is shown in its entirety...

NYYRIKKI wrote:

This looks like way too hard way to make proper SCREEN 2 pictures...

Here is my suggestion:

1) Make your picture in your favorite picture tool
2) Convert your picture to SC2 using your favorite tool (Like Jannones converter)
3) Convert your SC2 picture to SC5 (Tool here doesn't really matter)
4) Edit the worst SC2 conversion bugs away using your favorite SC5 editor (like DD-graphics)
5) Convert the result back to SC2 using the X-BASIC tool below
6) When you see the result with artifacts, push SPACE
7) Move mouse over the artifact blocks and use button 1 to remove them.
8) When you have removed the artifacts you wanted to remove, press mouse button 2
9) Now you see the final result
10) Press SPACE to save the result on disk.

10 '******** SC5-SC2.BAS
20 '*** converts a screen 5 picture to screen 2
30 '*** take care of using only 2 colors per 8 pixel
40 '*** the sc5-picture will be cut from 212 to 192 lines
50 '***
60 '*** made '94 by MI-CHI   -   this program is FREEWARE
70 '*** Fixed for sprite support By NYYRIKKI
80 '***
90 CLEAR 200,&H9FFF
100 SCREEN 0:FILES"*.sc5":LOCATE0,20:INPUT "Filename (without EXT)";N$:COLOR 15,0,0
110 SCREEN5,0:IFN$<>""THENSETPAGE,1:BLOADN$+".sc5",S:SETPAGE,2:CLS:SETPAGE,0
120 SPRITE$(0)=STRING$(8,255):PUTSPRITE0,(0,-1),15,0
130 COPY(0,0)-(255,191),1TO(0,0),0
140 _TURBO ON
150 DEFINT A-Z
160 DIMS(7),D(7),C(15):FORI=0TO7:S(7-I)=2^I:NEXTI
170 P=0:Y=0:X=0:O=0
180 A=0:C1=16:C2=16:FOR N=0 TO 7
190 CO=POINT(X+N,Y):D(N)=CO:IF CO<C1 THEN C1=CO
200 NEXT N:FORN=0TO7
210 CO=D(N):IF CO<>C1 AND CO<C2 THEN C2=CO
220 NEXT N:IF C2=16 THEN C2=10
230 SET PAGE ,2
240 FOR N=0 TO 7
250 CO=D(N):IF CO=C1 THEN A=A+S(N)
260 IF CO<>C1 AND CO<>C2 THEN PSET (X+N,Y),CO
270 NEXT N'LINE(X,Y)-(X+7,Y),15,,XOR
280 SET PAGE ,0
290 POKE &HA000+P,A:POKE &HB800+P,C2+16*C1:P=P+1
300 Y=Y+1:IF (YAND7)=0 THEN Y=Y-8:X=X+8:IF X=256 THEN X=0:Y=Y+8:VPOKE 30208,Y-1
310 IF Y<>192 THEN 180
320 SCREEN 2
330 FOR I=0 TO 6143
340 VPOKE I,PEEK(&HA000+I):VPOKE I+8192,PEEK(&HB800+I)
350 NEXT I
360 IFINKEY$=""THEN360
370 SCREEN 5:SET PAGE 2,2:SPRITE$(0)=STRING$(8,255)
380 FOR I=0 TO 31:POKE &HD100+I*4,208:NEXT I
390 SN=0:R=PAD(12):IF (PAD(13)ORPAD(14))=1 THEN P=16:J=2 ELSE P=12:J=1
400 R=PAD(P):X=(X+PAD(13)+248)MOD248:Y=(Y+PAD(14)+184)MOD184
410 PUT SPRITE 0,(X,Y-1),15,0
420 IF STRIG(J) THEN 450
430 IF STRIG(J+2) THEN 570
440 IFINKEY$=""THEN400
450 FOR PY=0 TO 7:FOR PX=0 TO 7
460 CO=POINT(X+PX,Y+PY):C(CO)=C(CO)+1:NEXT PX,PY
470 C(0)=0:MI=0:FOR I=1 TO 15:IF MI<C(I) THEN MI=C(I):SC=I
480 C(I)=0:NEXT I:POKE &HD200,SC
490 FOR PY=0 TO 7:A=0:FOR PX=0 TO 7
500 CO=POINT(X+PX,Y+PY):IF CO=SC THEN PSET (X+PX,Y+PY),0:A=A+S(PX)
510 NEXT PX
520 POKE &HD000+SN*8+PY,A:POKE&HD100+SN*4,(Y-1)AND255:POKE&HD101+SN*4,X
530 POKE &HD102+SN*4,SN:POKE&HD103+SN*4,SC
540 NEXT PY
550 IF STRIG(J) THEN 550
560 SN=SN+1:IF SN<32 GOTO 400
570 '
580 SCREEN 2
590 FOR I=0 TO 6143
600 VPOKE I,PEEK(&HA000+I):VPOKE I+8192,PEEK(&HB800+I)
610 NEXT I
620 FOR I=0 TO 255:VPOKE &H3800+I,PEEK(&HD000+I):NEXTI
630 FOR I=0 TO 127:VPOKE &H1B00+I,PEEK(&HD100+I):NEXTI
640 _TURBO OFF
650 A$=INPUT$(1)
660 BSAVEN$+".SC2",0,&H38FF,S

By ARTRAG

Enlighted (6250)

ARTRAG's picture

27-09-2018, 23:03

I used it in a different way:

I did my picture as PNG.
I converted it to SC5 using jannone's converter (using msx 1 palette!)
I used this tool to get a SC2 file with sprites

A bit rudimental, but for fixing small errors it works
Big smile

By ARTRAG

Enlighted (6250)

ARTRAG's picture

27-09-2018, 23:52

Rafael Jannone could integrate something like that in his converter on line....