UNIF UNL-EDU2000 board support

This commit is contained in:
Souryo 2016-11-06 12:25:54 -05:00
parent 0918fe7bb3
commit a56af21564
6 changed files with 52 additions and 1 deletions

View File

@ -424,6 +424,7 @@
<ClInclude Include="DebugState.h" />
<ClInclude Include="DefaultVideoFilter.h" />
<ClInclude Include="DreamTech01.h" />
<ClInclude Include="Edu2000.h" />
<ClInclude Include="ExpressionEvaluator.h" />
<ClInclude Include="FDS.h" />
<ClInclude Include="FdsAudio.h" />

View File

@ -973,6 +973,9 @@
<ClInclude Include="DreamTech01.h">
<Filter>Nes\Mappers\Unif</Filter>
</ClInclude>
<ClInclude Include="Edu2000.h">
<Filter>Nes\Mappers\Unif</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

43
Core/Edu2000.h Normal file
View File

@ -0,0 +1,43 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class Edu2000 : public BaseMapper
{
private:
uint8_t _reg;
protected:
uint16_t GetPRGPageSize() { return 0x2000; }
uint16_t GetCHRPageSize() { return 0x2000; }
uint32_t GetWorkRamSize() { return 0x8000; }
uint32_t GetWorkRamPageSize() { return 0x2000; }
void InitMapper() override
{
_reg = 0;
UpdatePrg();
SelectCHRPage(0, 0);
}
void StreamState(bool saving) override
{
BaseMapper::StreamState(saving);
Stream(_reg);
if(!saving) {
UpdatePrg();
}
}
void UpdatePrg()
{
SelectPrgPage4x(0, (_reg & 0x1F) << 2);
SetCpuMemoryMapping(0x6000, 0x7FFF, (_reg >> 6) & 0x03, PrgMemoryType::WorkRam);
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
_reg = value;
UpdatePrg();
}
};

View File

@ -22,6 +22,7 @@
#include "ColorDreams46.h"
#include "DaouInfosys.h"
#include "DreamTech01.h"
#include "Edu2000.h"
#include "FDS.h"
#include "FrontFareast.h"
#include "GxRom.h"
@ -223,6 +224,7 @@ const uint16_t MapperFactory::NsfMapperID;
const uint16_t MapperFactory::UnknownBoard;
const uint16_t MapperFactory::UnifCoolboy;
const uint16_t MapperFactory::UnifDreamTech01;
const uint16_t MapperFactory::UnifEdu2000;
const uint16_t MapperFactory::UnifMalee;
const uint16_t MapperFactory::UnifStreetHeroes;
const uint16_t MapperFactory::UnifSmb2j;
@ -456,6 +458,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case MapperFactory::UnifCoolboy: return new MMC3_Coolboy();
case MapperFactory::UnifDreamTech01: return new DreamTech01();
case MapperFactory::UnifEdu2000: return new Edu2000();
case MapperFactory::UnifMalee: return new Malee();
case MapperFactory::UnifSmb2j: return new Smb2j();
case MapperFactory::UnifStreetHeroes: return new MMC3_StreetHeroes();

View File

@ -18,6 +18,7 @@ class MapperFactory
static const uint16_t UnifMalee = 65529;
static const uint16_t UnifStreetHeroes = 65528;
static const uint16_t UnifDreamTech01 = 65527;
static const uint16_t UnifEdu2000 = 65526;
static shared_ptr<BaseMapper> InitializeFromFile(string romFilename, stringstream *filestream, string ipsFilename, int32_t archiveFileIndex);
};

View File

@ -42,7 +42,7 @@ private:
{ "DANCE", MapperFactory::UnknownBoard },
{ "DANCE2000", MapperFactory::UnknownBoard },
{ "DREAMTECH01", MapperFactory::UnifDreamTech01 },
{ "EDU2000", MapperFactory::UnknownBoard },
{ "EDU2000", MapperFactory::UnifEdu2000 },
{ "EKROM", 5 },
{ "ELROM", 5 },
{ "ETROM", 5 },