NES PPU Viewer - read ppu values once at the beginning of Generate() into an array and use that for all the drawing. About a 4-5fps speed up
This commit is contained in:
parent
233afd6ab0
commit
2e1f064424
|
@ -26,6 +26,8 @@ namespace BizHawk.MultiClient
|
|||
int defaultHeight;
|
||||
NES Nes;
|
||||
|
||||
byte[] PPUBus = new byte[0x2000];
|
||||
|
||||
NES.PPU.DebugCallback Callback = new NES.PPU.DebugCallback();
|
||||
|
||||
public NESPPU()
|
||||
|
@ -60,7 +62,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private byte GetBit(int address, int bit)
|
||||
{
|
||||
byte value = Nes.ppu.ppubus_peek(address);
|
||||
byte value = PPUBus[address];
|
||||
return (byte)(((value >> (7 - bit)) & 1));
|
||||
}
|
||||
|
||||
|
@ -68,8 +70,12 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
if (!this.IsHandleCreated || this.IsDisposed) return;
|
||||
|
||||
if (Global.Emulator.Frame % RefreshRate.Value == 0)
|
||||
{
|
||||
for (int x = 0; x < 0x2000; x++)
|
||||
PPUBus[x] = Nes.ppu.ppubus_peek(x);
|
||||
|
||||
//Pattern Viewer
|
||||
//Palette Viewer
|
||||
for (int x = 0; x < 16; x++)
|
||||
{
|
||||
PaletteView.bgPalettesPrev[x].Value = PaletteView.bgPalettes[x].Value;
|
||||
|
@ -80,9 +86,6 @@ namespace BizHawk.MultiClient
|
|||
if (PaletteView.HasChanged())
|
||||
PaletteView.Refresh();
|
||||
|
||||
|
||||
if (Global.Emulator.Frame % RefreshRate.Value == 0)
|
||||
{
|
||||
//Pattern Viewer
|
||||
int b0 = 0;
|
||||
int b1 = 0;
|
||||
|
|
Loading…
Reference in New Issue