Quantcast
Channel: nesdev.org
Viewing all articles
Browse latest Browse all 746

SMB emulation issues

$
0
0
Hi all,

That's my first post here.... I've being writing a NES emulator on my spare time for a while... so far I've got a lot of stuff ready: CPU Emulator, ROM Loader, GUI, Palletes, basically I do my tests with a few roms: nestest for CPU (all tests are passing), Donkey Kong (it looks everything works) and, of course, Super Mario Bros (SMB)... for SMB the scrolling is working, the demo works (so sprite 0 hit is working), but I have a very strange behavior with the first screen background plotting... basically I can't get some background colors on the top fixed area (scores, etc)... and the big brown square (showing the title) it doesn't appear....

The problem is in the nametable, I have dumped it and compared with one running on fceux, while my nametable has a lot of 0x24 in the middle of screen (as shown below), on fceux I can see the different indexes for the square box.... I'm attaching a screenshot, notice that some text is also missing (Player 1, Player 2, etc).... the strange thing is that the demo starts, Mario runs, jumps, the scrolling is working perfectly, the only other issue that I see is that clouds have the black background, squares (for coins and mushrooms) also have the black background when they move, while it should be the blue background color (transparent)....

A runtime nametable dump:

c0
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 c0
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 c0
24 24 16 a 1b 12 18 24 24 24 24 24 24 24 24 24
24 20 18 1b 15 d 24 24 1d 12 16 e 24 24 24 c0
24 24 0 0 0 0 0 0 24 24 2e 29 0 0 24 24
24 24 1 28 1 24 24 24 24 24 24 24 24 24 24 c0
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 c0
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 36 37 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
35 25 25 38 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
39 3a 3b 3c 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 ce 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 24 31 32 24 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 24 30 26 34 33 24 24 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
24 30 26 26 26 26 33 24 24 24 24 24 24 24 24 24
0 0 0 0 0 24 24 24 24 24 24 24 24 24 24 24
30 26 34 26 26 34 26 33 24 24 24 24 24 24 24 24
24 24 24 24 24 24 24 36 37 36 37 36 37 24 24 30
26 26 26 26 26 26 26 26 33 24 24 24 24 24 24 24
24 24 24 24 24 24 35 25 25 25 25 25 25 38 24 b4
b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b4
b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b6
b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b6
b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b4
b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b4
b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b4 b5 b6
b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b6
b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b6 b7 b6

I know it can be a lot of things causing this issue, I have checked CHR memory (it's all good), I've checked my pallete (it's good), I don't think the PPU background plotting is the problem because it plots everything else correct (and I can see the wrong data in the nametable)....

Does anybody has faced this kind of issue before? I thought it could also be the DMA transfer, I've checked and it looks good to me, but I'm not sure if there is any timing constraint.... anyways, any clue is highly appreciated!!!

cheers!
wrongMario.png

Statistics: Posted by renesp — Mon Jun 03, 2024 1:51 am — Replies 6 — Views 346



Viewing all articles
Browse latest Browse all 746

Trending Articles