Screen1 with Multicolor Sprite and 8 x line?

Página 1/4
| 2 | 3 | 4

Por KdL

Paragon (1450)

imagem de KdL

11-06-2007, 19:47

Question for programmers:
Is it possible to use a Multicolor Sprite in Screen 1 with v9938? ..and 8 sprites x line? QuestionQuestionQuestion

Best Regards @all

Entrar ou registrar-se para comentar

Por dvik

Prophet (2200)

imagem de dvik

11-06-2007, 19:57

afaik you can't use multicolor sprites in screen 0-3. With some clever masking on the color and tile base addresses you can use screen 4 with 256 characters and 64 colors. but the color table and tile table are locked to 2000h and 0000h. So not as flexible as screen 1.

Por PingPong

Prophet (4093)

imagem de PingPong

11-06-2007, 20:03

Also I think there is no way.

Por ARTRAG

Enlighted (6923)

imagem de ARTRAG

11-06-2007, 20:23

afaik you can't use multicolor sprites in screen 0-3. With some clever masking on the color and tile base addresses you can use screen 4 with 256 characters and 64 colors. but the color table and tile table are locked to 2000h and 0000h. So not as flexible as screen 1.

64 colors ?! How can you achieve such a miracle ?
Question

Por dvik

Prophet (2200)

imagem de dvik

11-06-2007, 20:36

Sorry, I ment a 64 byte color table. Of course with the same color limitations as regular screen 2.

Por SLotman

Paragon (1242)

imagem de SLotman

12-06-2007, 07:01

This program below could put 8 sprites per line + multicolored sprites on screen1, but I havent tested it on real MSX machines yet... on emulators it seems to work Wink

10 DIM A(20)
20 SCREEN 4,2
30 A(0)=VDP(0)
40 A(1)=VDP(1)
50 A(4)=VDP(4)
60 A(3)=VDP(3)
70 A(5)=VDP(5)
80 A(6)=VDP(6)
90 A(12)=VDP(12)
100 FOR N=0 TO 31
110 PUT SPRITE N,(N*32,128),15,0
120 NEXT
130 SCREEN 1,2
140 VDP(0)=A(0)
150 VDP(1)=A(1)
160 VDP(4)=A(4)
170 VDP(3)=A(3)
180 VDP(5)=A(5)
190 VDP(6)=A(6)
200 VDP(12)=A(12)
210 FOR N=8192 TO 8192+768*8-1
220 VPOKE N,RND(1)*2+2
230 NEXT
240 FOR N=0 TO 256*8-1
250 VPOKE N+256*8,VPEEK(N)
260 VPOKE N+512*8,VPEEK(N)
270 NEXT
280 SPRITE$(0)=STRING$(32,255)
290 FOR N=0 TO 7
300 PUT SPRITE N,(N*32,128),15,0
310 NEXT

Por KdL

Paragon (1450)

imagem de KdL

12-06-2007, 13:33

Very nice!! Smile

but "PUT SPRITE" is out of service at the end of this routine... Hannibal

