It is currently Sun Dec 10, 2017 7:02 pm

All times are UTC - 7 hours



Forum rules


1. NO BLATANT PIRACY. This includes reproducing homebrew less than 10 years old, with the exception of free software.
2. No advertising your reproductions, with the exception of free software.
3. Be nice. See RFC 1855 if you aren't sure what this means.



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Nov 11, 2015 6:18 pm 
Offline
User avatar

Joined: Tue Dec 04, 2012 3:28 pm
Posts: 339
Location: Canada
Does this game use 32K bankswitching? I have been trying to get it to work with a cart that does NOT support 32k banking (so games like Tetris don't work) and it just loads a black screen. Trying it on another cart that DOES support 32K banking, the game works fine. But that's not the main point... How can I tell what games do and don't use 32k banking?

I've tried in NesMapperReader and FCEUX, and neither state what kind of banking the game uses. Is there another tool out there that could work?


Top
 Profile  
 
PostPosted: Wed Nov 11, 2015 6:54 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6503
Location: Seattle
Tetris assumes 32 KiB banking (since it was released on SEROM, which forces 32 KiB banking).
The only pertinent variants of MMC1 PCBs are whether it connected CPU A14 (SEROM, SHROM, SH1ROM) or MMC1 A14 (everything else) to PRG A14.

Note that the MMC1 itself already supports 32 KiB banking, it's just that the initial values of the banking register may or may not play well with what the hack expected.

If so, this might be something that depends on the exact MMC1 revision ... or else needs to be fixed by further ROM hacking.


Let me rephrase that. The earlier revisions of the MMC1 can have any 16 KiB slice show up from $C000-$FFFF. While this game seems to be ok with it being any second half (since the PRG appears to be approximately four copies of the SMB1 engine), it doesn't even have the vectors in the bottom half.

The later revisions ensure that it's always the last 16 KiB slice. Using a modified SEROM/SHxROM board is probably the easiest way to fix this.


Top
 Profile  
 
PostPosted: Wed Nov 11, 2015 8:32 pm 
Offline
User avatar

Joined: Tue Dec 04, 2012 3:28 pm
Posts: 339
Location: Canada
Thanks for the response!

That all makes sense, but how can I check a Rom to determine if it uses 16K or 32K banking? Is there a flag somewhere or some other way to determine this in either a hex editor or debugger?

Also, on that same line, where in a Rom does it control which 16K slice is used? Can I go in there and make it use the second half at all times?


Top
 Profile  
 
PostPosted: Wed Nov 11, 2015 8:50 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6503
Location: Seattle
Depends on the mapper. In this case, it's MMC1, so the best you can do is use a debugging emulator (Nintendulator, FCEUX) and wait for writes to registers, cross referenced against the wiki...

For original (i.e. NOT romhacks), you can rely on the board names and specific IC revisions mentioned in NesCartDB. As I said, SEROM, SHROM, and SH1ROM don't support PRG banking, and so when naïvely extended they act weird if the MMC1 is programmed to a 16 KiB mode.

Similarly, the MMC1 and MMC1A ICs (I think) don't guarantee the contents of any of the registers on power-up, while the later ones do guarantee (I think...) booting up with the last 16 KiB resident in the top quarter of memory (as though the reset bit had been written).


In any case, the problem here isn't that the game is using 32 KiB banking. It's that it can't handle if the MMC1 boots up with the "Control Register" containing $08-$0B or $18-$1B.


Top
 Profile  
 
PostPosted: Wed Nov 11, 2015 8:55 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19322
Location: NE Indiana, USA (NTSC)
getafixx wrote:
That all makes sense, but how can I check a Rom to determine if it uses 16K or 32K banking? Is there a flag somewhere or some other way to determine this in either a hex editor or debugger?

To determine whether a game uses 32K banking mode, watch for writes to $8000. They'll come in groups of five, and if the fourth write of five has bit 0 clear, the banking mode is 32K. Details in MMC1.

To determine whether a game uses SEROM (which forces 32K banking mode), look for 32 KiB PRG ROM and no WRAM.

getafixx wrote:
Also, on that same line, where in a Rom does it control which 16K slice is used?

Through writes to $E000. But the reset vector needs to be valid before the CPU can make any writes to $E000.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group