[Homebrew] [VDP1] - Controlando Sprites. »  Mostrar los mensajes de    a     

SEGASaturno - Saturn, SEGA y Videojuegos


Desarrollo - [Homebrew] [VDP1] - Controlando Sprites.



FacundoARG [ 11 Agosto 2009, 04:28 PM ]
Título del mensajeRe: [VDP1] - Controlando Sprites.
Felicitaciones, te quedo muy bueno. Pero nos falta el control del framerate, me imagino que va muy rápido el muñeco.

Si tenes que hacer una tabla de atributos invertida, fijate la tabla SonicX_flip lo unico que tiene distinto es el ultimo parametro, sprHflip (sprite Horizontal flip). Y cuando llames a la función, usas la tabla invertida slDispSprite (pos, tablainvertida, angulo).

SPR_ATTR attr_SonicX[] = {
SPR_ATTRIBUTE(0,No_Palet,No_Gouraud,CL32KRGB|SPenb|ECdis,sprNoflip),
............
SPR_ATTRIBUTE(10,No_Palet,No_Gouraud,CL32KRGB|SPenb|ECdis,sprNoflip),
};

SPR_ATTR attr_SonicX_flip[] = {
SPR_ATTRIBUTE(0,No_Palet,No_Gouraud,CL32KRGB|SPenb|ECdis,sprHflip),
.............
SPR_ATTRIBUTE(10,No_Palet,No_Gouraud,CL32KRGB|SPenb|ECdis,sprHflip),
};

Estoy preparando la lista de funciones y paramatros, pero me parece que primero te subo lo del background.


Jean La Montarde [ 11 Agosto 2009, 04:42 PM ]
Título del mensajeRe: [VDP1] - Controlando Sprites.
Eso si lo cogi el problema es que si hago una nueva llamada al sldispsprite con la libreria cambiadase pinta encima sin borrar el anterior y queda muy feo. Yo queria algo asi

sldispsprite(pos,variabledetabla+spriteID,ang) e ir alternando la variabledetabla en funcion de la necesidad, pero creo que no es posible


FacundoARG [ 11 Agosto 2009, 05:25 PM ]
Título del mensajeRe: [VDP1] - Controlando Sprites.
Claro, eso tenes que hacer.
Por ejemplo lo que hacen los juegos en 2d, es dejar la tabla que tiene por defecto, pero si apretas el keypad izquierdo, se cambia la tabla y listo. .

Solo tenes que usar, un slDispSprite por personaje. Ademas de limpiar la pantalla todos los frames, cosa que Saturn lo hace solo.


Jean La Montarde [ 11 Agosto 2009, 05:32 PM ]
Título del mensajeRe: [VDP1] - Controlando Sprites.
me da error ... creo que declaro la variable mal, es que no se nada de C todo esto es mirando ejemplos y tutos .. , echame una mano Facundo


television2000 [ 09 Noviembre 2011, 01:57 PM ]
Título del mensajeRe: [Homebrew] [VDP1] - Controlando Sprites.
Hola a todos !
Soy nuevo aquí. Por favor, perdona mi español.

FacundoARG, have you found any way to reduce the Sprite frameskip ?
Sorry to revive such an old thread.

I'm also facing a few troubles with the SMPC input for sprite movement/flipping but I think it's a logical coding error from my side.
Before I discuss this I would like to fix the Frameskip if possible. Any idea/advice on how ?

Gracias !


FacundoARG [ 14 Noviembre 2011, 03:45 AM ]
Título del mensajeRe: [Homebrew] [VDP1] - Controlando Sprites.
Hi, yes.

You need to put this.


Código: [Ocultar] [Seleccionar]

#define TVSTAT (*(Uint16 *)0x25F80004)

void wait_vblank(void)
{
while((TVSTAT & 8) == 0);
while((TVSTAT & 8) == 8);
}

while(-1){

game();
wait_vblank();
slSynch();
}




For me this code works, but you can search in segaxtreme forums for more information.
I did a question in forums for the frameskip too.

Saludos.


television2000 [ 16 Noviembre 2011, 07:25 AM ]
Título del mensajeRe: [Homebrew] [VDP1] - Controlando Sprites.
Thanks for the reply.

The code compiles fine but actually doesn't seem to do anything strangely.
However reading SGL document from Sega, you can set the framerate with this command :
slInitSystem(TV_352x224, tex_SON , 1);
The higher the number the slower the framerate will be and you can process more commands/code.

That's one thing though. If I could ask you for one more thing,
I can't seem to get the idle sprite (Left or Right) to display with this command :

Código: [Ocultar] [Seleccionar]

if( (Smpc_Peripheral[index].data & PER_DGT_KR) == 0)
{ pos[X] = pos[X] + toFIXED( 1.0);
pos_river[X] = pos[X];
slDispSprite(pos_river, attr_SON + sprite_walk_ID, ang_river);
slPrint ("Right Walk Sprite -- ON", slLocate (0,4));
}

else if( (Smpc_Peripheral[index].data & PER_DGT_KL) == 0)
{ pos[X] = pos[X] - toFIXED( 1.0);
pos_river[X] = pos[X];
slDispSprite(pos_river, attr_SONH + sprite_walk_ID, ang_river);
slPrint ("Left Walk Sprite -- ON", slLocate (0,4));
}

else if ((Smpc_Peripheral[index].pull & PER_DGT_KL) == 0)
{ slDispSprite(pos_river, attr_SONH + sprite_idle_ID, ang_river);
slPrint ("Idle Left Sprite -- ON", slLocate (0,4));
}

else if( ((Smpc_Peripheral[index].data & PER_DGT_KR) == 1) || ((Smpc_Peripheral[index].pull & PER_DGT_KR) == 0))
{ slDispSprite(pos_river, attr_SON + sprite_idle_ID, ang_river);
slPrint ("Idle Right Sprite -- ON", slLocate (0,4));
}


Can you please tell me what causes this ?


FacundoARG [ 24 Noviembre 2011, 04:11 AM ]
Título del mensajeRe: [Homebrew] [VDP1] - Controlando Sprites.
Hi,
Send me a PM with all source code.

Sorry for the delay.


television2000 [ 25 Noviembre 2011, 06:16 AM ]
Título del mensajeRe: [Homebrew] [VDP1] - Controlando Sprites.
PM sent.




Powered by Icy Phoenix