Unverified Commit d5fb92d3 authored by Ignacio Sanchez Gines's avatar Ignacio Sanchez Gines
Browse files

Add support for Janggun mapper. Fix #46

parent 3efb9b92
......@@ -34,7 +34,7 @@ Please, consider [sponsoring](https://github.com/sponsors/drhelius) and followin
## Features
- Accurate Z80 core, including undocumented opcodes and behavior like R and [MEMPTR](https://gist.github.com/drhelius/8497817) registers.
- Supported cartridges: ROM, ROM + RAM, SEGA, Codemasters, Korean, MSX, SG-1000.
- Supported cartridges: ROM, ROM + RAM, SEGA, Codemasters, Korean, MSX + Nemesis, Janggun, SG-1000.
- Automatic region detection: NTSC-JAP, NTSC-USA, PAL-EUR.
- Accurate VDP emulation including timing and Master System 2 only 224 video mode support.
- Internal database for rom detection.
......
......@@ -17,7 +17,7 @@ SOURCES = $(EMULATOR_DESKTOP_SHARED_SRC)/main.cpp $(EMULATOR_DESKTOP_SHARED_SRC)
SOURCES += $(IMGUI_SRC)/imgui_impl_sdl.cpp $(IMGUI_SRC)/imgui_impl_opengl2.cpp $(IMGUI_SRC)/imgui.cpp $(IMGUI_SRC)/imgui_demo.cpp $(IMGUI_SRC)/imgui_draw.cpp $(IMGUI_SRC)/imgui_widgets.cpp $(IMGUI_FILEBROWSER_SRC)/ImGuiFileBrowser.cpp
SOURCES += $(EMULATOR_SRC)/Audio.cpp $(EMULATOR_SRC)/Cartridge.cpp $(EMULATOR_SRC)/CodemastersMemoryRule.cpp $(EMULATOR_SRC)/GameGearIOPorts.cpp $(EMULATOR_SRC)/GearsystemCore.cpp $(EMULATOR_SRC)/Input.cpp $(EMULATOR_SRC)/KoreanMemoryRule.cpp $(EMULATOR_SRC)/Memory.cpp $(EMULATOR_SRC)/MemoryRule.cpp $(EMULATOR_SRC)/MSXMemoryRule.cpp $(EMULATOR_SRC)/opcodes.cpp $(EMULATOR_SRC)/opcodes_cb.cpp $(EMULATOR_SRC)/opcodes_ed.cpp $(EMULATOR_SRC)/Processor.cpp $(EMULATOR_SRC)/RomOnlyMemoryRule.cpp $(EMULATOR_SRC)/SegaMemoryRule.cpp $(EMULATOR_SRC)/SG1000MemoryRule.cpp $(EMULATOR_SRC)/SmsIOPorts.cpp $(EMULATOR_SRC)/Video.cpp $(EMULATOR_SRC)/BootromMemoryRule.cpp
SOURCES += $(EMULATOR_SRC)/Audio.cpp $(EMULATOR_SRC)/Cartridge.cpp $(EMULATOR_SRC)/CodemastersMemoryRule.cpp $(EMULATOR_SRC)/GameGearIOPorts.cpp $(EMULATOR_SRC)/GearsystemCore.cpp $(EMULATOR_SRC)/Input.cpp $(EMULATOR_SRC)/KoreanMemoryRule.cpp $(EMULATOR_SRC)/Memory.cpp $(EMULATOR_SRC)/MemoryRule.cpp $(EMULATOR_SRC)/MSXMemoryRule.cpp $(EMULATOR_SRC)/opcodes.cpp $(EMULATOR_SRC)/opcodes_cb.cpp $(EMULATOR_SRC)/opcodes_ed.cpp $(EMULATOR_SRC)/Processor.cpp $(EMULATOR_SRC)/RomOnlyMemoryRule.cpp $(EMULATOR_SRC)/SegaMemoryRule.cpp $(EMULATOR_SRC)/SG1000MemoryRule.cpp $(EMULATOR_SRC)/SmsIOPorts.cpp $(EMULATOR_SRC)/Video.cpp $(EMULATOR_SRC)/BootromMemoryRule.cpp $(EMULATOR_SRC)/JanggunMemoryRule.cpp
SOURCES += $(EMULATOR_AUDIO_SRC)/Blip_Buffer.cpp $(EMULATOR_AUDIO_SRC)/Effects_Buffer.cpp $(EMULATOR_AUDIO_SRC)/Sms_Apu.cpp $(EMULATOR_AUDIO_SRC)/Multi_Buffer.cpp
......
......@@ -361,7 +361,7 @@ static void main_menu(void)
if (ImGui::BeginMenu("Mapper"))
{
ImGui::PushItemWidth(130.0f);
ImGui::Combo("##emu_mapper", &config_emulator.mapper, "Auto\0ROM Only\0SEGA\0Codemasters\0Korean\0SG-1000\0MSX\0\0");
ImGui::Combo("##emu_mapper", &config_emulator.mapper, "Auto\0ROM Only\0SEGA\0Codemasters\0Korean\0SG-1000\0MSX\0Janggun\0\0");
ImGui::PopItemWidth();
ImGui::EndMenu();
}
......@@ -1361,6 +1361,8 @@ static Cartridge::CartridgeTypes get_mapper(int index)
return Cartridge::CartridgeSG1000Mapper;
case 6:
return Cartridge::CartridgeMSXMapper;
case 7:
return Cartridge::CartridgeJanggunMapper;
default:
return Cartridge::CartridgeNotSupported;
}
......
......@@ -15,6 +15,7 @@ SOURCES_CXX := $(CORE_DIR)/libretro.cpp \
$(SOURCE_DIR)/KoreanMemoryRule.cpp \
$(SOURCE_DIR)/MSXMemoryRule.cpp \
$(SOURCE_DIR)/SG1000MemoryRule.cpp \
$(SOURCE_DIR)/JanggunMemoryRule.cpp \
$(SOURCE_DIR)/BootromMemoryRule.cpp \
$(SOURCE_DIR)/SmsIOPorts.cpp \
$(SOURCE_DIR)/opcodes.cpp \
......
......@@ -69,7 +69,7 @@ static void fallback_log(enum retro_log_level level, const char *fmt, ...)
static const struct retro_variable vars[] = {
{ "gearsystem_system", "System (restart); Auto|Master System / Mark III|Game Gear|SG-1000 / Multivision" },
{ "gearsystem_region", "Region (restart); Auto|Master System Japan|Master System Export|Game Gear Japan|Game Gear Export|Game Gear International" },
{ "gearsystem_mapper", "Mapper (restart); Auto|ROM|SEGA|Codemasters|Korean|SG-1000" },
{ "gearsystem_mapper", "Mapper (restart); Auto|ROM|SEGA|Codemasters|Korean|MSX|Janggun|SG-1000" },
{ "gearsystem_timing", "Refresh Rate (restart); Auto|NTSC (60 Hz)|PAL (50 Hz)" },
{ "gearsystem_bios_sms", "Master System BIOS (restart); Disabled|Enabled" },
{ "gearsystem_bios_gg", "Game Gear BIOS (restart); Disabled|Enabled" },
......@@ -359,6 +359,10 @@ static void check_variables(void)
config.type = Cartridge::CartridgeKoreanMapper;
else if (strcmp(var.value, "SG-1000") == 0)
config.type = Cartridge::CartridgeSG1000Mapper;
else if (strcmp(var.value, "MSX") == 0)
config.type = Cartridge::CartridgeMSXMapper;
else if (strcmp(var.value, "Janggun") == 0)
config.type = Cartridge::CartridgeJanggunMapper;
else
config.type = Cartridge::CartridgeNotSupported;
}
......
OBJS=$(GEARSYSTEM_RPI_SRC)/main.o $(GEARSYSTEM_SRC)/Audio.o $(GEARSYSTEM_SRC)/GearsystemCore.o $(GEARSYSTEM_SRC)/audio/Blip_Buffer.o $(GEARSYSTEM_SRC)/audio/Multi_Buffer.o $(GEARSYSTEM_SRC)/audio/Effects_Buffer.o $(GEARSYSTEM_SRC)/audio/Sms_Apu.o $(GEARSYSTEM_SRC)/MemoryRule.o $(GEARSYSTEM_SRC)/Input.o $(GEARSYSTEM_SRC)/Processor.o $(GEARSYSTEM_SRC)/Video.o $(GEARSYSTEM_SRC)/Memory.o $(GEARSYSTEM_SRC)/Cartridge.o $(GEARSYSTEM_SRC)/CodemastersMemoryRule.o $(GEARSYSTEM_SRC)/GameGearIOPorts.o $(GEARSYSTEM_AUDIO_SRC)/Sound_Queue.o $(GEARSYSTEM_SRC)/opcodes.o $(GEARSYSTEM_SRC)/opcodes_cb.o $(GEARSYSTEM_SRC)/opcodes_ed.o $(GEARSYSTEM_SRC)/RomOnlyMemoryRule.o $(GEARSYSTEM_SRC)/SegaMemoryRule.o $(GEARSYSTEM_SRC)/SG1000MemoryRule.o $(GEARSYSTEM_SRC)/KoreanMemoryRule.o $(GEARSYSTEM_SRC)/MSXMemoryRule.o $(GEARSYSTEM_SRC)/SmsIOPorts.o $(GEARSYSTEM_SRC)/BootromMemoryRule.o
OBJS=$(GEARSYSTEM_RPI_SRC)/main.o $(GEARSYSTEM_SRC)/Audio.o $(GEARSYSTEM_SRC)/GearsystemCore.o $(GEARSYSTEM_SRC)/audio/Blip_Buffer.o $(GEARSYSTEM_SRC)/audio/Multi_Buffer.o $(GEARSYSTEM_SRC)/audio/Effects_Buffer.o $(GEARSYSTEM_SRC)/audio/Sms_Apu.o $(GEARSYSTEM_SRC)/MemoryRule.o $(GEARSYSTEM_SRC)/Input.o $(GEARSYSTEM_SRC)/Processor.o $(GEARSYSTEM_SRC)/Video.o $(GEARSYSTEM_SRC)/Memory.o $(GEARSYSTEM_SRC)/Cartridge.o $(GEARSYSTEM_SRC)/CodemastersMemoryRule.o $(GEARSYSTEM_SRC)/GameGearIOPorts.o $(GEARSYSTEM_AUDIO_SRC)/Sound_Queue.o $(GEARSYSTEM_SRC)/opcodes.o $(GEARSYSTEM_SRC)/opcodes_cb.o $(GEARSYSTEM_SRC)/opcodes_ed.o $(GEARSYSTEM_SRC)/RomOnlyMemoryRule.o $(GEARSYSTEM_SRC)/SegaMemoryRule.o $(GEARSYSTEM_SRC)/SG1000MemoryRule.o $(GEARSYSTEM_SRC)/KoreanMemoryRule.o $(GEARSYSTEM_SRC)/MSXMemoryRule.o $(GEARSYSTEM_SRC)/SmsIOPorts.o $(GEARSYSTEM_SRC)/BootromMemoryRule.o $(GEARSYSTEM_SRC)/JanggunMemoryRule.o
BIN=gearsystem
......@@ -22,6 +22,7 @@
<ClCompile Include="..\..\src\GameGearIOPorts.cpp" />
<ClCompile Include="..\..\src\GearsystemCore.cpp" />
<ClCompile Include="..\..\src\Input.cpp" />
<ClCompile Include="..\..\src\JanggunMemoryRule.cpp" />
<ClCompile Include="..\..\src\KoreanMemoryRule.cpp" />
<ClCompile Include="..\..\src\Memory.cpp" />
<ClCompile Include="..\..\src\MemoryRule.cpp" />
......@@ -73,6 +74,7 @@
<ClInclude Include="..\..\src\GearsystemCore.h" />
<ClInclude Include="..\..\src\Input.h" />
<ClInclude Include="..\..\src\IOPorts.h" />
<ClInclude Include="..\..\src\JanggunMemoryRule.h" />
<ClInclude Include="..\..\src\KoreanMemoryRule.h" />
<ClInclude Include="..\..\src\Memory.h" />
<ClInclude Include="..\..\src\MemoryRule.h" />
......
......@@ -93,6 +93,9 @@
<ClCompile Include="..\..\src\Input.cpp">
<Filter>core</Filter>
</ClCompile>
<ClCompile Include="..\..\src\JanggunMemoryRule.cpp">
<Filter>core</Filter>
</ClCompile>
<ClCompile Include="..\..\src\KoreanMemoryRule.cpp">
<Filter>core</Filter>
</ClCompile>
......@@ -239,6 +242,9 @@
<ClInclude Include="..\..\src\IOPorts.h">
<Filter>core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\JanggunMemoryRule.h">
<Filter>core</Filter>
</ClInclude>
<ClInclude Include="..\..\src\KoreanMemoryRule.h">
<Filter>core</Filter>
</ClInclude>
......
......@@ -177,6 +177,14 @@ void Cartridge::ForceConfig(Cartridge::ForceConfiguration config)
m_Type = config.type;
Log("Forcing Mapper: Korean");
break;
case Cartridge::CartridgeMSXMapper:
m_Type = config.type;
Log("Forcing Mapper: MSX");
break;
case Cartridge::CartridgeJanggunMapper:
m_Type = config.type;
Log("Forcing Mapper: Janggun");
break;
default:
break;
}
......@@ -536,6 +544,12 @@ bool Cartridge::GatherMetadata(u32 crc)
case Cartridge::CartridgeKoreanMapper:
Log("Korean mapper found");
break;
case Cartridge::CartridgeMSXMapper:
Log("MSX mapper found");
break;
case Cartridge::CartridgeJanggunMapper:
Log("Janggun mapper found");
break;
case Cartridge::CartridgeNotSupported:
Log("Cartridge not supported!!");
break;
......@@ -587,6 +601,10 @@ void Cartridge::GetInfoFromDB(u32 crc)
{
m_Type = Cartridge::CartridgeMSXMapper;
}
else if (kGameDatabase[i].mapper == GS_DB_JANGGUN_MAPPER)
{
m_Type = Cartridge::CartridgeJanggunMapper;
}
if (kGameDatabase[i].sms_mode)
{
......
......@@ -34,6 +34,7 @@ public:
CartridgeSG1000Mapper,
CartridgeKoreanMapper,
CartridgeMSXMapper,
CartridgeJanggunMapper,
CartridgeNotSupported
};
......
......@@ -30,6 +30,7 @@
#include "RomOnlyMemoryRule.h"
#include "KoreanMemoryRule.h"
#include "MSXMemoryRule.h"
#include "JanggunMemoryRule.h"
#include "SG1000MemoryRule.h"
#include "SmsIOPorts.h"
#include "GameGearIOPorts.h"
......@@ -49,6 +50,7 @@ GearsystemCore::GearsystemCore()
InitPointer(m_pRomOnlyMemoryRule);
InitPointer(m_pKoreanMemoryRule);
InitPointer(m_pMSXMemoryRule);
InitPointer(m_pJanggunMemoryRule);
InitPointer(m_pSmsIOPorts);
InitPointer(m_pGameGearIOPorts);
InitPointer(m_pBootromMemoryRule);
......@@ -68,6 +70,7 @@ GearsystemCore::~GearsystemCore()
SafeDelete(m_pSegaMemoryRule);
SafeDelete(m_pKoreanMemoryRule);
SafeDelete(m_pMSXMemoryRule);
SafeDelete(m_pJanggunMemoryRule);
SafeDelete(m_pCartridge);
SafeDelete(m_pInput);
SafeDelete(m_pVideo);
......@@ -838,6 +841,7 @@ void GearsystemCore::InitMemoryRules()
m_pRomOnlyMemoryRule = new RomOnlyMemoryRule(m_pMemory, m_pCartridge, m_pInput);
m_pKoreanMemoryRule = new KoreanMemoryRule(m_pMemory, m_pCartridge, m_pInput);
m_pMSXMemoryRule = new MSXMemoryRule(m_pMemory, m_pCartridge, m_pInput);
m_pJanggunMemoryRule = new JanggunMemoryRule(m_pMemory, m_pCartridge, m_pInput);
m_pBootromMemoryRule = new BootromMemoryRule(m_pMemory, m_pCartridge, m_pInput);
m_pMemory->SetCurrentRule(m_pRomOnlyMemoryRule);
......@@ -871,6 +875,9 @@ bool GearsystemCore::AddMemoryRules()
case Cartridge::CartridgeMSXMapper:
m_pMemory->SetCurrentRule(m_pMSXMemoryRule);
break;
case Cartridge::CartridgeJanggunMapper:
m_pMemory->SetCurrentRule(m_pJanggunMemoryRule);
break;
case Cartridge::CartridgeNotSupported:
notSupported = true;
break;
......@@ -905,6 +912,7 @@ void GearsystemCore::Reset()
m_pRomOnlyMemoryRule->Reset();
m_pKoreanMemoryRule->Reset();
m_pMSXMemoryRule->Reset();
m_pJanggunMemoryRule->Reset();
m_pBootromMemoryRule->Reset();
m_pGameGearIOPorts->Reset();
m_pSmsIOPorts->Reset();
......
......@@ -34,6 +34,7 @@ class RomOnlyMemoryRule;
class SG1000MemoryRule;
class KoreanMemoryRule;
class MSXMemoryRule;
class JanggunMemoryRule;
class MemoryRule;
class SmsIOPorts;
class GameGearIOPorts;
......@@ -109,6 +110,7 @@ private:
RomOnlyMemoryRule* m_pRomOnlyMemoryRule;
KoreanMemoryRule* m_pKoreanMemoryRule;
MSXMemoryRule* m_pMSXMemoryRule;
JanggunMemoryRule* m_pJanggunMemoryRule;
SmsIOPorts* m_pSmsIOPorts;
GameGearIOPorts* m_pGameGearIOPorts;
BootromMemoryRule* m_pBootromMemoryRule;
......
/*
* Gearsystem - Sega Master System / Game Gear Emulator
* Copyright (C) 2013 Ignacio Sanchez
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/
*
*/
#include "JanggunMemoryRule.h"
#include "Memory.h"
#include "Cartridge.h"
#include "Input.h"
JanggunMemoryRule::JanggunMemoryRule(Memory* pMemory, Cartridge* pCartridge, Input* pInput) : MemoryRule(pMemory, pCartridge, pInput)
{
Reset();
}
JanggunMemoryRule::~JanggunMemoryRule()
{
}
u8 JanggunMemoryRule::PerformRead(u16 address)
{
u8 ret = 0;
if (address < 0x4000)
{
// First 16KB (fixed)
u8* pROM = m_pCartridge->GetROM();
ret = pROM[address];
}
else if (address < 0x6000)
{
// ROM slot 0
u8* pROM = m_pCartridge->GetROM();
ret = pROM[(address & 0x1FFF) + m_iMapperSlotAddress[0]];
}
else if (address < 0x8000)
{
// ROM slot 1
u8* pROM = m_pCartridge->GetROM();
ret = pROM[(address & 0x1FFF) + m_iMapperSlotAddress[1]];
}
else if (address < 0xA000)
{
// ROM slot 2
u8* pROM = m_pCartridge->GetROM();
ret = pROM[(address & 0x1FFF) + m_iMapperSlotAddress[2]];
}
else if (address < 0xC000)
{
// ROM slot 3
u8* pROM = m_pCartridge->GetROM();
ret = pROM[(address & 0x1FFF) + m_iMapperSlotAddress[3]];
}
else
{
// RAM + RAM mirror
ret = m_pMemory->Retrieve(address);
}
if (m_bReverseFlags[(address >> 14) & 0x03])
{
ret = ReverseBits(ret);
}
return ret;
}
void JanggunMemoryRule::PerformWrite(u16 address, u8 value)
{
switch (address)
{
case 0x4000:
{
// page 0
m_iMapperSlot[0] = value & 0x3F;
m_iMapperSlotAddress[0] = m_iMapperSlot[0] * 0x2000;
break;
}
case 0x6000:
{
// page 1
m_iMapperSlot[1] = value & 0x3F;
m_iMapperSlotAddress[1] = m_iMapperSlot[1] * 0x2000;
break;
}
case 0x8000:
{
// page 2
m_iMapperSlot[2] = value & 0x3F;
m_iMapperSlotAddress[2] = m_iMapperSlot[2] * 0x2000;
break;
}
case 0xA000:
{
// page 3
m_iMapperSlot[3] = value & 0x3F;
m_iMapperSlotAddress[3] = m_iMapperSlot[3] * 0x2000;
break;
}
default:
{
if (address >= 0xC000 && address < 0xE000)
{
m_pMemory->Load(address, value);
m_pMemory->Load(address + 0x2000, value);
}
else if (address >= 0xE000)
{
m_pMemory->Load(address, value);
m_pMemory->Load(address - 0x2000, value);
switch (address)
{
case 0xFFFE:
{
m_iMapperSlot[0] = (value & 0x3F) << 1;
m_iMapperSlot[1] = ((value & 0x3F) + 1) << 1;
m_iMapperSlotAddress[0] = m_iMapperSlot[0] * 0x2000;
m_iMapperSlotAddress[1] = m_iMapperSlot[1] * 0x2000;
m_bReverseFlags[1] = IsSetBit(value, 6);
break;
}
case 0xFFFF:
{
m_iMapperSlot[2] = (value & 0x3F) << 1;
m_iMapperSlot[3] = ((value & 0x3F) + 1) << 1;
m_iMapperSlotAddress[2] = m_iMapperSlot[2] * 0x2000;
m_iMapperSlotAddress[3] = m_iMapperSlot[3] * 0x2000;
m_bReverseFlags[2] = IsSetBit(value, 6);
break;
}
}
}
}
}
}
void JanggunMemoryRule::Reset()
{
for (int i = 0; i < 4; i++)
{
m_iMapperSlot[i] = i;
m_iMapperSlotAddress[i] = i * 0x4000;
m_bReverseFlags[i] = false;
}
}
u8* JanggunMemoryRule::GetPage(int index)
{
switch (index)
{
case 0:
case 1:
case 2:
case 3:
return m_pCartridge->GetROM() + m_iMapperSlotAddress[index];
default:
return NULL;
}
}
int JanggunMemoryRule::GetBank(int index)
{
switch (index)
{
case 0:
case 1:
case 2:
case 3:
return m_iMapperSlot[index];
default:
return 0;
}
}
void JanggunMemoryRule::SaveState(std::ostream& stream)
{
stream.write(reinterpret_cast<const char*> (m_iMapperSlot), sizeof(m_iMapperSlot));
stream.write(reinterpret_cast<const char*> (m_iMapperSlotAddress), sizeof(m_iMapperSlotAddress));
}
void JanggunMemoryRule::LoadState(std::istream& stream)
{
stream.read(reinterpret_cast<char*> (m_iMapperSlot), sizeof(m_iMapperSlot));
stream.read(reinterpret_cast<char*> (m_iMapperSlotAddress), sizeof(m_iMapperSlotAddress));
}
/*
* Gearsystem - Sega Master System / Game Gear Emulator
* Copyright (C) 2013 Ignacio Sanchez
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/
*
*/
#ifndef JANGGUNMEMORYRULE_H
#define JANGGUNMEMORYRULE_H
#include "MemoryRule.h"
class JanggunMemoryRule : public MemoryRule
{
public:
JanggunMemoryRule(Memory* pMemory, Cartridge* pCartridge, Input* pInput);
virtual ~JanggunMemoryRule();
virtual u8 PerformRead(u16 address);
virtual void PerformWrite(u16 address, u8 value);
virtual void Reset();
virtual u8* GetPage(int index);
virtual int GetBank(int index);
virtual void SaveState(std::ostream& stream);
virtual void LoadState(std::istream& stream);
private:
int m_iMapperSlot[4];
int m_iMapperSlotAddress[4];
bool m_bReverseFlags[4];
};
#endif /* JANGGUNMEMORYRULE_H */
......@@ -209,6 +209,15 @@ inline u8 FlipBit(const u8 value, const u8 bit)
return value ^ (0x01 << bit);
}
inline u8 ReverseBits(const u8 value)
{
u8 ret = value;
ret = (ret & 0xF0) >> 4 | (ret & 0x0F) << 4;
ret = (ret & 0xCC) >> 2 | (ret & 0x33) << 2;
ret = (ret & 0xAA) >> 1 | (ret & 0x55) << 1;
return ret;
}
inline int AsHex(const char c)
{
return c >= 'A' ? c - 'A' + 0xA : c - '0';
......
......@@ -25,6 +25,7 @@
#define GS_DB_SG1000_MAPPER 2
#define GS_DB_MSX_MAPPER 3
#define GS_DB_KOREAN_MAPPER 4
#define GS_DB_JANGGUN_MAPPER 5
struct GS_GameDBEntry
{
......@@ -126,6 +127,9 @@ const GS_GameDBEntry kGameDatabase[] =
{0xE316C06D, GS_DB_MSX_MAPPER, false, false, false, "Nemesis (KR)"},
{0x0A77FA5E, GS_DB_MSX_MAPPER, false, false, false, "Nemesis 2 (KR)"},
// JANGGUN MAPPER
//{0x192949D5, GS_DB_JANGGUN_MAPPER, false, false, false, "Janggun-ui Adeul (KR)"},
// SG-1000 with RAM without battery
{0x092F29D6, GS_DB_SG1000_MAPPER, false, false, true, "Castle, The (J)"},
{0x2E366CCF, GS_DB_SG1000_MAPPER, false, false, true, "Castle, The (T)"},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment