diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/Memory.cs index 3bdf95b..348e2ed 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/Memory.cs @@ -8,9 +8,85 @@ namespace MAME.Core public unsafe class Memory { //public static byte[] mainrom, audiorom, mainram, audioram; - //public static byte[] ; - static byte[] mainrom, audiorom, mainram, audioram; + + #region //指针化mainrom + static byte[] mainrom_src; + static GCHandle mainrom_handle; + public static byte* mainrom; + public static int mainromLength; + public static bool mainrom_IsNull => mainrom == null; + public static void Set_mainrom(byte[] data) { mainrom_set = data; } + public static byte[] mainrom_set + { + set + { + mainrom_handle.ReleaseGCHandle(); + mainrom_src = value; + mainromLength = value.Length; + mainrom_src.GetObjectPtr(ref mainrom_handle, ref mainrom); + } + } + #endregion + + #region //指针化audiorom + static byte[] audiorom_src; + static GCHandle audiorom_handle; + public static byte* audiorom; + public static int audioromLength; + public static bool audiorom_IsNull => audiorom == null; + public static void Set_audiorom(byte[] data) { audiorom_set = data; } + public static byte[] audiorom_set + { + set + { + audiorom_handle.ReleaseGCHandle(); + audiorom_src = value; + audioromLength = value.Length; + audiorom_src.GetObjectPtr(ref audiorom_handle, ref audiorom); + } + } + #endregion + + #region //指针化mainram + static byte[] mainram_src; + static GCHandle mainram_handle; + public static byte* mainram; + public static int mainramLength; + public static bool mainram_IsNull => mainram == null; + public static void Set_mainram(byte[] data) { mainram_set = data; } + public static byte[] mainram_set + { + set + { + mainram_handle.ReleaseGCHandle(); + mainram_src = value; + mainramLength = value.Length; + mainram_src.GetObjectPtr(ref mainram_handle, ref mainram); + } + } + #endregion + + #region //指针化audioram + static byte[] audioram_src; + static GCHandle audioram_handle; + public static byte* audioram; + public static int audioramLength; + public static bool audioram_IsNull => audioram == null; + public static void Set_audioram(byte[] data) { audioram_set = data; } + public static byte[] audioram_set + { + set + { + audioram_handle.ReleaseGCHandle(); + audioram_src = value; + audioramLength = value.Length; + audioram_src.GetObjectPtr(ref audioram_handle, ref audioram); + } + } + #endregion + + public static void memory_reset() { switch (Machine.sBoard) @@ -331,111 +407,6 @@ namespace MAME.Core } } - static GCHandle mainrom_handle; - public static byte* mainrom_Ptr; - public static int mainrom_Lenght; - public static bool mainrom_IsNull => mainrom == null; - - public static void Set_mainrom(byte[] data) - { - Release_mainrom(); - mainrom = data; - mainrom_handle = GCHandle.Alloc(mainrom, GCHandleType.Pinned); - mainrom_Ptr = (byte*)mainrom_handle.AddrOfPinnedObject(); - mainrom_Lenght = data.Length; - } - static void Release_mainrom() - { - if (mainrom != null) - { - if (mainrom_handle.IsAllocated) - mainrom_handle.Free(); - } - mainrom = null; - mainrom_handle = default; - mainrom_Ptr = null; - mainrom_Lenght = default; - } - - - static GCHandle audiorom_handle; - public static byte* audiorom_Ptr; - - public static bool audiorom_IsNull => audiorom == null; - - public static void Set_audiorom(byte[] data) - { - Release_audiorom(); - audiorom = data; - audiorom_handle = GCHandle.Alloc(audiorom, GCHandleType.Pinned); - audiorom_Ptr = (byte*)audiorom_handle.AddrOfPinnedObject(); - } - static void Release_audiorom() - { - if (audiorom != null) - { - if (audiorom_handle.IsAllocated) - audiorom_handle.Free(); - } - audiorom = null; - audiorom_handle = default; - audiorom_Ptr = null; - } - - - static GCHandle mainram_handle; - public static byte* mainram_Ptr; - public static int mainram_Lenght; - public static bool mainram_IsNull => mainram == null; - - public static void Set_mainram(byte[] data) - { - Release_mainram(); - mainram = data; - mainram_handle = GCHandle.Alloc(mainram, GCHandleType.Pinned); - mainram_Ptr = (byte*)mainram_handle.AddrOfPinnedObject(); - mainram_Lenght = data.Length; - } - static void Release_mainram() - { - if (mainram != null) - { - if (mainram_handle.IsAllocated) - mainram_handle.Free(); - } - mainram = null; - mainram_handle = default; - mainram_Ptr = null; - mainram_Lenght = default; - } - - - static GCHandle audioram_handle; - public static byte* audioram_Ptr; - public static int audioram_Lenght; - public static bool audioram_IsNull => audioram == null; - - public static void Set_audioram(byte[] data) - { - Release_audioram(); - audioram = data; - audioram_handle = GCHandle.Alloc(audioram, GCHandleType.Pinned); - audioram_Ptr = (byte*)audioram_handle.AddrOfPinnedObject(); - audioram_Lenght = data.Length; - } - static void Release_audioram() - { - if (audioram != null) - { - if (audioram_handle.IsAllocated) - audioram_handle.Free(); - } - audioram = null; - audioram_handle = default; - audioram_Ptr = null; - audioram_Lenght = default; - } - } public unsafe static class AxiMemoryEx diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Memory.cs index c7baa62..d3f4c5d 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Memory.cs @@ -15,16 +15,16 @@ namespace MAME.Core byte result = 0; if (address <= 0x1dff) { - result = Memory.mainram_Ptr[address]; + result = Memory.mainram[address]; } else if (address >= 0x4000 && address <= 0x5fff) { int offset = address - 0x4000; - result = Memory.mainrom_Ptr[basebankmain + offset]; + result = Memory.mainrom[basebankmain + offset]; } else if (address >= 0x6000 && address <= 0xffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else { @@ -37,7 +37,7 @@ namespace MAME.Core byte result = 0; if (address <= 0x1dff) { - result = Memory.mainram_Ptr[address]; + result = Memory.mainram[address]; } else if (address >= 0x1e00 && address <= 0x1fff) { @@ -85,11 +85,11 @@ namespace MAME.Core else if (address >= 0x4000 && address <= 0x5fff) { int offset = address - 0x4000; - result = Memory.mainrom_Ptr[basebankmain + offset]; + result = Memory.mainrom[basebankmain + offset]; } else if (address >= 0x6000 && address <= 0xffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -98,7 +98,7 @@ namespace MAME.Core byte result = 0; if (address <= 0x1dff) { - result = Memory.mainram_Ptr[address]; + result = Memory.mainram[address]; } else if (address >= 0x1e00 && address <= 0x1fff) { @@ -146,7 +146,7 @@ namespace MAME.Core else if (address >= 0x4000 && address <= 0x5fff) { int offset = address - 0x4000; - result = Memory.mainrom_Ptr[basebankmain + offset]; + result = Memory.mainrom[basebankmain + offset]; } else if (address == 0x6000) { @@ -154,7 +154,7 @@ namespace MAME.Core } else if (address >= 0x6001 && address <= 0xffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -162,7 +162,7 @@ namespace MAME.Core { if (address <= 0x1dff) { - Memory.mainram_Ptr[address] = value; + Memory.mainram[address] = value; } else if (address >= 0x1e00 && address <= 0x1fff) { @@ -222,7 +222,7 @@ namespace MAME.Core } else if (address >= 0x4000 && address <= 0xffff) { - Memory.mainrom_Ptr[address] = value; + Memory.mainrom[address] = value; } } public static byte ZReadOp_gng(ushort address) @@ -230,12 +230,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xc000 && address <= 0xc7ff) { int offset = address - 0xc000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else { @@ -248,12 +248,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xc000 && address <= 0xc7ff) { int offset = address - 0xc000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0xc800) { @@ -269,12 +269,12 @@ namespace MAME.Core { if (address >= 0x0000 && address <= 0x7fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0xc000 && address <= 0xc7ff) { int offset = address - 0xc000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0xe000) { @@ -299,9 +299,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x04ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -316,9 +316,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x04ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -428,7 +428,7 @@ namespace MAME.Core else if (address >= 0xff8000 && address <= 0xffdfff) { int offset = address - 0xff8000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0xffe000 && address <= 0xffffff) { @@ -450,9 +450,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x04ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -562,7 +562,7 @@ namespace MAME.Core else if (address >= 0xff8000 && address <= 0xffdfff) { int offset = address - 0xff8000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0xffe000 && address <= 0xffffff) { @@ -584,9 +584,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x04ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -696,7 +696,7 @@ namespace MAME.Core else if (address >= 0xff8000 && address <= 0xffdfff) { int offset = address - 0xff8000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0xffe000 && address <= 0xffffff) { @@ -718,9 +718,9 @@ namespace MAME.Core short result = 0; if (address <= 0x04ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -735,9 +735,9 @@ namespace MAME.Core short result = 0; if (address <= 0x04ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -784,7 +784,7 @@ namespace MAME.Core else if (address >= 0xff8000 && address + 1 <= 0xffdfff) { int offset = address - 0xff8000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0xffe000 && address + 1 <= 0xffffff) { @@ -799,9 +799,9 @@ namespace MAME.Core short result = 0; if (address <= 0x04ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -848,7 +848,7 @@ namespace MAME.Core else if (address >= 0xff8000 && address + 1 <= 0xffdfff) { int offset = address - 0xff8000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0xffe000 && address + 1 <= 0xffffff) { @@ -863,9 +863,9 @@ namespace MAME.Core short result = 0; if (address <= 0x04ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -912,7 +912,7 @@ namespace MAME.Core else if (address >= 0xff8000 && address + 1 <= 0xffdfff) { int offset = address - 0xff8000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0xffe000 && address + 1 <= 0xffffff) { @@ -927,9 +927,9 @@ namespace MAME.Core int result = 0; if (address <= 0x04ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -944,9 +944,9 @@ namespace MAME.Core int result = 0; if (address <= 0x04ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -961,7 +961,7 @@ namespace MAME.Core else if (address >= 0xff8000 && address + 3 <= 0xffdfff) { int offset = address - 0xff8000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0xffe000 && address + 3 <= 0xffffff) { @@ -975,9 +975,9 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address <= 0x04ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)value; + Memory.mainrom[address] = (byte)value; } } else if (address >= 0x800000 && address <= 0x800fff) @@ -1073,7 +1073,7 @@ namespace MAME.Core else if (address >= 0xff8000 && address <= 0xffdfff) { int offset = address - 0xff8000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0xffe000 && address <= 0xffffff) { @@ -1093,10 +1093,10 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address + 1 <= 0x04ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 1] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; } } else if (address >= 0x800000 && address + 1 <= 0x800fff) @@ -1136,8 +1136,8 @@ namespace MAME.Core else if (address >= 0xff8000 && address + 1 <= 0xffdfff) { int offset = address - 0xff8000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0xffe000 && address + 1 <= 0xffffff) { @@ -1150,12 +1150,12 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address + 3 <= 0x04ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 24); - Memory.mainrom_Ptr[address + 1] = (byte)(value >> 16); - Memory.mainrom_Ptr[address + 2] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 3] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 24); + Memory.mainrom[address + 1] = (byte)(value >> 16); + Memory.mainrom[address + 2] = (byte)(value >> 8); + Memory.mainrom[address + 3] = (byte)value; } } else if (address >= 0x800000 && address + 3 <= 0x800fff) @@ -1173,10 +1173,10 @@ namespace MAME.Core else if (address >= 0xff8000 && address + 3 <= 0xffdfff) { int offset = address - 0xff8000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0xffe000 && address + 3 <= 0xffffff) { @@ -1190,12 +1190,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xc000 && address <= 0xc7ff) { int offset = address - 0xc000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else { @@ -1208,12 +1208,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xc000 && address <= 0xc7ff) { int offset = address - 0xc000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0xc800) { @@ -1233,12 +1233,12 @@ namespace MAME.Core { if (address >= 0x0000 && address <= 0x7fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0xc000 && address <= 0xc7ff) { int offset = address - 0xc000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0xe000) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/State.cs index 156894c..500a78b 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/State.cs @@ -25,9 +25,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x1e00); + writer.Write(Memory.mainram, 0, 0x1e00); M6809.mm1[0].SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -124,9 +124,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x6000); + writer.Write(Memory.mainram, 0, 0x6000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[1].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/cps/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/cps/Memory.cs index 952e129..83b3eb7 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/cps/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/cps/Memory.cs @@ -14,9 +14,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x3fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -31,9 +31,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x3fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else { @@ -82,7 +82,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address <= 0xffffff) { - result = (sbyte)Memory.mainram_Ptr[address & 0xffff]; + result = (sbyte)Memory.mainram[address & 0xffff]; } return result; } @@ -92,9 +92,9 @@ namespace MAME.Core short result = 0; if (address <= 0x3fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -107,7 +107,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - result = (short)(Memory.mainram_Ptr[(address & 0xffff)] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 1]); + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); } return result; } @@ -117,9 +117,9 @@ namespace MAME.Core short result = 0; if (address <= 0x3fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -150,7 +150,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - result = (short)(Memory.mainram_Ptr[(address & 0xffff)] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 1]); + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); } return result; } @@ -160,9 +160,9 @@ namespace MAME.Core int result = 0; if (address <= 0x3fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -175,7 +175,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - result = (int)(Memory.mainram_Ptr[(address & 0xffff)] * 0x1000000 + Memory.mainram_Ptr[(address & 0xffff) + 1] * 0x10000 + Memory.mainram_Ptr[(address & 0xffff) + 2] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 3]); + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); } return result; } @@ -185,9 +185,9 @@ namespace MAME.Core int result = 0; if (address <= 0x3fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -217,7 +217,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - result = (int)(Memory.mainram_Ptr[(address & 0xffff)] * 0x1000000 + Memory.mainram_Ptr[(address & 0xffff) + 1] * 0x10000 + Memory.mainram_Ptr[(address & 0xffff) + 2] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 3]); + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); } return result; } @@ -258,7 +258,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value); } else { @@ -296,8 +296,8 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value); } else { @@ -340,10 +340,10 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value >> 24); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[(address & 0xffff) + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 3] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); } else { @@ -355,7 +355,7 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address & 0x7fff]; + result = Memory.audiorom[address & 0x7fff]; } else { @@ -368,15 +368,15 @@ namespace MAME.Core byte result = 0; if (address < 0x8000) { - result = Memory.audiorom_Ptr[address & 0x7fff]; + result = Memory.audiorom[address & 0x7fff]; } else if (address >= 0x8000 && address <= 0xbfff) { - result = Memory.audiorom_Ptr[basebanksnd + (address & 0x3fff)]; + result = Memory.audiorom[basebanksnd + (address & 0x3fff)]; } else if (address >= 0xd000 && address <= 0xd7ff) { - result = Memory.audioram_Ptr[address & 0x7ff]; + result = Memory.audioram[address & 0x7ff]; } else if (address == 0xf001) { @@ -405,7 +405,7 @@ namespace MAME.Core { if (address >= 0xd000 && address <= 0xd7ff) { - Memory.audioram_Ptr[address & 0x7ff] = value; + Memory.audioram[address & 0x7ff] = value; } else if (address == 0xf000) { @@ -438,9 +438,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x3fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -459,9 +459,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x3fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else { @@ -533,7 +533,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address <= 0xffffff) { - result = (sbyte)Memory.mainram_Ptr[address & 0xffff]; + result = (sbyte)Memory.mainram[address & 0xffff]; } return result; } @@ -543,9 +543,9 @@ namespace MAME.Core short result = 0; if (address <= 0x3fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -558,7 +558,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - result = (short)(Memory.mainram_Ptr[(address & 0xffff)] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 1]); + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); } return result; } @@ -568,9 +568,9 @@ namespace MAME.Core short result = 0; if (address <= 0x3fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -624,7 +624,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - result = (short)(Memory.mainram_Ptr[(address & 0xffff)] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 1]); + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); } return result; } @@ -634,9 +634,9 @@ namespace MAME.Core int result = 0; if (address <= 0x3fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -649,7 +649,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - result = (int)(Memory.mainram_Ptr[(address & 0xffff)] * 0x1000000 + Memory.mainram_Ptr[(address & 0xffff) + 1] * 0x10000 + Memory.mainram_Ptr[(address & 0xffff) + 2] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 3]); + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); } return result; } @@ -659,9 +659,9 @@ namespace MAME.Core int result = 0; if (address <= 0x3fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -710,7 +710,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - result = (int)(Memory.mainram_Ptr[(address & 0xffff)] * 0x1000000 + Memory.mainram_Ptr[(address & 0xffff) + 1] * 0x10000 + Memory.mainram_Ptr[(address & 0xffff) + 2] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 3]); + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); } return result; } @@ -778,7 +778,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value); } else { @@ -831,8 +831,8 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value); } else { @@ -890,10 +890,10 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value >> 24); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[(address & 0xffff) + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 3] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); } else { @@ -945,9 +945,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x3fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else { @@ -1061,7 +1061,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address <= 0xffffff) { - result = (sbyte)Memory.mainram_Ptr[address & 0xffff]; + result = (sbyte)Memory.mainram[address & 0xffff]; } return result; } @@ -1109,9 +1109,9 @@ namespace MAME.Core short result = 0; if (address <= 0x3fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1204,7 +1204,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - result = (short)(Memory.mainram_Ptr[(address & 0xffff)] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 1]); + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); } return result; } @@ -1252,9 +1252,9 @@ namespace MAME.Core int result = 0; if (address <= 0x3fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1355,7 +1355,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - result = (int)(Memory.mainram_Ptr[(address & 0xffff)] * 0x1000000 + Memory.mainram_Ptr[(address & 0xffff) + 1] * 0x10000 + Memory.mainram_Ptr[(address & 0xffff) + 2] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 3]); + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); } return result; } @@ -1466,7 +1466,7 @@ namespace MAME.Core } else if (address >= 0xff0000 && address <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value); } else { @@ -1571,8 +1571,8 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - Memory.mainram_Ptr[address & 0xffff] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)value; + Memory.mainram[address & 0xffff] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)value; } else { @@ -1695,10 +1695,10 @@ namespace MAME.Core } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value >> 24); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[(address & 0xffff) + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 3] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); } else { @@ -1723,11 +1723,11 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address & 0x7fff]; + result = Memory.audiorom[address & 0x7fff]; } else if (address >= 0x8000 && address <= 0xbfff) { - result = Memory.audiorom_Ptr[basebanksnd + (address & 0x3fff)]; + result = Memory.audiorom[basebanksnd + (address & 0x3fff)]; } else if (address >= 0xc000 && address <= 0xcfff) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/cps/Memory2.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/cps/Memory2.cs index 89fe0c2..ed4acb1 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/cps/Memory2.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/cps/Memory2.cs @@ -193,9 +193,9 @@ sbyte result = 0; if (address <= 0x3fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else { @@ -233,7 +233,7 @@ } else if (address >= 0xff0000 && address <= 0xffffff) { - result = (sbyte)Memory.mainram_Ptr[address & 0xffff]; + result = (sbyte)Memory.mainram[address & 0xffff]; } return result; } @@ -243,9 +243,9 @@ short result = 0; if (address <= 0x3fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -276,7 +276,7 @@ } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - result = (short)(Memory.mainram_Ptr[(address & 0xffff)] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 1]); + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); } return result; } @@ -286,9 +286,9 @@ int result = 0; if (address <= 0x3fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -318,7 +318,7 @@ } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - result = (int)(Memory.mainram_Ptr[(address & 0xffff)] * 0x1000000 + Memory.mainram_Ptr[(address & 0xffff) + 1] * 0x10000 + Memory.mainram_Ptr[(address & 0xffff) + 2] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 3]); + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); } return result; } @@ -367,7 +367,7 @@ } else if (address >= 0xff0000 && address <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value); } else { @@ -413,8 +413,8 @@ } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value); } else { @@ -466,10 +466,10 @@ } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value >> 24); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[(address & 0xffff) + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 3] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); } else { @@ -482,9 +482,9 @@ sbyte result = 0; if (address <= 0x3fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else { @@ -538,7 +538,7 @@ } else if (address >= 0xff0000 && address <= 0xffffff) { - result = (sbyte)Memory.mainram_Ptr[address & 0xffff]; + result = (sbyte)Memory.mainram[address & 0xffff]; } return result; } @@ -548,9 +548,9 @@ short result = 0; if (address <= 0x3fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -593,7 +593,7 @@ } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - result = (short)(Memory.mainram_Ptr[(address & 0xffff)] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 1]); + result = (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); } return result; } @@ -603,9 +603,9 @@ int result = 0; if (address <= 0x3fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -647,7 +647,7 @@ } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - result = (int)(Memory.mainram_Ptr[(address & 0xffff)] * 0x1000000 + Memory.mainram_Ptr[(address & 0xffff) + 1] * 0x10000 + Memory.mainram_Ptr[(address & 0xffff) + 2] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 3]); + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); } return result; } @@ -704,7 +704,7 @@ } else if (address >= 0xff0000 && address <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value); } else { @@ -760,8 +760,8 @@ } else if (address >= 0xff0000 && address + 1 <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value); } else { @@ -827,10 +827,10 @@ } else if (address >= 0xff0000 && address + 3 <= 0xffffff) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value >> 24); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[(address & 0xffff) + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 3] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); } else { @@ -958,9 +958,9 @@ sbyte result = 0; if (address <= 0x3fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -975,9 +975,9 @@ sbyte result = 0; if (address <= 0x3fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else { @@ -1091,7 +1091,7 @@ } else if (address >= 0xff0000 && address <= 0xffffef) { - result = (sbyte)Memory.mainram_Ptr[address & 0xffff]; + result = (sbyte)Memory.mainram[address & 0xffff]; } else if (address >= 0xfffff0 && address <= 0xfffffb) { @@ -1110,9 +1110,9 @@ short result = 0; if (address <= 0x3fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1127,9 +1127,9 @@ short result = 0; if (address <= 0x3fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1222,7 +1222,7 @@ } else if (address >= 0xff0000 && address + 1 <= 0xffffef) { - return (short)(Memory.mainram_Ptr[(address & 0xffff)] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 1]); + return (short)(Memory.mainram[(address & 0xffff)] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); } else if (address >= 0xfffff0 && address + 1 <= 0xfffffb) { @@ -1241,9 +1241,9 @@ int result = 0; if (address <= 0x3fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1258,9 +1258,9 @@ int result = 0; if (address <= 0x3fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1362,7 +1362,7 @@ } else if (address >= 0xff0000 && address + 3 <= 0xffffef) { - result = (int)(Memory.mainram_Ptr[(address & 0xffff)] * 0x1000000 + Memory.mainram_Ptr[(address & 0xffff) + 1] * 0x10000 + Memory.mainram_Ptr[(address & 0xffff) + 2] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 3]); + result = (int)(Memory.mainram[(address & 0xffff)] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]); } else if (address >= 0xfffff0 && address + 3 <= 0xfffffb) { @@ -1483,7 +1483,7 @@ } else if (address >= 0xff0000 && address <= 0xffffef) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value); } else if (address >= 0xfffff0 && address <= 0xfffffb) { @@ -1599,8 +1599,8 @@ } else if (address >= 0xff0000 && address + 1 <= 0xffffef) { - Memory.mainram_Ptr[address & 0xffff] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)value; + Memory.mainram[address & 0xffff] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)value; } else if (address >= 0xfffff0 && address + 1 <= 0xfffffb) { @@ -1732,10 +1732,10 @@ } else if (address >= 0xff0000 && address + 3 <= 0xffffef) { - Memory.mainram_Ptr[(address & 0xffff)] = (byte)(value >> 24); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[(address & 0xffff) + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 3] = (byte)(value); + Memory.mainram[(address & 0xffff)] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)(value); } else if (address >= 0xfffff0 && address + 3 <= 0xfffffb) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/cps/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/cps/State.cs index 01b5ee4..d1e8264 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/cps/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/cps/State.cs @@ -25,10 +25,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x10000); + writer.Write(Memory.mainram, 0, 0x10000); writer.Write(gfxram, 0, 0x30000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -95,10 +95,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x10000); + writer.Write(Memory.mainram, 0, 0x10000); writer.Write(gfxram, 0, 0x30000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -158,10 +158,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x10000); + writer.Write(Memory.mainram, 0, 0x10000); writer.Write(gfxram, 0, 0x30000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Memory.cs index 14cf8ee..82386d8 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Memory.cs @@ -9,21 +9,21 @@ byte result = 0; if (address <= 0x7ff) { - result = Memory.mainram_Ptr[address]; + result = Memory.mainram[address]; } else if (address >= 0x4000 && address <= 0x5fff) { int offset = address - 0x4000; - result = Memory.mainrom_Ptr[basebankmain1 + offset]; + result = Memory.mainrom[basebankmain1 + offset]; } else if (address >= 0x6000 && address <= 0x7fff) { int offset = address - 0x6000; - result = Memory.mainrom_Ptr[basebankmain2 + offset]; + result = Memory.mainrom[basebankmain2 + offset]; } else if (address >= 0x8000 && address <= 0xffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -32,21 +32,21 @@ byte result = 0; if (address <= 0x7ff) { - result = Memory.mainram_Ptr[address]; + result = Memory.mainram[address]; } else if (address >= 0x4000 && address <= 0x5fff) { int offset = address - 0x4000; - result = Memory.mainrom_Ptr[basebankmain1 + offset]; + result = Memory.mainrom[basebankmain1 + offset]; } else if (address >= 0x6000 && address <= 0x7fff) { int offset = address - 0x6000; - result = Memory.mainrom_Ptr[basebankmain2 + offset]; + result = Memory.mainrom[basebankmain2 + offset]; } else if (address >= 0x8000 && address <= 0xffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -55,7 +55,7 @@ byte result = 0; if (address <= 0x7ff) { - result = Memory.mainram_Ptr[address]; + result = Memory.mainram[address]; } else if (address == 0x1800) { @@ -72,16 +72,16 @@ else if (address >= 0x4000 && address <= 0x5fff) { int offset = address - 0x4000; - result = Memory.mainrom_Ptr[basebankmain1 + offset]; + result = Memory.mainrom[basebankmain1 + offset]; } else if (address >= 0x6000 && address <= 0x7fff) { int offset = address - 0x6000; - result = Memory.mainrom_Ptr[basebankmain2 + offset]; + result = Memory.mainrom[basebankmain2 + offset]; } else if (address >= 0x8000 && address <= 0xffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -89,7 +89,7 @@ { if (address <= 0x7ff) { - Memory.mainram_Ptr[address] = data; + Memory.mainram[address] = data; } else if (address >= 0x800 && address <= 0xfff) { @@ -115,7 +115,7 @@ } else if (address >= 0x4000 && address <= 0xffff) { - Memory.mainrom_Ptr[address] = data; + Memory.mainrom[address] = data; } } public static byte D1ReadOp(ushort address) @@ -123,7 +123,7 @@ byte result = 0; if (address <= 0x7ff) { - result = Memory.audioram_Ptr[address]; + result = Memory.audioram[address]; } else if (address >= 0x4000 && address <= 0x7fff) { @@ -142,16 +142,16 @@ byte result = 0; if (address <= 0x7ff) { - result = Memory.audioram_Ptr[address]; + result = Memory.audioram[address]; } else if (address >= 0x4000 && address <= 0x7fff) { int offset = address - 0x4000; - result = Memory.audiorom_Ptr[basebanksnd + offset]; + result = Memory.audiorom[basebanksnd + offset]; } else if (address >= 0x8000 && address <= 0xffff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } return result; } @@ -160,16 +160,16 @@ byte result = 0; if (address <= 0x7ff) { - result = Memory.audioram_Ptr[address]; + result = Memory.audioram[address]; } else if (address >= 0x4000 && address <= 0x7fff) { int offset = address - 0x4000; - result = Memory.audiorom_Ptr[basebanksnd + offset]; + result = Memory.audiorom[basebanksnd + offset]; } else if (address >= 0x8000 && address <= 0xffff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } return result; } @@ -178,7 +178,7 @@ byte result = 0; if (address <= 0x7ff) { - result = Memory.audioram_Ptr[address]; + result = Memory.audioram[address]; } else if (address == 0x3000) { @@ -191,11 +191,11 @@ else if (address >= 0x4000 && address <= 0x7fff) { int offset = address - 0x4000; - result = Memory.audiorom_Ptr[basebanksnd + offset]; + result = Memory.audiorom[basebanksnd + offset]; } else if (address >= 0x8000 && address <= 0xffff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } return result; } @@ -203,7 +203,7 @@ { if (address <= 0x7ff) { - Memory.audioram_Ptr[address] = data; + Memory.audioram[address] = data; } else if (address == 0x0800) { @@ -231,7 +231,7 @@ } else if (address >= 0x4000 && address <= 0xffff) { - Memory.audiorom_Ptr[address] = data; + Memory.audiorom[address] = data; } } } diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/State.cs index ebf740d..fca5115 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/State.cs @@ -18,10 +18,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x800); + writer.Write(Memory.mainram, 0, 0x800); writer.Write(Generic.videoram, 0, 0x800); writer.Write(Generic.spriteram, 0, 0x200); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); M6502.mm1[0].SaveStateBinary(writer); M6502.mm1[1].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/Memory.cs index af526b8..4bd757e 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/Memory.cs @@ -23,7 +23,7 @@ } else if (address >= 0 && address <= 0x7ffff) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } return result; } @@ -44,7 +44,7 @@ } else if (address >= 0 && address <= 0x7ffff) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else if (address >= 0x100000 && address <= 0x103fff) { @@ -117,7 +117,7 @@ } else if (address >= 0 && address + 1 <= 0x7ffff) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } return result; } @@ -131,7 +131,7 @@ } else if (address >= 0 && address + 1 <= 0x7ffff) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else if (address >= 0x100000 && address + 1 <= 0x103fff) { @@ -179,7 +179,7 @@ int result = 0; if (address >= 0 && address + 3 <= 0x7ffff) { - result = Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]; + result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]; } return result; } @@ -189,7 +189,7 @@ int result = 0; if (address >= 0 && address + 3 <= 0x7ffff) { - result = Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]; + result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]; } else if (address >= 0x100000 && address + 3 <= 0x103fff) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/Memory2.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/Memory2.cs index 05ff710..21fa181 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/Memory2.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/Memory2.cs @@ -352,7 +352,7 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else if (address >= 0x100000 && address <= 0x103fff) { @@ -436,7 +436,7 @@ } else if (address >= 0 && address + 1 <= 0x7ffff) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } return result; } @@ -454,7 +454,7 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else if (address >= 0x100000 && address + 1 <= 0x103fff) { @@ -496,7 +496,7 @@ int result = 0; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - result = Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]; + result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]; } else if (address >= 0x100000 && address + 3 <= 0x103fff) { @@ -790,7 +790,7 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else if (address >= 0x100000 && address + 1 <= 0x103fff) { @@ -840,7 +840,7 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else if (address >= 0x100000 && address + 1 <= 0x103fff) { @@ -900,9 +900,9 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -935,9 +935,9 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1023,9 +1023,9 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1048,9 +1048,9 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1101,9 +1101,9 @@ int result = 0; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1118,9 +1118,9 @@ int result = 0; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1435,9 +1435,9 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1474,9 +1474,9 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1486,7 +1486,7 @@ else if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x1f0000 && address <= 0x1f3fff) { @@ -1553,9 +1553,9 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1578,9 +1578,9 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1590,7 +1590,7 @@ else if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x1f0000 && address + 1 <= 0x1f3fff) { @@ -1632,9 +1632,9 @@ int result = 0; if (address <= 0x010001) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1644,7 +1644,7 @@ else if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } return result; } @@ -1654,10 +1654,10 @@ int result = 0; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x010000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1667,7 +1667,7 @@ else if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x1f0000 && address + 3 <= 0x1f3fff) { @@ -1718,7 +1718,7 @@ else if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value); + Memory.mainram[offset] = (byte)(value); } else if (address >= 0x1f0000 && address <= 0x1f3fff) { @@ -1841,8 +1841,8 @@ else if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x1f0000 && address + 1 <= 0x1f3fff) { @@ -1929,10 +1929,10 @@ if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x1f0000 && address + 3 <= 0x1f3fff) { @@ -1978,9 +1978,9 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -2021,9 +2021,9 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -2105,9 +2105,9 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2130,9 +2130,9 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2187,9 +2187,9 @@ int result = 0; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2204,10 +2204,10 @@ int result = 0; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2501,9 +2501,9 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -2562,9 +2562,9 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -2682,9 +2682,9 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2723,9 +2723,9 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2799,9 +2799,9 @@ int result = 0; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2816,10 +2816,10 @@ int result = 0; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -3265,9 +3265,9 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -3297,9 +3297,9 @@ } else if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -3381,9 +3381,9 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -3406,9 +3406,9 @@ } else if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -3459,9 +3459,9 @@ int result = 0; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -3476,10 +3476,10 @@ int result = 0; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x023000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs index deed15b..1d9edd1 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs @@ -925,12 +925,12 @@ namespace MAME.Core byte result = 0; if (addr <= 0x07ffff) { - result = Memory.mainrom_Ptr[addr]; + result = Memory.mainrom[addr]; } else if (addr >= 0x104000 && addr <= 0x107fff) { int offset = addr - 0x104000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } else if (addr >= 0x180000 && addr <= 0x183fff) { @@ -952,12 +952,12 @@ namespace MAME.Core addr *= 2; if (addr <= 0x07ffff) { - result = (ushort)(Memory.mainrom_Ptr[addr] * 0x100 + Memory.mainrom_Ptr[addr + 1]); + result = (ushort)(Memory.mainrom[addr] * 0x100 + Memory.mainrom[addr + 1]); } else if (addr >= 0x104000 && addr <= 0x107fff) { int offset = addr - 0x104000; - result = (ushort)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (ushort)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (addr >= 0x180000 && addr <= 0x183fff) { @@ -987,8 +987,8 @@ namespace MAME.Core else if (addr >= 0x104000 && addr <= 0x107fff) { int offset = (addr - 0x104000) / 2; - Memory.mainram_Ptr[offset] = (byte)(data >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)data; + Memory.mainram[offset] = (byte)(data >> 8); + Memory.mainram[offset + 1] = (byte)data; } } public static void tmnt2_1c0800_w(int offset, ushort data) diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Memory.cs index 348ccac..6df0efb 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Memory.cs @@ -13,9 +13,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x01ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -25,7 +25,7 @@ namespace MAME.Core else if (address >= 0x040000 && address <= 0x043fff) { int offset = address - 0x040000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x060000 && address <= 0x063fff) { @@ -40,9 +40,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x01ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -52,7 +52,7 @@ namespace MAME.Core else if (address >= 0x040000 && address <= 0x043fff) { int offset = address - 0x040000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x060000 && address <= 0x063fff) { @@ -190,9 +190,9 @@ namespace MAME.Core short result = 0; if (address <= 0x01ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -202,7 +202,7 @@ namespace MAME.Core else if (address >= 0x040000 && address + 1 <= 0x043fff) { int offset = address - 0x040000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x060000 && address + 1 <= 0x063fff) { @@ -217,9 +217,9 @@ namespace MAME.Core short result = 0; if (address <= 0x01ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -229,7 +229,7 @@ namespace MAME.Core else if (address >= 0x040000 && address + 1 <= 0x043fff) { int offset = address - 0x040000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x060000 && address + 1 <= 0x063fff) { @@ -297,9 +297,9 @@ namespace MAME.Core int result = 0; if (address <= 0x01ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -309,7 +309,7 @@ namespace MAME.Core else if (address >= 0x040000 && address + 3 <= 0x043fff) { int offset = address - 0x040000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x060000 && address + 3 <= 0x063fff) { @@ -324,9 +324,9 @@ namespace MAME.Core int result = 0; if (address <= 0x01ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -336,7 +336,7 @@ namespace MAME.Core else if (address >= 0x040000 && address + 3 <= 0x043fff) { int offset = address - 0x040000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x060000 && address + 3 <= 0x063fff) { @@ -380,7 +380,7 @@ namespace MAME.Core if (address >= 0x040000 && address <= 0x043fff) { int offset = address - 0x040000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x060000 && address <= 0x063fff) { @@ -490,8 +490,8 @@ namespace MAME.Core if (address >= 0x040000 && address + 1 <= 0x043fff) { int offset = address - 0x040000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x060000 && address + 1 <= 0x063fff) { @@ -555,10 +555,10 @@ namespace MAME.Core if (address >= 0x040000 && address + 3 <= 0x043fff) { int offset = address - 0x040000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x060000 && address + 3 <= 0x063fff) { @@ -615,9 +615,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -627,7 +627,7 @@ namespace MAME.Core else if (address >= 0x040000 && address <= 0x043fff) { int offset = address - 0x040000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x060000 && address <= 0x063fff) { @@ -642,9 +642,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -654,7 +654,7 @@ namespace MAME.Core else if (address >= 0x040000 && address <= 0x043fff) { int offset = address - 0x040000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x060000 && address <= 0x063fff) { @@ -769,9 +769,9 @@ namespace MAME.Core short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -781,7 +781,7 @@ namespace MAME.Core else if (address >= 0x040000 && address + 1 <= 0x043fff) { int offset = address - 0x040000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x060000 && address + 1 <= 0x063fff) { @@ -796,9 +796,9 @@ namespace MAME.Core short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -808,7 +808,7 @@ namespace MAME.Core else if (address >= 0x040000 && address + 1 <= 0x043fff) { int offset = address - 0x040000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x060000 && address + 1 <= 0x063fff) { @@ -867,9 +867,9 @@ namespace MAME.Core int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -879,7 +879,7 @@ namespace MAME.Core else if (address >= 0x040000 && address + 3 <= 0x043fff) { int offset = address - 0x040000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x060000 && address + 3 <= 0x063fff) { @@ -894,10 +894,10 @@ namespace MAME.Core int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -907,7 +907,7 @@ namespace MAME.Core else if (address >= 0x040000 && address + 3 <= 0x043fff) { int offset = address - 0x040000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x060000 && address + 3 <= 0x063fff) { @@ -942,7 +942,7 @@ namespace MAME.Core if (address >= 0x040000 && address <= 0x043fff) { int offset = address - 0x040000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x060000 && address <= 0x063fff) { @@ -1016,8 +1016,8 @@ namespace MAME.Core if (address >= 0x040000 && address + 1 <= 0x043fff) { int offset = address - 0x040000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x060000 && address + 1 <= 0x063fff) { @@ -1066,10 +1066,10 @@ namespace MAME.Core if (address >= 0x040000 && address + 3 <= 0x043fff) { int offset = address - 0x040000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x060000 && address + 3 <= 0x063fff) { @@ -1114,9 +1114,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x05ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1126,7 +1126,7 @@ namespace MAME.Core else if (address >= 0x060000 && address <= 0x063fff) { int offset = address - 0x060000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } return result; } @@ -1136,9 +1136,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x05ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1148,7 +1148,7 @@ namespace MAME.Core else if (address >= 0x060000 && address <= 0x063fff) { int offset = address - 0x060000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x080000 && address <= 0x080fff) { @@ -1280,9 +1280,9 @@ namespace MAME.Core short result = 0; if (address <= 0x05ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1292,7 +1292,7 @@ namespace MAME.Core else if (address >= 0x060000 && address + 1 <= 0x063fff) { int offset = address - 0x060000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } return result; } @@ -1302,9 +1302,9 @@ namespace MAME.Core short result = 0; if (address <= 0x05ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1314,7 +1314,7 @@ namespace MAME.Core else if (address >= 0x060000 && address + 1 <= 0x063fff) { int offset = address - 0x060000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x080000 && address + 1 <= 0x080fff) { @@ -1376,9 +1376,9 @@ namespace MAME.Core int result = 0; if (address <= 0x05ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1388,7 +1388,7 @@ namespace MAME.Core else if (address >= 0x060000 && address + 3 <= 0x063fff) { int offset = address - 0x060000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } return result; } @@ -1398,9 +1398,9 @@ namespace MAME.Core int result = 0; if (address <= 0x05ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1410,7 +1410,7 @@ namespace MAME.Core else if (address >= 0x060000 && address + 3 <= 0x063fff) { int offset = address - 0x060000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x080000 && address + 3 <= 0x080fff) { @@ -1440,7 +1440,7 @@ namespace MAME.Core if (address >= 0x060000 && address <= 0x063fff) { int offset = address - 0x060000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x080000 && address <= 0x080fff) { @@ -1513,8 +1513,8 @@ namespace MAME.Core if (address >= 0x060000 && address + 1 <= 0x063fff) { int offset = address - 0x060000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x080000 && address + 1 <= 0x080fff) { @@ -1561,10 +1561,10 @@ namespace MAME.Core if (address >= 0x060000 && address + 3 <= 0x063fff) { int offset = address - 0x060000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x080000 && address + 3 <= 0x080fff) { @@ -1601,9 +1601,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1613,7 +1613,7 @@ namespace MAME.Core else if (address >= 0x080000 && address <= 0x083fff) { int offset = address - 0x080000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } return result; } @@ -1623,9 +1623,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1635,7 +1635,7 @@ namespace MAME.Core else if (address >= 0x080000 && address <= 0x083fff) { int offset = address - 0x080000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x090000 && address <= 0x090fff) { @@ -1739,9 +1739,9 @@ namespace MAME.Core short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1751,7 +1751,7 @@ namespace MAME.Core else if (address >= 0x080000 && address + 1 <= 0x083fff) { int offset = address - 0x080000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } return result; } @@ -1761,9 +1761,9 @@ namespace MAME.Core short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1773,7 +1773,7 @@ namespace MAME.Core else if (address >= 0x080000 && address + 1 <= 0x083fff) { int offset = address - 0x080000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x090000 && address + 1 <= 0x090fff) { @@ -1828,9 +1828,9 @@ namespace MAME.Core int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1840,7 +1840,7 @@ namespace MAME.Core else if (address >= 0x080000 && address + 3 <= 0x083fff) { int offset = address - 0x080000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } return result; } @@ -1850,10 +1850,10 @@ namespace MAME.Core int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1863,7 +1863,7 @@ namespace MAME.Core else if (address >= 0x080000 && address + 3 <= 0x083fff) { int offset = address - 0x080000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x090000 && address + 3 <= 0x090fff) { @@ -1902,7 +1902,7 @@ namespace MAME.Core if (address >= 0x080000 && address <= 0x083fff) { int offset = address - 0x080000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x090000 && address <= 0x090fff) { @@ -1983,8 +1983,8 @@ namespace MAME.Core if (address >= 0x080000 && address + 1 <= 0x083fff) { int offset = address - 0x080000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x090000 && address + 1 <= 0x090fff) { @@ -2032,10 +2032,10 @@ namespace MAME.Core if (address >= 0x080000 && address + 3 <= 0x083fff) { int offset = address - 0x080000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x090000 && address + 3 <= 0x090fff) { @@ -2078,9 +2078,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -2090,7 +2090,7 @@ namespace MAME.Core else if (address >= 0x090000 && address <= 0x093fff) { int offset = address - 0x090000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } return result; } @@ -2100,9 +2100,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -2124,7 +2124,7 @@ namespace MAME.Core else if (address >= 0x090000 && address <= 0x093fff) { int offset = address - 0x090000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x0a0000 && address <= 0x0a0001) { @@ -2248,9 +2248,9 @@ namespace MAME.Core short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2260,7 +2260,7 @@ namespace MAME.Core else if (address >= 0x090000 && address + 1 <= 0x093fff) { int offset = address - 0x090000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } return result; } @@ -2270,9 +2270,9 @@ namespace MAME.Core short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2287,7 +2287,7 @@ namespace MAME.Core else if (address >= 0x090000 && address + 1 <= 0x093fff) { int offset = address - 0x090000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x0a0000 && address + 1 <= 0x0a0001) { @@ -2347,9 +2347,9 @@ namespace MAME.Core int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2359,7 +2359,7 @@ namespace MAME.Core else if (address >= 0x090000 && address + 3 <= 0x093fff) { int offset = address - 0x090000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } return result; } @@ -2369,10 +2369,10 @@ namespace MAME.Core int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2387,7 +2387,7 @@ namespace MAME.Core else if (address >= 0x090000 && address + 3 <= 0x093fff) { int offset = address - 0x090000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x0a0020 && address + 3 <= 0x0a0023) { @@ -2429,7 +2429,7 @@ namespace MAME.Core else if (address >= 0x090000 && address <= 0x093fff) { int offset = address - 0x090000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x0a0018 && address <= 0x0a0019) { @@ -2517,8 +2517,8 @@ namespace MAME.Core else if (address >= 0x090000 && address + 1 <= 0x093fff) { int offset = address - 0x090000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x0a0018 && address + 1 <= 0x0a0019) { @@ -2565,10 +2565,10 @@ namespace MAME.Core else if (address >= 0x090000 && address + 3 <= 0x093fff) { int offset = address - 0x090000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x0b0000 && address + 3 <= 0x0b3fff) { @@ -2601,11 +2601,11 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x0bffff) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else if (address >= 0x104000 && address <= 0x107fff) { - result = (sbyte)Memory.mainram_Ptr[address - 0x104000]; + result = (sbyte)Memory.mainram[address - 0x104000]; } return result; } @@ -2615,11 +2615,11 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x0bffff) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else if (address >= 0x104000 && address <= 0x107fff) { - result = (sbyte)Memory.mainram_Ptr[address - 0x104000]; + result = (sbyte)Memory.mainram[address - 0x104000]; } else if (address >= 0x140000 && address <= 0x140fff) { @@ -2774,9 +2774,9 @@ namespace MAME.Core short result = 0; if (address <= 0x0bffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2785,7 +2785,7 @@ namespace MAME.Core } else if (address >= 0x104000 && address + 1 <= 0x107fff) { - result = (short)(Memory.mainram_Ptr[address - 0x104000] * 0x100 + Memory.mainram_Ptr[address - 0x104000 + 1]); + result = (short)(Memory.mainram[address - 0x104000] * 0x100 + Memory.mainram[address - 0x104000 + 1]); } return result; } @@ -2795,9 +2795,9 @@ namespace MAME.Core short result = 0; if (address <= 0x0bffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2806,7 +2806,7 @@ namespace MAME.Core } else if (address >= 0x104000 && address + 1 <= 0x107fff) { - result = (short)(Memory.mainram_Ptr[address - 0x104000] * 0x100 + Memory.mainram_Ptr[address - 0x104000 + 1]); + result = (short)(Memory.mainram[address - 0x104000] * 0x100 + Memory.mainram[address - 0x104000 + 1]); } else if (address >= 0x140000 && address + 1 <= 0x140fff) { @@ -2877,9 +2877,9 @@ namespace MAME.Core int result = 0; if (address <= 0x0bffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2888,7 +2888,7 @@ namespace MAME.Core } else if (address >= 0x104000 && address + 3 <= 0x107fff) { - result = (int)(Memory.mainram_Ptr[address - 0x104000] * 0x1000000 + Memory.mainram_Ptr[address - 0x104000 + 1] * 0x10000 + Memory.mainram_Ptr[address - 0x104000 + 2] * 0x100 + Memory.mainram_Ptr[address - 0x104000 + 3]); + result = (int)(Memory.mainram[address - 0x104000] * 0x1000000 + Memory.mainram[address - 0x104000 + 1] * 0x10000 + Memory.mainram[address - 0x104000 + 2] * 0x100 + Memory.mainram[address - 0x104000 + 3]); } return result; } @@ -2898,9 +2898,9 @@ namespace MAME.Core int result = 0; if (address <= 0x0bffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2909,7 +2909,7 @@ namespace MAME.Core } else if (address >= 0x104000 && address + 3 <= 0x107fff) { - result = (int)(Memory.mainram_Ptr[address - 0x104000] * 0x1000000 + Memory.mainram_Ptr[address - 0x104000 + 1] * 0x10000 + Memory.mainram_Ptr[address - 0x104000 + 2] * 0x100 + Memory.mainram_Ptr[address - 0x104000 + 3]); + result = (int)(Memory.mainram[address - 0x104000] * 0x1000000 + Memory.mainram[address - 0x104000 + 1] * 0x10000 + Memory.mainram[address - 0x104000 + 2] * 0x100 + Memory.mainram[address - 0x104000 + 3]); } else if (address >= 0x140000 && address + 3 <= 0x140fff) { @@ -2948,7 +2948,7 @@ namespace MAME.Core if (address >= 0x104000 && address <= 0x107fff) { int offset = address - 0x104000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x140000 && address <= 0x140fff) { @@ -3071,8 +3071,8 @@ namespace MAME.Core if (address >= 0x104000 && address + 1 <= 0x107fff) { int offset = address - 0x104000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x140000 && address + 1 <= 0x140fff) { @@ -3141,10 +3141,10 @@ namespace MAME.Core if (address >= 0x104000 && address + 3 <= 0x107fff) { int offset = address - 0x104000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x140000 && address + 3 <= 0x140fff) { @@ -3196,12 +3196,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0x87ff) { int offset = address - 0x8000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else { @@ -3214,12 +3214,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0x87ff) { int offset = address - 0x8000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0xa000) { @@ -3241,7 +3241,7 @@ namespace MAME.Core if (address >= 0x8000 && address <= 0x87ff) { int offset = address - 0x8000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address >= 0xb000 && address <= 0xb00d) { @@ -3262,12 +3262,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0x87ff) { int offset = address - 0x8000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else { @@ -3280,12 +3280,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0x87ff) { int offset = address - 0x8000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0x9000) { @@ -3315,7 +3315,7 @@ namespace MAME.Core if (address >= 0x8000 && address <= 0x87ff) { int offset = address - 0x8000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0x9000) { @@ -3348,12 +3348,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else { @@ -3366,12 +3366,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0xf801) { @@ -3389,7 +3389,7 @@ namespace MAME.Core if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0xf800) { @@ -3414,12 +3414,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0x87ff) { int offset = address - 0x8000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else { @@ -3432,12 +3432,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0x87ff) { int offset = address - 0x8000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0xa001) { @@ -3455,7 +3455,7 @@ namespace MAME.Core if (address >= 0x8000 && address <= 0x87ff) { int offset = address - 0x8000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0xa000) { @@ -3476,12 +3476,12 @@ namespace MAME.Core byte result = 0; if (address <= 0xefff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else { @@ -3494,12 +3494,12 @@ namespace MAME.Core byte result = 0; if (address <= 0xefff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0xf801) { @@ -3517,7 +3517,7 @@ namespace MAME.Core if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0xf800) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Memory2.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Memory2.cs index 3fa833d..aefc71a 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Memory2.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Memory2.cs @@ -8,9 +8,9 @@ sbyte result = 0; if (address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -20,7 +20,7 @@ else if (address >= 0x204000 && address <= 0x207fff) { int offset = address - 0x204000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } return result; } @@ -30,9 +30,9 @@ sbyte result = 0; if (address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -54,7 +54,7 @@ else if (address >= 0x204000 && address <= 0x207fff) { int offset = address - 0x204000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x300000 && address <= 0x303fff) { @@ -170,9 +170,9 @@ short result = 0; if (address <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -182,7 +182,7 @@ else if (address >= 0x204000 && address + 1 <= 0x207fff) { int offset = address - 0x204000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } return result; } @@ -192,9 +192,9 @@ short result = 0; if (address <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -209,7 +209,7 @@ else if (address >= 0x204000 && address + 1 <= 0x207fff) { int offset = address - 0x204000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x300000 && address + 1 <= 0x303fff) { @@ -264,9 +264,9 @@ int result = 0; if (address <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -276,7 +276,7 @@ else if (address >= 0x204000 && address + 3 <= 0x207fff) { int offset = address - 0x204000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } return result; } @@ -286,10 +286,10 @@ int result = 0; if (address <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -304,7 +304,7 @@ else if (address >= 0x204000 && address + 3 <= 0x207fff) { int offset = address - 0x204000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x300000 && address + 3 <= 0x303fff) { @@ -356,7 +356,7 @@ else if (address >= 0x204000 && address <= 0x207fff) { int offset = address - 0x204000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x300000 && address <= 0x303fff) { @@ -472,8 +472,8 @@ else if (address >= 0x204000 && address + 1 <= 0x207fff) { int offset = address - 0x204000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x300000 && address + 1 <= 0x303fff) { @@ -534,10 +534,10 @@ else if (address >= 0x204000 && address + 3 <= 0x207fff) { int offset = address - 0x204000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x300000 && address + 3 <= 0x303fff) { @@ -576,9 +576,9 @@ sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -588,7 +588,7 @@ else if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } return result; } @@ -598,9 +598,9 @@ sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -610,7 +610,7 @@ else if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x104000 && address <= 0x107fff) { @@ -760,9 +760,9 @@ short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -772,7 +772,7 @@ else if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } return result; } @@ -782,9 +782,9 @@ short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -794,7 +794,7 @@ else if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x104000 && address + 1 <= 0x107fff) { @@ -864,9 +864,9 @@ int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -876,7 +876,7 @@ else if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } return result; } @@ -886,10 +886,10 @@ int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -899,7 +899,7 @@ else if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x104000 && address + 3 <= 0x107fff) { @@ -944,7 +944,7 @@ if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value); + Memory.mainram[offset] = (byte)(value); } else if (address >= 0x104000 && address <= 0x107fff) { @@ -1077,8 +1077,8 @@ if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x104000 && address + 1 <= 0x107fff) { @@ -1141,10 +1141,10 @@ if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x104000 && address + 3 <= 0x107fff) { @@ -1207,9 +1207,9 @@ sbyte result = 0; if (address <= 0x0fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1219,7 +1219,7 @@ else if (address >= 0x104000 && address <= 0x107fff) { int offset = address - 0x104000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } return result; } @@ -1229,9 +1229,9 @@ sbyte result = 0; if (address <= 0x0fffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1241,7 +1241,7 @@ else if (address >= 0x104000 && address <= 0x107fff) { int offset = address - 0x104000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x140000 && address <= 0x140fff) { @@ -1386,9 +1386,9 @@ short result = 0; if (address <= 0x0fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1398,7 +1398,7 @@ else if (address >= 0x104000 && address + 1 <= 0x107fff) { int offset = address - 0x104000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } return result; } @@ -1408,9 +1408,9 @@ short result = 0; if (address <= 0x0fffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1420,7 +1420,7 @@ else if (address >= 0x104000 && address + 1 <= 0x107fff) { int offset = address - 0x104000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x140000 && address + 1 <= 0x140fff) { @@ -1494,9 +1494,9 @@ int result = 0; if (address <= 0x0fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1506,7 +1506,7 @@ else if (address >= 0x104000 && address + 3 <= 0x107fff) { int offset = address - 0x104000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } return result; } @@ -1516,10 +1516,10 @@ int result = 0; if (address <= 0x0fffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1529,7 +1529,7 @@ else if (address >= 0x104000 && address + 3 <= 0x107fff) { int offset = address - 0x104000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x140000 && address + 3 <= 0x140fff) { @@ -1569,7 +1569,7 @@ if (address >= 0x104000 && address <= 0x107fff) { int offset = address - 0x104000; - Memory.mainram_Ptr[offset] = (byte)(value); + Memory.mainram[offset] = (byte)(value); } else if (address >= 0x140000 && address <= 0x140fff) { @@ -1699,8 +1699,8 @@ if (address >= 0x104000 && address + 1 <= 0x107fff) { int offset = address - 0x104000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x140000 && address + 1 <= 0x140fff) { @@ -1768,10 +1768,10 @@ if (address >= 0x104000 && address + 3 <= 0x107fff) { int offset = address - 0x104000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x140000 && address + 3 <= 0x140fff) { @@ -1824,9 +1824,9 @@ sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1836,7 +1836,7 @@ else if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } return result; } @@ -1846,9 +1846,9 @@ sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1858,7 +1858,7 @@ else if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x200000 && address <= 0x200fff) { @@ -1948,9 +1948,9 @@ short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1960,7 +1960,7 @@ else if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } return result; } @@ -1970,9 +1970,9 @@ short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1982,7 +1982,7 @@ else if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x200000 && address + 1 <= 0x200fff) { @@ -2030,9 +2030,9 @@ int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2042,7 +2042,7 @@ else if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } return result; } @@ -2052,10 +2052,10 @@ int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2065,7 +2065,7 @@ else if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x200000 && address + 3 <= 0x200fff) { @@ -2105,7 +2105,7 @@ if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value); + Memory.mainram[offset] = (byte)(value); } else if (address >= 0x200000 && address <= 0x200fff) { @@ -2199,8 +2199,8 @@ if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x200000 && address + 1 <= 0x200fff) { @@ -2255,10 +2255,10 @@ if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x200000 && address + 3 <= 0x200fff) { @@ -2307,9 +2307,9 @@ sbyte result = 0; if (address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -2319,7 +2319,7 @@ else if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } return result; } @@ -2329,9 +2329,9 @@ sbyte result = 0; if (address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -2341,7 +2341,7 @@ else if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x104000 && address <= 0x107fff) { @@ -2456,9 +2456,9 @@ short result = 0; if (address <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2468,7 +2468,7 @@ else if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } return result; } @@ -2478,9 +2478,9 @@ short result = 0; if (address <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2490,7 +2490,7 @@ else if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x104000 && address + 1 <= 0x107fff) { @@ -2545,9 +2545,9 @@ int result = 0; if (address <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2557,7 +2557,7 @@ else if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } return result; } @@ -2567,10 +2567,10 @@ int result = 0; if (address <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2580,7 +2580,7 @@ else if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x104000 && address + 3 <= 0x107fff) { @@ -2620,7 +2620,7 @@ if (address >= 0x100000 && address <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value); + Memory.mainram[offset] = (byte)(value); } else if (address >= 0x104000 && address <= 0x107fff) { @@ -2756,8 +2756,8 @@ if (address >= 0x100000 && address + 1 <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x104000 && address + 1 <= 0x107fff) { @@ -2823,10 +2823,10 @@ if (address >= 0x100000 && address + 3 <= 0x103fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x104000 && address + 3 <= 0x107fff) { @@ -2888,12 +2888,12 @@ byte result = 0; if (address <= 0xefff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else { @@ -2906,12 +2906,12 @@ byte result = 0; if (address <= 0xefff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address >= 0xf800 && address <= 0xf82f) { @@ -2925,7 +2925,7 @@ if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address >= 0xf800 && address <= 0xf82f) { @@ -2942,12 +2942,12 @@ byte result = 0; if (address <= 0xefff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else { @@ -2960,12 +2960,12 @@ byte result = 0; if (address <= 0xefff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0xf801 || address == 0xf811) { @@ -2983,7 +2983,7 @@ if (address >= 0xf000 && address <= 0xf7ff) { int offset = address - 0xf000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0xf800 || address == 0xf810) { @@ -3008,17 +3008,17 @@ byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - result = Memory.audiorom_Ptr[basebanksnd + offset]; + result = Memory.audiorom[basebanksnd + offset]; } else if (address >= 0xc000 && address <= 0xdfff) { int offset = address - 0xc000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else { @@ -3031,17 +3031,17 @@ byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - result = Memory.audiorom_Ptr[basebanksnd + offset]; + result = Memory.audiorom[basebanksnd + offset]; } else if (address >= 0xc000 && address <= 0xdfff) { int offset = address - 0xc000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address >= 0xe000 && address <= 0xe0ff) { @@ -3068,12 +3068,12 @@ if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - Memory.audiorom_Ptr[basebanksnd + offset] = value; + Memory.audiorom[basebanksnd + offset] = value; } else if (address >= 0xc000 && address <= 0xdfff) { int offset = address - 0xc000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address >= 0xe000 && address <= 0xe0ff) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/State.cs index 648d1e0..67d4aa0 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/State.cs @@ -45,10 +45,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); writer.Write(mainram2, 0, 0x4000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); writer.Write(EmuTimer.global_basetime.attoseconds); @@ -151,10 +151,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); writer.Write(mainram2, 0, 0x4000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -280,9 +280,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -419,9 +419,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -525,9 +525,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -629,9 +629,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -736,9 +736,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -838,10 +838,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); writer.Write(mainram2, 0, 0x80); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -946,10 +946,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); writer.Write(mainram2, 0, 0x80); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -1051,9 +1051,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); @@ -1156,9 +1156,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x2000); + writer.Write(Memory.audioram, 0, 0x2000); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs index 9ecce3d..63e72d7 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs @@ -137,20 +137,20 @@ namespace MAME.Core } public static byte soundram_r(int offset) { - return Memory.audioram_Ptr[offset]; + return Memory.audioram[offset]; } public static ushort soundram_r2(int offset) { - return (ushort)(Memory.audioram_Ptr[offset * 2 + 0] | (Memory.audioram_Ptr[offset * 2 + 1] << 8)); + return (ushort)(Memory.audioram[offset * 2 + 0] | (Memory.audioram[offset * 2 + 1] << 8)); } public static void soundram_w(int offset, byte data) { - Memory.audioram_Ptr[offset] = data; + Memory.audioram[offset] = data; } public static void soundram_w(int offset, ushort data) { - Memory.audioram_Ptr[offset * 2] = (byte)data; - Memory.audioram_Ptr[offset * 2 + 1] = (byte)(data >> 8); + Memory.audioram[offset * 2] = (byte)data; + Memory.audioram[offset * 2 + 1] = (byte)(data >> 8); } public static void machine_start_m72() { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Memory.cs index 7480edd..a77707d 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Memory.cs @@ -10,7 +10,7 @@ byte result = 0; if (address >= 0 && address <= 0xfffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -20,11 +20,11 @@ byte result = 0; if (address >= 0 && address <= 0x7ffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0xa0000 && address <= 0xa3fff) { - result = Memory.mainram_Ptr[address - 0xa0000]; + result = Memory.mainram[address - 0xa0000]; } else if (address >= 0xc0000 && address <= 0xc03ff) { @@ -58,7 +58,7 @@ } else if (address >= 0xffff0 && address <= 0xfffff) { - result = Memory.mainrom_Ptr[address & 0xfffff]; + result = Memory.mainrom[address & 0xfffff]; } return result; } @@ -68,11 +68,11 @@ ushort result = 0; if (address >= 0 && address + 1 <= 0x7ffff) { - result = (ushort)(Memory.mainrom_Ptr[address] + Memory.mainrom_Ptr[address + 1] * 0x100); + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); } else if (address >= 0xa0000 && address + 1 <= 0xa3fff) { - result = (ushort)(Memory.mainram_Ptr[address - 0xa0000] + Memory.mainram_Ptr[address - 0xa0000 + 1] * 0x100); + result = (ushort)(Memory.mainram[address - 0xa0000] + Memory.mainram[address - 0xa0000 + 1] * 0x100); } else if (address >= 0xc0000 && address + 1 <= 0xc03ff) { @@ -106,7 +106,7 @@ } else if (address >= 0xffff0 && address + 1 <= 0xfffff) { - result = (ushort)(Memory.mainrom_Ptr[address] + Memory.mainrom_Ptr[address + 1] * 0x100); + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); } return result; } @@ -115,7 +115,7 @@ address &= 0xfffff; if (address >= 0xa0000 && address <= 0xa3fff) { - Memory.mainram_Ptr[address - 0xa0000] = value; + Memory.mainram[address - 0xa0000] = value; } else if (address >= 0xc0000 && address <= 0xc03ff) { @@ -153,8 +153,8 @@ address &= 0xfffff; if (address >= 0xa0000 && address + 1 <= 0xa3fff) { - Memory.mainram_Ptr[address - 0xa0000] = (byte)value; - Memory.mainram_Ptr[address - 0xa0000 + 1] = (byte)(value >> 8); + Memory.mainram[address - 0xa0000] = (byte)value; + Memory.mainram[address - 0xa0000 + 1] = (byte)(value >> 8); } else if (address >= 0xc0000 && address + 1 <= 0xc03ff) { @@ -305,7 +305,7 @@ byte result = 0; if (address >= 0 && address <= 0x7ffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0x80000 && address <= 0x83fff) { @@ -334,11 +334,11 @@ } else if (address >= 0xe0000 && address <= 0xe3fff) { - result = Memory.mainram_Ptr[address - 0xe0000]; + result = Memory.mainram[address - 0xe0000]; } else if (address >= 0xffff0 && address <= 0xfffff) { - result = Memory.mainrom_Ptr[address & 0xfffff]; + result = Memory.mainrom[address & 0xfffff]; } return result; } @@ -348,7 +348,7 @@ ushort result = 0; if (address >= 0 && address + 1 <= 0x7ffff) { - result = (ushort)(Memory.mainrom_Ptr[address] + Memory.mainrom_Ptr[address + 1] * 0x100); + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); } else if (address >= 0x80000 && address + 1 <= 0x83fff) { @@ -377,11 +377,11 @@ } else if (address >= 0xe0000 && address + 1 <= 0xe3fff) { - result = (ushort)(Memory.mainram_Ptr[address - 0xe0000] + Memory.mainram_Ptr[address - 0xe0000 + 1] * 0x100); + result = (ushort)(Memory.mainram[address - 0xe0000] + Memory.mainram[address - 0xe0000 + 1] * 0x100); } else if (address >= 0xffff0 && address + 1 <= 0xfffff) { - result = (ushort)(Memory.mainrom_Ptr[address] + Memory.mainrom_Ptr[address + 1] * 0x100); + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); } return result; } @@ -423,7 +423,7 @@ } else if (address >= 0xe0000 && address <= 0xe3fff) { - Memory.mainram_Ptr[address - 0xe0000] = value; + Memory.mainram[address - 0xe0000] = value; } } public static void NWriteWord_kengo(int address, ushort value) @@ -464,8 +464,8 @@ } else if (address >= 0xe0000 && address + 1 <= 0xe3fff) { - Memory.mainram_Ptr[address - 0xe0000] = (byte)value; - Memory.mainram_Ptr[address - 0xe0000 + 1] = (byte)(value >> 8); + Memory.mainram[address - 0xe0000] = (byte)value; + Memory.mainram[address - 0xe0000 + 1] = (byte)(value >> 8); } } public static void NWriteIOByte_kengo(int address, byte value) @@ -535,7 +535,7 @@ byte result = 0; if (address >= 0 && address <= 0xffff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } return result; } @@ -544,7 +544,7 @@ byte result = 0; if (address >= 0 && address <= 0xffff) { - result = Memory.audioram_Ptr[address]; + result = Memory.audioram[address]; } return result; } @@ -553,11 +553,11 @@ byte result = 0; if (address >= 0 && address <= 0xefff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xf000 && address <= 0xffff) { - result = Memory.audioram_Ptr[address - 0xf000]; + result = Memory.audioram[address - 0xf000]; } return result; } @@ -565,14 +565,14 @@ { if (address >= 0x0000 && address <= 0xffff) { - Memory.audioram_Ptr[address] = value; + Memory.audioram[address] = value; } } public static void ZWriteMemory_rom(ushort address, byte value) { if (address >= 0xf000 && address <= 0xffff) { - Memory.audioram_Ptr[address - 0xf000] = value; + Memory.audioram[address - 0xf000] = value; } } public static byte ZReadHardware(ushort address) diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Memory2.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Memory2.cs index 7a8eb36..10ae392 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Memory2.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Memory2.cs @@ -15,7 +15,7 @@ namespace MAME.Core } else { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/State.cs index 8a2fe8f..87a6d9b 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/State.cs @@ -45,9 +45,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x4000); + writer.Write(Memory.mainram, 0, 0x4000); Nec.nn1[0].SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x10000); + writer.Write(Memory.audioram, 0, 0x10000); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary_v(writer); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Memory.cs index c110981..b9c420b 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Memory.cs @@ -10,7 +10,7 @@ byte result = 0; if (address >= 0 && address <= 0xfffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -20,16 +20,16 @@ byte result = 0; if (address >= 0 && address <= 0x9ffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0xa0000 && address <= 0xbffff) { int offset = address - 0xa0000; - result = Memory.mainrom_Ptr[bankaddress + offset]; + result = Memory.mainrom[bankaddress + offset]; } else if (address >= 0xc0000 && address <= 0xcffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0xd0000 && address <= 0xdffff) { @@ -46,7 +46,7 @@ else if (address >= 0xe0000 && address <= 0xeffff) { int offset = address - 0xe0000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } else if (address >= 0xf8000 && address <= 0xf87ff) { @@ -60,7 +60,7 @@ } else if (address >= 0xffff0 && address <= 0xfffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -70,16 +70,16 @@ ushort result = 0; if (address >= 0 && address + 1 <= 0x9ffff) { - result = (ushort)(Memory.mainrom_Ptr[address] + Memory.mainrom_Ptr[address + 1] * 0x100); + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); } else if (address >= 0xa0000 && address + 1 <= 0xbffff) { int offset = address - 0xa0000; - result = (ushort)(Memory.mainrom_Ptr[bankaddress + offset] + Memory.mainrom_Ptr[bankaddress + offset + 1] * 0x100); + result = (ushort)(Memory.mainrom[bankaddress + offset] + Memory.mainrom[bankaddress + offset + 1] * 0x100); } else if (address >= 0xc0000 && address + 1 <= 0xcffff) { - result = (ushort)(Memory.mainrom_Ptr[address] + Memory.mainrom_Ptr[address + 1] * 0x100); + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); } else if (address >= 0xd0000 && address + 1 <= 0xdffff) { @@ -89,7 +89,7 @@ else if (address >= 0xe0000 && address + 1 <= 0xeffff) { int offset = address - 0xe0000; - result = (ushort)(Memory.mainram_Ptr[offset] + Memory.mainram_Ptr[offset + 1] * 0x100); + result = (ushort)(Memory.mainram[offset] + Memory.mainram[offset + 1] * 0x100); } else if (address >= 0xf8000 && address + 1 <= 0xf87ff) { @@ -103,7 +103,7 @@ } else if (address >= 0xffff0 && address + 1 <= 0xfffff) { - result = (ushort)(Memory.mainrom_Ptr[address] + Memory.mainrom_Ptr[address + 1] * 0x100); + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); } return result; } @@ -126,7 +126,7 @@ else if (address >= 0xe0000 && address <= 0xeffff) { int offset = address - 0xe0000; - Memory.mainram_Ptr[offset] = value; + Memory.mainram[offset] = value; } else if (address >= 0xf8000 && address <= 0xf87ff) { @@ -170,8 +170,8 @@ else if (address >= 0xe0000 && address + 1 <= 0xeffff) { int offset = address - 0xe0000; - Memory.mainram_Ptr[offset] = (byte)value; - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 8); + Memory.mainram[offset] = (byte)value; + Memory.mainram[offset + 1] = (byte)(value >> 8); } else if (address >= 0xf8000 && address + 1 <= 0xf87ff) { @@ -363,12 +363,12 @@ byte result = 0; if (address >= 0 && address <= 0x1ffff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xffff0 && address <= 0xfffff) { int offset = address - 0xe0000; - result = Memory.audiorom_Ptr[offset]; + result = Memory.audiorom[offset]; } return result; } @@ -378,12 +378,12 @@ byte result = 0; if (address >= 0 && address <= 0x1ffff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xa0000 && address <= 0xa3fff) { int offset = address - 0xa0000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address >= 0xa8000 && address <= 0xa803f) { @@ -401,7 +401,7 @@ else if (address >= 0xffff0 && address <= 0xfffff) { int offset = address - 0xe0000; - result = Memory.mainrom_Ptr[offset]; + result = Memory.mainrom[offset]; } return result; } @@ -411,12 +411,12 @@ ushort result = 0; if (address >= 0 && address + 1 <= 0x1ffff) { - result = (ushort)(Memory.audiorom_Ptr[address] + Memory.audiorom_Ptr[address + 1] * 0x100); + result = (ushort)(Memory.audiorom[address] + Memory.audiorom[address + 1] * 0x100); } else if (address >= 0xa0000 && address + 1 <= 0xa3fff) { int offset = address - 0xa0000; - result = (ushort)(Memory.audioram_Ptr[offset] + Memory.audioram_Ptr[offset + 1] * 0x100); + result = (ushort)(Memory.audioram[offset] + Memory.audioram[offset + 1] * 0x100); } else if (address >= 0xa8000 && address + 1 <= 0xa803f) { @@ -434,7 +434,7 @@ else if (address >= 0xffff0 && address + 1 <= 0xfffff) { int offset = address - 0xe0000; - result = (ushort)(Memory.mainrom_Ptr[offset] + Memory.mainrom_Ptr[offset + 1] * 0x100); + result = (ushort)(Memory.mainrom[offset] + Memory.mainrom[offset + 1] * 0x100); } return result; } @@ -448,7 +448,7 @@ else if (address >= 0xa0000 && address <= 0xa3fff) { int offset = address - 0xa0000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address >= 0xa8000 && address <= 0xa803f) { @@ -482,8 +482,8 @@ else if (address >= 0xa0000 && address + 1 <= 0xa3fff) { int offset = address - 0xa0000; - Memory.audioram_Ptr[offset] = (byte)value; - Memory.audioram_Ptr[offset + 1] = (byte)(value >> 8); + Memory.audioram[offset] = (byte)value; + Memory.audioram[offset + 1] = (byte)(value >> 8); } else if (address >= 0xa8000 && address + 1 <= 0xa803f) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Memory2.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Memory2.cs index 4fbdf63..c74080a 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Memory2.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Memory2.cs @@ -8,7 +8,7 @@ byte result = 0; if (address >= 0 && address <= 0x7ffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0x80000 && address <= 0x8ffff) { @@ -25,7 +25,7 @@ else if (address >= 0xe0000 && address <= 0xeffff) { int offset = address - 0xe0000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } else if (address >= 0xf8000 && address <= 0xf87ff) { @@ -39,7 +39,7 @@ } else if (address >= 0xffff0 && address <= 0xfffff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -49,7 +49,7 @@ ushort result = 0; if (address >= 0 && address + 1 <= 0x7ffff) { - result = (ushort)(Memory.mainrom_Ptr[address] + Memory.mainrom_Ptr[address + 1] * 0x100); + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); } else if (address >= 0x80000 && address + 1 <= 0x8ffff) { @@ -59,7 +59,7 @@ else if (address >= 0xe0000 && address + 1 <= 0xeffff) { int offset = address - 0xe0000; - result = (ushort)(Memory.mainram_Ptr[offset] + Memory.mainram_Ptr[offset + 1] * 0x100); + result = (ushort)(Memory.mainram[offset] + Memory.mainram[offset + 1] * 0x100); } else if (address >= 0xf8000 && address + 1 <= 0xf87ff) { @@ -73,7 +73,7 @@ } else if (address >= 0xffff0 && address + 1 <= 0xfffff) { - result = (ushort)(Memory.mainrom_Ptr[address] + Memory.mainrom_Ptr[address + 1] * 0x100); + result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100); } return result; } @@ -96,7 +96,7 @@ else if (address >= 0xe0000 && address <= 0xeffff) { int offset = address - 0xe0000; - Memory.mainram_Ptr[offset] = value; + Memory.mainram[offset] = value; } else if (address >= 0xf8000 && address <= 0xf87ff) { @@ -140,8 +140,8 @@ else if (address >= 0xe0000 && address + 1 <= 0xeffff) { int offset = address - 0xe0000; - Memory.mainram_Ptr[offset] = (byte)value; - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 8); + Memory.mainram[offset] = (byte)value; + Memory.mainram[offset + 1] = (byte)(value >> 8); } else if (address >= 0xf8000 && address + 1 <= 0xf87ff) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/State.cs index dd8c6c2..1b705cd 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/State.cs @@ -59,9 +59,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x10000); + writer.Write(Memory.mainram, 0, 0x10000); Nec.nn1[0].SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x4000); + writer.Write(Memory.audioram, 0, 0x4000); Nec.nn1[1].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); Cpuint.SaveStateBinary_v(writer); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Memory.cs index afaf616..3681090 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Memory.cs @@ -18,20 +18,20 @@ namespace MAME.Core } else if (main_cpu_vector_table_source == 1) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } } else if (address >= 0x000080 && address <= 0x0fffff) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else if (address >= 0x100000 && address <= 0x1fffff) { - result = (sbyte)Memory.mainram_Ptr[address & 0xffff]; + result = (sbyte)Memory.mainram[address & 0xffff]; } else if (address >= 0x200000 && address <= 0x2fffff) { - result = (sbyte)Memory.mainrom_Ptr[main_cpu_bank_address + (address - 0x200000)]; + result = (sbyte)Memory.mainrom[main_cpu_bank_address + (address - 0x200000)]; } else if (address >= 0xc00000 && address <= 0xcfffff) { @@ -55,20 +55,20 @@ namespace MAME.Core } else if (main_cpu_vector_table_source == 1) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } } else if (address >= 0x000080 && address <= 0x0fffff) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else if (address >= 0x100000 && address <= 0x1fffff) { - result = (sbyte)Memory.mainram_Ptr[address & 0xffff]; + result = (sbyte)Memory.mainram[address & 0xffff]; } else if (address >= 0x200000 && address <= 0x2fffff) { - result = (sbyte)Memory.mainrom_Ptr[main_cpu_bank_address + (address - 0x200000)]; + result = (sbyte)Memory.mainrom[main_cpu_bank_address + (address - 0x200000)]; } /*else if (address >= 0x300000 && address <= 0x300001) { @@ -187,7 +187,7 @@ namespace MAME.Core } else if (main_cpu_vector_table_source == 1) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } } else if (address >= 0x000080 && address + 1 <= 0x0fffff) @@ -196,15 +196,15 @@ namespace MAME.Core { //m68000Form.iStatus = 1; } - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else if (address >= 0x100000 && address + 1 <= 0x1fffff) { - result = (short)(Memory.mainram_Ptr[address & 0xffff] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 1]); + result = (short)(Memory.mainram[address & 0xffff] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); } else if (address >= 0x200000 && address + 1 <= 0x2fffff) { - result = (short)(Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff)] * 0x100 + Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff) + 1]); + result = (short)(Memory.mainrom[main_cpu_bank_address + (address & 0xfffff)] * 0x100 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 1]); } else if (address >= 0xc00000 && address + 1 <= 0xcfffff) { @@ -228,7 +228,7 @@ namespace MAME.Core } else if (main_cpu_vector_table_source == 1) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } } else if (address >= 0x000080 && address + 1 <= 0x0fffff) @@ -237,7 +237,7 @@ namespace MAME.Core { //m68000Form.iStatus = 1; } - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else if (address >= 0x100000 && address + 1 <= 0x1fffff) { @@ -245,11 +245,11 @@ namespace MAME.Core { int i1 = 1; } - result = (short)(Memory.mainram_Ptr[address & 0xffff] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 1]); + result = (short)(Memory.mainram[address & 0xffff] * 0x100 + Memory.mainram[(address & 0xffff) + 1]); } else if (address >= 0x200000 && address <= 0x2fffff) { - result = (short)(Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff)] * 0x100 + Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff) + 1]); + result = (short)(Memory.mainrom[main_cpu_bank_address + (address & 0xfffff)] * 0x100 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 1]); } /*else if (address >= 0x300000 && address <= 0x300001) { @@ -317,7 +317,7 @@ namespace MAME.Core } else if (main_cpu_vector_table_source == 1) { - result = Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]; + result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]; } } else if (address >= 0x000080 && address + 3 <= 0x0fffff) @@ -326,15 +326,15 @@ namespace MAME.Core { //m68000Form.iStatus = 1; } - result = Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]; + result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]; } else if (address >= 0x100000 && address + 3 <= 0x1fffff) { - result = Memory.mainram_Ptr[address & 0xffff] * 0x1000000 + Memory.mainram_Ptr[(address & 0xffff) + 1] * 0x10000 + Memory.mainram_Ptr[(address & 0xffff) + 2] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 3]; + result = Memory.mainram[address & 0xffff] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]; } else if (address >= 0x200000 && address + 3 <= 0x2fffff) { - result = Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff)] * 0x1000000 + Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff) + 1] * 0x10000 + Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff) + 2] * 0x100 + Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff) + 3]; + result = Memory.mainrom[main_cpu_bank_address + (address & 0xfffff)] * 0x1000000 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 1] * 0x10000 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 2] * 0x100 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 3]; } else if (address >= 0xc00000 && address + 3 <= 0xcfffff) { @@ -358,7 +358,7 @@ namespace MAME.Core } else if (main_cpu_vector_table_source == 1) { - result = Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]; + result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]; } } else if (address >= 0x000080 && address + 3 <= 0x0fffff) @@ -367,15 +367,15 @@ namespace MAME.Core { //m68000Form.iStatus = 1; } - result = Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]; + result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]; } else if (address >= 0x100000 && address + 3 <= 0x1fffff) { - result = Memory.mainram_Ptr[address & 0xffff] * 0x1000000 + Memory.mainram_Ptr[(address & 0xffff) + 1] * 0x10000 + Memory.mainram_Ptr[(address & 0xffff) + 2] * 0x100 + Memory.mainram_Ptr[(address & 0xffff) + 3]; + result = Memory.mainram[address & 0xffff] * 0x1000000 + Memory.mainram[(address & 0xffff) + 1] * 0x10000 + Memory.mainram[(address & 0xffff) + 2] * 0x100 + Memory.mainram[(address & 0xffff) + 3]; } else if (address >= 0x200000 && address + 3 <= 0x2fffff) { - result = Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff)] * 0x1000000 + Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff) + 1] * 0x10000 + Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff) + 2] * 0x100 + Memory.mainrom_Ptr[main_cpu_bank_address + (address & 0xfffff) + 3]; + result = Memory.mainrom[main_cpu_bank_address + (address & 0xfffff)] * 0x1000000 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 1] * 0x10000 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 2] * 0x100 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 3]; } else if (address >= 0x300000 && address <= 0x31ffff) { @@ -427,7 +427,7 @@ namespace MAME.Core int i2 = 1; //m68000Form.iStatus = 1; } - Memory.mainram_Ptr[address & 0xffff] = (byte)value; + Memory.mainram[address & 0xffff] = (byte)value; } else if (address >= 0x2ffff0 && address <= 0x2fffff) { @@ -500,8 +500,8 @@ namespace MAME.Core { int i1 = 1; } - Memory.mainram_Ptr[address & 0xffff] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)value; + Memory.mainram[address & 0xffff] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 1] = (byte)value; } else if (address >= 0x2ffff0 && address <= 0x2fffff) { @@ -551,10 +551,10 @@ namespace MAME.Core { int i1 = 1; } - Memory.mainram_Ptr[address & 0xffff] = (byte)(value >> 24); - Memory.mainram_Ptr[(address & 0xffff) + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[(address & 0xffff) + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[(address & 0xffff) + 3] = (byte)value; + Memory.mainram[address & 0xffff] = (byte)(value >> 24); + Memory.mainram[(address & 0xffff) + 1] = (byte)(value >> 16); + Memory.mainram[(address & 0xffff) + 2] = (byte)(value >> 8); + Memory.mainram[(address & 0xffff) + 3] = (byte)value; } else if (address >= 0x2ffff0 && address <= 0x2fffff) { @@ -1975,27 +1975,27 @@ namespace MAME.Core byte result = 0; if (address >= 0x0000 && address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { - result = Memory.audiorom_Ptr[audio_cpu_banks[3] * 0x4000 + address - 0x8000]; + result = Memory.audiorom[audio_cpu_banks[3] * 0x4000 + address - 0x8000]; } else if (address >= 0xc000 && address <= 0xdfff) { - result = Memory.audiorom_Ptr[audio_cpu_banks[2] * 0x2000 + address - 0xc000]; + result = Memory.audiorom[audio_cpu_banks[2] * 0x2000 + address - 0xc000]; } else if (address >= 0xe000 && address <= 0xefff) { - result = Memory.audiorom_Ptr[audio_cpu_banks[1] * 0x1000 + address - 0xe000]; + result = Memory.audiorom[audio_cpu_banks[1] * 0x1000 + address - 0xe000]; } else if (address >= 0xf000 && address <= 0xf7ff) { - result = Memory.audiorom_Ptr[audio_cpu_banks[0] * 0x800 + address - 0xf000]; + result = Memory.audiorom[audio_cpu_banks[0] * 0x800 + address - 0xf000]; } else if (address >= 0xf800 && address <= 0xffff) { - result = Memory.audioram_Ptr[address - 0xf800]; + result = Memory.audioram[address - 0xf800]; } return result; } @@ -2004,27 +2004,27 @@ namespace MAME.Core byte result = 0; if (address >= 0x0000 && address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { - result = Memory.audiorom_Ptr[audio_cpu_banks[3] * 0x4000 + address - 0x8000]; + result = Memory.audiorom[audio_cpu_banks[3] * 0x4000 + address - 0x8000]; } else if (address >= 0xc000 && address <= 0xdfff) { - result = Memory.audiorom_Ptr[audio_cpu_banks[2] * 0x2000 + address - 0xc000]; + result = Memory.audiorom[audio_cpu_banks[2] * 0x2000 + address - 0xc000]; } else if (address >= 0xe000 && address <= 0xefff) { - result = Memory.audiorom_Ptr[audio_cpu_banks[1] * 0x1000 + address - 0xe000]; + result = Memory.audiorom[audio_cpu_banks[1] * 0x1000 + address - 0xe000]; } else if (address >= 0xf000 && address <= 0xf7ff) { - result = Memory.audiorom_Ptr[audio_cpu_banks[0] * 0x800 + address - 0xf000]; + result = Memory.audiorom[audio_cpu_banks[0] * 0x800 + address - 0xf000]; } else if (address >= 0xf800 && address <= 0xffff) { - result = Memory.audioram_Ptr[address - 0xf800]; + result = Memory.audioram[address - 0xf800]; } return result; } @@ -2032,7 +2032,7 @@ namespace MAME.Core { if (address >= 0xf800 && address <= 0xffff) { - Memory.audioram_Ptr[address - 0xf800] = value; + Memory.audioram[address - 0xf800] = value; } else { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neogeo.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neogeo.cs index 2429747..2ecad17 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neogeo.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neogeo.cs @@ -262,7 +262,7 @@ namespace MAME.Core public static void main_cpu_bank_select_w(int data) { int bank_address; - int len = Memory.mainrom_Lenght; + int len = Memory.mainromLength; if ((len <= 0x100000) && ((data & 0x07) != 0)) { int i1 = 1; @@ -313,7 +313,7 @@ namespace MAME.Core } public static void machine_start_neogeo() { - if (Memory.mainrom_Lenght > 0x100000) + if (Memory.mainromLength > 0x100000) { main_cpu_bank_address = 0x100000; } diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neoprot.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neoprot.cs index 7c4bcc9..c0338a2 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neoprot.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/Neoprot.cs @@ -63,16 +63,16 @@ namespace MAME.Core switch (value) { case 0x0090: - Memory.mainrom_Ptr[0x100] = 0x00; - Memory.mainrom_Ptr[0x101] = 0xc2; - Memory.mainrom_Ptr[0x102] = 0x00; - Memory.mainrom_Ptr[0x103] = 0xfd; + Memory.mainrom[0x100] = 0x00; + Memory.mainrom[0x101] = 0xc2; + Memory.mainrom[0x102] = 0x00; + Memory.mainrom[0x103] = 0xfd; break; case 0x00f0: - Memory.mainrom_Ptr[0x100] = 0x4e; - Memory.mainrom_Ptr[0x101] = 0x45; - Memory.mainrom_Ptr[0x102] = 0x4f; - Memory.mainrom_Ptr[0x103] = 0x2d; + Memory.mainrom[0x100] = 0x4e; + Memory.mainrom[0x101] = 0x45; + Memory.mainrom[0x102] = 0x4f; + Memory.mainrom[0x103] = 0x2d; break; default: break; @@ -305,7 +305,7 @@ namespace MAME.Core extra_ram[0x1ff1] = 0xa0; extra_ram[0x1ff2] &= 0x7f; main_cpu_bank_address = address + 0x100000; - Memory.mainrom_Ptr[0x58197] = prt; + Memory.mainrom[0x58197] = prt; } } public static void kof2003p_w(int offset) @@ -317,12 +317,12 @@ namespace MAME.Core extra_ram[0x1ff1] &= 0xfe; extra_ram[0x1ff2] &= 0x7f; main_cpu_bank_address = address + 0x100000; - Memory.mainrom_Ptr[0x58197] = prt; + Memory.mainrom[0x58197] = prt; } } public static byte sbp_protection_r(int offset) { - byte origdata = Memory.mainrom_Ptr[offset + 0x200]; + byte origdata = Memory.mainrom[offset + 0x200]; byte data = (byte)BITSWAP8(origdata, 3, 2, 1, 0, 7, 6, 5, 4); int realoffset = 0x200 + offset; if (realoffset == 0xd5e || realoffset == 0xd5f) @@ -348,7 +348,7 @@ namespace MAME.Core { if (extra_ram[0x1ffc] == 0 && extra_ram[0x1ffd] == 0) { - Memory.mainrom_Ptr[0xe0000 + offset] = (byte)data; + Memory.mainrom[0xe0000 + offset] = (byte)data; } else { @@ -359,8 +359,8 @@ namespace MAME.Core { if (extra_ram[0x1ffc] == 0 && extra_ram[0x1ffd] == 0) { - Memory.mainrom_Ptr[0xe0000 + offset] = (byte)(data >> 8); - Memory.mainrom_Ptr[0xe0000 + offset + 1] = (byte)data; + Memory.mainrom[0xe0000 + offset] = (byte)(data >> 8); + Memory.mainrom[0xe0000 + offset + 1] = (byte)data; } else { @@ -383,8 +383,8 @@ namespace MAME.Core //Array.Copy(Memory.mainrom, ((data & 1) != 0) ? 0x810000 : 0x710000, Memory.mainrom, 0x10000, 0xcffff); //TODO 验证拷贝可靠性 - byte* source = Memory.mainrom_Ptr + ((data & 1) != 0 ? 0x810000 : 0x710000); - byte* destination = Memory.mainrom_Ptr + 0x10000; + byte* source = Memory.mainrom + ((data & 1) != 0 ? 0x810000 : 0x710000); + byte* destination = Memory.mainrom + 0x10000; int length = 0xcffff; // 注意:这个长度是否正确取决于你的实际需求 Buffer.MemoryCopy(source, destination, length, length); } @@ -407,8 +407,8 @@ namespace MAME.Core //Array.Copy(Memory.mainrom, ((data & 1) != 0) ? 0x810000 : 0x710000, Memory.mainrom, 0x10000, 0xcffff); //TODO 验证拷贝可靠性 - byte* source = Memory.mainrom_Ptr + ((data & 1) != 0 ? 0x810000 : 0x710000); - byte* destination = Memory.mainrom_Ptr + 0x10000; + byte* source = Memory.mainrom + ((data & 1) != 0 ? 0x810000 : 0x710000); + byte* destination = Memory.mainrom + 0x10000; int length = 0xcffff; // 注意:这个长度是否正确取决于你的实际需求 Buffer.MemoryCopy(source, destination, length, length); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/State.cs index a1a27f2..d3d263e 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/neogeo/State.cs @@ -46,9 +46,9 @@ namespace MAME.Core writer.Write(auto_animation_disabled); writer.Write(auto_animation_counter); writer.Write(auto_animation_frame_counter); - writer.Write(Memory.mainram_Ptr, 0, 0x10000); + writer.Write(Memory.mainram, 0, 0x10000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/Memory.cs index acfb5d7..bf177ac 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/Memory.cs @@ -14,9 +14,9 @@ } else if (address >= 0x100000 && address <= 0x3fffff) { - if (address < 0x100000 + Memory.mainrom_Lenght) + if (address < 0x100000 + Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address - 0x100000]); + result = (sbyte)(Memory.mainrom[address - 0x100000]); } else { @@ -25,7 +25,7 @@ } /*else if (address >= 0x800000 && address <= 0x81ffff) { - result = (sbyte)Memory.mainram_Ptr[address - 0x800000]; + result = (sbyte)Memory.mainram[address - 0x800000]; }*/ return result; } @@ -39,9 +39,9 @@ } else if (address >= 0x100000 && address <= 0x3fffff) { - if (address < 0x100000 + Memory.mainrom_Lenght) + if (address < 0x100000 + Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address - 0x100000]); + result = (sbyte)(Memory.mainrom[address - 0x100000]); } else { @@ -50,7 +50,7 @@ } else if (address >= 0x800000 && address <= 0x81ffff) { - result = (sbyte)Memory.mainram_Ptr[address - 0x800000]; + result = (sbyte)Memory.mainram[address - 0x800000]; } else if (address >= 0x900000 && address <= 0x903fff) { @@ -128,9 +128,9 @@ } else if (address >= 0x100000 && address + 1 <= 0x3fffff) { - if (address + 1 < 0x100000 + Memory.mainrom_Lenght) + if (address + 1 < 0x100000 + Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address - 0x100000] * 0x100 + Memory.mainrom_Ptr[address - 0x100000 + 1]); + result = (short)(Memory.mainrom[address - 0x100000] * 0x100 + Memory.mainrom[address - 0x100000 + 1]); } else { @@ -139,7 +139,7 @@ } else if (address >= 0x800000 && address + 1 <= 0x81ffff) { - result = (short)(Memory.mainram_Ptr[address - 0x800000] * 0x100 + Memory.mainram_Ptr[address - 0x800000 + 1]); + result = (short)(Memory.mainram[address - 0x800000] * 0x100 + Memory.mainram[address - 0x800000 + 1]); } return result; } @@ -153,9 +153,9 @@ } else if (address >= 0x100000 && address + 1 <= 0x3fffff) { - if (address + 1 < 0x100000 + Memory.mainrom_Lenght) + if (address + 1 < 0x100000 + Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address - 0x100000] * 0x100 + Memory.mainrom_Ptr[address - 0x100000 + 1]); + result = (short)(Memory.mainrom[address - 0x100000] * 0x100 + Memory.mainrom[address - 0x100000 + 1]); } else { @@ -164,7 +164,7 @@ } else if (address >= 0x800000 && address + 1 <= 0x81ffff) { - result = (short)(Memory.mainram_Ptr[address - 0x800000] * 0x100 + Memory.mainram_Ptr[address - 0x800000 + 1]); + result = (short)(Memory.mainram[address - 0x800000] * 0x100 + Memory.mainram[address - 0x800000 + 1]); } else if (address >= 0x900000 && address + 1 <= 0x903fff) { @@ -235,9 +235,9 @@ } else if (address >= 0x100000 && address + 3 <= 0x3fffff) { - if (address + 3 < 0x100000 + Memory.mainrom_Lenght) + if (address + 3 < 0x100000 + Memory.mainromLength) { - result = Memory.mainrom_Ptr[address - 0x100000] * 0x1000000 + Memory.mainrom_Ptr[address - 0x100000 + 1] * 0x10000 + Memory.mainrom_Ptr[address - 0x100000 + 2] * 0x100 + Memory.mainrom_Ptr[address - 0x100000 + 3]; + result = Memory.mainrom[address - 0x100000] * 0x1000000 + Memory.mainrom[address - 0x100000 + 1] * 0x10000 + Memory.mainrom[address - 0x100000 + 2] * 0x100 + Memory.mainrom[address - 0x100000 + 3]; } else { @@ -246,7 +246,7 @@ } else if (address >= 0x800000 && address + 3 <= 0x81ffff) { - result = Memory.mainram_Ptr[address - 0x800000] * 0x1000000 + Memory.mainram_Ptr[address - 0x800000 + 1] * 0x10000 + Memory.mainram_Ptr[address - 0x800000 + 2] * 0x100 + Memory.mainram_Ptr[address - 0x800000 + 3]; + result = Memory.mainram[address - 0x800000] * 0x1000000 + Memory.mainram[address - 0x800000 + 1] * 0x10000 + Memory.mainram[address - 0x800000 + 2] * 0x100 + Memory.mainram[address - 0x800000 + 3]; } return result; } @@ -260,9 +260,9 @@ } else if (address >= 0x100000 && address + 3 <= 0x3fffff) { - if (address + 3 < 0x100000 + Memory.mainrom_Lenght) + if (address + 3 < 0x100000 + Memory.mainromLength) { - result = Memory.mainrom_Ptr[address - 0x100000] * 0x1000000 + Memory.mainrom_Ptr[address - 0x100000 + 1] * 0x10000 + Memory.mainrom_Ptr[address - 0x100000 + 2] * 0x100 + Memory.mainrom_Ptr[address - 0x100000 + 3]; + result = Memory.mainrom[address - 0x100000] * 0x1000000 + Memory.mainrom[address - 0x100000 + 1] * 0x10000 + Memory.mainrom[address - 0x100000 + 2] * 0x100 + Memory.mainrom[address - 0x100000 + 3]; } else { @@ -271,7 +271,7 @@ } else if (address >= 0x800000 && address + 3 <= 0x81ffff) { - result = Memory.mainram_Ptr[address - 0x800000] * 0x1000000 + Memory.mainram_Ptr[address - 0x800000 + 1] * 0x10000 + Memory.mainram_Ptr[address - 0x800000 + 2] * 0x100 + Memory.mainram_Ptr[address - 0x800000 + 3]; + result = Memory.mainram[address - 0x800000] * 0x1000000 + Memory.mainram[address - 0x800000 + 1] * 0x10000 + Memory.mainram[address - 0x800000 + 2] * 0x100 + Memory.mainram[address - 0x800000 + 3]; } else if (address >= 0x900000 && address + 3 <= 0x903fff) { @@ -342,7 +342,7 @@ else if (address >= 0x800000 && address <= 0x81ffff) { int offset = address - 0x800000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x900000 && address <= 0x903fff) { @@ -431,8 +431,8 @@ else if (address >= 0x800000 && address + 1 <= 0x81ffff) { int offset = address - 0x800000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x900000 && address + 1 <= 0x903fff) { @@ -507,10 +507,10 @@ else if (address >= 0x800000 && address + 3 <= 0x81ffff) { int offset = address - 0x800000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x900000 && address + 3 <= 0x903fff) { @@ -587,12 +587,12 @@ } public static byte ZReadMemory(ushort address) { - byte result = Memory.audioram_Ptr[address]; + byte result = Memory.audioram[address]; return result; } public static void ZWriteMemory(ushort address, byte value) { - Memory.audioram_Ptr[address] = value; + Memory.audioram[address] = value; } public static byte ZReadHardware(ushort address) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/PGM.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/PGM.cs index 7be946a..33161da 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/PGM.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/PGM.cs @@ -103,12 +103,12 @@ namespace MAME.Core } public unsafe static byte z80_ram_r(int offset) { - return Memory.audioram_Ptr[offset]; + return Memory.audioram[offset]; } public unsafe static void z80_ram_w(int offset, byte data) { int pc = MC68000.m1.PC; - Memory.audioram_Ptr[offset] = data; + Memory.audioram[offset] = data; if (pc != 0xf12 && pc != 0xde2 && pc != 0x100c50 && pc != 0x100b20) { //error diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/State.cs index db8d0ca..364a28e 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/State.cs @@ -33,9 +33,9 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x20000); + writer.Write(Memory.mainram, 0, 0x20000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x10000); + writer.Write(Memory.audioram, 0, 0x10000); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/Video.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/Video.cs index 853eb09..4194c94 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/Video.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/Video.cs @@ -398,7 +398,7 @@ namespace MAME.Core int i; for (i = 0; i < 0x500; i++) { - pgm_spritebufferram[i] = (ushort)(Memory.mainram_Ptr[i * 2] * 0x100 + Memory.mainram_Ptr[i * 2 + 1]); + pgm_spritebufferram[i] = (ushort)(Memory.mainram[i * 2] * 0x100 + Memory.mainram[i * 2 + 1]); } } } diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/Memory.cs index ee1d44b..c222001 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/Memory.cs @@ -16,7 +16,7 @@ namespace MAME.Core else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - result = Memory.mainrom_Ptr[basebankmain + offset]; + result = Memory.mainrom[basebankmain + offset]; } else { @@ -29,12 +29,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - result = Memory.mainrom_Ptr[basebankmain + offset]; + result = Memory.mainrom[basebankmain + offset]; } else if (address == 0xc000) { @@ -64,7 +64,7 @@ namespace MAME.Core else if (address >= 0xc800 && address <= 0xdfff) { int offset = address - 0xc800; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } else if (address >= 0xe000 && address <= 0xffff) { @@ -77,12 +77,12 @@ namespace MAME.Core { if (address <= 0x7fff) { - Memory.mainrom_Ptr[address] = value; + Memory.mainrom[address] = value; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - Memory.mainrom_Ptr[basebankmain + offset] = value; + Memory.mainrom[basebankmain + offset] = value; } else if (address == 0xc200) { @@ -116,7 +116,7 @@ namespace MAME.Core else if (address >= 0xc800 && address <= 0xdfff) { int offset = address - 0xc800; - Memory.mainram_Ptr[offset] = value; + Memory.mainram[offset] = value; } else if (address >= 0xe000 && address <= 0xffff) { @@ -141,7 +141,7 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } return result; } @@ -150,12 +150,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0xc000 && address <= 0xc7ff) { int offset = address - 0xc000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0xc800) { @@ -171,7 +171,7 @@ namespace MAME.Core { if (address <= 0x7fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0xa000 && address <= 0xa001) { @@ -186,7 +186,7 @@ namespace MAME.Core else if (address >= 0xc000 && address <= 0xc7ff) { int offset = address - 0xc000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0xd000) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Memory.cs index 4521355..74f334f 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Memory.cs @@ -12,12 +12,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - result = Memory.mainrom_Ptr[basebankmain + offset]; + result = Memory.mainrom[basebankmain + offset]; } else if (address >= 0xc000 && address <= 0xdcff) { @@ -32,7 +32,7 @@ namespace MAME.Core else if (address >= 0xe000 && address <= 0xf7ff) { int offset = address - 0xe000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } else if (address == 0xfa03) { @@ -73,12 +73,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - result = Memory.mainrom_Ptr[basebankmain + offset]; + result = Memory.mainrom[basebankmain + offset]; } else if (address >= 0xc000 && address <= 0xdcff) { @@ -93,7 +93,7 @@ namespace MAME.Core else if (address >= 0xe000 && address <= 0xf7ff) { int offset = address - 0xe000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } else if (address == 0xfa03) { @@ -134,12 +134,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - result = Memory.mainrom_Ptr[basebankmain + offset]; + result = Memory.mainrom[basebankmain + offset]; } else if (address >= 0xc000 && address <= 0xdcff) { @@ -154,7 +154,7 @@ namespace MAME.Core else if (address >= 0xe000 && address <= 0xf7ff) { int offset = address - 0xe000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } else if (address >= 0xfc00 && address <= 0xfcff) { @@ -202,12 +202,12 @@ namespace MAME.Core { if (address >= 0x0000 && address <= 0x7fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - Memory.mainrom_Ptr[basebankmain + offset] = value; + Memory.mainrom[basebankmain + offset] = value; } else if (address >= 0xc000 && address <= 0xdcff) { @@ -222,7 +222,7 @@ namespace MAME.Core else if (address >= 0xe000 && address <= 0xf7ff) { int offset = address - 0xe000; - Memory.mainram_Ptr[offset] = value; + Memory.mainram[offset] = value; } else if (address >= 0xf800 && address <= 0xf9ff) { @@ -258,12 +258,12 @@ namespace MAME.Core { if (address >= 0x0000 && address <= 0x7fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - Memory.mainrom_Ptr[basebankmain + offset] = value; + Memory.mainrom[basebankmain + offset] = value; } else if (address >= 0xc000 && address <= 0xdcff) { @@ -278,7 +278,7 @@ namespace MAME.Core else if (address >= 0xe000 && address <= 0xf7ff) { int offset = address - 0xe000; - Memory.mainram_Ptr[offset] = value; + Memory.mainram[offset] = value; } else if (address >= 0xf800 && address <= 0xf9ff) { @@ -340,7 +340,7 @@ namespace MAME.Core else if (address >= 0x8000 && address <= 0x97ff) { int offset = address - 0x8000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } return result; } @@ -354,7 +354,7 @@ namespace MAME.Core else if (address >= 0x8000 && address <= 0x97ff) { int offset = address - 0x8000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } return result; } @@ -367,7 +367,7 @@ namespace MAME.Core else if (address >= 0x8000 && address <= 0x97ff) { int offset = address - 0x8000; - Memory.mainram_Ptr[offset] = value; + Memory.mainram[offset] = value; } } public static byte Z2ReadMemory_tokio(ushort address) @@ -375,12 +375,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0x8fff) { int offset = address - 0x8000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0x9000) { @@ -400,7 +400,7 @@ namespace MAME.Core } else if (address >= 0xe000 && address <= 0xffff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } return result; } @@ -408,12 +408,12 @@ namespace MAME.Core { if (address <= 0x7fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0x8000 && address <= 0x8fff) { int offset = address - 0x8000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0x9000) { @@ -437,7 +437,7 @@ namespace MAME.Core } else if (address >= 0xe000 && address <= 0xffff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } } public static byte Z0ReadOp_bublbobl(ushort address) @@ -445,12 +445,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - result = Memory.mainrom_Ptr[basebankmain + offset]; + result = Memory.mainrom[basebankmain + offset]; } else { @@ -463,12 +463,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - result = Memory.mainrom_Ptr[basebankmain + offset]; + result = Memory.mainrom[basebankmain + offset]; } else if (address >= 0xc000 && address <= 0xdcff) { @@ -483,7 +483,7 @@ namespace MAME.Core else if (address >= 0xe000 && address <= 0xf7ff) { int offset = address - 0xe000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } else if (address >= 0xfc00 && address <= 0xffff) { @@ -500,12 +500,12 @@ namespace MAME.Core { if (address >= 0x0000 && address <= 0x7fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0x8000 && address <= 0xbfff) { int offset = address - 0x8000; - Memory.mainrom_Ptr[basebankmain + offset] = value; + Memory.mainrom[basebankmain + offset] = value; } else if (address >= 0xc000 && address <= 0xdcff) { @@ -520,7 +520,7 @@ namespace MAME.Core else if (address >= 0xe000 && address <= 0xf7ff) { int offset = address - 0xe000; - Memory.mainram_Ptr[offset] = value; + Memory.mainram[offset] = value; } else if (address >= 0xf800 && address <= 0xf9ff) { @@ -567,7 +567,7 @@ namespace MAME.Core else if (address >= 0xe000 && address <= 0xf7ff) { int offset = address - 0xe000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } return result; } @@ -581,7 +581,7 @@ namespace MAME.Core else if (address >= 0xe000 && address <= 0xf7ff) { int offset = address - 0xe000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } return result; } @@ -594,7 +594,7 @@ namespace MAME.Core else if (address >= 0xe000 && address <= 0xf7ff) { int offset = address - 0xe000; - Memory.mainram_Ptr[offset] = value; + Memory.mainram[offset] = value; } } public static byte Z1ReadHardware(ushort address) @@ -617,12 +617,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0x8fff) { int offset = address - 0x8000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } return result; } @@ -631,12 +631,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x7fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x8000 && address <= 0x8fff) { int offset = address - 0x8000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0x9000) { @@ -656,7 +656,7 @@ namespace MAME.Core } else if (address >= 0xe000 && address <= 0xffff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } return result; } @@ -664,12 +664,12 @@ namespace MAME.Core { if (address <= 0x7fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0x8000 && address <= 0x8fff) { int offset = address - 0x8000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0x9000) { @@ -697,7 +697,7 @@ namespace MAME.Core } else if (address >= 0xe000 && address <= 0xffff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } } public static byte Z2ReadHardware(ushort address) @@ -896,9 +896,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -914,9 +914,9 @@ namespace MAME.Core int add1; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -953,7 +953,7 @@ namespace MAME.Core else if (address >= 0x100000 && address <= 0x107fff) { int offset = address - 0x100000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x200000 && address <= 0x200fff) { @@ -1038,9 +1038,9 @@ namespace MAME.Core short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1056,9 +1056,9 @@ namespace MAME.Core int add1; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1081,7 +1081,7 @@ namespace MAME.Core else if (address >= 0x100000 && address + 1 <= 0x107fff) { int offset = address - 0x100000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x200000 && address + 1 <= 0x200fff) { @@ -1124,9 +1124,9 @@ namespace MAME.Core int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1142,10 +1142,10 @@ namespace MAME.Core int add1; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1164,7 +1164,7 @@ namespace MAME.Core else if (address >= 0x100000 && address + 3 <= 0x107fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x200000 && address + 3 <= 0x200fff) { @@ -1198,9 +1198,9 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)value; + Memory.mainrom[address] = (byte)value; } } else if (address >= 0x0ff000 && address <= 0x0ff7ff) @@ -1229,7 +1229,7 @@ namespace MAME.Core else if (address >= 0x100000 && address <= 0x107fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x200000 && address <= 0x200fff) { @@ -1340,10 +1340,10 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address + 1 <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 1] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; } } else if (address >= 0x0ff000 && address + 1 <= 0x0ff7ff) @@ -1362,8 +1362,8 @@ namespace MAME.Core else if (address >= 0x100000 && address + 1 <= 0x107fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x200000 && address + 1 <= 0x200fff) { @@ -1424,12 +1424,12 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address + 3 <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 24); - Memory.mainrom_Ptr[address + 1] = (byte)(value >> 16); - Memory.mainrom_Ptr[address + 2] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 3] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 24); + Memory.mainrom[address + 1] = (byte)(value >> 16); + Memory.mainrom[address + 2] = (byte)(value >> 8); + Memory.mainrom[address + 3] = (byte)value; } } else if (address >= 0x0ff000 && address + 3 <= 0x0ff7ff) @@ -1441,10 +1441,10 @@ namespace MAME.Core else if (address >= 0x100000 && address + 3 <= 0x107fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x200000 && address + 3 <= 0x200fff) { @@ -1483,9 +1483,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -1519,7 +1519,7 @@ namespace MAME.Core else if (address >= 0x100000 && address <= 0x107fff) { int offset = address - 0x100000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x200000 && address <= 0x200fff) { @@ -1604,9 +1604,9 @@ namespace MAME.Core short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1621,9 +1621,9 @@ namespace MAME.Core short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -1643,7 +1643,7 @@ namespace MAME.Core else if (address >= 0x100000 && address + 1 <= 0x107fff) { int offset = address - 0x100000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x200000 && address + 1 <= 0x200fff) { @@ -1686,9 +1686,9 @@ namespace MAME.Core int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1703,10 +1703,10 @@ namespace MAME.Core int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -1726,7 +1726,7 @@ namespace MAME.Core else if (address >= 0x100000 && address + 3 <= 0x107fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x200000 && address + 3 <= 0x200fff) { @@ -1760,9 +1760,9 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)value; + Memory.mainrom[address] = (byte)value; } } else if (address >= 0x0ff000 && address <= 0x0fffff) @@ -1780,7 +1780,7 @@ namespace MAME.Core else if (address >= 0x100000 && address <= 0x107fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x200000 && address <= 0x200fff) { @@ -1891,10 +1891,10 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address + 1 <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 1] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; } } else if (address >= 0x0ff000 && address + 1 <= 0x0fffff) @@ -1905,8 +1905,8 @@ namespace MAME.Core else if (address >= 0x100000 && address + 1 <= 0x107fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x200000 && address + 1 <= 0x200fff) { @@ -1967,12 +1967,12 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address + 3 <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 24); - Memory.mainrom_Ptr[address + 1] = (byte)(value >> 16); - Memory.mainrom_Ptr[address + 2] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 3] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 24); + Memory.mainrom[address + 1] = (byte)(value >> 16); + Memory.mainrom[address + 2] = (byte)(value >> 8); + Memory.mainrom[address + 3] = (byte)value; } } else if (address >= 0x0ff000 && address + 3 <= 0x0fffff) @@ -1984,10 +1984,10 @@ namespace MAME.Core else if (address >= 0x100000 && address + 3 <= 0x107fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x200000 && address + 3 <= 0x200fff) { @@ -2026,9 +2026,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else { @@ -2038,7 +2038,7 @@ namespace MAME.Core else if (address >= 0x100000 && address <= 0x107fff) { int offset = address - 0x100000; - result = (sbyte)Memory.mainram_Ptr[offset]; + result = (sbyte)Memory.mainram[offset]; } else if (address >= 0x200000 && address <= 0x200fff) { @@ -2123,9 +2123,9 @@ namespace MAME.Core short result = 0; if (address <= 0x03ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -2135,7 +2135,7 @@ namespace MAME.Core else if (address >= 0x100000 && address + 1 <= 0x107fff) { int offset = address - 0x100000; - result = (short)(Memory.mainram_Ptr[offset] * 0x100 + Memory.mainram_Ptr[offset + 1]); + result = (short)(Memory.mainram[offset] * 0x100 + Memory.mainram[offset + 1]); } else if (address >= 0x200000 && address + 1 <= 0x200fff) { @@ -2178,10 +2178,10 @@ namespace MAME.Core int result = 0; if (address <= 0x03ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { int offset = (address - 0x000000) / 2; - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -2191,7 +2191,7 @@ namespace MAME.Core else if (address >= 0x100000 && address + 3 <= 0x107fff) { int offset = address - 0x100000; - result = (int)(Memory.mainram_Ptr[offset] * 0x1000000 + Memory.mainram_Ptr[offset + 1] * 0x10000 + Memory.mainram_Ptr[offset + 2] * 0x100 + Memory.mainram_Ptr[offset + 3]); + result = (int)(Memory.mainram[offset] * 0x1000000 + Memory.mainram[offset + 1] * 0x10000 + Memory.mainram[offset + 2] * 0x100 + Memory.mainram[offset + 3]); } else if (address >= 0x200000 && address + 3 <= 0x200fff) { @@ -2225,15 +2225,15 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)value; + Memory.mainrom[address] = (byte)value; } } else if (address >= 0x100000 && address <= 0x107fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x200000 && address <= 0x200fff) { @@ -2344,17 +2344,17 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address + 1 <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 1] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; } } else if (address >= 0x100000 && address + 1 <= 0x107fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x200000 && address + 1 <= 0x200fff) { @@ -2415,21 +2415,21 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address + 3 <= 0x03ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 24); - Memory.mainrom_Ptr[address + 1] = (byte)(value >> 16); - Memory.mainrom_Ptr[address + 2] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 3] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 24); + Memory.mainrom[address + 1] = (byte)(value >> 16); + Memory.mainrom[address + 2] = (byte)(value >> 8); + Memory.mainrom[address + 3] = (byte)value; } } else if (address >= 0x100000 && address + 3 <= 0x107fff) { int offset = address - 0x100000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x200000 && address + 3 <= 0x200fff) { @@ -2467,12 +2467,12 @@ namespace MAME.Core byte result = 0; if (address <= 0x3fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x4000 && address <= 0x7fff) { int offset = address - 0x4000; - result = Memory.audiorom_Ptr[basebanksnd + offset]; + result = Memory.audiorom[basebanksnd + offset]; } return result; } @@ -2481,17 +2481,17 @@ namespace MAME.Core byte result = 0; if (address <= 0x3fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x4000 && address <= 0x7fff) { int offset = address - 0x4000; - result = Memory.audiorom_Ptr[basebanksnd + offset]; + result = Memory.audiorom[basebanksnd + offset]; } else if (address >= 0x8000 && address <= 0x8fff) { int offset = address - 0x8000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0x9001) { @@ -2500,7 +2500,7 @@ namespace MAME.Core else if (address >= 0x9002 && address <= 0x9100) { int offset = address - 0x9002; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0xa001) { @@ -2512,17 +2512,17 @@ namespace MAME.Core { if (address <= 0x3fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0x4000 && address <= 0x7fff) { int offset = address - 0x4000; - Memory.audiorom_Ptr[basebanksnd + offset] = value; + Memory.audiorom[basebanksnd + offset] = value; } else if (address >= 0x8000 && address <= 0x8fff) { int offset = address - 0x8000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0x9000) { @@ -2599,7 +2599,7 @@ namespace MAME.Core else if (address == 0x8000) { int offset = address - 0x8000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0x9000) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Opwolf.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Opwolf.cs index 7a2a4d4..29c25c6 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Opwolf.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Opwolf.cs @@ -700,8 +700,8 @@ namespace MAME.Core { if (coin_table[slot] != 0) { - cchip_coins_for_credit[slot] = (byte)((Memory.mainrom_Ptr[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2] * 0x100 + Memory.mainrom_Ptr[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2 + 1]) & 0xff); - cchip_credits_for_coin[slot] = (byte)((Memory.mainrom_Ptr[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2] * 0x100 + Memory.mainrom_Ptr[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2 + 1]) & 0xff); + cchip_coins_for_credit[slot] = (byte)((Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2] * 0x100 + Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2 + 1]) & 0xff); + cchip_credits_for_coin[slot] = (byte)((Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2] * 0x100 + Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2 + 1]) & 0xff); } } } @@ -741,8 +741,8 @@ namespace MAME.Core { if (coin_table[slot] != 0) { - cchip_coins_for_credit[slot] = (byte)((Memory.mainrom_Ptr[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2] * 0x100 + Memory.mainrom_Ptr[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2 + 1]) & 0xff); - cchip_credits_for_coin[slot] = (byte)((Memory.mainrom_Ptr[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2] * 0x100 + Memory.mainrom_Ptr[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2 + 1]) & 0xff); + cchip_coins_for_credit[slot] = (byte)((Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2] * 0x100 + Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 0) / 2 * 2 + 1]) & 0xff); + cchip_credits_for_coin[slot] = (byte)((Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2] * 0x100 + Memory.mainrom[(coin_table[slot] + coin_offset[slot] + 2) / 2 * 2 + 1]) & 0xff); } } } diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/State.cs index 2be276d..830b439 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/State.cs @@ -25,8 +25,8 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x1800); - writer.Write(Memory.audioram_Ptr, 0, 0x1000); + writer.Write(Memory.mainram, 0, 0x1800); + writer.Write(Memory.audioram, 0, 0x1000); for (i = 0; i < 3; i++) { Z80A.zz1[i].SaveStateBinary(writer); @@ -133,8 +133,8 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x1800); - writer.Write(Memory.audioram_Ptr, 0, 0x1000); + writer.Write(Memory.mainram, 0, 0x1800); + writer.Write(Memory.audioram, 0, 0x1000); writer.Write(mcuram, 0, 0xc0); for (i = 0; i < 3; i++) { @@ -250,10 +250,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x1800); + writer.Write(Memory.mainram, 0, 0x1800); writer.Write(mainram2, 0, 0x100); writer.Write(mainram3, 0, 0x100); - writer.Write(Memory.audioram_Ptr, 0, 0x1000); + writer.Write(Memory.audioram, 0, 0x1000); writer.Write(mcuram, 0, 0xc0); for (i = 0; i < 3; i++) { @@ -362,8 +362,8 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x1800); - writer.Write(Memory.audioram_Ptr, 0, 0x1000); + writer.Write(Memory.mainram, 0, 0x1800); + writer.Write(Memory.audioram, 0, 0x1000); writer.Write(mcuram, 0, 0xc0); for (i = 0; i < 3; i++) { @@ -565,10 +565,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x8000); + writer.Write(Memory.mainram, 0, 0x8000); writer.Write(mainram2, 0, 0x10000); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x1000); + writer.Write(Memory.audioram, 0, 0x1000); for (i = 0; i < Z80A.nZ80; i++) { Z80A.zz1[i].SaveStateBinary(writer); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Taito.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Taito.cs index da547ae..024a775 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Taito.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Taito.cs @@ -307,22 +307,22 @@ namespace MAME.Core } public unsafe static void driver_init_opwolf() { - opwolf_region = Memory.mainrom_Ptr[0x03ffff]; + opwolf_region = Memory.mainrom[0x03ffff]; opwolf_cchip_init(); - opwolf_gun_xoffs = 0xec - Memory.mainrom_Ptr[0x03ffb1]; - opwolf_gun_yoffs = 0x1c - Memory.mainrom_Ptr[0x03ffaf]; + opwolf_gun_xoffs = 0xec - Memory.mainrom[0x03ffb1]; + opwolf_gun_yoffs = 0x1c - Memory.mainrom[0x03ffaf]; basebanksnd = 0x10000; } public unsafe static void driver_init_opwolfb() { - opwolf_region = Memory.mainrom_Ptr[0x03ffff]; + opwolf_region = Memory.mainrom[0x03ffff]; opwolf_gun_xoffs = -2; opwolf_gun_yoffs = 17; basebanksnd = 0x10000; } public unsafe static void driver_init_opwolfp() { - opwolf_region = Memory.mainrom_Ptr[0x03ffff]; + opwolf_region = Memory.mainrom[0x03ffff]; opwolf_gun_xoffs = 5; opwolf_gun_yoffs = 30; basebanksnd = 0x10000; diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Memory.cs index 62138d1..81df795 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Memory.cs @@ -12,7 +12,7 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x07ffff) { - result = (sbyte)(Memory.mainrom_Ptr[address]); + result = (sbyte)(Memory.mainrom[address]); } else if (address >= 0x800000 && address <= 0x801fff) { @@ -28,7 +28,7 @@ namespace MAME.Core } else if (address >= 0x900000 && address <= 0x90ffff) { - result = (sbyte)Memory.mainram_Ptr[address - 0x900000]; + result = (sbyte)Memory.mainram[address - 0x900000]; } return result; } @@ -38,9 +38,9 @@ namespace MAME.Core sbyte result = 0; if (address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else { @@ -185,7 +185,7 @@ namespace MAME.Core } else if (address >= 0x900000 && address <= 0x90ffff) { - result = (sbyte)Memory.mainram_Ptr[address - 0x900000]; + result = (sbyte)Memory.mainram[address - 0x900000]; } return result; } @@ -195,9 +195,9 @@ namespace MAME.Core short result = 0; if (address <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -211,7 +211,7 @@ namespace MAME.Core } else if (address >= 0x900000 && address + 1 <= 0x90ffff) { - result = (short)(Memory.mainram_Ptr[address - 0x900000] * 0x100 + Memory.mainram_Ptr[address - 0x900000 + 1]); + result = (short)(Memory.mainram[address - 0x900000] * 0x100 + Memory.mainram[address - 0x900000 + 1]); } return result; } @@ -221,9 +221,9 @@ namespace MAME.Core short result = 0; if (address <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -292,7 +292,7 @@ namespace MAME.Core } else if (address >= 0x900000 && address + 1 <= 0x90ffff) { - result = (short)(Memory.mainram_Ptr[address - 0x900000] * 0x100 + Memory.mainram_Ptr[address - 0x900000 + 1]); + result = (short)(Memory.mainram[address - 0x900000] * 0x100 + Memory.mainram[address - 0x900000 + 1]); } return result; } @@ -302,9 +302,9 @@ namespace MAME.Core int result = 0; if (address <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -318,7 +318,7 @@ namespace MAME.Core } else if (address >= 0x900000 && address + 3 <= 0x90ffff) { - result = (int)(Memory.mainram_Ptr[address - 0x900000] * 0x1000000 + Memory.mainram_Ptr[address - 0x900000 + 1] * 0x10000 + Memory.mainram_Ptr[address - 0x900000 + 2] * 0x100 + Memory.mainram_Ptr[address - 0x900000 + 3]); + result = (int)(Memory.mainram[address - 0x900000] * 0x1000000 + Memory.mainram[address - 0x900000 + 1] * 0x10000 + Memory.mainram[address - 0x900000 + 2] * 0x100 + Memory.mainram[address - 0x900000 + 3]); } return result; } @@ -328,9 +328,9 @@ namespace MAME.Core int result = 0; if (address <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -379,7 +379,7 @@ namespace MAME.Core } else if (address >= 0x900000 && address + 3 <= 0x90ffff) { - result = (int)(Memory.mainram_Ptr[address - 0x900000] * 0x1000000 + Memory.mainram_Ptr[address - 0x900000 + 1] * 0x10000 + Memory.mainram_Ptr[address - 0x900000 + 2] * 0x100 + Memory.mainram_Ptr[address - 0x900000 + 3]); + result = (int)(Memory.mainram[address - 0x900000] * 0x1000000 + Memory.mainram[address - 0x900000 + 1] * 0x10000 + Memory.mainram[address - 0x900000 + 2] * 0x100 + Memory.mainram[address - 0x900000 + 3]); } return result; } @@ -388,9 +388,9 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)value; + Memory.mainrom[address] = (byte)value; } } else if (address >= 0x400000 && address <= 0x40ffff) @@ -515,7 +515,7 @@ namespace MAME.Core else if (address >= 0x900000 && address <= 0x90ffff) { int offset = address - 0x900000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } } public static void MWriteWord_pbobble(int address, short value) @@ -523,10 +523,10 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 1] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; } } else if (address >= 0x400000 && address + 1 <= 0x40ffff) @@ -594,8 +594,8 @@ namespace MAME.Core else if (address >= 0x900000 && address + 1 <= 0x90ffff) { int offset = address - 0x900000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } } public static void MWriteLong_pbobble(int address, int value) @@ -603,12 +603,12 @@ namespace MAME.Core address &= 0xffffff; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 24); - Memory.mainrom_Ptr[address + 1] = (byte)(value >> 16); - Memory.mainrom_Ptr[address + 2] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 3] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 24); + Memory.mainrom[address + 1] = (byte)(value >> 16); + Memory.mainrom[address + 2] = (byte)(value >> 8); + Memory.mainrom[address + 3] = (byte)value; } } else if (address >= 0x400000 && address + 3 <= 0x40ffff) @@ -670,10 +670,10 @@ namespace MAME.Core else if (address >= 0x900000 && address + 3 <= 0x90ffff) { int offset = address - 0x900000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } } public static byte ZReadOp(ushort address) @@ -681,7 +681,7 @@ namespace MAME.Core byte result = 0; if (address <= 0x3fff) { - result = Memory.audiorom_Ptr[address & 0x7fff]; + result = Memory.audiorom[address & 0x7fff]; } else { @@ -694,15 +694,15 @@ namespace MAME.Core byte result = 0; if (address <= 0x3fff) { - result = Memory.audiorom_Ptr[address & 0x7fff]; + result = Memory.audiorom[address & 0x7fff]; } else if (address >= 0x4000 && address <= 0x7fff) { - result = Memory.audiorom_Ptr[basebanksnd + (address & 0x3fff)]; + result = Memory.audiorom[basebanksnd + (address & 0x3fff)]; } else if (address >= 0xc000 && address <= 0xdfff) { - result = Memory.audioram_Ptr[address - 0xc000]; + result = Memory.audioram[address - 0xc000]; } else if (address >= 0xe000 && address <= 0xe000) { @@ -734,11 +734,11 @@ namespace MAME.Core { if (address <= 0x7fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0xc000 && address <= 0xdfff) { - Memory.audioram_Ptr[address - 0xc000] = value; + Memory.audioram[address - 0xc000] = value; } else if (address >= 0xe000 && address <= 0xe000) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Memory2.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Memory2.cs index b2c2b4a..f66f350 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Memory2.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Memory2.cs @@ -8,9 +8,9 @@ sbyte result = 0; if (address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else { @@ -31,7 +31,7 @@ } else if (address >= 0x400000 && address <= 0x403fff) { - result = (sbyte)Memory.mainram_Ptr[address - 0x400000]; + result = (sbyte)Memory.mainram[address - 0x400000]; } return result; } @@ -41,9 +41,9 @@ sbyte result = 0; if (address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - result = (sbyte)Memory.mainrom_Ptr[address]; + result = (sbyte)Memory.mainrom[address]; } else { @@ -124,7 +124,7 @@ } else if (address >= 0x400000 && address <= 0x403fff) { - result = (sbyte)Memory.mainram_Ptr[address - 0x400000]; + result = (sbyte)Memory.mainram[address - 0x400000]; } else if (address >= 0x500000 && address <= 0x50ffff) { @@ -198,9 +198,9 @@ short result = 0; if (address <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -214,7 +214,7 @@ } else if (address >= 0x400000 && address + 1 <= 0x403fff) { - result = (short)(Memory.mainram_Ptr[address - 0x400000] * 0x100 + Memory.mainram_Ptr[address - 0x400000 + 1]); + result = (short)(Memory.mainram[address - 0x400000] * 0x100 + Memory.mainram[address - 0x400000 + 1]); } return result; } @@ -224,9 +224,9 @@ short result = 0; if (address <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - result = (short)(Memory.mainrom_Ptr[address] * 0x100 + Memory.mainrom_Ptr[address + 1]); + result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]); } else { @@ -265,7 +265,7 @@ } else if (address >= 0x400000 && address + 1 <= 0x403fff) { - result = (short)(Memory.mainram_Ptr[address - 0x400000] * 0x100 + Memory.mainram_Ptr[address - 0x400000 + 1]); + result = (short)(Memory.mainram[address - 0x400000] * 0x100 + Memory.mainram[address - 0x400000 + 1]); } else if (address >= 0x500000 && address + 1 <= 0x50ffff) { @@ -304,9 +304,9 @@ int result = 0; if (address <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -320,7 +320,7 @@ } else if (address >= 0x400000 && address + 3 <= 0x403fff) { - result = (int)(Memory.mainram_Ptr[address - 0x400000] * 0x1000000 + Memory.mainram_Ptr[address - 0x400000 + 1] * 0x10000 + Memory.mainram_Ptr[address - 0x400000 + 2] * 0x100 + Memory.mainram_Ptr[address - 0x400000 + 3]); + result = (int)(Memory.mainram[address - 0x400000] * 0x1000000 + Memory.mainram[address - 0x400000 + 1] * 0x10000 + Memory.mainram[address - 0x400000 + 2] * 0x100 + Memory.mainram[address - 0x400000 + 3]); } return result; } @@ -330,9 +330,9 @@ int result = 0; if (address <= 0x07ffff) { - if (address + 3 < Memory.mainrom_Lenght) + if (address + 3 < Memory.mainromLength) { - result = (int)(Memory.mainrom_Ptr[address] * 0x1000000 + Memory.mainrom_Ptr[address + 1] * 0x10000 + Memory.mainrom_Ptr[address + 2] * 0x100 + Memory.mainrom_Ptr[address + 3]); + result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]); } else { @@ -351,7 +351,7 @@ } else if (address >= 0x400000 && address + 1 <= 0x403fff) { - result = (int)(Memory.mainram_Ptr[address - 0x400000] * 0x1000000 + Memory.mainram_Ptr[address - 0x400000 + 1] * 0x10000 + Memory.mainram_Ptr[address - 0x400000 + 2] * 0x100 + Memory.mainram_Ptr[address - 0x400000 + 3]); + result = (int)(Memory.mainram[address - 0x400000] * 0x1000000 + Memory.mainram[address - 0x400000 + 1] * 0x10000 + Memory.mainram[address - 0x400000 + 2] * 0x100 + Memory.mainram[address - 0x400000 + 3]); } else if (address >= 0x500000 && address + 1 <= 0x50ffff) { @@ -389,9 +389,9 @@ address &= 0xffffff; if (address >= 0x000000 && address <= 0x07ffff) { - if (address < Memory.mainrom_Lenght) + if (address < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)value; + Memory.mainrom[address] = (byte)value; } } else if (address >= 0x100000 && address <= 0x100001) @@ -432,7 +432,7 @@ else if (address >= 0x400000 && address <= 0x403fff) { int offset = address - 0x400000; - Memory.mainram_Ptr[offset] = (byte)value; + Memory.mainram[offset] = (byte)value; } else if (address >= 0x500000 && address <= 0x50ffff) { @@ -505,10 +505,10 @@ address &= 0xffffff; if (address >= 0x000000 && address + 1 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 1] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 8); + Memory.mainrom[address + 1] = (byte)value; } } else if (address >= 0x100000 && address + 1 <= 0x100001) @@ -536,8 +536,8 @@ else if (address >= 0x400000 && address + 1 <= 0x403fff) { int offset = address - 0x400000; - Memory.mainram_Ptr[offset] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 1] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 8); + Memory.mainram[offset + 1] = (byte)value; } else if (address >= 0x500000 && address + 1 <= 0x50ffff) { @@ -576,12 +576,12 @@ address &= 0xffffff; if (address >= 0x000000 && address + 3 <= 0x07ffff) { - if (address + 1 < Memory.mainrom_Lenght) + if (address + 1 < Memory.mainromLength) { - Memory.mainrom_Ptr[address] = (byte)(value >> 24); - Memory.mainrom_Ptr[address + 1] = (byte)(value >> 16); - Memory.mainrom_Ptr[address + 2] = (byte)(value >> 8); - Memory.mainrom_Ptr[address + 3] = (byte)value; + Memory.mainrom[address] = (byte)(value >> 24); + Memory.mainrom[address + 1] = (byte)(value >> 16); + Memory.mainrom[address + 2] = (byte)(value >> 8); + Memory.mainrom[address + 3] = (byte)value; } } else if (address >= 0x200000 && address + 3 <= 0x20000f) @@ -599,10 +599,10 @@ else if (address >= 0x400000 && address + 3 <= 0x403fff) { int offset = address - 0x400000; - Memory.mainram_Ptr[offset] = (byte)(value >> 24); - Memory.mainram_Ptr[offset + 1] = (byte)(value >> 16); - Memory.mainram_Ptr[offset + 2] = (byte)(value >> 8); - Memory.mainram_Ptr[offset + 3] = (byte)value; + Memory.mainram[offset] = (byte)(value >> 24); + Memory.mainram[offset + 1] = (byte)(value >> 16); + Memory.mainram[offset + 2] = (byte)(value >> 8); + Memory.mainram[offset + 3] = (byte)value; } else if (address >= 0x500000 && address + 3 <= 0x50ffff) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/State.cs index 03992e1..f3e1eca 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/State.cs @@ -53,10 +53,10 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x10000); + writer.Write(Memory.mainram, 0, 0x10000); writer.Write(mainram2, 0, 0x1e80); MC68000.m1.SaveStateBinary(writer); - writer.Write(Memory.audioram_Ptr, 0, 0x2000); + writer.Write(Memory.audioram, 0, 0x2000); Z80A.zz1[0].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); writer.Write(EmuTimer.global_basetime.seconds); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Memory.cs index a3c8e19..0ab24b1 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Memory.cs @@ -11,11 +11,11 @@ namespace MAME.Core byte result = 0; if (address >= 0 && address <= 0x7fff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -28,7 +28,7 @@ namespace MAME.Core } else if (address >= 0x8000 && address <= 0xbfff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } return result; } @@ -37,16 +37,16 @@ namespace MAME.Core byte result = 0; if (address >= 0 && address <= 0x7fff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0x8000 && address <= 0xbfff) { - result = Memory.mainrom_Ptr[address]; + result = Memory.mainrom[address]; } else if (address >= 0xc000 && address <= 0xcfff) { int offset = address - 0xc000; - result = Memory.mainram_Ptr[offset]; + result = Memory.mainram[offset]; } else if (address >= 0xd000 && address <= 0xd3ff) { @@ -121,16 +121,16 @@ namespace MAME.Core { if (address >= 0x0000 && address <= 0x7fff) { - Memory.mainrom_Ptr[address] = value; + Memory.mainrom[address] = value; } else if (address >= 0x8000 && address <= 0xbfff) { - Memory.mainrom_Ptr[address] = value; + Memory.mainrom[address] = value; } else if (address >= 0xc000 && address <= 0xcfff) { int offset = address - 0xc000; - Memory.mainram_Ptr[offset] = value; + Memory.mainram[offset] = value; } else if (address >= 0xd000 && address <= 0xd3ff) { @@ -196,7 +196,7 @@ namespace MAME.Core byte result = 0; if (address >= 0 && address <= 0x1fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } return result; } @@ -205,12 +205,12 @@ namespace MAME.Core byte result = 0; if (address >= 0 && address <= 0x1fff) { - result = Memory.audiorom_Ptr[address]; + result = Memory.audiorom[address]; } else if (address >= 0x4000 && address <= 0x47ff) { int offset = address - 0x4000; - result = Memory.audioram_Ptr[offset]; + result = Memory.audioram[offset]; } else if (address == 0x8000) { @@ -222,12 +222,12 @@ namespace MAME.Core { if (address >= 0 && address <= 0x1fff) { - Memory.audiorom_Ptr[address] = value; + Memory.audiorom[address] = value; } else if (address >= 0x4000 && address <= 0x47ff) { int offset = address - 0x4000; - Memory.audioram_Ptr[offset] = value; + Memory.audioram[offset] = value; } else if (address == 0xffff) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Pbaction.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Pbaction.cs index 961154f..91a57b3 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Pbaction.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Pbaction.cs @@ -92,7 +92,7 @@ namespace MAME.Core } else { - result = Memory.mainram_Ptr[0]; + result = Memory.mainram[0]; } return result; } diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/State.cs index fdfee68..90d06e6 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/State.cs @@ -15,14 +15,14 @@ namespace MAME.Core { writer.Write(Palette.entry_color[i]); } - writer.Write(Memory.mainram_Ptr, 0, 0x1000); + writer.Write(Memory.mainram, 0, 0x1000); writer.Write(Generic.videoram, 0, 0x400); writer.Write(pbaction_videoram2, 0, 0x400); writer.Write(Generic.colorram, 0, 0x400); writer.Write(pbaction_colorram2, 0, 0x400); writer.Write(Generic.spriteram, 0, 0x80); writer.Write(Generic.paletteram, 0, 0x200); - writer.Write(Memory.audioram_Ptr, 0, 0x800); + writer.Write(Memory.audioram, 0, 0x800); Z80A.zz1[0].SaveStateBinary(writer); Z80A.zz1[1].SaveStateBinary(writer); Cpuint.SaveStateBinary(writer); diff --git a/SafeSnippet/SafeCust.snippet b/SafeSnippet/SafeCust.snippet index 121d0c1..0834950 100644 --- a/SafeSnippet/SafeCust.snippet +++ b/SafeSnippet/SafeCust.snippet @@ -27,6 +27,7 @@ static $PtrDataType$[] $PtrDataname$_src; static GCHandle $PtrDataname$_handle; public static $PtrDataType$* $PtrDataname$; public static int $PtrDataname$Length; +public static bool $PtrDataname$_IsNull => $PtrDataname$ == null; public static $PtrDataType$[] $PtrDataname$_set { set