diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 214615da..86ecabe9 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -424,6 +424,8 @@ + + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 98243acc..e2013650 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -748,6 +748,12 @@ Nes\Mappers\Kaiser + + Nes\Mappers + + + Nes\Mappers + diff --git a/Core/Henggedianzi177.h b/Core/Henggedianzi177.h new file mode 100644 index 00000000..ffedd7a5 --- /dev/null +++ b/Core/Henggedianzi177.h @@ -0,0 +1,24 @@ +#pragma once +#include "stdafx.h" +#include "BaseMapper.h" + +class Henggedianzi177 : public BaseMapper +{ +protected: + virtual uint16_t GetPRGPageSize() { return 0x8000; } + virtual uint16_t GetCHRPageSize() { return 0x2000; } + virtual uint16_t RegisterStartAddress() { return 0x8000; } + virtual uint16_t RegisterEndAddress() { return 0xFFFF; } + + void InitMapper() + { + SelectPRGPage(0, 0); + SelectCHRPage(0, 0); + } + + void WriteRegister(uint16_t addr, uint8_t value) + { + SelectPRGPage(0, value); + SetMirroringType(value & 0x20 ? MirroringType::Horizontal : MirroringType::Vertical); + } +}; \ No newline at end of file diff --git a/Core/Henggedianzi179.h b/Core/Henggedianzi179.h new file mode 100644 index 00000000..807336d0 --- /dev/null +++ b/Core/Henggedianzi179.h @@ -0,0 +1,28 @@ +#pragma once +#include "stdafx.h" +#include "BaseMapper.h" + +class Henggedianzi179 : public BaseMapper +{ +protected: + virtual uint16_t GetPRGPageSize() { return 0x8000; } + virtual uint16_t GetCHRPageSize() { return 0x2000; } + virtual uint16_t RegisterStartAddress() { return 0x8000; } + virtual uint16_t RegisterEndAddress() { return 0xFFFF; } + + void InitMapper() + { + AddRegisterRange(0x5000, 0x5FFF, MemoryOperation::Write); + SelectPRGPage(0, 0); + SelectCHRPage(0, 0); + } + + void WriteRegister(uint16_t addr, uint8_t value) + { + if(addr >= 0x8000) { + SetMirroringType(value & 0x01 ? MirroringType::Horizontal : MirroringType::Vertical); + } else { + SelectPRGPage(0, value >> 1); + } + } +}; \ No newline at end of file diff --git a/Core/MapperFactory.cpp b/Core/MapperFactory.cpp index 663b233f..3a14273b 100644 --- a/Core/MapperFactory.cpp +++ b/Core/MapperFactory.cpp @@ -18,6 +18,8 @@ #include "FDS.h" #include "FrontFareast.h" #include "GxRom.h" +#include "Henggedianzi177.h" +#include "Henggedianzi179.h" #include "IremG101.h" #include "IremH3001.h" #include "IremLrog017.h" @@ -140,7 +142,7 @@ Supported mappers: (... denotes bad mappers) | | | | |132|133| | | |137|138|139|140|141|142|143| |144|145|146|147|148|149|150|151|152|153|154|155|156|157| |159| | | | |163|164| | | | | | |171|172|173| |175| -|176| | | |180| |182| |184|185| | | |189| |191| +|176|177| |179|180| |182| |184|185| | | |189| |191| |192|193|194|195| | | | |200|201|202|203| |205|206|207| | | |210| | | | | | | |218| | | | | | | |225|226|227|228| |230|231|232| | | | | | | | @@ -282,6 +284,8 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData) case 173: return new Txc22211C(); case 175: return new Kaiser7022(); case 176: return new Waixing176(); + case 177: return new Henggedianzi177(); + case 179: return new Henggedianzi179(); case 180: return new UnRom_180(); case 182: return new MMC3_182(); case 184: return new Sunsoft184();