From 69a6a816bcc3275164d39fab24065caf081e4252 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Wed, 22 Jan 2025 11:15:22 +0800 Subject: [PATCH] =?UTF-8?q?Generic=E6=8C=87=E9=92=88=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=8C=87=E9=92=88=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=89=87=E6=AE=B5=E7=BC=96=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Plugins/UMAME/Motion/MameMainMotion.cs | 1 + .../Assets/Plugins/UMAME/emu/Generic.cs | 294 +++++++++++++++++- MAME.Unity/Assets/Plugins/UMAME/emu/Memory.cs | 130 +++++++- .../Plugins/UMAME/mame/capcom/Capcom.cs | 10 +- .../Assets/Plugins/UMAME/mame/capcom/Gng.cs | 2 +- .../Assets/Plugins/UMAME/mame/capcom/State.cs | 8 +- .../Plugins/UMAME/mame/dataeast/Pcktgal.cs | 4 +- .../Plugins/UMAME/mame/dataeast/State.cs | 4 +- .../Plugins/UMAME/mame/dataeast/Video.cs | 2 +- .../Plugins/UMAME/mame/igs011/IGS011.cs | 4 +- .../Assets/Plugins/UMAME/mame/igs011/State.cs | 4 +- .../UMAME/mame/konami68000/Konami68000.cs | 6 +- .../Assets/Plugins/UMAME/mame/m72/M72.cs | 6 +- .../Assets/Plugins/UMAME/mame/m72/Video.cs | 27 +- .../Assets/Plugins/UMAME/mame/m92/M92.cs | 6 +- .../Assets/Plugins/UMAME/mame/m92/Video.cs | 2 +- .../Plugins/UMAME/mame/namcos1/Memory.cs | 2 +- .../Plugins/UMAME/mame/namcos1/Namcos1.cs | 2 +- .../Plugins/UMAME/mame/namcos1/State.cs | 4 +- .../Assets/Plugins/UMAME/mame/pgm/PGM.cs | 2 +- .../Assets/Plugins/UMAME/mame/pgm/State.cs | 2 +- .../Assets/Plugins/UMAME/mame/suna8/SunA8.cs | 4 +- .../Assets/Plugins/UMAME/mame/suna8/Video.cs | 8 +- .../Assets/Plugins/UMAME/mame/taito/State.cs | 8 +- .../Assets/Plugins/UMAME/mame/taito/Taito.cs | 14 +- .../Plugins/UMAME/mame/taitob/Taitob.cs | 2 +- .../Plugins/UMAME/mame/tehkan/Pbaction.cs | 16 +- .../Assets/Plugins/UMAME/mame/tehkan/State.cs | 8 +- .../Assets/Plugins/UMAME/mame/tehkan/Video.cs | 2 +- SafeSnippet/SafeCust.snippet | 53 ++++ 30 files changed, 540 insertions(+), 97 deletions(-) create mode 100644 SafeSnippet/SafeCust.snippet diff --git a/MAME.Unity/Assets/Plugins/UMAME/Motion/MameMainMotion.cs b/MAME.Unity/Assets/Plugins/UMAME/Motion/MameMainMotion.cs index 5e423e0..27b372e 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/Motion/MameMainMotion.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/Motion/MameMainMotion.cs @@ -45,6 +45,7 @@ namespace MAME.Core ITimeSpan itime ) { + AxiMemoryEx.Init(); Mame.RomRoot = RomDir; EmuLogger.BindFunc(ilog); Video.BindFunc(ivp); diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/Generic.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/Generic.cs index 59ec9f3..fea3baa 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/Generic.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/Generic.cs @@ -1,30 +1,290 @@ using cpu.m68000; using System; +using System.Runtime.InteropServices; namespace MAME.Core { - public class Generic + public unsafe class Generic { - private static uint[] coin_count; - private static uint[] coinlockedout; - private static uint[] lastcoin; - public static byte[] videoram, colorram; - public static byte[] generic_nvram; - public static byte[] buffered_spriteram; - public static ushort[] buffered_spriteram16; - public static byte[] spriteram; - public static ushort[] spriteram16, spriteram16_2; - public static byte[] paletteram, paletteram_2; - public static ushort[] paletteram16, paletteram16_2; + //private static uint[] coin_count; + //private static uint[] coinlockedout; + //private static uint[] lastcoin; + //public static byte[] videoram, colorram; + //public static byte[] generic_nvram; + //public static byte[] buffered_spriteram; + //public static ushort[] buffered_spriteram16; + //public static byte[] spriteram; + //public static ushort[] spriteram16, spriteram16_2; + //public static byte[] paletteram, paletteram_2; + //public static ushort[] paletteram16, paletteram16_2; + + #region //指针化coin_count + static uint[] coin_count_src; + static GCHandle coin_count_handle; + public static uint* coin_count; + public static int coin_countLength; + public static uint[] coin_count_set + { + set + { + coin_count_handle.ReleaseGCHandle(); + coin_count_src = value; + coin_countLength = value.Length; + coin_count_src.GetObjectPtr(ref coin_count_handle, ref coin_count); + } + } + #endregion + + #region //指针化coinlockedout + static uint[] coinlockedout_src; + static GCHandle coinlockedout_handle; + public static uint* coinlockedout; + public static int coinlockedoutLength; + public static uint[] coinlockedout_set + { + set + { + coinlockedout_handle.ReleaseGCHandle(); + coinlockedout_src = value; + coinlockedoutLength = value.Length; + coinlockedout_src.GetObjectPtr(ref coinlockedout_handle, ref coinlockedout); + } + } + #endregion + + #region //指针化lastcoin + static uint[] lastcoin_src; + static GCHandle lastcoin_handle; + public static uint* lastcoin; + public static int lastcoinLength; + public static uint[] lastcoin_set + { + set + { + lastcoin_handle.ReleaseGCHandle(); + lastcoin_src = value; + lastcoinLength = value.Length; + lastcoin_src.GetObjectPtr(ref lastcoin_handle, ref lastcoin); + } + } + #endregion + + #region //指针化colorram + static byte[] colorram_src; + static GCHandle colorram_handle; + public static byte* colorram; + public static int colorramLength; + public static byte[] colorram_set + { + set + { + colorram_handle.ReleaseGCHandle(); + colorram_src = value; + colorramLength = value.Length; + colorram_src.GetObjectPtr(ref colorram_handle, ref colorram); + } + } + #endregion + + #region //指针化videoram + static byte[] videoram_src; + static GCHandle videoram_handle; + public static byte* videoram; + public static int videoramLength; + public static byte[] videoram_set + { + set + { + videoram_handle.ReleaseGCHandle(); + videoram_src = value; + videoramLength = value.Length; + videoram_src.GetObjectPtr(ref videoram_handle, ref videoram); + } + } + #endregion + + #region //指针化generic_nvram + static byte[] generic_nvram_src; + static GCHandle generic_nvram_handle; + public static byte* generic_nvram; + public static int generic_nvramLength; + public static byte[] generic_nvram_set + { + set + { + generic_nvram_handle.ReleaseGCHandle(); + generic_nvram_src = value; + generic_nvramLength = value.Length; + generic_nvram_src.GetObjectPtr(ref generic_nvram_handle, ref generic_nvram); + } + } + #endregion + + #region //指针化buffered_spriteram + static byte[] buffered_spriteram_src; + static GCHandle buffered_spriteram_handle; + public static byte* buffered_spriteram; + public static int buffered_spriteramLength; + public static byte[] buffered_spriteram_set + { + set + { + buffered_spriteram_handle.ReleaseGCHandle(); + buffered_spriteram_src = value; + buffered_spriteramLength = value.Length; + buffered_spriteram_src.GetObjectPtr(ref buffered_spriteram_handle, ref buffered_spriteram); + } + } + #endregion + + #region //指针化buffered_spriteram16 + static ushort[] buffered_spriteram16_src; + static GCHandle buffered_spriteram16_handle; + public static ushort* buffered_spriteram16; + public static int buffered_spriteram16Length; + public static ushort[] buffered_spriteram16_set + { + set + { + buffered_spriteram16_handle.ReleaseGCHandle(); + buffered_spriteram16_src = value; + buffered_spriteram16Length = value.Length; + buffered_spriteram16_src.GetObjectPtr(ref buffered_spriteram16_handle, ref buffered_spriteram16); + } + } + #endregion + + + #region //指针化spriteram + static byte[] spriteram_src; + static GCHandle spriteram_handle; + public static byte* spriteram; + public static int spriteramLength; + public static byte[] spriteram_set + { + set + { + spriteram_handle.ReleaseGCHandle(); + spriteram_src = value; + spriteramLength = value.Length; + spriteram_src.GetObjectPtr(ref spriteram_handle, ref spriteram); + } + } + #endregion + + #region //指针化spriteram16 + static ushort[] spriteram16_src; + static GCHandle spriteram16_handle; + public static ushort* spriteram16; + public static int spriteram16Length; + public static ushort[] spriteram16_set + { + set + { + spriteram16_handle.ReleaseGCHandle(); + spriteram16_src = value; + spriteram16Length = value.Length; + spriteram16_src.GetObjectPtr(ref spriteram16_handle, ref spriteram16); + } + } + #endregion + + #region //指针化spriteram16_2 + static ushort[] spriteram16_2_src; + static GCHandle spriteram16_2_handle; + public static ushort* spriteram16_2; + public static int spriteram16_2Length; + public static ushort[] spriteram16_2_set + { + set + { + spriteram16_2_handle.ReleaseGCHandle(); + spriteram16_2_src = value; + spriteram16_2Length = value.Length; + spriteram16_2_src.GetObjectPtr(ref spriteram16_2_handle, ref spriteram16_2); + } + } + #endregion + + #region //指针化paletteram + static byte[] paletteram_src; + static GCHandle paletteram_handle; + public static byte* paletteram; + public static int paletteramLength; + public static byte[] paletteram_set + { + set + { + paletteram_handle.ReleaseGCHandle(); + paletteram_src = value; + paletteramLength = value.Length; + paletteram_src.GetObjectPtr(ref paletteram_handle, ref paletteram); + } + } + #endregion + + #region //指针化paletteram_2 + static byte[] paletteram_2_src; + static GCHandle paletteram_2_handle; + public static byte* paletteram_2; + public static int paletteram_2Length; + public static byte[] paletteram_2_set + { + set + { + paletteram_2_handle.ReleaseGCHandle(); + paletteram_2_src = value; + paletteram_2Length = value.Length; + paletteram_2_src.GetObjectPtr(ref paletteram_2_handle, ref paletteram_2); + } + } + #endregion + + #region //指针化paletteram16 + static ushort[] paletteram16_src; + static GCHandle paletteram16_handle; + public static ushort* paletteram16; + public static int paletteram16Length; + public static ushort[] paletteram16_set + { + set + { + paletteram16_handle.ReleaseGCHandle(); + paletteram16_src = value; + paletteram16Length = value.Length; + paletteram16_src.GetObjectPtr(ref paletteram16_handle, ref paletteram16); + } + } + #endregion + + + #region //指针化paletteram16_2 + static ushort[] paletteram16_2_src; + static GCHandle paletteram16_2_handle; + public static ushort* paletteram16_2; + public static int paletteram16_2Length; + public static ushort[] paletteram16_2_set + { + set + { + paletteram16_2_handle.ReleaseGCHandle(); + paletteram16_2_src = value; + paletteram16_2Length = value.Length; + paletteram16_2_src.GetObjectPtr(ref paletteram16_2_handle, ref paletteram16_2); + } + } + #endregion + + public static int[] interrupt_enable; public static int objcpunum; public static int flip_screen_x, flip_screen_y; public static void generic_machine_init() { int counternum; - coin_count = new uint[8]; - coinlockedout = new uint[8]; - lastcoin = new uint[8]; + coin_count_set = new uint[8]; + coinlockedout_set = new uint[8]; + lastcoin_set = new uint[8]; for (counternum = 0; counternum < 8; counternum++) { lastcoin[counternum] = 0; @@ -205,11 +465,11 @@ namespace MAME.Core } public static void buffer_spriteram_w() { - Array.Copy(spriteram, buffered_spriteram, spriteram.Length); + AxiArray.Copy(spriteram, buffered_spriteram, spriteramLength); } public static void buffer_spriteram16_w() { - Array.Copy(spriteram16, buffered_spriteram16, spriteram16.Length); + AxiArray.Copy(spriteram16, buffered_spriteram16, spriteram16Length); } public static ushort paletteram16_le(int offset) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/Memory.cs index ce08ff9..3bdf95b 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/Memory.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; @@ -437,20 +438,129 @@ namespace MAME.Core } - public unsafe static class MemoryEx + public unsafe static class AxiMemoryEx { - // 创建一个临时数组来存储从指针指向的数据中复制的内容 - static byte[] tempBuffer = new byte[0x20000]; + static HashSet GCHandles = new HashSet(); + + public static void Init() + { + FreeAllGCHandle(); + set_TempBuffer = new byte[0x20000]; + } + + public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref uint* ptr) + { + GetObjectPtr(srcObj, ref handle, out IntPtr intptr); + ptr = (uint*)intptr; + } + public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref ushort* ptr) + { + GetObjectPtr(srcObj, ref handle, out IntPtr intptr); + ptr = (ushort*)intptr; + } + public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref int* ptr) + { + GetObjectPtr(srcObj, ref handle, out IntPtr intptr); + ptr = (int*)intptr; + } + public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref byte* ptr) + { + GetObjectPtr(srcObj, ref handle, out IntPtr intptr); + ptr = (byte*)intptr; + } + + static void GetObjectPtr(this object srcObj, ref GCHandle handle, out IntPtr intptr) + { + ReleaseGCHandle(ref handle); + handle = GCHandle.Alloc(srcObj, GCHandleType.Pinned); + GCHandles.Add(handle); + intptr = handle.AddrOfPinnedObject(); + } + + public static void ReleaseGCHandle(this ref GCHandle handle) + { + if (handle.IsAllocated) + handle.Free(); + GCHandles.Remove(handle); + } + + public static void FreeAllGCHandle() + { + foreach (var handle in GCHandles) + { + if (handle.IsAllocated) + handle.Free(); + } + GCHandles.Clear(); + } + + #region 指针化 TempBuffer + static byte[] TempBuffer_src; + static GCHandle TempBuffer_handle; + public static byte* TempBuffer; + public static byte[] set_TempBuffer + { + set + { + TempBuffer_handle.ReleaseGCHandle(); + TempBuffer_src = value; + TempBuffer_src.GetObjectPtr(ref TempBuffer_handle, ref TempBuffer); + } + } + #endregion + public static void Write(this BinaryWriter bw, byte* buffer, int index, int count) { - fixed (byte* pTempBuffer = tempBuffer) - { - // 使用指针复制数据到临时数组 - Buffer.MemoryCopy(buffer + index, pTempBuffer, count, count); - } - + // 使用指针复制数据到临时数组 + Buffer.MemoryCopy(buffer + index, TempBuffer, count, count); // 使用BinaryWriter写入临时数组 - bw.Write(tempBuffer, 0, count); + bw.Write(TempBuffer, 0, count); + } + + } + + public unsafe static class AxiArray + { + + public static void Copy(byte* src, int srcindex, byte* target, int targetindex, int count) + { + Buffer.MemoryCopy(&src[srcindex], target, targetindex, count); + } + + public static void Copy(byte* src, byte* target, int index, int count) + { + Buffer.MemoryCopy(src, target, index, count); + } + + public static void Copy(ushort* src, ushort* target, int index, int count) + { + long destinationStartIndexInBytes = index * sizeof(ushort); + long totalBytesToCopy = count * sizeof(ushort); + Buffer.MemoryCopy(src, target, destinationStartIndexInBytes, totalBytesToCopy); + } + public static void Copy(ushort* src, ushort* target, int count) + { + long totalBytesToCopy = count * sizeof(ushort); + Buffer.MemoryCopy(src, target, 0, totalBytesToCopy); + } + public static void Copy(byte* src, byte* target, int count) + { + Buffer.MemoryCopy(src, target, 0, count); + } + public static void Clear(byte* data, int index, int lenght) + { + for (int i = index; i < lenght; i++, index++) + { + data[index] = 0; + } + } + public static void Clear(ushort* data, int index, int lenght) + { + for (int i = index; i < lenght; i++, index++) + { + data[index] = 0; + } } } + } \ No newline at end of file diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Capcom.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Capcom.cs index f0b955d..06b1643 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Capcom.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Capcom.cs @@ -28,8 +28,8 @@ namespace MAME.Core case "makaimurc": case "makaimurg": case "diamond": - Generic.spriteram = new byte[0x200]; - Generic.buffered_spriteram = new byte[0x200]; + Generic.spriteram_set = new byte[0x200]; + Generic.buffered_spriteram_set = new byte[0x200]; Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); @@ -59,8 +59,8 @@ namespace MAME.Core } Memory.Set_mainram(new byte[0x1e00]); Memory.Set_audioram(new byte[0x800]); - Generic.paletteram = new byte[0x100]; - Generic.paletteram_2 = new byte[0x100]; + Generic.paletteram_set = new byte[0x100]; + Generic.paletteram_2_set = new byte[0x100]; if (Memory.mainrom_IsNull|| Memory.audiorom_IsNull || gfx12rom == null || gfx22rom == null || gfx32rom == null) { Machine.bRom = false; @@ -74,7 +74,7 @@ namespace MAME.Core case "sfp": sf_objectram = new ushort[0x1000]; sf_videoram = new ushort[0x800]; - Generic.paletteram16 = new ushort[0x400]; + Generic.paletteram16_set = new ushort[0x400]; Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Gng.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Gng.cs index b3889a2..3d9c986 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Gng.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/Gng.cs @@ -1,6 +1,6 @@ namespace MAME.Core { - public partial class Capcom + public unsafe partial class Capcom { public static byte[] gng_fgvideoram, gng_bgvideoram; public static byte[] scrollx, scrolly; diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/State.cs index 293915d..156894c 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/capcom/State.cs @@ -63,10 +63,10 @@ namespace MAME.Core gng_bgvideoram = reader.ReadBytes(0x800); scrollx = reader.ReadBytes(2); scrolly = reader.ReadBytes(2); - Generic.paletteram = reader.ReadBytes(0x100); - Generic.paletteram_2 = reader.ReadBytes(0x100); - Generic.spriteram = reader.ReadBytes(0x200); - Generic.buffered_spriteram = reader.ReadBytes(0x200); + Generic.paletteram_set = reader.ReadBytes(0x100); + Generic.paletteram_2_set = reader.ReadBytes(0x100); + Generic.spriteram_set = reader.ReadBytes(0x200); + Generic.buffered_spriteram_set = reader.ReadBytes(0x200); for (i = 0; i < 0x100; i++) { Palette.entry_color[i] = reader.ReadUInt32(); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Pcktgal.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Pcktgal.cs index 9848e99..1ad853e 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Pcktgal.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Pcktgal.cs @@ -11,8 +11,8 @@ Machine.bRom = true; Memory.Set_mainram(new byte[0x800]); Memory.Set_audioram(new byte[0x800]); - Generic.spriteram = new byte[0x200]; - Generic.videoram = new byte[0x800]; + Generic.spriteram_set = new byte[0x200]; + Generic.videoram_set = new byte[0x800]; switch (Machine.sName) { case "pcktgal": diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/State.cs index faedcc0..ebf740d 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/State.cs @@ -62,8 +62,8 @@ namespace MAME.Core Palette.entry_color[i] = reader.ReadUInt32(); } Memory.Set_mainram(reader.ReadBytes(0x800)); - Generic.videoram = reader.ReadBytes(0x800); - Generic.spriteram = reader.ReadBytes(0x200); + Generic.videoram_set = reader.ReadBytes(0x800); + Generic.spriteram_set = reader.ReadBytes(0x200); Memory.Set_audioram(reader.ReadBytes(0x800)); M6502.mm1[0].LoadStateBinary(reader); M6502.mm1[1].LoadStateBinary(reader); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Video.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Video.cs index fe98727..629bcf4 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Video.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/dataeast/Video.cs @@ -1,6 +1,6 @@ namespace MAME.Core { - public partial class Dataeast + public unsafe partial class Dataeast { public static void palette_init_pcktgal(byte[] color_prom) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/IGS011.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/IGS011.cs index 0a093de..447bc56 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/IGS011.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/IGS011.cs @@ -1,6 +1,6 @@ namespace MAME.Core { - public partial class IGS011 + public unsafe partial class IGS011 { public static ushort[] priority_ram, paletteram16; public static byte prot1, prot2, prot1_swap; @@ -14,7 +14,7 @@ public static void IGS011Init() { Machine.bRom = true; - Generic.generic_nvram = new byte[0x4000]; + Generic.generic_nvram_set = new byte[0x4000]; priority_ram = new ushort[0x800]; paletteram16 = new ushort[0x1000]; igs003_reg = new ushort[2]; diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/State.cs index 6343ac4..2519ab8 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/igs011/State.cs @@ -3,7 +3,7 @@ using System.IO; namespace MAME.Core { - public partial class IGS011 + public unsafe partial class IGS011 { public static void SaveStateBinary(BinaryWriter writer) { @@ -81,7 +81,7 @@ namespace MAME.Core { Palette.entry_color[i] = reader.ReadUInt32(); } - Generic.generic_nvram = reader.ReadBytes(0x4000); + Generic.generic_nvram_set = reader.ReadBytes(0x4000); for (i = 0; i < 0x800; i++) { priority_ram[i] = reader.ReadUInt16(); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs index 00ba558..deed15b 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/konami68000/Konami68000.cs @@ -3,7 +3,7 @@ using System; namespace MAME.Core { - public partial class Konami68000 + public unsafe partial class Konami68000 { public static byte[] gfx1rom, gfx2rom, gfx12rom, gfx22rom, titlerom, user1rom, zoomrom; public static byte dsw1, dsw2, dsw3, bytee; @@ -17,8 +17,8 @@ namespace MAME.Core public static void Konami68000Init() { int i, n1, n2; - Generic.paletteram16 = new ushort[0x800]; - Generic.spriteram16 = new ushort[0x2000]; + Generic.paletteram16_set = new ushort[0x800]; + Generic.spriteram16_set = new ushort[0x2000]; init_eeprom_count = 10; toggle = 0; Memory.Set_mainram(new byte[0x4000]); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs index b611c56..9ecce3d 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/M72.cs @@ -40,9 +40,9 @@ namespace MAME.Core public static void M72Init() { int i1, i2, i3, n1, n2, n3; - Generic.paletteram16 = new ushort[0x600]; - Generic.paletteram16_2 = new ushort[0x600]; - Generic.spriteram16 = new ushort[0x200]; + Generic.paletteram16_set = new ushort[0x600]; + Generic.paletteram16_2_set = new ushort[0x600]; + Generic.spriteram16_set = new ushort[0x200]; Machine.bRom = true; EmuTimer.setvector = setvector_callback; protection_ram = new byte[0x1000]; diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Video.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Video.cs index 0420dfd..8bc62bd 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Video.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m72/Video.cs @@ -1,13 +1,32 @@ using System; +using System.Runtime.InteropServices; namespace MAME.Core { - public partial class M72 + public unsafe partial class M72 { public static byte[] m72_videoram1, m72_videoram2; public static ushort[] majtitle_rowscrollram; public static int m72_raster_irq_position; - public static ushort[] m72_spriteram; + //public static ushort[] m72_spriteram; + + #region //指针化m72_spriteram + static ushort[] m72_spriteram_src; + static GCHandle m72_spriteram_handle; + public static ushort* m72_spriteram; + public static int m72_spriteramLength; + public static ushort[] m72_spriteram_set + { + set + { + m72_spriteram_handle.ReleaseGCHandle(); + m72_spriteram_src = value; + m72_spriteramLength = value.Length; + m72_spriteram_src.GetObjectPtr(ref m72_spriteram_handle, ref m72_spriteram); + } + } + #endregion + private static ushort[] uuB200; public static int scrollx1, scrolly1, scrollx2, scrolly2; public static int video_off, spriteram_size, majtitle_rowscroll; @@ -96,7 +115,7 @@ namespace MAME.Core public static void m72_dmaon_w(ushort data) { //if (ACCESSING_BITS_0_7) - Array.Copy(Generic.spriteram16, m72_spriteram, spriteram_size / 2); + AxiArray.Copy(Generic.spriteram16, m72_spriteram, spriteram_size / 2); } public static void m72_port02_w(ushort data) { @@ -200,7 +219,7 @@ namespace MAME.Core { uuB200[i] = 0x200; } - m72_spriteram = new ushort[0x200]; + m72_spriteram_set = new ushort[0x200]; m72_videoram1 = new byte[0x4000]; m72_videoram2 = new byte[0x4000]; fg_tilemap.tilemap_set_scrolldx(0, 0); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/M92.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/M92.cs index aa00dcd..dad9b5a 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/M92.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/M92.cs @@ -225,9 +225,9 @@ namespace MAME.Core { pf_layer[i1].control = new ushort[4]; } - Generic.paletteram16 = new ushort[0x800]; - Generic.spriteram16 = new ushort[0x400]; - Generic.buffered_spriteram16 = new ushort[0x400]; + Generic.paletteram16_set = new ushort[0x800]; + Generic.spriteram16_set = new ushort[0x400]; + Generic.buffered_spriteram16_set = new ushort[0x400]; m92_vram_data = new ushort[0x8000]; m92_spritecontrol = new ushort[8]; bb1 = Machine.GetRom("maincpu.rom"); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Video.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Video.cs index e696156..71543a2 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Video.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/m92/Video.cs @@ -2,7 +2,7 @@ namespace MAME.Core { - public partial class M92 + public unsafe partial class M92 { public static ushort[] pf_master_control; public static int m92_sprite_list; diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/Memory.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/Memory.cs index 98641a9..d1fe7a0 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/Memory.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/Memory.cs @@ -2,7 +2,7 @@ namespace MAME.Core { - public partial class Namcos1 + public unsafe partial class Namcos1 { public static byte byte0, byte1, byte2, byte00, byte01, byte02, byte03; public static byte byte0_old, byte1_old, byte2_old; diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/Namcos1.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/Namcos1.cs index fdb9bca..4c7156f 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/Namcos1.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/Namcos1.cs @@ -41,7 +41,7 @@ namespace MAME.Core bank_ram20 = new byte[0x2000]; bank_ram30 = new byte[0x80]; Namco.namco_wavedata = new byte[0x400]; - Generic.generic_nvram = new byte[0x800]; + Generic.generic_nvram_set = new byte[0x800]; cus117_offset = new int[2, 8]; key = new byte[8]; if (audiorom == null || gfx1rom == null || gfx2rom == null || gfx3rom == null || user1rom == null || voicerom == null) diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/State.cs index 17b3092..70360d4 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/namcos1/State.cs @@ -4,7 +4,7 @@ using System.IO; namespace MAME.Core { - public partial class Namcos1 + public unsafe partial class Namcos1 { public static void SaveStateBinary(BinaryWriter writer) { @@ -101,7 +101,7 @@ namespace MAME.Core dac1_value = reader.ReadInt32(); dac0_gain = reader.ReadInt32(); dac1_gain = reader.ReadInt32(); - Generic.generic_nvram = reader.ReadBytes(0x800); + Generic.generic_nvram_set = reader.ReadBytes(0x800); for (i = 0; i < 2; i++) { for (j = 0; j < 8; j++) diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/PGM.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/PGM.cs index 79351e5..7be946a 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/PGM.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/PGM.cs @@ -50,7 +50,7 @@ namespace MAME.Core pgm_bg_videoram = new byte[0x4000]; pgm_tx_videoram = new byte[0x2000]; pgm_rowscrollram = new byte[0x800]; - Generic.paletteram16 = new ushort[0x900]; + Generic.paletteram16_set = new ushort[0x900]; pgm_videoregs = new byte[0x10000]; Memory.Set_audioram(new byte[0x10000]); if (Memory.mainrom_IsNull || sprmaskrom == null || pgm_sprite_a_region == null) diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/State.cs index 075378e..db8d0ca 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/pgm/State.cs @@ -4,7 +4,7 @@ using System.IO; namespace MAME.Core { - public partial class PGM + public unsafe partial class PGM { public unsafe static void SaveStateBinary(BinaryWriter writer) { diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/SunA8.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/SunA8.cs index c31113a..d0d4652 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/SunA8.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/SunA8.cs @@ -23,7 +23,7 @@ namespace MAME.Core switch (Machine.sName) { case "starfigh": - Generic.spriteram = new byte[0x4000]; + Generic.spriteram_set = new byte[0x4000]; mainromop = Machine.GetRom("maincpuop.rom"); Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); @@ -38,7 +38,7 @@ namespace MAME.Core } Memory.Set_mainram(new byte[0x1800]); Memory.Set_audioram(new byte[0x800]); - Generic.paletteram = new byte[0x200]; + Generic.paletteram_set = new byte[0x200]; if (mainromop == null || Memory.mainrom_IsNull || Memory.audiorom_IsNull || samplesrom == null || gfx12rom == null) { Machine.bRom = false; diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/Video.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/Video.cs index feb0150..c2c2c4f 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/Video.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/suna8/Video.cs @@ -2,7 +2,7 @@ namespace MAME.Core { - public partial class SunA8 + public unsafe partial class SunA8 { public static RECT cliprect; public static ushort[] uuFF; @@ -61,9 +61,9 @@ namespace MAME.Core m_palettebank = 0; if (m_has_text == 0) { - Generic.paletteram = new byte[0x200 * 2]; - Generic.spriteram = new byte[0x2000 * 2 * 2]; - Array.Clear(Generic.spriteram, 0, 0x2000 * 2 * 2); + Generic.paletteram_set = new byte[0x200 * 2]; + Generic.spriteram_set = new byte[0x2000 * 2 * 2]; + AxiArray.Clear(Generic.spriteram, 0, 0x2000 * 2 * 2); } } public static void video_start_suna8_text() diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/State.cs index 6c80cd9..2be276d 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/State.cs @@ -65,7 +65,7 @@ namespace MAME.Core basebankmain = reader.ReadInt32(); videoram = reader.ReadBytes(0x1d00); bublbobl_objectram = reader.ReadBytes(0x300); - Generic.paletteram = reader.ReadBytes(0x200); + Generic.paletteram_set = reader.ReadBytes(0x200); bublbobl_video_enable = reader.ReadInt32(); tokio_prot_count = reader.ReadInt32(); sound_nmi_enable = reader.ReadInt32(); @@ -178,7 +178,7 @@ namespace MAME.Core basebankmain = reader.ReadInt32(); videoram = reader.ReadBytes(0x1d00); bublbobl_objectram = reader.ReadBytes(0x300); - Generic.paletteram = reader.ReadBytes(0x200); + Generic.paletteram_set = reader.ReadBytes(0x200); bublbobl_mcu_sharedram = reader.ReadBytes(0x400); bublbobl_video_enable = reader.ReadInt32(); ddr1 = reader.ReadByte(); @@ -296,7 +296,7 @@ namespace MAME.Core basebankmain = reader.ReadInt32(); videoram = reader.ReadBytes(0x1d00); bublbobl_objectram = reader.ReadBytes(0x300); - Generic.paletteram = reader.ReadBytes(0x200); + Generic.paletteram_set = reader.ReadBytes(0x200); bublbobl_video_enable = reader.ReadInt32(); ic43_a = reader.ReadInt32(); ic43_b = reader.ReadInt32(); @@ -407,7 +407,7 @@ namespace MAME.Core basebankmain = reader.ReadInt32(); videoram = reader.ReadBytes(0x1d00); bublbobl_objectram = reader.ReadBytes(0x300); - Generic.paletteram = reader.ReadBytes(0x200); + Generic.paletteram_set = reader.ReadBytes(0x200); bublbobl_mcu_sharedram = reader.ReadBytes(0x400); bublbobl_video_enable = reader.ReadInt32(); portA_in = reader.ReadByte(); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Taito.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Taito.cs index e951360..da547ae 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Taito.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taito/Taito.cs @@ -20,7 +20,7 @@ namespace MAME.Core bublbobl_objectram = new byte[0x300]; Memory.Set_mainram(new byte[0x1800]); Memory.Set_audioram(new byte[0x1000]); - Generic.paletteram = new byte[0x200]; + Generic.paletteram_set = new byte[0x200]; //bublbobl_mcu_sharedram = new byte[0x400]; Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); slaverom = Machine.GetRom("slave.rom"); @@ -59,7 +59,7 @@ namespace MAME.Core Memory.Set_mainram(new byte[0x1800]); Memory.Set_audioram(new byte[0x1000]); mcuram = new byte[0xc0]; - Generic.paletteram = new byte[0x200]; + Generic.paletteram_set = new byte[0x200]; bublbobl_mcu_sharedram = new byte[0x400]; Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); slaverom = Machine.GetRom("slave.rom"); @@ -100,7 +100,7 @@ namespace MAME.Core bublbobl_objectram = new byte[0x300]; Memory.Set_mainram(new byte[0x1800]); Memory.Set_audioram(new byte[0x1000]); - Generic.paletteram = new byte[0x200]; + Generic.paletteram_set = new byte[0x200]; Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); slaverom = Machine.GetRom("slave.rom"); //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); @@ -133,7 +133,7 @@ namespace MAME.Core bublbobl_objectram = new byte[0x300]; Memory.Set_mainram(new byte[0x1800]); Memory.Set_audioram(new byte[0x1000]); - Generic.paletteram = new byte[0x200]; + Generic.paletteram_set = new byte[0x200]; Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); slaverom = Machine.GetRom("slave.rom"); //Memory.Set_audiorom(Machine.GetRom("audiocpu.rom")); @@ -165,7 +165,7 @@ namespace MAME.Core { mainram2 = new byte[0x10000]; cchip_ram = new byte[0x2000]; - Generic.paletteram16 = new ushort[0x800]; + Generic.paletteram16_set = new ushort[0x800]; Memory.Set_mainram(new byte[0x8000]); Memory.Set_audioram(new byte[0x1000]); Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); @@ -209,7 +209,7 @@ namespace MAME.Core { mainram2 = new byte[0x10000]; cchip_ram = new byte[0x2000]; - Generic.paletteram16 = new ushort[0x800]; + Generic.paletteram16_set = new ushort[0x800]; Memory.Set_mainram(new byte[0x8000]); Memory.Set_audioram(new byte[0x1000]); Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); @@ -254,7 +254,7 @@ namespace MAME.Core { mainram2 = new byte[0x10000]; cchip_ram = new byte[0x2000]; - Generic.paletteram16 = new ushort[0x800]; + Generic.paletteram16_set = new ushort[0x800]; Memory.Set_mainram(new byte[0x8000]); Memory.Set_audioram(new byte[0x1000]); Memory.Set_mainrom(Machine.GetRom("maincpu.rom")); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Taitob.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Taitob.cs index 90e2c76..dc2ec24 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Taitob.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/taitob/Taitob.cs @@ -12,7 +12,7 @@ namespace MAME.Core public static void TaitobInit() { int i, n; - Generic.paletteram16 = new ushort[0x1000]; + Generic.paletteram16_set = new ushort[0x1000]; TC0180VCU_ram = new ushort[0x8000]; TC0180VCU_ctrl = new ushort[0x10]; TC0220IOC_regs = new byte[8]; diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Pbaction.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Pbaction.cs index b134737..961154f 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Pbaction.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Pbaction.cs @@ -23,12 +23,12 @@ namespace MAME.Core gfx32rom = Machine.GetRom("gfx32.rom"); Memory.Set_mainram(new byte[0x1000]); Memory.Set_audioram(new byte[0x800]); - Generic.videoram = new byte[0x400]; + Generic.videoram_set = new byte[0x400]; pbaction_videoram2 = new byte[0x400]; - Generic.colorram = new byte[0x400]; + Generic.colorram_set = new byte[0x400]; pbaction_colorram2 = new byte[0x400]; - Generic.spriteram = new byte[0x80]; - Generic.paletteram = new byte[0x200]; + Generic.spriteram_set = new byte[0x80]; + Generic.paletteram_set = new byte[0x200]; if (Memory.mainrom_IsNull || Memory.audiorom_IsNull || gfx1rom == null || gfx2rom == null || gfx3rom == null || gfx32rom == null) { Machine.bRom = false; @@ -47,12 +47,12 @@ namespace MAME.Core gfx32rom = Machine.GetRom("gfx32.rom"); Memory.Set_mainram(new byte[0x1000]); Memory.Set_audioram(new byte[0x800]); - Generic.videoram = new byte[0x400]; + Generic.videoram_set = new byte[0x400]; pbaction_videoram2 = new byte[0x400]; - Generic.colorram = new byte[0x400]; + Generic.colorram_set = new byte[0x400]; pbaction_colorram2 = new byte[0x400]; - Generic.spriteram = new byte[0x80]; - Generic.paletteram = new byte[0x200]; + Generic.spriteram_set = new byte[0x80]; + Generic.paletteram_set = new byte[0x200]; if (Memory.mainrom_IsNull || mainromop == null || Memory.audiorom_IsNull || gfx1rom == null || gfx2rom == null || gfx3rom == null || gfx32rom == null) { Machine.bRom = false; diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/State.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/State.cs index c1e218a..fdfee68 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/State.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/State.cs @@ -57,12 +57,12 @@ namespace MAME.Core Palette.entry_color[i] = reader.ReadUInt32(); } Memory.Set_mainram(reader.ReadBytes(0x1000)); - Generic.videoram = reader.ReadBytes(0x400); + Generic.videoram_set = reader.ReadBytes(0x400); pbaction_videoram2 = reader.ReadBytes(0x400); - Generic.colorram = reader.ReadBytes(0x400); + Generic.colorram_set = reader.ReadBytes(0x400); pbaction_colorram2 = reader.ReadBytes(0x400); - Generic.spriteram = reader.ReadBytes(0x80); - Generic.paletteram = reader.ReadBytes(0x200); + Generic.spriteram_set = reader.ReadBytes(0x80); + Generic.paletteram_set = reader.ReadBytes(0x200); Memory.Set_audioram(reader.ReadBytes(0x800)); Z80A.zz1[0].LoadStateBinary(reader); Z80A.zz1[1].LoadStateBinary(reader); diff --git a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Video.cs b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Video.cs index e6eb191..8fe7e3f 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Video.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/mame/tehkan/Video.cs @@ -1,6 +1,6 @@ namespace MAME.Core { - public partial class Tehkan + public unsafe partial class Tehkan { public static byte[] pbaction_videoram2, pbaction_colorram2; public static int scroll; diff --git a/SafeSnippet/SafeCust.snippet b/SafeSnippet/SafeCust.snippet new file mode 100644 index 0000000..121d0c1 --- /dev/null +++ b/SafeSnippet/SafeCust.snippet @@ -0,0 +1,53 @@ + + + +
+ SafeCust + safecust + SafeCust for C#Array. + YourName +
+ + + + PtrDataname + Name of the delegate + PtrDataname + + + PtrDataType + Type + byte + + + + + + + + System + + + System.Runtime.InteropServices + + + +
+
\ No newline at end of file