From acbbd946e7d400caa23994532d53ee81bede98a1 Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Sat, 15 Jan 2022 10:05:04 +0100 Subject: [PATCH] Fix #3050 --- .../Consoles/Nintendo/BSNES/BsnesCore.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs index 139fc86b60..c7a4c33e2d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs @@ -307,7 +307,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES } } - private readonly int[] palette = new int[32768]; + private readonly int[] palette = new int[0x8000]; private void generate_palette() { @@ -358,7 +358,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES ushort* sp = data + y * pitch + 48; for (int x = 0; x < 160; x++) { - _videoBuffer[di++] = palette[*sp++]; + _videoBuffer[di++] = palette[*sp++ & 0x7FFF]; } } return; @@ -369,7 +369,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES int si = y / heightMultiplier * pitch; for (int x = 0; x < width * widthMultiplier; x++) { - _videoBuffer[di++] = palette[data[si + x / widthMultiplier]]; + _videoBuffer[di++] = palette[data[si + x / widthMultiplier] & 0x7FFF]; } } }