GBHawk: Bug FIx

This commit is contained in:
alyosha-tas 2017-11-24 09:31:57 -05:00
parent 5eae2d2a9a
commit 6f9066aac1
2 changed files with 14 additions and 2 deletions

View File

@ -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; }
}
}

View File

@ -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;