Mapper 111 support (missing flashing support)
This commit is contained in:
parent
8b1235d86d
commit
0f894584aa
4 changed files with 75 additions and 4 deletions
65
Core/Cheapocabra.h
Normal file
65
Core/Cheapocabra.h
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
#pragma once
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "BaseMapper.h"
|
||||||
|
|
||||||
|
//Missing Flash rom support, and only tested via a test rom
|
||||||
|
class Cheapocabra : public BaseMapper
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
uint8_t _reg;
|
||||||
|
uint8_t* _extraNametables[4];
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual uint16_t GetPRGPageSize() override { return 0x8000; }
|
||||||
|
virtual uint16_t GetCHRPageSize() override { return 0x2000; }
|
||||||
|
virtual uint16_t RegisterStartAddress() override { return 0x5000; }
|
||||||
|
virtual uint16_t RegisterEndAddress() override { return 0x5FFF; }
|
||||||
|
virtual uint32_t GetChrRamSize() override { return 0x8000; }
|
||||||
|
|
||||||
|
void InitMapper() override
|
||||||
|
{
|
||||||
|
AddRegisterRange(0x7000, 0x7FFF, MemoryOperation::Write);
|
||||||
|
for(int i = 0; i < 4; i++) {
|
||||||
|
_extraNametables[i] = new uint8_t[0x400];
|
||||||
|
BaseMapper::InitializeRam(_extraNametables[i], 0x400);
|
||||||
|
AddNametable(4 + i, _extraNametables[i]);
|
||||||
|
}
|
||||||
|
_reg = 0;
|
||||||
|
UpdateState();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~Cheapocabra()
|
||||||
|
{
|
||||||
|
delete[] _extraNametables[0];
|
||||||
|
delete[] _extraNametables[1];
|
||||||
|
delete[] _extraNametables[2];
|
||||||
|
delete[] _extraNametables[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
void StreamState(bool saving) override
|
||||||
|
{
|
||||||
|
BaseMapper::StreamState(saving);
|
||||||
|
ArrayInfo<uint8_t> extraNametable0{ _extraNametables[0], 0x400 };
|
||||||
|
ArrayInfo<uint8_t> extraNametable1{ _extraNametables[1], 0x400 };
|
||||||
|
ArrayInfo<uint8_t> extraNametable2{ _extraNametables[2], 0x400 };
|
||||||
|
ArrayInfo<uint8_t> extraNametable3{ _extraNametables[3], 0x400 };
|
||||||
|
Stream(_reg, extraNametable0, extraNametable1, extraNametable2, extraNametable3);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateState()
|
||||||
|
{
|
||||||
|
SelectPRGPage(0, _reg & 0x0F);
|
||||||
|
SelectCHRPage(0, (_reg >> 4) & 0x01);
|
||||||
|
if(_reg & 0x20) {
|
||||||
|
SetNametables(4, 5, 6, 7);
|
||||||
|
} else {
|
||||||
|
SetNametables(0, 1, 2, 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||||
|
{
|
||||||
|
_reg = value;
|
||||||
|
UpdateState();
|
||||||
|
}
|
||||||
|
};
|
|
@ -440,6 +440,7 @@
|
||||||
<ClInclude Include="Bs5.h" />
|
<ClInclude Include="Bs5.h" />
|
||||||
<ClInclude Include="Caltron41.h" />
|
<ClInclude Include="Caltron41.h" />
|
||||||
<ClInclude Include="Cc21.h" />
|
<ClInclude Include="Cc21.h" />
|
||||||
|
<ClInclude Include="Cheapocabra.h" />
|
||||||
<ClInclude Include="CodeRunner.h" />
|
<ClInclude Include="CodeRunner.h" />
|
||||||
<ClInclude Include="ColorDreams46.h" />
|
<ClInclude Include="ColorDreams46.h" />
|
||||||
<ClInclude Include="CrossFeedFilter.h" />
|
<ClInclude Include="CrossFeedFilter.h" />
|
||||||
|
|
|
@ -1144,6 +1144,9 @@
|
||||||
<ClInclude Include="MovieManager.h">
|
<ClInclude Include="MovieManager.h">
|
||||||
<Filter>Movies</Filter>
|
<Filter>Movies</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="Cheapocabra.h">
|
||||||
|
<Filter>Nes\Mappers</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="stdafx.cpp">
|
<ClCompile Include="stdafx.cpp">
|
||||||
|
@ -1323,9 +1326,6 @@
|
||||||
<ClCompile Include="MemoryAccessCounter.cpp">
|
<ClCompile Include="MemoryAccessCounter.cpp">
|
||||||
<Filter>Debugger</Filter>
|
<Filter>Debugger</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Profiler.cpp">
|
|
||||||
<Filter>Misc</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="CrossFeedFilter.cpp">
|
<ClCompile Include="CrossFeedFilter.cpp">
|
||||||
<Filter>Nes\APU\Filters</Filter>
|
<Filter>Nes\APU\Filters</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -1350,5 +1350,8 @@
|
||||||
<ClCompile Include="MovieManager.cpp">
|
<ClCompile Include="MovieManager.cpp">
|
||||||
<Filter>Movies</Filter>
|
<Filter>Movies</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="Profiler.cpp">
|
||||||
|
<Filter>Debugger</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -32,6 +32,7 @@
|
||||||
#include "Bs5.h"
|
#include "Bs5.h"
|
||||||
#include "Caltron41.h"
|
#include "Caltron41.h"
|
||||||
#include "Cc21.h"
|
#include "Cc21.h"
|
||||||
|
#include "Cheapocabra.h"
|
||||||
#include "CNROM.h"
|
#include "CNROM.h"
|
||||||
#include "CpRom.h"
|
#include "CpRom.h"
|
||||||
#include "ColorDreams.h"
|
#include "ColorDreams.h"
|
||||||
|
@ -251,7 +252,7 @@ Supported mappers:
|
||||||
| 48| 49| 50| 51| 52| 53| 54|???| 56| 57| 58|===| 60| 61| 62| 63|
|
| 48| 49| 50| 51| 52| 53| 54|???| 56| 57| 58|===| 60| 61| 62| 63|
|
||||||
| 64| 65| 66| 67| 68| 69| 70| 71| 72| 73| 74| 75| 76| 77| 78| 79|
|
| 64| 65| 66| 67| 68| 69| 70| 71| 72| 73| 74| 75| 76| 77| 78| 79|
|
||||||
| 80|===| 82| 83|===| 85| 86| 87| 88| 89| 90| 91| 92| 93| 94| 95|
|
| 80|===| 82| 83|===| 85| 86| 87| 88| 89| 90| 91| 92| 93| 94| 95|
|
||||||
| 96| 97|===| 99|...|101|===|103|104|105|106|107|108|===|===|===|
|
| 96| 97|===| 99|...|101|===|103|104|105|106|107|108|===|===|111|
|
||||||
|112|113|114|115| |117|118|119|120|121|===|123|===|125|126|===|
|
|112|113|114|115| |117|118|119|120|121|===|123|===|125|126|===|
|
||||||
|===|===|===|===|132|133|134|===|136|137|138|139|140|141|142|143|
|
|===|===|===|===|132|133|134|===|136|137|138|139|140|141|142|143|
|
||||||
|144|145|146|147|148|149|150|151|152|153|154|155|156|157|???|159|
|
|144|145|146|147|148|149|150|151|152|153|154|155|156|157|???|159|
|
||||||
|
@ -374,6 +375,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
|
||||||
case 106: return new Mapper106();
|
case 106: return new Mapper106();
|
||||||
case 107: return new Mapper107();
|
case 107: return new Mapper107();
|
||||||
case 108: return new Mapper108();
|
case 108: return new Mapper108();
|
||||||
|
case 111: return new Cheapocabra();
|
||||||
case 112: return new Mapper112();
|
case 112: return new Mapper112();
|
||||||
case 113: return new Nina03_06(true);
|
case 113: return new Nina03_06(true);
|
||||||
case 114: return new MMC3_114();
|
case 114: return new MMC3_114();
|
||||||
|
|
Loading…
Add table
Reference in a new issue