[ChannelFHawk] Fix off by one for ROM array creation

This commit is contained in:
CasualPokePlayer 2024-09-04 18:24:21 -07:00
parent 7f3a1668d8
commit 1ada77e51f
5 changed files with 9 additions and 5 deletions

View File

@ -10,7 +10,7 @@
public mapper_HANG(byte[] rom)
{
ROM = new byte[0xFFFF - 0x800];
ROM = new byte[0x10000 - 0x800];
for (int i = 0; i < rom.Length; i++)
{
ROM[i] = rom[i];
@ -26,6 +26,10 @@
public override byte ReadBus(ushort addr)
{
var off = addr - 0x800;
if (off >= ROM.Length)
{
System.Diagnostics.Debugger.Break();
}
return ROM[off];
}

View File

@ -9,7 +9,7 @@
public mapper_MAZE(byte[] rom)
{
ROM = new byte[0xFFFF - 0x800];
ROM = new byte[0x10000 - 0x800];
for (int i = 0; i < rom.Length; i++)
{
ROM[i] = rom[i];

View File

@ -9,7 +9,7 @@
public mapper_RIDDLE(byte[] rom)
{
ROM = new byte[0xFFFF - 0x800];
ROM = new byte[0x10000 - 0x800];
for (int i = 0; i < rom.Length; i++)
{
ROM[i] = rom[i];

View File

@ -11,7 +11,7 @@
public mapper_SCHACH(byte[] rom)
{
ROM = new byte[0xFFFF - 0x800];
ROM = new byte[0x10000 - 0x800];
for (int i = 0; i < rom.Length; i++)
{
ROM[i] = rom[i];

View File

@ -10,7 +10,7 @@
public mapper_STD(byte[] rom)
{
ROM = new byte[0xFFFF - 0x800];
ROM = new byte[0x10000 - 0x800];
for (int i = 0; i < rom.Length; i++)
{
ROM[i] = rom[i];