nesdev.com
https://forums.nesdev.com/

Ensuring I don't violate constraints of a mapper subset
https://forums.nesdev.com/viewtopic.php?f=2&t=14962
Page 1 of 1

Author:  tepples [ Tue Oct 18, 2016 9:04 pm ]
Post subject:  Ensuring I don't violate constraints of a mapper subset

I'm developing a game for a subset of the MMC3 that fits on a particular CPLD. I'm trying to ensure that the game doesn't accidentally do anything that the subset can't handle. Is there a way to tell any stable NES emulator to log or stop if any of the following inadvertently occur?

  • Writes to $8000 with a value greater than 7, no matter from which register the write came
  • Writes to $8001 with bit 4 = 1 while $8000 is 0 or 1
  • Writes to $8001 with bit 4 = 0 while $8000 is 2, 3, 4, or 5

The answer to "Then just don't do that!" is "We did not budget for formal verification."

Or would it be better to modify an emulator's source code to support the subset directly?

Author:  thefox [ Tue Oct 18, 2016 9:06 pm ]
Post subject:  Re: Ensuring I don't violate subset constraints

Lua scripting in FCEUX should be able to handle that.

Modifying the emulator source code shouldn't be too hard, either.

Author:  Memblers [ Tue Oct 18, 2016 10:11 pm ]
Post subject:  Re: Ensuring I don't violate subset constraints

If you wanted to go NES-code-only, you could track it in your code (and I suppose remove the checks when you're done testing). Since mapper registers generally aren't readable I like to keep a shadow copy in RAM. If you did that, you could use a macro or subroutine for all mapper writes and check for whatever conditions you want by reading those shadow copies. Though I guess that solution falls apart if your code timing is so tight that adding anything will completely break everything.

Author:  Myask [ Wed Oct 19, 2016 8:00 am ]
Post subject:  Re: Ensuring I don't violate constraints of a mapper subset

Don't forget to set a breakpoint on writes $8002-9FFF to trap possible unintended writes to these as well.

Curious how this is credited.

Author:  Dwedit [ Wed Oct 19, 2016 10:37 am ]
Post subject:  Re: Ensuring I don't violate constraints of a mapper subset

Is this like DxROM (mapper 206), or does it have more features/bits?

Author:  tepples [ Wed Oct 19, 2016 2:34 pm ]
Post subject:  Re: Ensuring I don't violate constraints of a mapper subset

It's sort of like mapper 206 (Namco 108/Tengen MIMIC-1) in lacking mirroring, WRAM, and CP bits, and having a reduced CHR capacity. It's also sort of like 88 in that PPU $0xxx (BG) is always the first half of CHR and PPU $1xxx (sprites) is always the second half. But it has the full MMC3 PIT at $C000-$E001 because levels use lots of parallax splits.

Mapper 88: 128K PRG, 128K CHR (CHR A16 = PPU A12)
Mapper 4: 512K PRG, 256K CHR (all bits switchable), CP, variable mirroring, WRAM, PIT
Our MMC3 subset: 512K PRG, 32K CHR (CHR A14 = PPU A12), PIT

Author:  Myask [ Wed Oct 19, 2016 3:20 pm ]
Post subject:  Re: Ensuring I don't violate constraints of a mapper subset

"PIT" = programmable interrupt timer, I expect, but "CP bits"?

Author:  lidnariq [ Wed Oct 19, 2016 3:30 pm ]
Post subject:  Re: Ensuring I don't violate constraints of a mapper subset

The "CP bits" are [$8000] & $C0 , using the terminology from the wiki (and meaning "Chr" and "Prg" reordering)

Author:  Myask [ Wed Oct 19, 2016 3:44 pm ]
Post subject:  Re: Ensuring I don't violate constraints of a mapper subset

…Banking modes.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/