GBHawk: minor fixes for GBvideoplayer
This commit is contained in:
parent
d32b1824ed
commit
0ff7a07eaf
|
@ -720,6 +720,7 @@
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Consoles\Nintendo\GBA\VBARegisterHelper.cs" />
|
<Compile Include="Consoles\Nintendo\GBA\VBARegisterHelper.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\GBHawk\Audio.cs" />
|
<Compile Include="Consoles\Nintendo\GBHawk\Audio.cs" />
|
||||||
|
<Compile Include="Consoles\Nintendo\GBHawk\Mappers\Mapper_WisdomTree.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\GBHawk\Mappers\Mapper_RockMan8.cs" />
|
<Compile Include="Consoles\Nintendo\GBHawk\Mappers\Mapper_RockMan8.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\GBHawk\Mappers\Mapper_Sachen_MMC2.cs" />
|
<Compile Include="Consoles\Nintendo\GBHawk\Mappers\Mapper_Sachen_MMC2.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\GBHawk\Mappers\Mapper_Sachen_MMC1.cs" />
|
<Compile Include="Consoles\Nintendo\GBHawk\Mappers\Mapper_Sachen_MMC1.cs" />
|
||||||
|
|
|
@ -109,6 +109,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
LCDC = value;
|
LCDC = value;
|
||||||
|
|
||||||
|
Console.WriteLine(value);
|
||||||
break;
|
break;
|
||||||
case 0xFF41: // STAT
|
case 0xFF41: // STAT
|
||||||
// writing to STAT during mode 0 or 2 causes a STAT IRQ
|
// writing to STAT during mode 0 or 2 causes a STAT IRQ
|
||||||
|
@ -363,6 +365,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
LY_inc = 1;
|
LY_inc = 1;
|
||||||
Core.in_vblank = false;
|
Core.in_vblank = false;
|
||||||
|
|
||||||
|
STAT &= 0xFC;
|
||||||
|
|
||||||
// special note here, the y coordiate of the window is kept if the window is deactivated
|
// special note here, the y coordiate of the window is kept if the window is deactivated
|
||||||
// meaning it will pick up where it left off if re-enabled later
|
// meaning it will pick up where it left off if re-enabled later
|
||||||
// so we don't reset it in the scanline loop
|
// so we don't reset it in the scanline loop
|
||||||
|
@ -431,6 +435,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
Core.REG_FF0F |= 0x01;
|
Core.REG_FF0F |= 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((cycle == 84) && (LY == 144))
|
||||||
|
{
|
||||||
|
if (STAT.Bit(5)) { VBL_INT = false; }
|
||||||
|
}
|
||||||
|
|
||||||
if ((LY == 153) && (cycle == 6))
|
if ((LY == 153) && (cycle == 6))
|
||||||
{
|
{
|
||||||
LY = 0;
|
LY = 0;
|
||||||
|
@ -521,7 +530,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
}
|
}
|
||||||
else if ((cycle >= 80) && (LY < 144))
|
else if ((cycle >= 80) && (LY < 144))
|
||||||
{
|
{
|
||||||
|
|
||||||
if (cycle == 84)
|
if (cycle == 84)
|
||||||
{
|
{
|
||||||
STAT &= 0xFC;
|
STAT &= 0xFC;
|
||||||
|
@ -614,7 +622,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
|
|
||||||
public override void render(int render_cycle)
|
public override void render(int render_cycle)
|
||||||
{
|
{
|
||||||
|
|
||||||
// we are now in STAT mode 3
|
// we are now in STAT mode 3
|
||||||
// NOTE: presumably the first necessary sprite is fetched at sprite evaulation
|
// NOTE: presumably the first necessary sprite is fetched at sprite evaulation
|
||||||
// i.e. just keeping track of the lowest x-value sprite
|
// i.e. just keeping track of the lowest x-value sprite
|
||||||
|
@ -768,7 +775,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
// There is another priority bit in GBC, that can still override sprite priority
|
// There is another priority bit in GBC, that can still override sprite priority
|
||||||
if (LCDC.Bit(0) && tile_data_latch[2].Bit(7) && Core.GBC_compat)
|
if (LCDC.Bit(0) && tile_data_latch[2].Bit(7) && (ref_pixel != 0) && Core.GBC_compat)
|
||||||
{
|
{
|
||||||
use_sprite = false;
|
use_sprite = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
cycle = 0;
|
cycle = 0;
|
||||||
|
|
||||||
LY += LY_inc;
|
LY += LY_inc;
|
||||||
Core.cpu.LY = LY;
|
Core.cpu.LY = LY;
|
||||||
|
|
||||||
|
@ -209,6 +208,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
Core.REG_FF0F |= 0x01;
|
Core.REG_FF0F |= 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((cycle == 84) && (LY == 144))
|
||||||
|
{
|
||||||
|
if (STAT.Bit(5)) { VBL_INT = false; }
|
||||||
|
}
|
||||||
|
|
||||||
if ((LY == 153) && (cycle == 6))
|
if ((LY == 153) && (cycle == 6))
|
||||||
{
|
{
|
||||||
LY = 0;
|
LY = 0;
|
||||||
|
@ -243,7 +247,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
|
|
||||||
if (cycle == 84)
|
if (cycle == 84)
|
||||||
{
|
{
|
||||||
|
|
||||||
STAT &= 0xFC;
|
STAT &= 0xFC;
|
||||||
STAT |= 0x03;
|
STAT |= 0x03;
|
||||||
OAM_INT = false;
|
OAM_INT = false;
|
||||||
|
@ -340,7 +343,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
LYC_INT = false;
|
LYC_INT = false;
|
||||||
STAT &= 0xFB;
|
STAT &= 0xFB;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ((cycle == 4) && (LY != 0))
|
else if ((cycle == 4) && (LY != 0))
|
||||||
{
|
{
|
||||||
|
@ -419,7 +421,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
first_fetch = true;
|
first_fetch = true;
|
||||||
no_sprites = false;
|
no_sprites = false;
|
||||||
evaled_sprites = 0;
|
evaled_sprites = 0;
|
||||||
|
|
||||||
window_pre_render = false;
|
window_pre_render = false;
|
||||||
window_latch = LCDC.Bit(5);
|
window_latch = LCDC.Bit(5);
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
|
|
||||||
// some games have sizes that result in a degenerate ROM, account for it here
|
// some games have sizes that result in a degenerate ROM, account for it here
|
||||||
if (ROM_mask > 4) { ROM_mask |= 3; }
|
if (ROM_mask > 4) { ROM_mask |= 3; }
|
||||||
|
if (ROM_mask > 0x100) { ROM_mask |= 0xFF; }
|
||||||
|
|
||||||
RAM_mask = 0;
|
RAM_mask = 0;
|
||||||
if (Core.cart_RAM != null)
|
if (Core.cart_RAM != null)
|
||||||
|
|
Loading…
Reference in New Issue