Karoshi MSX Community
05 de Julio de 2021, 03:39:29 pm *
Bienvenido(a), Visitante. Por favor, ingresa o regístrate.

Ingresar con nombre de usuario, contraseña y duración de la sesión
Noticias:
 
   Inicio   Ayuda Buscar Ingresar Registrarse  
Páginas: 1 ... 3 4 [5] 6
  Imprimir  
Autor Tema: Evitando la "Regla del 5º Sprite" (antes "Snippets")  (Leído 37528 veces)
0 Usuarios y 1 Visitante están viendo este tema.
Jon_Cortazar
Administrator
Karoshi Forum's God
********
Mensajes: 2777



WWW Email
« Respuesta #60 : 19 de Octubre de 2006, 03:22:34 pm »

Que alguien les pase ese texto a los del BLUEMSX!!!!

Joer, pero si el blueMSX -junto con el openMSX- es uno de los emus que mejor emulan los timings de la VRAM!!  Shocked
En línea

Jon Cortázar Abraido (aka El Viejo Archivero)
RELEVO Videogames
[Dioniso: La cafeína está haciendo su trabajo; yo espero hacer el mío.]
[pitpan: Me sigue pareciendo más productivo jugar al SNAIL MAZE que seguir esta discusión.]
nerlaska
Karoshi Excellent Member
******
Mensajes: 1102


Programador


WWW Email
« Respuesta #61 : 19 de Octubre de 2006, 06:05:35 pm »

Si .. eso ya lo se :-)
Me referia a los TIMINGs chungos de fallos de la VDP .. pero ya me dijo el Van Dik este o como se llame que no habia documentación adecuada al respecto.
En línea

MSX4EVER2GETHER
www.nerlaska.com
SapphiRe
Visitante
« Respuesta #62 : 19 de Octubre de 2006, 06:15:15 pm »

Si .. eso ya lo se :-)
Me referia a los TIMINGs chungos de fallos de la VDP .. pero ya me dijo el Van Dik este o como se llame que no habia documentación adecuada al respecto.
¿Te refieres a Daniel Vik? Huh
En línea
Jon_Cortazar
Administrator
Karoshi Forum's God
********
Mensajes: 2777



WWW Email
« Respuesta #63 : 19 de Octubre de 2006, 09:39:34 pm »

 Cheesy Cheesy
En línea

Jon Cortázar Abraido (aka El Viejo Archivero)
RELEVO Videogames
[Dioniso: La cafeína está haciendo su trabajo; yo espero hacer el mío.]
[pitpan: Me sigue pareciendo más productivo jugar al SNAIL MAZE que seguir esta discusión.]
ARTRAG
Visitante
« Respuesta #64 : 19 de Octubre de 2006, 10:06:50 pm »



Only 4 Sprite units in the VDP....
En línea
Dioniso
Visitante
« Respuesta #65 : 20 de Octubre de 2006, 06:47:14 pm »

WYZ, llegaste a terminar lo del logo MSXDEV que te comenté? Creo que éste es el momento de enseñar algo de eso aquí, no te parece? La teoría de jltursan se acerca mucho al nuevo efecto de los sprites.
En línea
jltursan
Karoshi Forum's Guru
*******
Mensajes: 1516


¿Que es lo que has aprendido hoy?


WWW Email
« Respuesta #66 : 25 de Octubre de 2006, 10:49:48 pm »

Bueno; pues aquí está la versión final de la demo de multiplexado de sprites con la rutina de ARTRAG corregida y hasta 16 sprites para jugar con ellos Smiley 
Ahora ya puedo comentar un poco la cosa, mañana escribiré algo por aquí...
En línea

Doom dee doom dee doom
ARTRAG
Visitante
« Respuesta #67 : 25 de Octubre de 2006, 11:00:25 pm »

what is "dynamic ring buffer"?
En línea
jltursan
Karoshi Forum's Guru
*******
Mensajes: 1516


¿Que es lo que has aprendido hoy?


WWW Email
« Respuesta #68 : 26 de Octubre de 2006, 09:36:05 am »

