From 0f294a220e168098cc915dd75f85ee05b5a5e809 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Thu, 29 Jul 2021 17:35:41 -0400 Subject: [PATCH] Replace Win32 call in GBA viewer --- src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs b/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs index a6c3e91f65..de9619b140 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs @@ -7,7 +7,6 @@ using BizHawk.Client.Common; using BizHawk.Common.NumberExtensions; using BizHawk.Emulation.Cores.Nintendo.Gameboy; using BizHawk.Emulation.Cores.Nintendo.GBA; -using BizHawk.Common; using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk @@ -415,7 +414,8 @@ namespace BizHawk.Client.EmuHawk Bitmap bmp = mbv.BmpView.Bmp; var lockData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); - Win32Imports.MemSet(lockData.Scan0, 0xff, (uint)(lockData.Height * lockData.Stride)); + byte* clear_out = (byte*)lockData.Scan0; + for (uint i = 0; i < (uint)(lockData.Height * lockData.Stride); i++) { clear_out[i] = 0xFF; } int* pixels = (int*)lockData.Scan0; int pitch = lockData.Stride / sizeof(int); @@ -507,7 +507,9 @@ namespace BizHawk.Client.EmuHawk if (tophalfonly) { - Win32Imports.MemSet(lockData.Scan0, 0xff, (uint)(128 * lockData.Stride)); + byte* clear_out = (byte*)lockData.Scan0; + for (uint i = 0; i < (uint)(128 * lockData.Stride); i++) { clear_out[i] = 0xFF; } + pixels += 128 * pitch; tiles += 16384; }