From e7262578a3279bffbcb65458c5407ca6cb0a2af7 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Tue, 21 Jan 2025 14:56:12 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E5=8D=A1=E9=A1=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MAME.Unity/Assets/Plugins/UMAME/emu/Motion.cs | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) 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); + //} } } }