Missing score rendering in Donkey Kong

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
andsve
Posts: 5
Joined: Mon Sep 03, 2018 2:41 pm

Missing score rendering in Donkey Kong

Post by andsve » Wed Dec 30, 2020 7:27 pm

Hi all,

I'm just started implementing the PPU in my emulator, and for the most part it is going OK. After some initial issues I can actually play the game, even though a lot of stuff is still to do.

But there is an issue I just can't wrap my head around, the score and top bar is missing some tiles it seems;
(Ignore the colors of the background tiles, I have just started fixing colors for sprite for now.)
Screenshot 2020-12-31 at 03.23.28.png
Screenshot 2020-12-31 at 03.23.28.png (8.68 KiB) Viewed 2310 times
I have tried looking for anyone having similar issues, and actually found a post on reddit: https://www.reddit.com/r/EmuDev/comment ... emulation/

However, I can't really see there would be the same issue in my code, I update the PC after both mem read and getting the operand etc... Has anyone experienced this, or know where would be a good point to start investigating?

My CPU passes the nestest, exact same output cycles and all.. But then again, I still have a hunch there is something wrong with the CPU. :)

User avatar
andsve
Posts: 5
Joined: Mon Sep 03, 2018 2:41 pm

Re: Missing score rendering in Donkey Kong

Post by andsve » Fri Jan 01, 2021 9:40 am

Turns out I'm a huge dumbass. Realising that the only chars missing was zeros it reminded me I had a stupid check in my nametables debug code;

Code: Select all

                if (chr_i > 0) {
                    // ...
                }
Essentially, it didn't render anything that used chr with index 0.
Screenshot 2021-01-01 at 17.40.02.png
Screenshot 2021-01-01 at 17.40.02.png (10.57 KiB) Viewed 2229 times

Post Reply