Genesis ROM header parsing
and other stuff thats only committed because svn isn't decentralized!
This commit is contained in:
parent
64cac4c1a2
commit
adee5befa5
|
@ -269,6 +269,8 @@
|
||||||
<Compile Include="Consoles\PC Engine\MemoryMap.Populous.cs" />
|
<Compile Include="Consoles\PC Engine\MemoryMap.Populous.cs" />
|
||||||
<Compile Include="Consoles\PC Engine\ScsiCDBus.cs" />
|
<Compile Include="Consoles\PC Engine\ScsiCDBus.cs" />
|
||||||
<Compile Include="Consoles\PC Engine\TurboCD.cs" />
|
<Compile Include="Consoles\PC Engine\TurboCD.cs" />
|
||||||
|
<Compile Include="Consoles\Sega\Genesis\Cart\RomHeader.cs" />
|
||||||
|
<Compile Include="Consoles\Sega\Genesis\Cart\SaveRAM.cs" />
|
||||||
<Compile Include="Consoles\Sega\Genesis\Input.cs" />
|
<Compile Include="Consoles\Sega\Genesis\Input.cs" />
|
||||||
<Compile Include="Consoles\Sega\SMS\MemoryMap.CodeMasters.cs" />
|
<Compile Include="Consoles\Sega\SMS\MemoryMap.CodeMasters.cs" />
|
||||||
<Compile Include="Consoles\Sega\SMS\MemoryMap.Sega.cs" />
|
<Compile Include="Consoles\Sega\SMS\MemoryMap.Sega.cs" />
|
||||||
|
|
|
@ -209,14 +209,12 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
|
||||||
// it in the least intrusive and most honest way we can.
|
// it in the least intrusive and most honest way we can.
|
||||||
|
|
||||||
if (game["HBlankPeriod"])
|
if (game["HBlankPeriod"])
|
||||||
VDC1.HBlankCycles = int.Parse(game.OptionValue("HBlankPeriod"));
|
VDC1.HBlankCycles = game.GetIntValue("HBlankPeriod");
|
||||||
|
|
||||||
// This is also a hack. Proper multi-res/TV emulation will be a native-code core feature.
|
// This is also a hack. Proper multi-res/TV emulation will be a native-code core feature.
|
||||||
|
|
||||||
if (game["MultiResHack"])
|
if (game["MultiResHack"])
|
||||||
{
|
VDC1.MultiResHack = game.GetIntValue("MultiResHack");
|
||||||
VDC1.MultiResHack = int.Parse(game.OptionValue("MultiResHack"));
|
|
||||||
}
|
|
||||||
|
|
||||||
Cpu.ResetPC();
|
Cpu.ResetPC();
|
||||||
SetupMemoryDomains();
|
SetupMemoryDomains();
|
||||||
|
|
|
@ -130,6 +130,13 @@ namespace BizHawk.Emulation.Consoles.Sega
|
||||||
MainCPU.Reset();
|
MainCPU.Reset();
|
||||||
VDP.GetPC = () => MainCPU.PC;
|
VDP.GetPC = () => MainCPU.PC;
|
||||||
#endif
|
#endif
|
||||||
|
InitializeCartHardware(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitializeCartHardware(GameInfo game)
|
||||||
|
{
|
||||||
|
LogCartInfo();
|
||||||
|
InitializeSaveRam(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FrameAdvance(bool render)
|
public void FrameAdvance(bool render)
|
||||||
|
@ -260,22 +267,7 @@ namespace BizHawk.Emulation.Consoles.Sega
|
||||||
public bool DeterministicEmulation { get; set; }
|
public bool DeterministicEmulation { get; set; }
|
||||||
public string SystemId { get { return "GEN"; } }
|
public string SystemId { get { return "GEN"; } }
|
||||||
|
|
||||||
public byte[] ReadSaveRam
|
|
||||||
{
|
|
||||||
get { throw new NotImplementedException(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool SaveRamModified
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return false; // TODO implement
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SaveStateText(TextWriter writer)
|
public void SaveStateText(TextWriter writer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,9 +8,16 @@ namespace BizHawk.Emulation.Consoles.Sega
|
||||||
{
|
{
|
||||||
address &= 0x00FFFFFF;
|
address &= 0x00FFFFFF;
|
||||||
|
|
||||||
if (address < 0x400000)
|
if (address < 0x200000)
|
||||||
return (sbyte) RomData[address];
|
return (sbyte) RomData[address];
|
||||||
|
|
||||||
|
if (address < 0x400000)
|
||||||
|
{
|
||||||
|
if (SaveRamEnabled && address >= SaveRamStartOffset && address < SaveRamEndOffset)
|
||||||
|
return (sbyte) SaveRAM[address - SaveRamStartOffset];
|
||||||
|
return (sbyte)RomData[address];
|
||||||
|
}
|
||||||
|
|
||||||
if (address >= 0xE00000)
|
if (address >= 0xE00000)
|
||||||
return (sbyte) Ram[address & 0xFFFF];
|
return (sbyte) Ram[address & 0xFFFF];
|
||||||
|
|
||||||
|
@ -144,6 +151,13 @@ namespace BizHawk.Emulation.Consoles.Sega
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SaveRamEnabled && address >= SaveRamStartOffset && address < SaveRamEndOffset)
|
||||||
|
{
|
||||||
|
SaveRAM[address - SaveRamStartOffset] = (byte) value;
|
||||||
|
SaveRamModified = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Console.WriteLine("UNHANDLED WRITEB {0:X6}:{1:X2}", address, value);
|
Console.WriteLine("UNHANDLED WRITEB {0:X6}:{1:X2}", address, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace BizHawk
|
namespace BizHawk
|
||||||
{
|
{
|
||||||
|
@ -87,6 +88,16 @@ namespace BizHawk
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int GetIntValue(string option)
|
||||||
|
{
|
||||||
|
return int.Parse(Options[option]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetHexValue(string option)
|
||||||
|
{
|
||||||
|
return int.Parse(Options[option], NumberStyles.HexNumber);
|
||||||
|
}
|
||||||
|
|
||||||
public ICollection<string> GetOptions()
|
public ICollection<string> GetOptions()
|
||||||
{
|
{
|
||||||
return Options.Keys;
|
return Options.Keys;
|
||||||
|
|
Loading…
Reference in New Issue