nesdev.com
http://forums.nesdev.com/

MMC5 initialisation (default prg mode, chr mode etc.)
http://forums.nesdev.com/viewtopic.php?f=3&t=14446
Page 1 of 1

Author:  colinvella [ Fri Jun 24, 2016 6:46 am ]
Post subject:  MMC5 initialisation (default prg mode, chr mode etc.)

Hi,

I started implemented MMC5 and have most of the code in place (except screen split, fill mode, extended ram use and audio). I have tried to find out about the initial state of the mapper but I couldn't find any documentation. Glancing at some implementations in Github, I have gathered that PRG Mode should initially be 3. I have no idea, however, if I should initialise other settings like banks for PRG Mode 3, or anything for CHR modes.

When trying to run Castlevania III, the first address read from the Reset Vector and set in the program counter is $4920, which clearly seems to be an invalid address since it doesn't point to program ROM.

The mapper logic is working as follows: It redirects the reset vector's value $FFFC to the 8 KB switchable PRG ROM bank addressed by range CPU $E000-$FFFF. This is translated to offset $1FFC of bank 0 within the program rom (a flat array containing all the program rom banks loaded from the .NES file). This translates to the flattened ROM address $2000 x 0 + $1FFC (= $1FFC in the flat ROM array). The word at the locations $1FFC,$1FFD is $4920.

Could anyone help out please? I can share code here as needed. Very likely, I got many things wrong, despite following the MMC5 specs carefully.

Thanks a lot!

Author:  tepples [ Fri Jun 24, 2016 6:59 am ]
Post subject:  Re: MMC5 initialisation (default prg mode, chr mode etc.)

It's traditional for NES mappers with 8K bank switching (Namco 108/MMC3, VRC2/4, FME-7) to fix the $E000-$FFFF window to the last bank in the cart. I'd assume MMC5 powers on the same way, even though it does allow switching $E000-$FFFF after power on.

Author:  colinvella [ Fri Jun 24, 2016 8:07 am ]
Post subject:  Re: MMC5 initialisation (default prg mode, chr mode etc.)

tepples wrote:
It's traditional for NES mappers with 8K bank switching (Namco 108/MMC3, VRC2/4, FME-7) to fix the $E000-$FFFF window to the last bank in the cart. I'd assume MMC5 powers on the same way, even though it does allow switching $E000-$FFFF after power on.


That seems indeed to have been the problem. The last ROM bank for Castlevania III is 31. The first instruction was CLD.. definitely a good sign. I'm now encountering other issues but I think I can proceed from here for now.

Cheers! :)

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