Página 2 de 2
Ir a la página Anterior  1, 2
 

Mensaje Re: [VDP1] - Controlando Sprites.

#11  FacundoARG 11 Agosto 2009, 04:28 PM

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.  
 




____________
SegaSaturn Developer Addict
 
avatar
argentina.png FacundoARG Sexo: Masculino
Colaborador SEGASATURNO
Colaborador SEGASATURNO
Professional Videogamer Coder
Donante Unreleased €
 
Registrado: Diciembre 2006
Ubicación: San Luis
Mensajes: 691
  • Volver arriba Página inferior
 

Mensaje Re: [VDP1] - Controlando Sprites.

#12  Jean La Montarde 11 Agosto 2009, 04:42 PM

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
 



 
avatar
spain.png Jean La Montarde Sexo: Masculino
SEGA Fan
SEGA Fan
 
Registrado: Julio 2009
Mensajes: 181
  • Volver arriba Página inferior
 

Mensaje Re: [VDP1] - Controlando Sprites.

#13  FacundoARG 11 Agosto 2009, 05:25 PM

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.
 




____________
SegaSaturn Developer Addict
 
avatar
argentina.png FacundoARG Sexo: Masculino
Colaborador SEGASATURNO
Colaborador SEGASATURNO
Professional Videogamer Coder
Donante Unreleased €
 
Registrado: Diciembre 2006
Ubicación: San Luis
Mensajes: 691
  • Volver arriba Página inferior
 

Mensaje Re: [VDP1] - Controlando Sprites.

#14  Jean La Montarde 11 Agosto 2009, 05:32 PM

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  
 



 
avatar
spain.png Jean La Montarde Sexo: Masculino
SEGA Fan
SEGA Fan
 
Registrado: Julio 2009
Mensajes: 181
  • Volver arriba Página inferior
 

Mensaje Re: [Homebrew] [VDP1] - Controlando Sprites.

#15  television2000 09 Noviembre 2011, 01:57 PM

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 !
 



 
avatar
 television2000 Sexo: Masculino
Recien llegado
Recien llegado
 
Registrado: Marzo 2011
Mensajes: 3
  • Volver arriba Página inferior
 

Mensaje Re: [Homebrew] [VDP1] - Controlando Sprites.

#16  FacundoARG 14 Noviembre 2011, 03:45 AM

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.
 




____________
SegaSaturn Developer Addict
 
avatar
argentina.png FacundoARG Sexo: Masculino
Colaborador SEGASATURNO
Colaborador SEGASATURNO
Professional Videogamer Coder
Donante Unreleased €
 
Registrado: Diciembre 2006
Ubicación: San Luis
Mensajes: 691
  • Volver arriba Página inferior
 

Mensaje Re: [Homebrew] [VDP1] - Controlando Sprites.

#17  television2000 16 Noviembre 2011, 07:25 AM

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 ?
 



 
avatar
 television2000 Sexo: Masculino
Recien llegado
Recien llegado
 
Registrado: Marzo 2011
Mensajes: 3
  • Volver arriba Página inferior
 

Mensaje Re: [Homebrew] [VDP1] - Controlando Sprites.

#18  FacundoARG 24 Noviembre 2011, 04:11 AM

Hi,
Send me a PM with all source code.

Sorry for the delay.
 




____________
SegaSaturn Developer Addict
 
avatar
argentina.png FacundoARG Sexo: Masculino
Colaborador SEGASATURNO
Colaborador SEGASATURNO
Professional Videogamer Coder
Donante Unreleased €
 
Registrado: Diciembre 2006
Ubicación: San Luis
Mensajes: 691
  • Volver arriba Página inferior
 

Mensaje Re: [Homebrew] [VDP1] - Controlando Sprites.

#19  television2000 25 Noviembre 2011, 06:16 AM

PM sent.
 



 
avatar
 television2000 Sexo: Masculino
Recien llegado
Recien llegado
 
Registrado: Marzo 2011
Mensajes: 3
  • Volver arriba Página inferior
 


Ocultar¿Este tema fue útil?
Compartir este tema
Correo a un amigo Facebook Twitter Windows Live Favorites MySpace del.icio.us Digg SlashDot google.com LinkedIn StumbleUpon Blogmarks Diigo reddit.com Blinklist co.mments.com
technorati.com DIGG ITA linkagogo.com meneame.net netscape.com newsvine.com yahoo.com Fai Informazione Ok Notizie Segnalo Bookmark IT fark.com feedmelinks.com spurl.net

Página 2 de 2
Ir a la página Anterior  1, 2