diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index a98fdc5b..3170101a 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -532,6 +532,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 9743a431..f400fc77 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -985,6 +985,9 @@ Nes\Mappers\Unif + + Nes\Mappers\Unif + diff --git a/Core/MMC3_Kof97.h b/Core/MMC3_Kof97.h new file mode 100644 index 00000000..d9c14113 --- /dev/null +++ b/Core/MMC3_Kof97.h @@ -0,0 +1,21 @@ +#pragma once +#include "stdafx.h" +#include "MMC3.h" + +class MMC3_Kof97 : public MMC3 +{ +protected: + void WriteRegister(uint16_t addr, uint8_t value) override + { + value = (value & 0xD8) | ((value & 0x20) >> 4) | ((value & 0x04) << 3) | ((value & 0x02) >> 1) | ((value & 0x01) << 2); + if(addr == 0x9000) { + addr = 0x8001; + } else if(addr == 0xD000) { + addr = 0xC001; + } else if(addr == 0xF000) { + addr = 0xE001; + } + + MMC3::WriteRegister(addr, value); + } +}; \ No newline at end of file diff --git a/Core/MapperFactory.cpp b/Core/MapperFactory.cpp index 944abcca..0a953342 100644 --- a/Core/MapperFactory.cpp +++ b/Core/MapperFactory.cpp @@ -130,6 +130,7 @@ #include "MMC3_254.h" #include "MMC3_ChrRam.h" #include "MMC3_Coolboy.h" +#include "MMC3_Kof97.h" #include "MMC3_StreetHeroes.h" #include "MMC4.h" #include "MMC5.h" @@ -230,6 +231,7 @@ const uint16_t MapperFactory::UnifDreamTech01; const uint16_t MapperFactory::UnifEdu2000; const uint16_t MapperFactory::UnifGs2004; const uint16_t MapperFactory::UnifGs2013; +const uint16_t MapperFactory::UnifKof97; const uint16_t MapperFactory::UnifMalee; const uint16_t MapperFactory::UnifNovelDiamond; const uint16_t MapperFactory::UnifStreetHeroes; @@ -466,6 +468,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData) case MapperFactory::UnifEdu2000: return new Edu2000(); case MapperFactory::UnifGs2004: return new Gs2004(); case MapperFactory::UnifGs2013: return new Gs2013(); + case MapperFactory::UnifKof97: return new MMC3_Kof97(); case MapperFactory::UnifMalee: return new Malee(); case MapperFactory::UnifNovelDiamond: return new NovelDiamond(); case MapperFactory::UnifSmb2j: return new Smb2j(); diff --git a/Core/MapperFactory.h b/Core/MapperFactory.h index ff86dc14..10ad9ce9 100644 --- a/Core/MapperFactory.h +++ b/Core/MapperFactory.h @@ -22,6 +22,7 @@ class MapperFactory static const uint16_t UnifGs2013 = 65525; static const uint16_t UnifGs2004 = 65524; static const uint16_t UnifNovelDiamond = 65523; + static const uint16_t UnifKof97 = 65522; static shared_ptr InitializeFromFile(string romFilename, stringstream *filestream, string ipsFilename, int32_t archiveFileIndex); }; diff --git a/Core/UnifLoader.h b/Core/UnifLoader.h index 0f80f897..3df5ee33 100644 --- a/Core/UnifLoader.h +++ b/Core/UnifLoader.h @@ -57,7 +57,7 @@ private: { "Ghostbusters63in1", MapperFactory::UnknownBoard }, { "H2288", 123 }, { "HKROM", MapperFactory::UnknownBoard }, - { "KOF97", MapperFactory::UnknownBoard }, + { "KOF97", MapperFactory::UnifKof97 }, { "KONAMI-QTAI", MapperFactory::UnknownBoard }, { "KS7010", MapperFactory::UnknownBoard }, { "KS7012", MapperFactory::UnknownBoard },