From 22fe9a1b7b76207793673e7435bc338ea6b3d060 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Fri, 17 Dec 2021 20:08:36 -0500 Subject: [PATCH] PCEHawk: add 240p test suite to game DB and properly resize buffer, fixes #3018 to at least not crash --- Assets/gamedb/gamedb_pce_cd.txt | 5 ++++- Assets/gamedb/gamedb_pce_hucards.txt | 1 + src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs | 1 + .../Consoles/PC Engine/VDC.Render.cs | 7 ++++++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Assets/gamedb/gamedb_pce_cd.txt b/Assets/gamedb/gamedb_pce_cd.txt index 86fd397168..e246d34d81 100644 --- a/Assets/gamedb/gamedb_pce_cd.txt +++ b/Assets/gamedb/gamedb_pce_cd.txt @@ -125,4 +125,7 @@ FB571B290600A18B90E1BBF1D18FC8AA World Heroes II PCE NeedSuperSysCard;ArcadeCa BA451E33D76FD6C644F46309708BABF2 Ys Book I & II (U) PCE 725BF9524040917AC8D5DD1765483527 Ys III - Wanderers from Ys (U) PCE 844E0E4D40BE2EBD5550429AE53EAFB2 Ys IV - The Dawn of Ys PCE NeedSuperSysCard -1F91B1245003DB964C35AFE6A165964E Zero Wing PCE EqualizeVolumes \ No newline at end of file +1F91B1245003DB964C35AFE6A165964E Zero Wing PCE EqualizeVolumes + +6D29B5083499ADEBA12305560FEBBBA6 240pSuite (CD) PCE MultiResHack=512; +EEF09E30451EFAE18CEE49DE25728B0C 240pSuite (Super CD) PCE NeedSuperSysCard;MultiResHack=512; diff --git a/Assets/gamedb/gamedb_pce_hucards.txt b/Assets/gamedb/gamedb_pce_hucards.txt index b61415e74b..170edd2408 100644 --- a/Assets/gamedb/gamedb_pce_hucards.txt +++ b/Assets/gamedb/gamedb_pce_hucards.txt @@ -1601,3 +1601,4 @@ D3A12A001E22EFB1436EC509D453A10F V Super CD-ROM2 System V3.00 (J) [o4] PCE BRAM 2E1ACCEC7CDEBEDEE1F699684549507A Games Express CD Card 1993 (J) [o2] PCE BRAM;BIOS 6D2CB14FC3E1F65CEB135633D1694122 Games Express CD Card 1993 (J) PCE BRAM;BIOS +6A700DFF41DD303801042E7F05CE9130 240pSuite PCE MultiResHack=512; diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs index 4b93533402..437191fd0b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/PCEngine.cs @@ -309,6 +309,7 @@ namespace BizHawk.Emulation.Cores.PCEngine if (game["MultiResHack"]) { VDC1.MultiResHack = game.GetIntValue("MultiResHack"); + VDC1.Resize_Frame_Buffer_MultiResHack(); } Cpu.ResetPC(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs index e339fc3d21..baf2735403 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/PC Engine/VDC.Render.cs @@ -428,7 +428,12 @@ namespace BizHawk.Emulation.Cores.PCEngine private int FramePitch = 320; private int FrameWidth = 320; - private readonly int[] FrameBuffer = new int[320 * 262]; + private int[] FrameBuffer = new int[320 * 262]; + + public void Resize_Frame_Buffer_MultiResHack() + { + FrameBuffer = new int[MultiResHack * 262]; + } // IVideoProvider implementation public int[] GetVideoBuffer() => FrameBuffer;