Some explanations:

  • 0 : No multiplexing at all  Tongue
  • 1 : Plane swapping. ARTRAG's routine posted early in this thread, it basically swaps the two halves of the SAT defined by the 5th sprite plane. Great for few plane conflicts, very good for plattformers for example.
  • 2 : Ring buffer (1). Rotation, taking the SAT as a ring buffer, of sprite planes starting from plane 0. Each time 1 plane is shifted 1 position. Very easy to implement, handy when used with care and over few sprites
  • 3 : Ring buffer (4). Rotation, taking the SAT as a ring buffer, of sprite planes starting from plane 0. Each time 4 planes are shifted 4 positions. The same routine as above; but much better when used over lots of multidirectional sprites.
  • 4 : Dynamic ring buffer. Rotation, taking the SAT as a ring buffer, of sprite planes starting from the nearest 4-multiple plane of the 5th plane. Each time 4 planes are shifted 4 positions. Like the routine 3; but with some little refinements, in some cases could handle better the conflicts. As a limitation, the size of the SAT must be also multiple of 4.

Now, with 16 sprites anyone can experiment the different behaviors of each routine... Smiley

Some more multiplexing algorithms?, anyone?
En línea

Doom dee doom dee doom
ARTRAG
Visitante
« Respuesta #69 : 26 de Octubre de 2006, 03:46:29 pm »

What about introducing two classes of priority among sprites?

This is the idea:
Assume some sprites can disappear while some other need to be displayed, eventually cycling.
This is the case where you use 2 sprites per object.
One is the main color of the body of the object, one is the secondary color for small details.

This is also the case where you use sprites for UFOs and for the stars in the starfield (this latter
must be with lower priority).

the requirements are:

1) if main sprites are on the same line, main sprites  (eventually)  cycle
2) if detail sprites are on the same line detail sprites (eventually) cycle
3) if main sprites and detail sprites are on the same line, details disappear, main sprites (eventually) cycles

Using an advanced version of the technique I proposed you can get this effect...





« Última modificación: 26 de Octubre de 2006, 03:56:42 pm por ARTRAG » En línea
ARTRAG
Visitante
« Respuesta #70 : 27 de Octubre de 2006, 10:30:22 am »

so, none cares obout this subject !?
 Huh Angry
En línea
Jon_Cortazar
Administrator
Karoshi Forum's God
********
Mensajes: 2777



WWW Email
« Respuesta #71 : 27 de Octubre de 2006, 12:17:51 pm »

so, none cares obout this subject !?
 Huh Angry

hey ARTRAG, your last message was posted 9 hours ago... please wait a bit more before getting that angry  Huh
En línea

Jon Cortázar Abraido (aka El Viejo Archivero)
RELEVO Videogames
[Dioniso: La cafeína está haciendo su trabajo; yo espero hacer el mío.]
[pitpan: Me sigue pareciendo más productivo jugar al SNAIL MAZE que seguir esta discusión.]
ARTRAG
Visitante
« Respuesta #72 : 27 de Octubre de 2006, 03:20:53 pm »

kidding
 Wink
« Última modificación: 27 de Octubre de 2006, 04:19:45 pm por ARTRAG » En línea
Jon_Cortazar
Administrator
Karoshi Forum's God
********
Mensajes: 2777



WWW Email
« Respuesta #73 : 28 de Octubre de 2006, 10:20:21 am »

 Cheesy Cheesy Cheesy Cheesy Cheesy

I think it is an iteresting topic too. A good article can be taken out of all this imho.  Wink
En línea

Jon Cortázar Abraido (aka El Viejo Archivero)
RELEVO Videogames
[Dioniso: La cafeína está haciendo su trabajo; yo espero hacer el mío.]
[pitpan: Me sigue pareciendo más productivo jugar al SNAIL MAZE que seguir esta discusión.]
ARTRAG
Visitante
« Respuesta #74 : 28 de Octubre de 2006, 10:42:54 am »

Ok I'll try to sketch my idea about the main + deatail sprite management

Assume that the SAT is in RAM with:
N active positions (planes)
M main sprites
N-M detail sprites


In case of no 5thsprite, you copy directly from ram to vram N sprite positions [0,N-1]-> [0,N-1].

Assume now that there is 5thsprite.
Let S0 be the 5th sprite plane from the VDP.

Assume S0<M (i.e. S0<=M-1)
We want to scramble the main sprites and leave the details where they are.

RAM      VRAM
0      0
      
