Checked in memory map...I need to stop programming and start sleeping.

This commit is contained in:
brandman211 2012-07-09 19:41:49 +00:00
parent 0791a713a4
commit f3ce111c48
1 changed files with 82 additions and 0 deletions

View File

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Emulation.Consoles.Intellivision
{
public sealed partial class Intellivision
{
private byte[] STIC_Registers;
private byte[] Scratchpad_RAM;
private byte[] PSG_Registers;
private byte[] System_RAM;
private byte[] Executive_ROM;
private byte[] Graphics_ROM;
private byte[] Graphics_RAM;
public byte ReadMemory(ushort addr)
{
switch (addr & 0xF000)
{
case 0x0000:
if (addr >= 0x0100 && addr <= 0x01EF)
return Scratchpad_RAM[addr];
if (addr >= 0x01F0 && addr <= 0x01FF)
return PSG_Registers[addr];
if (addr >= 0x0200 && addr <= 0x035F)
return System_RAM[addr];
break;
case 0x1000:
return Executive_ROM[addr];
case 0x3000:
if (addr >= 0x3000 && addr <= 0x37FF)
return Graphics_ROM[addr];
if (addr >= 0x3800 && addr <= 0x39FF)
return Graphics_RAM[addr];
break;
}
throw new NotImplementedException();
}
public void WriteMemory(ushort addr, byte value)
{
switch (addr & 0xF000)
{
case 0x0000:
if (addr >= 0x0100 && addr <= 0x01EF)
{
Scratchpad_RAM[addr] = value;
return;
}
if (addr >= 0x01F0 && addr <= 0x01FF)
{
PSG_Registers[addr] = value;
return;
}
if (addr >= 0x0200 && addr <= 0x035F)
{
System_RAM[addr] = value;
return;
}
break;
case 0x1000:
Executive_ROM[addr] = value;
return;
case 0x3000:
if (addr >= 0x3000 && addr <= 0x37FF)
{
Graphics_ROM[addr] = value;
return;
}
if (addr >= 0x3800 && addr <= 0x39FF)
{
Graphics_RAM[addr] = value;
return;
}
break;
}
throw new NotImplementedException();
}
}
}