[ChannelFHawk] Fix off by one for ROM array creation
This commit is contained in:
parent
7f3a1668d8
commit
1ada77e51f
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
public mapper_HANG(byte[] rom)
|
public mapper_HANG(byte[] rom)
|
||||||
{
|
{
|
||||||
ROM = new byte[0xFFFF - 0x800];
|
ROM = new byte[0x10000 - 0x800];
|
||||||
for (int i = 0; i < rom.Length; i++)
|
for (int i = 0; i < rom.Length; i++)
|
||||||
{
|
{
|
||||||
ROM[i] = rom[i];
|
ROM[i] = rom[i];
|
||||||
|
@ -26,6 +26,10 @@
|
||||||
public override byte ReadBus(ushort addr)
|
public override byte ReadBus(ushort addr)
|
||||||
{
|
{
|
||||||
var off = addr - 0x800;
|
var off = addr - 0x800;
|
||||||
|
if (off >= ROM.Length)
|
||||||
|
{
|
||||||
|
System.Diagnostics.Debugger.Break();
|
||||||
|
}
|
||||||
return ROM[off];
|
return ROM[off];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
public mapper_MAZE(byte[] rom)
|
public mapper_MAZE(byte[] rom)
|
||||||
{
|
{
|
||||||
ROM = new byte[0xFFFF - 0x800];
|
ROM = new byte[0x10000 - 0x800];
|
||||||
for (int i = 0; i < rom.Length; i++)
|
for (int i = 0; i < rom.Length; i++)
|
||||||
{
|
{
|
||||||
ROM[i] = rom[i];
|
ROM[i] = rom[i];
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
public mapper_RIDDLE(byte[] rom)
|
public mapper_RIDDLE(byte[] rom)
|
||||||
{
|
{
|
||||||
ROM = new byte[0xFFFF - 0x800];
|
ROM = new byte[0x10000 - 0x800];
|
||||||
for (int i = 0; i < rom.Length; i++)
|
for (int i = 0; i < rom.Length; i++)
|
||||||
{
|
{
|
||||||
ROM[i] = rom[i];
|
ROM[i] = rom[i];
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
public mapper_SCHACH(byte[] rom)
|
public mapper_SCHACH(byte[] rom)
|
||||||
{
|
{
|
||||||
ROM = new byte[0xFFFF - 0x800];
|
ROM = new byte[0x10000 - 0x800];
|
||||||
for (int i = 0; i < rom.Length; i++)
|
for (int i = 0; i < rom.Length; i++)
|
||||||
{
|
{
|
||||||
ROM[i] = rom[i];
|
ROM[i] = rom[i];
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
public mapper_STD(byte[] rom)
|
public mapper_STD(byte[] rom)
|
||||||
{
|
{
|
||||||
ROM = new byte[0xFFFF - 0x800];
|
ROM = new byte[0x10000 - 0x800];
|
||||||
for (int i = 0; i < rom.Length; i++)
|
for (int i = 0; i < rom.Length; i++)
|
||||||
{
|
{
|
||||||
ROM[i] = rom[i];
|
ROM[i] = rom[i];
|
||||||
|
|
Loading…
Reference in New Issue