P      S0
      
M-1      M-1
      
N-1      N-1

S0 in VRAM corresponds to plane P in ram

We copy :

[P,M-1] -> [0,M-1-P]
[0,P-1] -> [M-P,M-1]
[M,N-1] -> [M,N-1]

0             0
      
P      
      
M-1      M-1
      
N-1      N-1

Now, sprite that was in S0 in VRAM, and in P in RAM is at plane 0 ad is displayed for sure.
Now probably some other sprite is hidden
Let S0 be the 5th sprite again.
Assume always S0<M
We want to scramble the main sprites again and leave the details where they are.

Now S0 does not correspond to P but to we have two cases
1)
If  S0<M-P then the new  P’ = P + S0
This is because in the previous step we moved [P,M-1] -> [0,M-1-P]

2)
if M-P<= S0 <M then the new P’ = S0 – (M - P) = P + S0 – M
this is because in the previous step we moved [0,P-1] -> [M-P,M-1]

in both cases now we do
P=P’

And we copy again

[P,M-1] -> [0,M-1-P]
[0,P-1] -> [M-P,M-1]
[M,N-1] -> [M,N-1]

0            0
      
P      
      
M-1      M-1
      
N-1      N-1

Now the main sprites have been scrambled the 5th sprite is again moved on top and we can continue the loop again and again.

----------------------------------------


Assume now that at a certain point we get S0>=M
Now we want to scramble the details leaving the main sprites unaltered.

0      0
      
M-1      M-1
      
P      S0
      
N-1      N-1

Again at first step P = S0

We copy

[0,M-1] -> [0,M-1]
[P,N-1] -> [M,N-P-1]
[M,P-1] -> [N-P+M,N-1]


0      0
      
M          M
      
P      N-P+M
      
N-1      N-1

Now let S0>=M  again

Again S0 and P do not correspond anymore and we have two cases,
1)
if S0<N-P+M then P’ = P + S0-M
This because we moved at previous step [P,N-1] -> [M,N-P-1]

2)
If S0>=N-P+M then P’ = S0 – (N-P+M) +M = S0 –N +P
This because we moved at previous step [M,P-1] -> [N-P+M,N-1]


Now we do
P=P’
And we copy again

[0,M-1] -> [0,M-1]
[P,N-1] -> [M,N-P-1]
[M,P-1] -> [N-P+M,N-1]

in this way details have been scrambled and if S0 stay >= M we can continue with this part of code

Do you see the idea ?

Note that each time we pass from mode “scramble main sprites”  to “scramble details” be need to reset the variable P.

This is a draft code of the idea above

Código:
    di();
   
    v99 = SAT & 255;
    v99 = SAT/256 | 64;

    if  (vdps0 & 64) {
        u_char s = (vdps0 & 31)*4;
                 
        if  (s<M) {
            if (P>=M) {P=0;}
            if  (s<M-P)   {P += s;}
            else
            {P += s-M;}
       
            vcopy(P,M-1);     //  [P,M-1] -> 0
            vcopy(0,P-1);     //  [0,P-1] -> M-P 
            vcopy(M,N-1);     //  [M,N-1] -> M
            }
        else {
            if (P<M) {P=0;}
            if  (s<M+N-P) {P += s-M;}
            else
            {P += s-N;}
           
       
            Q+=4;
            if (Q>=M) {
                Q=0;
                vcopy(0,M-1);     //  [0,M-1] -> 0
            }
            else
            {
                vcopy(Q,M-1);     //  [Q,M-1] -> 0
                vcopy(0,Q-1);     //  [0,Q-1] -> M-Q           
            }
           
            vcopy(P,N-1);     //  [P,N-1] -> M
            vcopy(M,P-1);     //  [M,P-1] -> M+N-P
            }
        }
    else
    {
        P = 0;
        otir(p_sprt,N);
    }
    v98 = 208;   
    ei();
}

« Última modificación: 28 de Octubre de 2006, 10:46:47 am por ARTRAG » En línea
Páginas: 1 ... 3 4 [5] 6
  Imprimir  
 
Ir a:  

Impulsado por MySQL Impulsado por PHP Powered by SMF 1.1.21 | SMF © 2013, Simple Machines XHTML 1.0 válido! CSS válido!