From f9baa5e8e435c1252e856c85aba51cf1d85da0bb Mon Sep 17 00:00:00 2001 From: goyuken Date: Mon, 22 Sep 2014 19:35:00 +0000 Subject: [PATCH] genesis: change initial frame 0 size of video display --- .../Consoles/Sega/gpgx/GPGX.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs index aa9d809276..64f8c94d10 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGX.cs @@ -153,7 +153,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx SetControllerDefinition(); // pull the default video size from the core - update_video(); + update_video_initial(); SetMemoryDomains(); @@ -731,6 +731,20 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx public int BufferHeight { get { return vheight; } } public int BackgroundColor { get { return unchecked((int)0xff000000); } } + void update_video_initial() + { + // hack: you should call update_video() here, but that gives you 256x192 on frame 0 + // and we know that we only use GPGX to emulate genesis games that will always be 320x224 immediately afterwards + + // so instead, just assume a 320x224 size now; if that happens to be wrong, it'll be fixed soon enough. + + vwidth = 320; + vheight = 224; + vidbuff = new int[vwidth * vheight]; + for (int i = 0; i < vidbuff.Length; i++) + vidbuff[i] = unchecked((int)0xff000000); + } + unsafe void update_video() { int pitch = 0;