diff --git a/MAME.Unity/Assets/Plugins/UMAME/emu/Motion.cs b/MAME.Unity/Assets/Plugins/UMAME/emu/Motion.cs index e2d7117..308719c 100644 --- a/MAME.Unity/Assets/Plugins/UMAME/emu/Motion.cs +++ b/MAME.Unity/Assets/Plugins/UMAME/emu/Motion.cs @@ -1,4 +1,8 @@ -using System; +using MAME.Core; +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using UnityEngine.UIElements; namespace MAME.Core { @@ -154,29 +158,29 @@ namespace MAME.Core else { + for (y = startY; y < endY; y++) + { + int stepIndex = y * Video.fullwidth; + for (x = startX; x < endX; x++, target_i++) + { + i = stepIndex + x; + bitmapcolorRect[target_i] = (int)entry_color[curbitmap[i]]; + } + } + //for (y = startY; y < endY; y++) //{ // int stepIndex = y * Video.fullwidth; + // for (x = startX; x < endX; x++, target_i++) // { // i = stepIndex + x; // bitmapcolorRect[target_i] = (int)entry_color[curbitmap[i]]; // } - //} - for (y = startY; y < endY; y++) - { - int stepIndex = y * Video.fullwidth; - //for (x = startX; x < endX; x++, target_i++) - //{ - // i = stepIndex + x; - // //bitmapcolorRect[target_i] = (int)entry_color[curbitmap[i]]; - //} - int stepStartIdx = stepIndex + startX; - int linelenght = endX - startX; - Array.Copy(Palette.entry_color, stepStartIdx, Video.bitmapcolorRect, 0, linelenght); - target_i += linelenght; - } + // // 使用Marshal.Copy进行内存拷贝 + // Marshal.Copy(Palette.entry_color_Ptr,, Video.bitmapcolorRect_Ptr, endX - startX); + //} } } }