problem groups sprites with BASIC

Por DanySoft

Champion (439)

imagem de DanySoft

01-04-2013, 14:17

I have a problem on BASIC, to be done in groups sprites !
I already have a binary program with Wbass2, which displays all the sprites in groups such as

0,1,2 group = 1
3,4,5 Group 2
etc. ...

The problem lies in the construction of the BASIC listing can work out and thereby unite the sprites.
There are three different designs that can be combined in order to operate the group.
- NestorBASIC: with the functions 2 and 6 for writing and reading for the insertion of the sprite is not very easy and complicated.
- NPR: with this for the insertion of ASCII text, precisely in order to use NestorBASIC but the result is unclear and very difficult
- BASIC: I already tried everything without NestorBASIC or NPR but the calculation with INKEY $, VPEEK and VPOKE becomes increasingly diffcile build a BASIC listing to create and build groups of sprites

But which of the three is the best solution? I have to take in assembleer?? I've already thought to use to create and costruziore sprites, but it seems complex ...
Someone I've already made? Let me see, thank you!

Entrar ou registrar-se para comentar

Por DanySoft

Champion (439)

imagem de DanySoft

01-04-2013, 14:29

But I'm afraid that I can not use the BASIC to prepare groups of sprites .... Sad Sad


Por Edwin

Paragon (1182)

imagem de Edwin

01-04-2013, 22:00

After reading I still don't understand what you are trying to accomplish.

Por DanySoft

Champion (439)

imagem de DanySoft

02-04-2013, 11:21

I am grateful, Big smile
I'll explain:
Total 2 groups:
Group 1/2, 2 sprites:
  sprite x, y, s, c
  sprite x, y, s, c
group 2/2, 4 sprites:
  sprite x, y, s, c
  sprite x, y, s, c
  sprite x, y, s, c
  sprite x, y, s, c

I tried to program in BASIC, unsuccessfully construction groups sprite (2 sprites are two colors!)
in MSX2, with 15 colors of one sprite will be added in the near future project!

Meanwhile, I have already solved the problem: I used the CALL!
I'm Make source and execute the CALL (go BLOAD"",R) !

- DDADR(, )
- DDSET (,,,)
- DDADR(, )
CALL DDADR(2048, 128 ) have max 128 group of sprites on start addres vram: 2048
CALL DDSET (0,0,0,0) ADD 4 bytes : X,Y,Sprite, Colour (note: X,Y are OFFSET +10, +00) 
CALL DDGRP Close the group, add address VRAM to next group.

Everything okay?
Sorry for the mistakes of English grammarians.
I'm a lousy translator of English.

Bye bye Big smile

Por PingPong

Prophet (3662)

imagem de PingPong

02-04-2013, 19:33

Edwin wrote:

After reading I still don't understand what you are trying to accomplish.

you are not alone....

Por enribar

Paragon (1109)

imagem de enribar

02-04-2013, 20:08

ciao Dany, spiegalo prima in italiano, perche pure io non capisco lo scopo del raggruppamento sprite...

Por DanySoft

Champion (439)

imagem de DanySoft

02-04-2013, 20:46

Ciao, Enribar, ma non possiamo qua a scrivere in italiano anche se tieni così:
Per prima cosa : il gruppo di sprite era il numero dei colori di ogni sprite.

gruppo sprite n. 1
colore giallo
colore bianco
colore nero
gruppo sprite n. 2
colore verde
colore grigio
gruppo sprite n. 3

Ogni sprite si colora, e dà il numero degli sprite da 0 a 63, appunto, resta la posizione dello sprite che si vuole
posizionare nel X,Y.
Per esempio :

put sprite 0,(x,y),10,0
put sprite 1,(x+16,y),15,1

simile a :
0,0, 0, 10  ; X,Y, numero sprite 0-63, colore da 1 a 15
16,0, 1, 15 secondo sprite

Infatti il "secondo sprite" era la posizione X + 16
dopo aver fatto i 8 byte di 2 sprite
vanno aggiunti all'indirizzo #1B00 oppure sul Put sprite
vpoke #1B00+0, Y+ vpeek(2048 + L * 4 + 1)
vpoke #1B00+1, X + vpeek(2048 + L * 4 + 0)
vpoke #1b00+2, vpeek(2048 + L * 4 +2) *4 ;sprite x 4
vpoke #1B00+3, vpeek(2048 + L * 4 + 3) ; colore

Un solo consiglio :
se si sposta fuori dallo schermo (oltre X>255 o Y>255 o X<0 o Y<0 ) BASIC può generare errore su
questo vpoke, perciò
aggiungere questo :
vpoke #1B00+0, int ( Y+ vpeek(2048 + L * 4 + 1) and 255 )
vpoke #1B00+1, int ( X + vpeek(2048 + L * 4 + 0) and 255)

d'ora in poi non genera più errori.
Io intanto continuo a progettare sui CALL per aggiungere più gruppi.
A dopo

Por DanySoft

Champion (439)

imagem de DanySoft

28-04-2013, 19:09

Hello !!!
The source of ASM for group of sprite : group.bin : OK !!

CALL DDCLR ( 0 or 1 )

10 SCREEN 1,2:WIDTH 32 : COLOR 15,1,1
30 _DDCLR ( 0 )
40 _DDPUT (100,100,0 )
50 _DDPUT(150,100,4 )
70 END 

Two sprite (one with two colors, two with three colors ) : Work !!!
Bye bye
DanySoft Cool