[Homebrew] [VDP1] - Controlando Sprites.


Ir a la página Anterior  1, 2

Objetivo: Re: [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. :wink:

Perfil MP  
Objetivo: Re: [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

Perfil MP  
Objetivo: Re: [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. :wink: .

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

Perfil MP  
Objetivo: Re: [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 :oops:

Perfil MP  
Objetivo: Re: [Homebrew] [VDP1] - Controlando Sprites.
Hola a todos !
Soy nuevo aquí. Por favor, perdona mi español. :oops:

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 ? :putoamo:

Gracias !

Perfil MP  
Objetivo: Re: [Homebrew] [VDP1] - Controlando Sprites.
Hi, yes.

You need to put this.



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

Perfil MP  
Objetivo: Re: [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 :


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 ?

Perfil MP  
Objetivo: Re: [Homebrew] [VDP1] - Controlando Sprites.
Hi,
Send me a PM with all source code.

Sorry for the delay.

Perfil MP  
Objetivo: Re: [Homebrew] [VDP1] - Controlando Sprites.
PM sent. :)

Perfil MP  
Ir a la página Anterior  1, 2

Página 2 de 2


  
No puede crear mensajes
No puede responder temas
No puede editar sus mensajes
No puede borrar sus mensajes
No puede votar en encuestas
No puede adjuntar archivos
No puede descargar archivos
Puede publicar eventos en el calendario

   

Está utilizando la versión (Lo-Fi). Para ver la versión completa del foro, haga clic aquí.

Powered by Icy Phoenix based on phpBB
Design by DiDiDaDo

Página generada en:: 0.1464s (PHP: 16% SQL: 84%)
Consultas SQL: 14 - Debug off - GZIP Desactivado