fix crashy bugs in snes gfx debugger

This commit is contained in:
zeromus 2015-11-15 18:02:20 -06:00
parent 59766d07c0
commit 0ff2a2eb49
2 changed files with 8 additions and 2 deletions

View File

@ -1160,6 +1160,10 @@ namespace BizHawk.Client.EmuHawk
{
var bg = si.BG[(int)CurrDisplaySelection];
//unavailable BG for this mode
if (bg.Bpp == 0)
break;
if (bg.TileSize == 16) { tx /= 2; ty /= 2; } //worry about this later. need to pass a different flag into `currViewingTile`
int tloc = ty * bg.ScreenSizeInTiles.Width + tx;

View File

@ -6,8 +6,7 @@
//http://wiki.superfamicom.org/snes/show/Registers
//TODO
//SF2 title art doesnt seem to show up..
//scanline control doesnt work?
//when a BG is not available, the last rendered BG still shows up. should clear it
using System;
@ -645,6 +644,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
/// </summary>
public void DecodeBG(int* screen, int stride, TileEntry[] map, int tiledataBaseAddr, ScreenSize size, int bpp, int tilesize, int paletteStart)
{
//emergency backstop. this can only happen if we're displaying an unavailable BG or other similar such value
if (bpp == 0) return;
int ncolors = 1 << bpp;
int[] tileBuf = new int[16*16];