NES Program how to get the mirror information
Moderator: Moderators
NES Program how to get the mirror information
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?
Re: NES Program how to get the mirror information
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.
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.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Re: NES Program how to get the mirror information
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_connector
If neither, the nametable mirroring is most likely controlled by the mapper.
http://wiki.nesdev.com/w/index.php/Cartridge_connector
If neither, the nametable mirroring is most likely controlled by the mapper.
-
doppelganger
- Posts: 183
- Joined: Tue Apr 05, 2005 7:30 pm
Re: NES Program how to get the mirror information
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.
Be whatever the situation demands.
Re: NES Program how to get the mirror information
Re: NES Program how to get the mirror information
For my new fc/nes cartridge dump device softCopyFamicom to auto detected the mirror!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.
And later I want to make a emulator to run cartridge from a real fc/nes(so I need detected the mirror and irq...)
- infiniteneslives
- Posts: 2102
- Joined: Mon Apr 04, 2011 11:49 am
- Location: WhereverIparkIt, USA
- Contact:
Re: NES Program how to get the mirror information
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.
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.
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers
Re: NES Program how to get the mirror information
An easy way to detect v-mirror and h-mirror!
Code: Select all
//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);
Re: NES Program how to get the mirror information
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.)
$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.)
- infiniteneslives
- Posts: 2102
- Joined: Mon Apr 04, 2011 11:49 am
- Location: WhereverIparkIt, USA
- Contact:
Re: NES Program how to get the mirror information
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...
I thought the question was sensing the mapper for smart dumping, but everyone else's response seems from the perspective of the nes...
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers
Re: NES Program how to get the mirror information
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.
- infiniteneslives
- Posts: 2102
- Joined: Mon Apr 04, 2011 11:49 am
- Location: WhereverIparkIt, USA
- Contact:
Re: NES Program how to get the mirror information
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.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.
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...
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers
Re: NES Program how to get the mirror information
Thanks,let me have a try.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.)
Re: NES Program how to get the mirror information
It's on my new dump device "softCopyFamicom"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...
viewtopic.php?f=9&t=10322
Re: NES Program how to get the mirror information
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.
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.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!