First steps in writing an emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
janzdott
Posts: 42
Joined: Fri Oct 04, 2013 11:56 pm

Re: First steps in writing an emulator

Post by janzdott »

I just rewrote my CPU from the ground up, to make sure there were no bugs. It's also 100% cycle-accurate now, including the instructions that add 1 cycle when crossing page boundaries. Every read/write triggers 3 PPU cycles. It's hardcoded to 3 right now, but I'll add the option for switching to PAL later.

I was able to squeeze a little more performance out of it, but it's the PPU that's the bottleneck. It ran at insane framerates before I added sprite rendering. It runs slightly faster than Nintendulator when Nintendulator's sound is off and framerates aren't capped. I still have a lot of room for optimization in the PPU.

Scrolling works in Bomberman and Balloon Fight, but there's a glitch in Excitebike. I think that's due to a bug with my sprite 0 hit, but I'm not sure yet. I haven't tried any other scrolling games yet. SMB1 still crashes due to some error making it try to write to CHR ROM. I'm positive it's a PPU bug. Now that everything is cycle-accurate, I should be able to make some logs and compare it to Nintendulator's. The dot and scanline counters between our logs look spot on now.

And tepples, I don't know what happened on EFnet the other day. The site completely stopped responding for me. Tried refreshing it every now and then for over an hour and it still wouldn't work.
Post Reply