10 SCREEN 1: KEY OFF: COLOR 15,1,1: WIDTH32
20 LOCATE 0,0: PRINT "DO YOU HAVE TURBO BASIC (S/N)?"
30 A$=INKEY$: IF A$="S" OR A$="s" THEN 50
40 IF A$="N" OR A$="n" THEN 70 ELSE 20
50 CALL TURBO ON
60 ' *** MAIN *** REMAKED by KdL 2007 ***
70 DIM A(20)
80 SCREEN 4,2
90 A(0)=VDP(0)
100 A(1)=VDP(1)
110 A(4)=VDP(4)
120 A(3)=VDP(3)
130 A(5)=VDP(5)
140 A(6)=VDP(6)
150 A(12)=VDP(12)
160 FOR N=0 TO 7
170 C$=""
180 FOR L=0 TO 15
190 C=C+1
200 IF C<>5 THEN C=4
210 C$=C$+CHR$(C)
220 NEXT L
230 C=C-1 :' *** COLORS SWAP ***
240 COLOR SPRITE$(N)=C$
250 PUT SPRITE N,(N*32,88)
260 NEXT N
270 SCREEN 1
280 VDP(0)=A(0)
290 VDP(1)=A(1)
300 VDP(4)=A(4)
310 VDP(3)=A(3)
320 VDP(5)=A(5)
330 VDP(6)=A(6)
340 VDP(12)=A(12)
350 ' *** WARNING! PUT SPRITE IS OUT OF SERVICE FROM HERE ***
360 FOR N=8192 TO 8192+768*8-1
370 VPOKE N,RND(1)*2+2
380 NEXT N
390 FOR N=0 TO 256*8-1
400 VPOKE N+256*8,VPEEK(N)
410 VPOKE N+512*8,VPEEK(N)
420 NEXT N
430 RESTORE 550
440 FOR N=0 TO 7
450 B$=""
460 FOR X=0 TO 31
470 READ A$
480 A=VAL("&H"+A$)
490 B$=B$+CHR$(A)
500 NEXT X
510 SPRITE$(N)=B$
520 PUT SPRITE N,(N*32,0): ' *** THIS IS OUT OF SERVICE ***
530 NEXT N
540 END
550 DATA 3C,42,99,A1,A1,99,42,3C,38,6C,C6,C6,FE,C6,C6,00
560 DATA FC,C6,C6,FC,C6,C6,FC,00,3C,66,C0,C0,C0,66,3C,00
570 DATA F8,CC,C6,C6,C6,CC,F8,00,FE,C0,C0,F8,C0,C0,FE,00
580 DATA FE,C0,C0,F8,C0,C0,C0,00,3E,60,C0,CE,C6,66,3E,00
590 DATA C6,C6,C6,FE,C6,C6,C6,00,7E,18,18,18,18,18,7E,00
600 DATA 06,06,06,06,06,C6,7C,00,C6,CC,D8,F0,F8,DC,CE,00
610 DATA C0,C0,C0,C0,C0,C0,FE,00,C6,EE,FE,FE,D6,C6,C6,00
620 DATA C6,E6,F6,FE,DE,CE,C6,00,7C,C6,C6,C6,C6,C6,7C,00
630 DATA FC,C6,C6,C6,FC,C0,C0,00,7C,C6,C6,C6,DE,CC,76,00
640 DATA FC,C6,C6,CE,F8,DC,CE,00,78,CC,C0,7C,06,C6,7C,00
650 DATA 7E,18,18,18,18,18,18,00,C6,C6,C6,C6,C6,C6,7C,00
660 DATA C6,C6,C6,EE,7C,38,10,00,C6,C6,D6,FE,FE,6C,44,00
670 DATA C6,EE,7C,38,7C,EE,C6,00,66,66,66,3C,18,18,18,00
680 DATA FE,0E,1C,38,70,E0,FE,00,F8,C0,C0,C0,C0,C0,F8,00
690 DATA 00,80,40,20,10,08,00,00,F8,18,18,18,18,18,F8,00
700 DATA 00,00,20,50,88,00,00,00,00,00,00,00,00,00,00,F8

Por PingPong

Prophet (4093)

imagem de PingPong

12-06-2007, 13:40

SlotMan, if you are setting an invalid mode, probably this appear to work on emu, because for example, bluemsx does nothing when you set an illegal msx2 mode, the screen mode remain the latest used.

Por SLotman

Paragon (1242)

imagem de SLotman

12-06-2007, 14:43

this mode is not invalid!!!!!

Just tried it on my tR, and guess what? I have 8 sprites on screen 1!

Now I'll have to hack a certain scr1 game to see if it works in this "new screen mode"... if it works, no more sprite flickering Wink

Ps. can anyone test the code on MSX2 and 2+ machines? you never know if it will behave the same...

Por dioniso

Champion (479)

imagem de dioniso

12-06-2007, 15:15

This program below could put 8 sprites per line + multicolored sprites on screen1, but I havent tested it on real MSX machines yet... on emulators it seems to work Wink

Long ago (20th, Nov, 2006) I received the same program from Andrea Gasparrini. Who wrote the original program? Just feel curious.

Por ARTRAG

Enlighted (6923)

imagem de ARTRAG

12-06-2007, 16:25

I did, but note that this isn't a new mode.

You only set screen 4 while the msx basic is thinking to be in screen1,
this is the reason why put sprite fails: it does not update the color
attributes in screen 4

