GBHawk: more bug fixes

This commit is contained in:
alyosha-tas 2019-10-01 18:36:39 -04:00
parent 5cfda44cbf
commit 9bfe61a9d4
5 changed files with 44 additions and 32 deletions

View File

@ -211,6 +211,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
SQ1_vol_state &= 0xF;
if ((value & 0xF8) == 0) { SQ1_enable = SQ1_swp_enable = false; SQ1_output = 0; }
if (!SQ1_enable && (SQ1_st_vol == 15)) { SQ1_output = 2; }
Audio_Regs[NR12] = value;
break;
case 0xFF13: // NR13 (freq low)
@ -301,6 +302,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
SQ2_vol_state &= 0xF;
if ((value & 0xF8) == 0) { SQ2_enable = false; SQ2_output = 0; }
if (!SQ2_enable && (SQ2_st_vol == 15)) { SQ2_output = 2; }
Audio_Regs[NR22] = value;
break;
case 0xFF18: // NR23 (freq low)
@ -429,6 +431,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
NOISE_vol_state &= 0xF;
if ((value & 0xF8) == 0) { NOISE_enable = false; NOISE_output = 0; }
if (!NOISE_enable && (NOISE_st_vol == 15)) { NOISE_output = 2; }
Audio_Regs[NR42] = value;
break;
case 0xFF22: // NR43 (shift)

View File

@ -18,10 +18,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
}
public void StoreSaveRam(byte[] data)
{
if (_syncSettings.Use_SRAM)
{
Buffer.BlockCopy(data, 0, cart_RAM, 0, data.Length);
Console.WriteLine("loading SRAM here");
}
}
public bool SaveRamModified
{

View File

@ -163,7 +163,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
Buffer.BlockCopy(rom, 0x100, header, 0, 0x50);
if (is_GBC && (header[0x43] == 0))
if (is_GBC && ((header[0x43] != 0x80) && (header[0x43] != 0xC0)))
{
ppu = new GBC_PPU_GB();
}

View File

@ -52,6 +52,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
}
public void StoreSaveRam(byte[] data)
{
if (linkSyncSettings.Use_SRAM)
{
if ((L.cart_RAM != null) && (R.cart_RAM == null))
{
@ -69,6 +71,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
Console.WriteLine("loading SRAM here");
}
}
public bool SaveRamModified
{

View File

@ -67,6 +67,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x
}
public void StoreSaveRam(byte[] data)
{
if (Link3xSyncSettings.Use_SRAM)
{
int temp = 0;
@ -89,6 +91,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x
Console.WriteLine("loading SRAM here");
}
}
public bool SaveRamModified
{