Problems with Mapper 1

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
siliconandsolder
Posts: 9
Joined: Tue Apr 20, 2021 1:25 pm

Problems with Mapper 1

Post by siliconandsolder »

Hi all! I've been working on my emulator off-and-on for a while now, and I've finally gotten to the point where I can play games on it. I've implemented mapper 0, and games like Super Mario Bros work just fine.

Now I've moved on to Mapper 1, and I'm having some issues. I'm using Legend of Zelda as a test ROM, and everything works but the sprites. The background colours, music, and controls work as expected. Here's a video of the problem: https://streamable.com/txvnn7

Has anyone else seen something like this? It'd be great if someone else could skim through my implementation of Mapper 1 and tell me if there's any obvious problems: https://github.com/siliconandsolder/rus ... mapper1.rs
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Problems with Mapper 1

Post by lidnariq »

But your video shows no graphics at all, not just "no sprites" ?
siliconandsolder
Posts: 9
Joined: Tue Apr 20, 2021 1:25 pm

Re: Problems with Mapper 1

Post by siliconandsolder »

lidnariq wrote: Tue Apr 20, 2021 8:45 pm But your video shows no graphics at all, not just "no sprites" ?
Yes, sorry, I should've been more clear. The background colour is the only thing that appears.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Problems with Mapper 1

Post by lidnariq »

Zelda1 uses CHR RAM. How do you handle writes to RAM that isn't nametables?
siliconandsolder
Posts: 9
Joined: Tue Apr 20, 2021 1:25 pm

Re: Problems with Mapper 1

Post by siliconandsolder »

lidnariq wrote: Tue Apr 20, 2021 9:23 pm Zelda1 uses CHR RAM. How do you handle writes to RAM that isn't nametables?
I was wondering if Zelda 1 used CHR RAM. Looking at my implementation of the NES cartridge, I don't think I have it properly distinguishing between RAM carts and ROM carts. That might explain why mapper 0 games work fine, and mapper 1 games don't. Let me look at my cartridge implementation and see if I can find any problems.
siliconandsolder
Posts: 9
Joined: Tue Apr 20, 2021 1:25 pm

Re: Problems with Mapper 1

Post by siliconandsolder »

lidnariq wrote: Tue Apr 20, 2021 9:23 pm Zelda1 uses CHR RAM. How do you handle writes to RAM that isn't nametables?
Yep, that was the issue. I wasn't properly initializing the CHR RAM. I was multiplying the number of CHR banks by 8192 to get the total size of the CHR memory. So if the number of banks was 0 (ie. it's CHR RAM) the CHR memory was empty. Everything looks good now.
Attachments
Selection_027.png
Post Reply