A fix for Wrong Srpites being drawn.......

tbizzle

Well-known member
I had the weirdest Sprite glitch in my game where my HUD, Player, and Monster sprites would do a cycle through an animated tileset I had for that screen. It would happen like every 70 or so times upon entering a new screen. Here is some video of it below:

If this ever happens to you, here is it what I did to fix it.......
Right before the drawSprite macro around line 300 in the doDrawSprites script, I added this:
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Tbone added code
            LDA updateScreenData
            AND #%00000100
            BEQ +isUpdated
            JSR doWaitFrame
                +isUpdated:
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   
            DrawSprite tempA, tempB, tempC, tempD

Hope this helps someone.
 

JayJayHux

Active member
I
I had the weirdest Sprite glitch in my game where my HUD, Player, and Monster sprites would do a cycle through an animated tileset I had for that screen. It would happen like every 70 or so times upon entering a new screen. Here is some video of it below:

If this ever happens to you, here is it what I did to fix it.......
Right before the drawSprite macro around line 300 in the doDrawSprites script, I added this:
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Tbone added code
            LDA updateScreenData
            AND #%00000100
            BEQ +isUpdated
            JSR doWaitFrame
                +isUpdated:
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  
            DrawSprite tempA, tempB, tempC, tempD

Hope this helps someone.
I wonder if this will help with my issue of sprites from my game object sprite sheets sometimes being replaced with my monster sprite sheet?
 

tbizzle

Well-known member
@JayJayHux I meant to follow up on this but forgot to. The above code actually didn't solve the issue. It actually just changed when and where it happened. Sorry!!!
 

JayJayHux

Active member
@JayJayHux I meant to follow up on this but forgot to. The above code actually didn't solve the issue. It actually just changed when and where it happened. Sorry!!!
No worries, tbizzle. Im sure if I bug enough of you guys ill find the answer haha. My sprite and tile glitches are gone now, just the wrong sprite sheet issue remains.
 

tbizzle

Well-known member
No worries, tbizzle. Im sure if I bug enough of you guys ill find the answer haha. My sprite and tile glitches are gone now, just the wrong sprite sheet issue remains.
Post a video of it in action, I'd like to see if it is similar to what is going with mine.
 

JayJayHux

Active member
Post a video of it in action, I'd like to see if it is similar to what is going with mine.
This is the weirdest thing...
I had never seen the glitch you experienced before until just now in the link below.
My issue has been when the screen loads sometimes it will just load my 1st monster sprite sheet instead of my game object sprite sheet.
So my player and HUD maybe every 20th screen load will just be wrong until I change to a new screen again.
But after 30 minutes of trying to trigger my issue I instead found the same issue as you for the first time.
The one big difference I can think of why this happened is that I normally test within NESmaker but for this video I was testing in my seperate version of MESEN that I play other NES games on???
Animated Tile Glitch
 

JayJayHux

Active member
Also Im thinking the cause of these animated tiles glitching for me is likely because im jumping back and forth between an animated screen and a non animated screen. ScreenByte0 is set to 1(animated) in the right screen(waterfall) and set to 0(not animated) in the left screen(where the glitch is happening).
 

tbizzle

Well-known member
I get that glitch also. I think it may have something to do with animated tiles. And yeah, any outdated version of Mesen will gie you different bugs than the most up to date version.
 

JayJayHux

Active member
I get that glitch also. I think it may have something to do with animated tiles. And yeah, any outdated version of Mesen will gie you different bugs than the most up to date version.
Ok no worries, I wasnt aware of that. At least I know now I have 2 issues to deal with but they maybe only appear on different emulators.
 

tbizzle

Well-known member
Ok no worries, I wasnt aware of that. At least I know now I have 2 issues to deal with but they maybe only appear on different emulators.
Never trust the old versions, or different emulators when it comes to the buggery. The thing that you can trust the most is original hardware.
 

JayJayHux

Active member
Never trust the old versions, or different emulators when it comes to the buggery. The thing that you can trust the most is original hardware.
Thats good advice, thanks. I will eventually test my game on the NES once I get abit further in.
But I do really want to have no bugs for emulators too since alot of people play on emulators including me.
I own an NES and am keen play my game on it but yer ideally id like it smooth on both.
 

tbizzle

Well-known member
Thats good advice, thanks. I will eventually test my game on the NES once I get abit further in.
But I do really want to have no bugs for emulators too since alot of people play on emulators including me.
I own an NES and am keen play my game on it but yer ideally id like it smooth on both.
That may be an impossible feat. Clone systems and different emulators, they'll all have their own issues with bugs. There are so many of each too.
 

JayJayHux

Active member
That may be an impossible feat. Clone systems and different emulators, they'll all have their own issues with bugs. There are so many of each too.
Hmmm...I guess ill have to start periodically testing on the NES and a few different emulators and see all current possible bugs. Ill prioritize for the NES but yer ill at least try to keep it bug free on emulators. Im curious how you go about an allround solution or compromise?
 

tbizzle

Well-known member
Hmmm...I guess ill have to start periodically testing on the NES and a few different emulators and see all current possible bugs. Ill prioritize for the NES but yer ill at least try to keep it bug free on emulators. Im curious how you go about an allround solution or compromise?
Then each emulator will have so many versions also. It is just too much...
 

dale_coop

Moderator
Staff member
I get that glitch also. I think it may have something to do with animated tiles. And yeah, any outdated version of Mesen will gie you different bugs than the most up to date version.
@JayJayHux

That glich with animated tiles happen also with NES hardware... it's a code glitch... the loading screen code that takes too long, and corrupts some memory values.
I have that same bugs on some games (physical, digital..)
 

JayJayHux

Active member
@JayJayHux

That glich with animated tiles happen also with NES hardware... it's a code glitch... the loading screen code that takes too long, and corrupts some memory values.
I have that same bugs on some games (physical, digital..)
Ok thanks for letting me know Dale.
Im still too inexperienced to understand the deeper parts of Nes or Nesmaker code but im just wondering if theres a way to allow more load time between screens or something to prevent the animated tile glitch and the wrong sprite sheet glitch?
Its probably just wishful thinking but I thought it was worth asking just incase.
 

dale_coop

Moderator
Staff member
Ok thanks for letting me know Dale.
Im still too inexperienced to understand the deeper parts of Nes or Nesmaker code but im just wondering if theres a way to allow more load time between screens or something to prevent the animated tile glitch and the wrong sprite sheet glitch?
Its probably just wishful thinking but I thought it was worth asking just incase.
Nobody has really fixed that. Some members say that adding a few JSR doWaitFrame lines in the Load Screen helps… while others (like me) think that removing some JSR doWaitFrame lines actually works better.
 
Top Bottom