GBHawk Cleanups

This commit is contained in:
alyosha-tas 2017-12-06 19:20:15 -05:00
parent 7ae43505ec
commit e92a455995
2 changed files with 3 additions and 23 deletions

View File

@ -37,7 +37,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
color_palette[3] = color_palette_Gr[3]; color_palette[3] = color_palette_Gr[3];
} }
if (_tracer.Enabled) if (_tracer.Enabled)
{ {
cpu.TraceCallback = s => _tracer.Put(s); cpu.TraceCallback = s => _tracer.Put(s);
@ -103,9 +102,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
input_register |= 0xF; input_register |= 0xF;
} }
// check for interrupts // check for interrupts
if (((contr_prev & 8) > 0) && ((input_register & 8) == 0) || if (((contr_prev & 8) > 0) && ((input_register & 8) == 0) ||
((contr_prev & 4) > 0) && ((input_register & 4) == 0) || ((contr_prev & 4) > 0) && ((input_register & 4) == 0) ||
((contr_prev & 2) > 0) && ((input_register & 2) == 0) || ((contr_prev & 2) > 0) && ((input_register & 2) == 0) ||
@ -115,7 +112,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
REG_FF0F |= 0x10; REG_FF0F |= 0x10;
} }
while (!vblank_rise) while (!vblank_rise)
{ {
audio.tick(); audio.tick();
@ -177,7 +173,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
Marshal.FreeHGlobal(iptr3); Marshal.FreeHGlobal(iptr3);
} }
#region Video provider #region Video provider
public int _frameHz = 60; public int _frameHz = 60;

View File

@ -203,14 +203,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
} }
else if ((DMA_clock % 4) == 3) else if ((DMA_clock % 4) == 3)
{ {
if ((DMA_inc % 4) == 3) Core.OAM[DMA_inc] = DMA_byte;
{
Core.OAM[DMA_inc] = DMA_byte;
}
else
{
Core.OAM[DMA_inc] = DMA_byte;
}
if (DMA_inc < (0xA0 - 1)) { DMA_inc++; } if (DMA_inc < (0xA0 - 1)) { DMA_inc++; }
} }
@ -424,11 +417,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
// render the screen and handle hblank // render the screen and handle hblank
render(cycle - 80); render(cycle - 80);
} }
} }
} }
if ((LY_inc == 0)) if ((LY_inc == 0))
{ {
if (cycle == 12) if (cycle == 12)
@ -466,10 +457,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
} }
else else
{ {
// screen disable sets STAT as though it were vblank, but there is no Stat IRQ asserted
//STAT &= 0xFC;
//STAT |= 0x01;
STAT &= 0xF8; STAT &= 0xF8;
VBL_INT = LYC_INT = HBL_INT = OAM_INT = false; VBL_INT = LYC_INT = HBL_INT = OAM_INT = false;
@ -497,7 +484,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
// process latch delays // process latch delays
//latch_delay(); //latch_delay();
} }
// might be needed, not sure yet // might be needed, not sure yet
@ -795,7 +781,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
temp_fetch = y_tile * 32 + (x_tile + tile_inc) % 32; temp_fetch = y_tile * 32 + (x_tile + tile_inc) % 32;
tile_byte = LCDC.Bit(3) ? Core.BG_map_2[temp_fetch] : Core.BG_map_1[temp_fetch]; tile_byte = LCDC.Bit(3) ? Core.BG_map_2[temp_fetch] : Core.BG_map_1[temp_fetch];
} }
else else
{ {