I'm a nes application,I'm in a nes cartridge run on a real nes,I want to know which mirror my cartridge used at this time,What must I do?
For cartridges with fixed mirroring, that's it, it's fixed.
Otherwise, you can tell by looking at the screen for scrolling artifacts. If the left column is blocked off, and there are attribute clashes as it scrolls horizontally, it's probably using horizontal mirroring (vertical nametable arrangement). If there is junk appearing at the top and bottom of the screen as it scrolls vertically, it's probably using vertical mirroring (horizontal nametable arrangement).
If there's no junk, and it's scrolling only horizontally or vertically, chances are good that it's using that nametable arrangement. Horizontal scrolling means vertical mirroring (horizontal nametable arrangement), and Vertical scrolling means horizontal mirroring (vertical nametable arrangement).
Or run it in an emulator and use a debugger to find out what mirroring mode it last selected.
Then there's the other hardware stuff where you determine how the vram lines that go back to the console are routed, since that's how mirroring selection works.
Use a continuity meter to see if the
CIRAM A10 pin is connected to
PPU A10 or
PPU A11.
http://wiki.nesdev.com/w/index.php/Cartridge_connectorIf neither, the nametable mirroring is most likely controlled by the mapper.
If for some reason you want to do this in-program, you could read the name tables and check for mirroring that way. Not sure why you'd need to do that, but yeah, there it is.
I did it in-program in three mapper test programs: one for MMC1 (unreleased), one for mappers 7 and 34 (
BNTest), and one for mapper 28 (
test28). Outside of mapper tests, a save state tool might use this to probe the current mirroring settings.
doppelganger wrote:
If for some reason you want to do this in-program, you could read the name tables and check for mirroring that way. Not sure why you'd need to do that, but yeah, there it is.
For my new fc/nes cartridge dump device softCopyFamicom to auto detected the mirror!
And later I want to make a emulator to run cartridge from a real fc/nes(so I need detected the mirror and irq...)
I detect the board via mirroring, you just have to scroll through all the different styles of mirroring control registers and perform a test for each mapper's style of mirroring. If the test passes then that's your mapper(s).
This is limited, but it works pretty well for 'standard' mappers. Between mirroring, IRQs, WRAM detection, CHR-RAM detection,
and bankswitching you should be able to detect most boards.
tepples wrote:
I did it in-program in three mapper test programs: one for MMC1 (unreleased), one for mappers 7 and 34 (
BNTest), and one for mapper 28 (
test28). Outside of mapper tests, a save state tool might use this to probe the current mirroring settings.
An easy way to detect v-mirror and h-mirror!
Code:
//back
data_2000 = ppu_read(0x2000);
data_2400 = ppu_read(0x2400);
data_2800 = ppu_read(0x2800);
data_2C00 = ppu_read(0x2C00);
//
k0 = 0x00;
k1 = 0x88;
ppu_write(0x2000,k0);
ppu_write(0x2400,k0);
ppu_write(0x2800,k0);
ppu_write(0x2C00,k0);
ppu_write(0x2000,k1);
k1_2000 = ppu_read(0x2000);
k1_2400 = ppu_read(0x2400);
k1_2800 = ppu_read(0x2800);
k1_2C00 = ppu_read(0x2C00);
//h
if( (k1==k1_2000)&&(k1==k1_2400)&&(!k1_2800)&&(!k1_2C00) )
printf("h mirror\n");
//v
if( (k1==k1_2000)&&(k1==k1_2800)&&(!k1_2400)&&(!k1_2C00) )
printf("v mirror\n");
//resume
ppu_write(0x2000,data_2000);
ppu_write(0x2400,data_2400);
ppu_write(0x2800,data_2800);
ppu_write(0x2C00,data_2C00);
Write:
$2000 <- #00
$2400 <- #01
$2800 <- #02
$2C00 <- #03
Then, simply read $2000 to get the mirroring configuration.
$2000 -> 00 = Four screen
$2000 -> 01 = Horizontal mirroring
$2000 -> 02 = Vertical mirroring
$2000 -> 03 = Single screen
(The reason this works is because $2000 gets overwritten with a different value for each of the four common mirroring configurations, if you write $2000, $2400, $2800, $2C00 in order.)
I'm confused... Is this testing being done with the nes/fc or kazoo/other dumping device?
I thought the question was sensing the mapper for smart dumping, but everyone else's response seems from the perspective of the nes...
From the perspective of the NES and from the perspective of the dumping device are ultimately the same thing, as they interact with the Game Pak through the same 60 or 72 pins.
tepples wrote:
From the perspective of the NES and from the perspective of the dumping device are ultimately the same thing, as they interact with the Game Pak through the same 60 or 72 pins.
Yeah but with the NES you can't just read CIRAM A10 signal from the connector. You have to infer it from the NT's arrangment. In a standalone dumper (not copyNES) writing to NT's and then reading back tells you a whole lot of nothing unless the NT's are on the cartridge which is generally not the case.
Yes it's the same connector, but the methods you're able to sense what's going on with that connector aren't the same based on how the said hardware is connected to that connector...
Drag wrote:
Write:
$2000 <- #00
$2400 <- #01
$2800 <- #02
$2C00 <- #03
Then, simply read $2000 to get the mirroring configuration.
$2000 -> 00 = Four screen
$2000 -> 01 = Horizontal mirroring
$2000 -> 02 = Vertical mirroring
$2000 -> 03 = Single screen
(The reason this works is because $2000 gets overwritten with a different value for each of the four common mirroring configurations, if you write $2000, $2400, $2800, $2C00 in order.)
Thanks,let me have a try.
infiniteneslives wrote:
I'm confused... Is this testing being done with the nes/fc or kazoo/other dumping device?
I thought the question was sensing the mapper for smart dumping, but everyone else's response seems from the perspective of the nes...
It's on my new dump device "softCopyFamicom"
viewtopic.php?f=9&t=10322
Some boards support custom mirroring, and can create mirroring configurations that don't match one of the standard types. For example:
0 1
1 1
or
0 1
1 0
mirroring won't be correctly identified by that code snippet.
Also, some boards can map ROM into the nametables.
Dwedit wrote:
Some boards support custom mirroring, and can create mirroring configurations that don't match one of the standard types.
[...]
Also, some boards can map ROM into the nametables.
Worst case scenario, you read all four memory locations and compare against a string instead.
Edit: I assumed this was for hardwired mirroring. I don't know of any boards that have nametable ROM hardwired, or have a nonstandard mirroring configuration hardwired; it's only mappers that do that. That and there's no reason to be trying to detect the mirroring configuration of a cart that uses mapper-controlled mirroring, because it's completely dependent on the software. Thus, I think my method is appropriate for detecting the mirroring of a cart that has it hardwired.