UNROM512: Fixed mirroring logic to match changes on the wiki (fixes Black Box Challenge)
This commit is contained in:
parent
893ea249ce
commit
03f160a949
2 changed files with 8 additions and 14 deletions
|
@ -180,16 +180,7 @@ uint8_t NESHeader::GetSubMapper()
|
||||||
MirroringType NESHeader::GetMirroringType()
|
MirroringType NESHeader::GetMirroringType()
|
||||||
{
|
{
|
||||||
if(Byte6 & 0x08) {
|
if(Byte6 & 0x08) {
|
||||||
if(GetRomHeaderVersion() == RomHeaderVersion::Nes2_0) {
|
return MirroringType::FourScreens;
|
||||||
if(Byte6 & 0x01) {
|
|
||||||
//Based on proposal by rainwarrior/Myask: http://wiki.nesdev.com/w/index.php/Talk:NES_2.0
|
|
||||||
return MirroringType::ScreenAOnly;
|
|
||||||
} else {
|
|
||||||
return MirroringType::FourScreens;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return MirroringType::FourScreens;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return Byte6 & 0x01 ? MirroringType::Vertical : MirroringType::Horizontal;
|
return Byte6 & 0x01 ? MirroringType::Vertical : MirroringType::Horizontal;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,13 @@ protected:
|
||||||
void InitMapper() override
|
void InitMapper() override
|
||||||
{
|
{
|
||||||
SelectPRGPage(1, -1);
|
SelectPRGPage(1, -1);
|
||||||
if(IsNes20()) {
|
|
||||||
_enableMirroringBit = GetMirroringType() == MirroringType::ScreenAOnly;
|
_enableMirroringBit = false;
|
||||||
} else {
|
switch(_romInfo.NesHeader.Byte6 & 0x09) {
|
||||||
_enableMirroringBit = GetMirroringType() == MirroringType::FourScreens;
|
case 0: SetMirroringType(MirroringType::Vertical); break;
|
||||||
|
case 1: SetMirroringType(MirroringType::Horizontal); break;
|
||||||
|
case 8: SetMirroringType(MirroringType::ScreenAOnly); _enableMirroringBit = true; break;
|
||||||
|
case 9: SetMirroringType(MirroringType::FourScreens); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GetMirroringType() == MirroringType::FourScreens && _chrRam && _chrRamSize >= 0x8000) {
|
if(GetMirroringType() == MirroringType::FourScreens && _chrRam && _chrRamSize >= 0x8000) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue