Scratchpad RAM, Graphics ROM, and Graphics RAM are apparently all 8-bit.

This commit is contained in:
brandman211 2012-08-10 20:40:34 +00:00
parent f42b96ba7d
commit c6cf18061f
4 changed files with 56 additions and 56 deletions

View File

@ -15,7 +15,7 @@ namespace BizHawk.Emulation.Consoles.Intellivision
STIC Stic; STIC Stic;
PSG Psg; PSG Psg;
public void LoadExecutive_ROM() public void LoadExecutiveRom()
{ {
FileStream fs = new FileStream("C:/erom.int", FileMode.Open, FileAccess.Read); FileStream fs = new FileStream("C:/erom.int", FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
@ -23,18 +23,18 @@ namespace BizHawk.Emulation.Consoles.Intellivision
int index = 0; int index = 0;
// Combine every two bytes into a word. // Combine every two bytes into a word.
while (index + 1 < erom.Length) while (index + 1 < erom.Length)
Executive_ROM[index / 2] = (ushort)((erom[index++] << 8) | erom[index++]); ExecutiveRom[index / 2] = (ushort)((erom[index++] << 8) | erom[index++]);
r.Close(); r.Close();
fs.Close(); fs.Close();
} }
public void LoadGraphics_ROM() public void LoadGraphicsRom()
{ {
FileStream fs = new FileStream("C:/grom.int", FileMode.Open, FileAccess.Read); FileStream fs = new FileStream("C:/grom.int", FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs); BinaryReader r = new BinaryReader(fs);
byte[] grom = r.ReadBytes(2048); byte[] grom = r.ReadBytes(2048);
for (int index = 0; index < grom.Length; index++) for (int index = 0; index < grom.Length; index++)
Graphics_ROM[index] = grom[index]; GraphicsRom[index] = grom[index];
r.Close(); r.Close();
fs.Close(); fs.Close();
} }
@ -43,8 +43,8 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
Rom = rom; Rom = rom;
Game = game; Game = game;
LoadExecutive_ROM(); LoadExecutiveRom();
LoadGraphics_ROM(); LoadGraphicsRom();
Cart = new Intellicart(); Cart = new Intellicart();
if (Cart.Parse(Rom) == -1) if (Cart.Parse(Rom) == -1)
{ {

View File

@ -9,11 +9,11 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
private const ushort UNMAPPED = 0xFFFF; private const ushort UNMAPPED = 0xFFFF;
private ushort[] Scratchpad_RAM = new ushort[240]; private byte[] ScratchpadRam = new byte[240];
private ushort[] System_RAM = new ushort[352]; private ushort[] SystemRam = new ushort[352];
private ushort[] Executive_ROM = new ushort[4096]; // TODO: Intellivision II support? private ushort[] ExecutiveRom = new ushort[4096]; // TODO: Intellivision II support?
private ushort[] Graphics_ROM = new ushort[2048]; private byte[] GraphicsRom = new byte[2048];
private ushort[] Graphics_RAM = new ushort[512]; private byte[] GraphicsRam = new byte[512];
public ushort ReadMemory(ushort addr) public ushort ReadMemory(ushort addr)
{ {
@ -31,12 +31,12 @@ namespace BizHawk.Emulation.Consoles.Intellivision
// Unoccupied. // Unoccupied.
break; break;
else if (addr <= 0x01EF) else if (addr <= 0x01EF)
core = Scratchpad_RAM[addr - 0x0100]; core = (ushort)(ScratchpadRam[addr - 0x0100] & 0x00FF);
else if (addr <= 0x01FF) else if (addr <= 0x01FF)
// PSG. // PSG.
break; break;
else if (addr <= 0x035F) else if (addr <= 0x035F)
core = System_RAM[addr - 0x0200]; core = SystemRam[addr - 0x0200];
else if (addr <= 0x03FF) else if (addr <= 0x03FF)
// TODO: Garbage values for Intellivision II. // TODO: Garbage values for Intellivision II.
break; break;
@ -45,24 +45,24 @@ namespace BizHawk.Emulation.Consoles.Intellivision
break; break;
break; break;
case 0x1000: case 0x1000:
core = Executive_ROM[addr - 0x1000]; core = ExecutiveRom[addr - 0x1000];
break; break;
case 0x3000: case 0x3000:
if (addr <= 0x37FF) if (addr <= 0x37FF)
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
core = Graphics_ROM[addr - 0x3000]; core = (byte)(GraphicsRom[addr - 0x3000] & 0x00FF);
else if (addr <= 0x39FF) else if (addr <= 0x39FF)
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
core = Graphics_RAM[addr - 0x3800]; core = (byte)(GraphicsRam[addr - 0x3800] & 0x00FF);
else if (addr <= 0x3BFF) else if (addr <= 0x3BFF)
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
core = Graphics_RAM[addr - 0x3A00]; core = (byte)(GraphicsRam[addr - 0x3A00] & 0x00FF);
else if (addr <= 0x3DFF) else if (addr <= 0x3DFF)
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
core = Graphics_RAM[addr - 0x3C00]; core = (byte)(GraphicsRam[addr - 0x3C00] & 0x00FF);
else else
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
core = Graphics_RAM[addr - 0x3E00]; core = (byte)(GraphicsRam[addr - 0x3E00] & 0x00FF);
break; break;
case 0x7000: case 0x7000:
if (addr <= 0x77FF) if (addr <= 0x77FF)
@ -140,7 +140,7 @@ namespace BizHawk.Emulation.Consoles.Intellivision
break; break;
else if (addr <= 0x01EF) else if (addr <= 0x01EF)
{ {
Scratchpad_RAM[addr - 0x0100] = value; ScratchpadRam[addr - 0x0100] = (byte)(value & 0x00FF);
return true; return true;
} }
else if (addr <= 0x01FF) else if (addr <= 0x01FF)
@ -150,7 +150,7 @@ namespace BizHawk.Emulation.Consoles.Intellivision
} }
else if (addr <= 0x035F) else if (addr <= 0x035F)
{ {
System_RAM[addr - 0x0200] = value; SystemRam[addr - 0x0200] = value;
return true; return true;
} }
else if (addr <= 0x03FF) else if (addr <= 0x03FF)
@ -170,25 +170,25 @@ namespace BizHawk.Emulation.Consoles.Intellivision
else if (addr <= 0x39FF) else if (addr <= 0x39FF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0x3800] = value; GraphicsRam[addr - 0x3800] = (byte)(value & 0x00FF);
return true; return true;
} }
else if (addr <= 0x3BFF) else if (addr <= 0x3BFF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0x3A00] = value; GraphicsRam[addr - 0x3A00] = (byte)(value & 0x00FF);
return true; return true;
} }
else if (addr <= 0x3DFF) else if (addr <= 0x3DFF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0x3C00] = value; GraphicsRam[addr - 0x3C00] = (byte)(value & 0x00FF);
return true; return true;
} }
else else
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0x3E00] = value; GraphicsRam[addr - 0x3E00] = (byte)(value & 0x00FF);
return true; return true;
} }
case 0x7000: case 0x7000:
@ -198,25 +198,25 @@ namespace BizHawk.Emulation.Consoles.Intellivision
else if (addr <= 0x79FF) else if (addr <= 0x79FF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr & 0x01FF] = value; GraphicsRam[addr & 0x01FF] = (byte)(value & 0x00FF);
return true; return true;
} }
else if (addr <= 0x7BFF) else if (addr <= 0x7BFF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr & 0x01FF] = value; GraphicsRam[addr & 0x01FF] = (byte)(value & 0x00FF);
return true; return true;
} }
else if (addr <= 0x7DFF) else if (addr <= 0x7DFF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr & 0x01FF] = value; GraphicsRam[addr & 0x01FF] = (byte)(value & 0x00FF);
return true; return true;
} }
else else
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr & 0x01FF] = value; GraphicsRam[addr & 0x01FF] = (byte)(value & 0x00FF);
return true; return true;
} }
case 0x9000: case 0x9000:
@ -228,25 +228,25 @@ namespace BizHawk.Emulation.Consoles.Intellivision
else if (addr <= 0xB9FF) else if (addr <= 0xB9FF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0xB800] = value; GraphicsRam[addr - 0xB800] = (byte)(value & 0x00FF);
return true; return true;
} }
else if (addr <= 0xBBFF) else if (addr <= 0xBBFF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0xBA00] = value; GraphicsRam[addr - 0xBA00] = (byte)(value & 0x00FF);
return true; return true;
} }
else if (addr <= 0xBDFF) else if (addr <= 0xBDFF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0xBC00] = value; GraphicsRam[addr - 0xBC00] = (byte)(value & 0x00FF);
return true; return true;
} }
else else
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0xBE00] = value; GraphicsRam[addr - 0xBE00] = (byte)(value & 0x00FF);
return true; return true;
} }
case 0xF000: case 0xF000:
@ -256,25 +256,25 @@ namespace BizHawk.Emulation.Consoles.Intellivision
else if (addr <= 0xF9FF) else if (addr <= 0xF9FF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0xF800] = value; GraphicsRam[addr - 0xF800] = (byte)(value & 0x00FF);
return true; return true;
} }
else if (addr <= 0xFBFF) else if (addr <= 0xFBFF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0xFA00] = value; GraphicsRam[addr - 0xFA00] = (byte)(value & 0x00FF);
return true; return true;
} }
else if (addr <= 0xFDFF) else if (addr <= 0xFDFF)
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0xFC00] = value; GraphicsRam[addr - 0xFC00] = (byte)(value & 0x00FF);
return true; return true;
} }
else else
{ {
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
Graphics_RAM[addr - 0xFE00] = value; GraphicsRam[addr - 0xFE00] = (byte)(value & 0x00FF);
return true; return true;
} }
} }

