Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Better support for MMC3_198 #33

Merged
merged 1 commit into from
Jun 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Core/MMC3_198.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
#include "MMC3.h"

//Most likely incorrect/incomplete, but works (with minor glitches) with the 2 games marked as mapper 198 that I am aware of.
//Game 1: 吞食天地2 (CHR RAM, but uses chr banking?, has save ram at 6000-7FFF?)
//Game 2: Cheng Ji Si Han (ES-1110) (Ch) (CHR RAM, work ram mirrored from 5000-7FFF?, doesn't use chr banking)
//These games may actually use different mappers.
//Game 1: 吞食天地: 三国外传 (Tūnshí Tiāndì - Sānguó Wàizhuàn) (CHR RAM, but uses chr banking?, has save ram at 6000-7FFF)
// 吞食天地: 三国外传 (Tūnshí Tiāndì - Sānguó Wàizhuàn) uses ram 5000-7FFF (Add Chinese character process program in 5000-5FFF)
// Original 1994 Hong Kong release by an unknown publisher, 640 KiB PRG-ROM.
//Game 2: 成吉思汗 (Chéngjísīhán) (CHR RAM, work ram mirrored from 5000-7FFF?, doesn't use chr banking)
// 成吉思汗 (Chéngjísīhán) could actually be using MMC3_199 in reality according to the Nesdev wiki.
//These games may actually use different mappers altogether.
class MMC3_198 : public MMC3
{
private:
Expand Down Expand Up @@ -44,7 +47,7 @@ class MMC3_198 : public MMC3
void WriteRegister(uint16_t addr, uint8_t value) override
{
if(addr == 0x8001 && (GetState().Reg8000 & 0x07) >= 6) {
_exRegs[(GetState().Reg8000 & 0x07) - 6] = value & (value >= 0x40 ? 0x4F : 0x3F);
_exRegs[(GetState().Reg8000 & 0x07) - 6] = value & 0x7F;
}
MMC3::WriteRegister(addr, value);
}
Expand All @@ -62,4 +65,4 @@ class MMC3_198 : public MMC3
MMC3::UpdateChrMapping();
}
}
};
};