Ok, sorry for the inconvenience. And I detected the fault. Upon update the sprite, the FOR performed it four times instead of one. Why did that bug.dougeff wrote:Without the source code, I won't be able to figure it out. Clearly, 2 incorrect spites are appearing.
Have the linker make a label file. Find the address of the label that handles sprites. Set a breakpoint in the FCEUX for execution at that address (at the same time it happens). Step through the code, and see what numbers are being loaded to the Sprite area of RAM.
Or, review that RAM in the hex editor tool, and see the exact address of the strange sprite. Set a breakpoint for writes to that RAM area, and try to figure out where those numbers are coming from.
Learning to debug is an important lesson. I spend at least 25% of my time fixing bugs.
Thank you for your explanations. There are things that I find hard to understand, but I try to move on. I look much your example to find solutions, and as you see, for now it seems that everything works fine.
What do you like my alpha 0.08? This afternoon add weapon selection on the menu.
And a technical question is it better to have a single function with many instructions or have multiple functions with separate instructions? For example, in the function movi_logic() I store the movement of all: player, enemies menu arrow, weapons, etc ... would it be better to give a movement function separately to each thing? Does it affect the performance?
UPDATE: I have already managed to make a functional menu, and then select to catch and weapon.
https://dl.dropboxusercontent.com/u/319 ... 00.09c.nes
Spanish:
Ok, perdona por la molestia. Ya detecté el fallo. Al hacer el update del sprite, el FOR lo realizaba cuatro veces en vez de una. Por eso daba ese error.
Gracias por tus explicaciones. Hay cosas que me resultan difíciles de entender, pero me esfuerzo por seguir adelante. Miro mucho tus ejemplo para buscar soluciones, y como ves, por ahora parece que todo funciona bien.
¿Que te a parecido mi alpha 0.08? Esta tarde añadiré la selección de armas en el menú.
Y una pregunta técnica ¿es mejor tener una sola función con muchas instrucciones o tener varias funciones con instrucciones separadas? Por ejemplo, en la función movi_logic almaceno el movimiento de TODO: player, enemigos, flecha del menu, armas, etc... ¿seria mejor dar una funcion de movimiento separada a cada cosa? ¿afecta al rendimiento?
UPDATE: Ya he conseguido hacer un menú funcional, y poder coger y luego seleccionar arma.