View File

@ -7,12 +7,12 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
public sealed class PSG public sealed class PSG
{ {
private ushort[] Registers = new ushort[16]; private ushort[] Register = new ushort[16];
public ushort? ReadPSG(ushort addr) public ushort? ReadPSG(ushort addr)
{ {
if (addr >= 0x01F0 && addr <= 0x01FF) if (addr >= 0x01F0 && addr <= 0x01FF)
return Registers[addr - 0x01F0]; return Register[addr - 0x01F0];
return null; return null;
} }
@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
if (addr >= 0x01F0 && addr <= 0x01FF) if (addr >= 0x01F0 && addr <= 0x01FF)
{ {
Registers[addr - 0x01F0] = value; Register[addr - 0x01F0] = value;
return true; return true;
} }
return false; return false;

View File

@ -7,8 +7,8 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
public sealed class STIC public sealed class STIC
{ {
private ushort[] Registers = new ushort[64]; private bool Sr1, Sr2, Fgbg = false;
private bool FGBG = false; private ushort[] Register = new ushort[64];
public ushort? ReadSTIC(ushort addr) public ushort? ReadSTIC(ushort addr)
{ {
@ -19,19 +19,19 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
// TODO: OK only during VBlank Period 1. // TODO: OK only during VBlank Period 1.
if (addr == 0x0021) if (addr == 0x0021)
FGBG = false; Fgbg = false;
return Registers[addr]; return Register[addr];
} }
else if (addr <= 0x007F) else if (addr <= 0x007F)
// TODO: OK only during VBlank Period 2. // TODO: OK only during VBlank Period 2.
return Registers[addr - 0x0040]; return Register[addr - 0x0040];
break; break;
case 0x4000: case 0x4000:
if (addr <= 0x403F) if (addr <= 0x403F)
{ {
// TODO: OK only during VBlank Period 1. // TODO: OK only during VBlank Period 1.
if (addr == 0x4021) if (addr == 0x4021)
FGBG = false; Fgbg = false;
} }
break; break;
case 0x8000: case 0x8000:
@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
// TODO: OK only during VBlank Period 1. // TODO: OK only during VBlank Period 1.
if (addr == 0x8021) if (addr == 0x8021)
FGBG = false; Fgbg = false;
} }
break; break;
case 0xC000: case 0xC000:
@ -47,7 +47,7 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
// TODO: OK only during VBlank Period 1. // TODO: OK only during VBlank Period 1.
if (addr == 0xC021) if (addr == 0xC021)
FGBG = false; Fgbg = false;
} }
break; break;
} }
@ -63,8 +63,8 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
// TODO: OK only during VBlank Period 1. // TODO: OK only during VBlank Period 1.
if (addr == 0x0021) if (addr == 0x0021)
FGBG = true; Fgbg = true;
Registers[addr] = value; Register[addr] = value;
return true; return true;
} }
else if (addr <= 0x007F) else if (addr <= 0x007F)
@ -76,8 +76,8 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
// TODO: OK only during VBlank Period 1. // TODO: OK only during VBlank Period 1.
if (addr == 0x4021) if (addr == 0x4021)
FGBG = true; Fgbg = true;
Registers[addr - 0x4000] = value; Register[addr - 0x4000] = value;
return true; return true;
} }
break; break;
@ -86,8 +86,8 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
// TODO: OK only during VBlank Period 1. // TODO: OK only during VBlank Period 1.
if (addr == 0x8021) if (addr == 0x8021)
FGBG = true; Fgbg = true;
Registers[addr & 0x003F] = value; Register[addr & 0x003F] = value;
return true; return true;
} }
break; break;
@ -96,8 +96,8 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{ {
// TODO: OK only during VBlank Period 1. // TODO: OK only during VBlank Period 1.
if (addr == 0xC021) if (addr == 0xC021)
FGBG = true; Fgbg = true;
Registers[addr - 0xC000] = value; Register[addr - 0xC000] = value;
return true; return true;
} }
break; break;