-Made Executive ROM and Graphics ROM read-only. I still haven't made the memory map accessibility limited by the VBlank Period, but I'm assuming that should come way later.

-Initialized the memory devices with a tentative size that ignores the unofficial ranges.
-Masked addresses to match those sizes (That's my understanding of what the memory map needs to do based on other examples).
-Added the ICart interface.
-Started the Intellicart parser; got far enough to know that the files I'm working with are not Intellicarts. ^_^
This commit is contained in:
brandman211 2012-07-15 08:38:50 +00:00
parent bd1aaf7ff7
commit 4f9539b73c
5 changed files with 150 additions and 112 deletions

View File

@ -114,6 +114,7 @@
<Compile Include="Consoles\GB\Input.cs" /> <Compile Include="Consoles\GB\Input.cs" />
<Compile Include="Consoles\GB\MemoryMap.cs" /> <Compile Include="Consoles\GB\MemoryMap.cs" />
<Compile Include="Consoles\GB\GB.cs" /> <Compile Include="Consoles\GB\GB.cs" />
<Compile Include="Consoles\Intellivision\Intellicart.cs" />
<Compile Include="Consoles\Intellivision\Intellivision.cs" /> <Compile Include="Consoles\Intellivision\Intellivision.cs" />
<Compile Include="Consoles\Intellivision\MemoryMap.cs" /> <Compile Include="Consoles\Intellivision\MemoryMap.cs" />
<Compile Include="Consoles\Nintendo\NES\APU.cs" /> <Compile Include="Consoles\Nintendo\NES\APU.cs" />
@ -311,6 +312,7 @@
<Compile Include="Interfaces\Base Implementations\NullController.cs" /> <Compile Include="Interfaces\Base Implementations\NullController.cs" />
<Compile Include="Interfaces\Base Implementations\NullEmulator.cs" /> <Compile Include="Interfaces\Base Implementations\NullEmulator.cs" />
<Compile Include="Interfaces\CoreComms.cs" /> <Compile Include="Interfaces\CoreComms.cs" />
<Compile Include="Interfaces\ICart.cs" />
<Compile Include="Properties\svnrev.cs" /> <Compile Include="Properties\svnrev.cs" />
<Compile Include="QuickCollections.cs" /> <Compile Include="QuickCollections.cs" />
<Compile Include="Sound\CDAudio.cs" /> <Compile Include="Sound\CDAudio.cs" />

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Emulation.Consoles.Intellivision
{
public sealed partial class Intellivision : ICart
{
private ushort[] memory = new ushort[65536];
public void Parse()
{
// Check to see if the header is valid.
if (Rom[0] != 0xA8 || Rom[1] != (0xFF ^ Rom[2]))
throw new ArgumentException();
}
public ushort ReadMemory(ushort addr, out bool responded)
{
responded = false;
return 0;
}
public void WriteMemory(ushort addr, ushort value, out bool responded)
{
responded = false;
}
}
}

View File

@ -10,12 +10,13 @@ namespace BizHawk.Emulation.Consoles.Intellivision
byte[] Rom; byte[] Rom;
GameInfo Game; GameInfo Game;
CP1610 Cpu ; CP1610 Cpu;
public Intellivision(GameInfo game, byte[] rom) public Intellivision(GameInfo game, byte[] rom)
{ {
Rom = rom; Rom = rom;
Game = game; Game = game;
Parse();
Cpu = new CP1610(); Cpu = new CP1610();
Cpu.ReadMemory = ReadMemory; Cpu.ReadMemory = ReadMemory;

View File

@ -7,13 +7,13 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
public sealed partial class Intellivision public sealed partial class Intellivision
{ {
private ushort[] STIC_Registers; private ushort[] STIC_Registers = new ushort[64];
private ushort[] Scratchpad_RAM; private ushort[] Scratchpad_RAM = new ushort[240];
private ushort[] PSG_Registers; private ushort[] PSG_Registers = new ushort[16];
private ushort[] System_RAM; private ushort[] System_RAM = new ushort[352];
private ushort[] Executive_ROM; private ushort[] Executive_ROM = new ushort[4096];
private ushort[] Graphics_ROM; private ushort[] Graphics_ROM = new ushort[2048];
private ushort[] Graphics_RAM; private ushort[] Graphics_RAM = new ushort[512];
public ushort ReadMemory(ushort addr) public ushort ReadMemory(ushort addr)
{ {
@ -21,19 +21,19 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
case 0x0000: case 0x0000:
if (addr >= 0x0100 && addr <= 0x01EF) if (addr >= 0x0100 && addr <= 0x01EF)
return Scratchpad_RAM[addr]; return Scratchpad_RAM[addr & 0x00EF];
if (addr >= 0x01F0 && addr <= 0x01FF) if (addr >= 0x01F0 && addr <= 0x01FF)
return PSG_Registers[addr]; return PSG_Registers[addr & 0x000F];
if (addr >= 0x0200 && addr <= 0x035F) if (addr >= 0x0200 && addr <= 0x035F)
return System_RAM[addr]; return System_RAM[addr & 0x015F];
break; break;
case 0x1000: case 0x1000:
return Executive_ROM[addr]; return Executive_ROM[addr & 0x0FFF];
case 0x3000: case 0x3000:
if (addr >= 0x3000 && addr <= 0x37FF) if (addr >= 0x3000 && addr <= 0x37FF)
return Graphics_ROM[addr]; return Graphics_ROM[addr & 0x07FF];
if (addr >= 0x3800 && addr <= 0x39FF) if (addr >= 0x3800 && addr <= 0x39FF)
return Graphics_RAM[addr]; return Graphics_RAM[addr & 0x01FF];
break; break;
} }
throw new NotImplementedException(); throw new NotImplementedException();
@ -46,32 +46,24 @@ namespace BizHawk.Emulation.Consoles.Intellivision
case 0x0000: case 0x0000:
if (addr >= 0x0100 && addr <= 0x01EF) if (addr >= 0x0100 && addr <= 0x01EF)
{ {
Scratchpad_RAM[addr] = value; Scratchpad_RAM[addr & 0x00EF] = value;
return; return;
} }
if (addr >= 0x01F0 && addr <= 0x01FF) if (addr >= 0x01F0 && addr <= 0x01FF)
{ {
PSG_Registers[addr] = value; PSG_Registers[addr & 0x000F] = value;
return; return;
} }
if (addr >= 0x0200 && addr <= 0x035F) if (addr >= 0x0200 && addr <= 0x035F)
{ {
System_RAM[addr] = value; System_RAM[addr & 0x015F] = value;
return; return;
} }
break; break;
case 0x1000:
Executive_ROM[addr] = value;
return;
case 0x3000: case 0x3000:
if (addr >= 0x3000 && addr <= 0x37FF)
{
Graphics_ROM[addr] = value;
return;
}
if (addr >= 0x3800 && addr <= 0x39FF) if (addr >= 0x3800 && addr <= 0x39FF)
{ {
Graphics_RAM[addr] = value; Graphics_RAM[addr & 0x01FF] = value;
return; return;
} }
break; break;

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk
{
public interface ICart
{
ushort ReadMemory(ushort addr, out bool responded);
void WriteMemory(ushort addr, ushort value, out bool responded);
}
}