PS
KDL modified, my code. Now I modified KDL's:
in this way initialization is twice faster Wink
Try!

10 SCREEN 1: KEY OFF: COLOR 15,1,1: WIDTH32
20 LOCATE 0,0: PRINT "DO YOU HAVE TURBO BASIC (S/N)?"
30 A$=INKEY$: IF A$="S" OR A$="s" THEN 50
40 IF A$="N" OR A$="n" THEN 70 ELSE 20
50 CALL TURBO ON
60 ' *** MAIN *** REMAKED by KdL 2007 ***
70 DIM A(20)
80 SCREEN 4,2
90 A(0)=VDP(0)
100 A(1)=VDP(1)
110 A(4)=VDP(4)
120 A(3)=VDP(3)
130 A(5)=VDP(5)
140 A(6)=VDP(6)
150 A(12)=VDP(12)
160 FOR N=0 TO 7
170 C$=""
180 FOR L=0 TO 15
190 C=C+1
200 IF C<>5 THEN C=4
210 C$=C$+CHR$(C)
220 NEXT L
230 C=C-1 :' *** COLORS SWAP ***
240 COLOR SPRITE$(N)=C$
250 PUT SPRITE N,(N*32,88)
260 NEXT N
270 SCREEN 0:screen 1
280 VDP(0)=A(0)
290 VDP(1)=A(1)
300 VDP(4)=A(4)
310 VDP(3)=A(3)
320 VDP(5)=A(5)
330 VDP(6)=A(6)
340 VDP(12)=A(12)
350 ' *** WARNING! PUT SPRITE IS OUT OF SERVICE FROM HERE ***
360 FOR N=8192 TO 8192+768*8-1
370 VPOKE N,RND(1)*2+2
380 NEXT 
390 FOR N=0 TO 256*8-1
410 VPOKE N+512*8,VPEEK(N)
420 NEXT 
430 RESTORE 550
440 FOR N=0 TO 7
450 B$=""
460 FOR X=0 TO 31
470 READ A$
480 A=VAL("&H"+A$)
490 B$=B$+CHR$(A)
500 NEXT X
510 SPRITE$(N)=B$
520 PUT SPRITE N,(N*32,0): ' *** THIS IS OUT OF SERVICE ***
530 NEXT N
540 END
550 DATA 3C,42,99,A1,A1,99,42,3C,38,6C,C6,C6,FE,C6,C6,00
560 DATA FC,C6,C6,FC,C6,C6,FC,00,3C,66,C0,C0,C0,66,3C,00
570 DATA F8,CC,C6,C6,C6,CC,F8,00,FE,C0,C0,F8,C0,C0,FE,00
580 DATA FE,C0,C0,F8,C0,C0,C0,00,3E,60,C0,CE,C6,66,3E,00
590 DATA C6,C6,C6,FE,C6,C6,C6,00,7E,18,18,18,18,18,7E,00
600 DATA 06,06,06,06,06,C6,7C,00,C6,CC,D8,F0,F8,DC,CE,00
610 DATA C0,C0,C0,C0,C0,C0,FE,00,C6,EE,FE,FE,D6,C6,C6,00
620 DATA C6,E6,F6,FE,DE,CE,C6,00,7C,C6,C6,C6,C6,C6,7C,00
630 DATA FC,C6,C6,C6,FC,C0,C0,00,7C,C6,C6,C6,DE,CC,76,00
640 DATA FC,C6,C6,CE,F8,DC,CE,00,78,CC,C0,7C,06,C6,7C,00
650 DATA 7E,18,18,18,18,18,18,00,C6,C6,C6,C6,C6,C6,7C,00
660 DATA C6,C6,C6,EE,7C,38,10,00,C6,C6,D6,FE,FE,6C,44,00
670 DATA C6,EE,7C,38,7C,EE,C6,00,66,66,66,3C,18,18,18,00
680 DATA FE,0E,1C,38,70,E0,FE,00,F8,C0,C0,C0,C0,C0,F8,00
690 DATA 00,80,40,20,10,08,00,00,F8,18,18,18,18,18,F8,00
700 DATA 00,00,20,50,88,00,00,00,00,00,00,00,00,00,00,F8
Página 1/4
| 2 | 3 | 4