diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs index 3b94dc01de..28b9c2edf2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/Audio.cs @@ -552,7 +552,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk SQ1_output *= SQ1_vol_state; // avoid aliasing at high frequenices - if (SQ1_frq > 0x7D2) { SQ1_output = 0; } + if (SQ1_frq > 0x7F0) { SQ1_output = 0; } } } @@ -570,7 +570,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk SQ2_output *= SQ2_vol_state; // avoid aliasing at high frequenices - if (SQ2_frq > 0x7D2) { SQ2_output = 0; } + if (SQ2_frq > 0x7F0) { SQ2_output = 0; } } } @@ -615,6 +615,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk WAVE_output = sample; if (!WAVE_DAC_pow) { WAVE_output = 0; } + + // avoid aliasing at high frequenices + if (WAVE_frq > 0x7F0) { WAVE_output = 0; } } } diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/PPU.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/PPU.cs index 626bb7f549..9b17a7d619 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/PPU.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/PPU.cs @@ -120,6 +120,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk LCDC = value; break; case 0xFF41: // STAT + // writing to STAT during mode 0 or 2 causes a STAT IRQ + if (LCDC.Bit(7)) + { + if (((STAT & 3) == 0) || ((STAT & 3) == 1)) + { + LYC_INT = true; + } + } STAT = (byte)((value & 0xF8) | (STAT & 7) | 0x80); break; case 0xFF42: // SCY @@ -136,6 +144,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk case 0xFF45: // LYC LYC = value; if (LY != LYC) { STAT &= 0xFB; } + Console.WriteLine(value); break; case 0xFF46: // DMA DMA_addr = value;