What's wrong with my SMB-palette?

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

What's wrong with my SMB-palette?

Post by oRBIT2002 »

If you check the attached file, you'll see a strange effect in SMB running in my environment. SMB is the only title that's affected and I've tried quite a few. It looks like it's attribute-related, but only under certain conditions somehow.
I've checked attribute/nametable-mirroring, it seems okay.
Anyone got a quick feeling like "aha, he's doing this wrong"?
Attachments
Titlescreen of SMB with bugs
Titlescreen of SMB with bugs
smbattrib.png
User avatar
Disch
Posts: 1848
Joined: Wed Nov 10, 2004 6:47 pm

Re: What's wrong with my SMB-palette?

Post by Disch »

Don't know offhand what would be causing this particular problem. But step 1 is to determine whether this is a PPU or CPU problem.

Do the attribute tables look correct in memory and are just being displayed incorrectly? (PPU problem)

Or are the attribute tables themselves incorrect? (CPU problem)

Or it might be a mirroring issue. Is your PPU getting the attributes from the wrong NT?
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's wrong with my SMB-palette?

Post by oRBIT2002 »

Looks like the attributetable is bad when I check. My CPU core passes the nestest.nes CPU-test, so.. To be continued..
User avatar
Disch
Posts: 1848
Joined: Wed Nov 10, 2004 6:47 pm

Re: What's wrong with my SMB-palette?

Post by Disch »

Maybe the CPU is writing the correct values to $2006/2007, but they're being moved to the wrong place??
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's wrong with my SMB-palette?

Post by oRBIT2002 »

Still bothered with this bug. Doesn't seem to be PPU-related. Wrong data is stored in RAM.. I've got other issues in "Ice Climber", wrong data is also stored in RAM which is used for leveldata, I suspect the issues are related..
It's difficult tracking the code backwards on what's going wrong.. How reliable are the CPU test ROMS out there? I pass the tests I've tried but this problem isn't obviously caught..
User avatar
miker00lz
Posts: 235
Joined: Thu Sep 23, 2010 7:28 pm

Re: What's wrong with my SMB-palette?

Post by miker00lz »

oRBIT2002 wrote:Looks like the attributetable is bad when I check. My CPU core passes the nestest.nes CPU-test, so.. To be continued..
Try this one too: http://blargg.8bitalley.com/nes-tests/instr_test-v4.zip

My emulator passed nestest.nes but this one found a problem and I was able to fix it.
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's wrong with my SMB-palette?

Post by oRBIT2002 »

Thanks for the tip, this fixed the problem! I already thought I've been running these tests but this one obviously was different.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: What's wrong with my SMB-palette?

Post by tokumaru »

So, what exactly was wrong about your CPU implementation that caused such bugs? You know, to keep this thread relevant for future readers.
User avatar
miker00lz
Posts: 235
Joined: Thu Sep 23, 2010 7:28 pm

Re: What's wrong with my SMB-palette?

Post by miker00lz »

Glad you got it working! I'd also be interested in knowing what it was.
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: What's wrong with my SMB-palette?

Post by oRBIT2002 »

My <ROL zeropage> & <LSR zeropage> implementation was flawed. Strange that other test-ROMs didn't find this..
Post Reply