This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Things emulators get wrong/Emulation inaccuracies.

Things emulators get wrong/Emulation inaccuracies.
by on (#107460)
I'd just like to make a thread for others developing be able to check to see if a program they have trouble with is an emulator fault or not.

Just going to list a few of mine:

MMC1 bank switching: [ZP],Y final write of register for MMC1 doesn't work. Infects NESICIDE (As of Jan 6th, 2013), Nintendulator (0.975 Beta?).

SUROM: FCEUX emulates SUROM very wonky/badly. Don't have time to figure it out exactly, but it doesn't work with my ROM. Seems to be related the number of times/order or writing registers. Nestopia plays the SUROM ROM just fine in every way.
Re: Things emulators get wrong/Emulation inaccuracies.
by on (#107461)
Dummy writes to MMC1 registers are always problematic, because you're supposed to ignore the second write, and keep the first write. It took a while before emulators ran Bill & Ted.
Re: Things emulators get wrong/Emulation inaccuracies.
by on (#107462)
Dwedit wrote:
Dummy writes to MMC1 registers are always problematic, because you're supposed to ignore the second write, and keep the first write. It took a while before emulators ran Bill & Ted.


http://users.telenet.be/kim1-6502/6502/hwman.html#AA

MOS's book say the write is only asserted for one cycle. Unless that is a mistake. This also says the same.

http://www.eskimo.com/~tmcintos/atari/6502.proc.info

But the problem is with a STA [$00],Y and the page is never crossed or anything. Not a RMW instruction used with [ZP],Y.
Re: Things emulators get wrong/Emulation inaccuracies.
by on (#107464)
3gengames wrote:
SUROM: FCEUX emulates SUROM very wonky/badly. Don't have time to figure it out exactly, but it doesn't work with my ROM. Seems to be related the number of times/order or writing registers. Nestopia plays the SUROM ROM just fine in every way.

Perhaps the difference is that in 4K mode, the PRG ROM address is based on the current rendering state, and catch-up has to be done more often to find what that state is. Have you tried writing the expected values to both $A000 and the nominally unused $C000 and then making sure to stay in 8K mode?

Quote:
MOS's book say the write is only asserted for one cycle.

It's still a read and a write from the same address, which might confuse the MMC1 even if it isn't a read-write-write. Until Decap Attack is ported to MMC1, someone's going to need to write a test ROM and run it on a modded SNROM cart.
Re: Things emulators get wrong/Emulation inaccuracies.
by on (#107471)
I've verified the behavior on an MMC1B2 on real hardware. It passes. The ROM is on the forum, posted it a bunch. Also works on PowerPak as far as I know as the ROM in questions works on PowerPak.

And I set the MMC1 to 8KB mode. Then set CHR-ROM register 0 then 1 to 0. Then the program is banked to bank 0 and the graphics uploaded. The register is always written 0,1 to the same value, even in 8KB mode.
Re: Things emulators get wrong/Emulation inaccuracies.
by on (#107472)
If an emulator behaves differently from authentic hardware, notify the developers of the difference through the project's bug tracker.
Re: Things emulators get wrong/Emulation inaccuracies.
by on (#107482)
Dwedit wrote:
Dummy writes to MMC1 registers are always problematic, because you're supposed to ignore the second write, and keep the first write. It took a while before emulators ran Bill & Ted.


Yeah...and I could have swore I fixed this one ages ago. Hmmm...
Re: Things emulators get wrong/Emulation inaccuracies.
by on (#107484)
cpow wrote:
Dwedit wrote:
Dummy writes to MMC1 registers are always problematic, because you're supposed to ignore the second write, and keep the first write. It took a while before emulators ran Bill & Ted.


Yeah...and I could have swore I fixed this one ages ago. Hmmm...


I remember you sent me a new DLL for my MMC1 test ROM that worked, but the new version didn't include a fix. :o
Re: Things emulators get wrong/Emulation inaccuracies.
by on (#107558)
tepples wrote:
Until Decap Attack is ported to MMC1, someone's going to need to write a test ROM and run it on a modded SNROM cart.


There is, But it is named Kid Kool,

Kid Kool/Jump Tengoku is the First of the series, Psycho Fox is Second, Then Magical Hat/Decap Attack!
Re: Things emulators get wrong/Emulation inaccuracies.
by on (#109305)
Midframe state changes and PPU register access is tricky - especially if you want to produce exactly the same glitching as on the original hardware. For that you have to consider when different data is loaded by the PPU, etc., and I'm not even sure the exact timing that goes into e.g. enabling and disabling the PPU at all points is known.