Missing Scanline Glitch

Post Reply
Metaedge
Posts: 1
Joined: Sat May 16, 2020 2:59 am

Missing Scanline Glitch

Post by Metaedge » Sat May 16, 2020 4:11 am

Hello,

I've encountered a strange glitch in a new project of mine that I was hoping to get help with.

It seems that some of the scanlines near the top of the screen aren't being displayed on certain backgrounds. This tends to get worse as the size of my game arrays increase. Strangely, this glitch has no impact on vram, which is perfect when viewed through VBA's map tool.

The game arrays are stored in sram to avoid soaking up all the ram (even though they really aren't that big with a mere 400 entries).

I'm not sure what's causing this problem, but I'm hoping someone else has encountered this before and can post some advice.

Thanks,
Metaedge
Attachments
glitch.png
(35.12 KiB) Not downloaded yet

WinterMute
Site Admin
Posts: 1478
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Missing Scanline Glitch

Post by WinterMute » Thu May 28, 2020 3:30 am

This is screen tearing caused by updating graphics during screen draw time. It's difficult to offer specific advice without seeing exactly what you're doing but calling VBlankIntrWait immediately before drawing will ensure you're in the vblank period. Make sure to separate your game logic from your graphics updates too so you're not trying to calculate and draw at the same time. i.e. calculate all your player movements/collisions etc in one place before calling VBlankIntrWait then render your graphics appropriately.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest