O2Hawk: bug fixes and add reset button

This commit is contained in:
alyosha-tas 2020-04-03 16:56:22 -04:00
parent eae2ee7e29
commit f39319fd12
5 changed files with 26 additions and 6 deletions

View File

@ -34,6 +34,11 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
HardReset();
}
if (controller.IsPressed("Reset"))
{
SoftReset();
}
_islag = true;
do_frame(controller);

View File

@ -95,6 +95,8 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
ser.Register<ITraceable>(_tracer);
ser.Register<IStatable>(new StateSerializer(SyncState));
SetupMemoryDomains();
cpu.SetCallbacks(ReadMemory, PeekMemory, PeekMemory, WriteMemory);
HardReset();
// set up differences between PAL and NTSC systems
@ -131,7 +133,12 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
ppu.Reset();
cpu.SetCallbacks(ReadMemory, PeekMemory, PeekMemory, WriteMemory);
cpu.Reset();
}
public void SoftReset()
{
cpu.Reset();
}
private void ExecFetch(ushort addr)

View File

@ -38,7 +38,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
"Q", "S", "D", "F", "G", "H", "J", "K",
"A", "Z", "X", "C", "V", "B", "M", "PERIOD",
"-", "*", "/", "=", "YES", "NO", "CLR", "ENT",
"Power"
"Reset","Power"
})
.ToList()
};

View File

@ -157,6 +157,8 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
A5_latch = (byte)(cycle - HBL_CNT);
}
else { VDC_status |= 0x2; }
if (VDC_ctrl.Bit(2)) { Console.WriteLine("sound INT"); }
}
else if (addr == 0xA1)
{
@ -740,7 +742,13 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
Grid_H = new byte[18];
Grid_V = new byte[10];
AudioReset();
VDC_ctrl = VDC_status = VDC_collision = VDC_color = grid_fill_col = 0;
Pixel_Stat = A4_latch = A5_latch = 0;
bg_brightness = grid_brightness = grid_fill = LY = cycle = 0;
VBL = HBL = lum_en = false;
AudioReset();
}
public void set_region(bool pal_flag)
@ -821,8 +829,8 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 00, // \ 0x3B
0x00, 0x00, 0x18, 0x10, 0x10, 0xFF, 0x7E, 00, // (boat 1) 0x3C
0x00, 0x03, 0x63, 0xFF, 0xFF, 0x18, 0x08, 00, // (plane) 0x3D
0x00, 0x00, 0x00, 0x01, 0x38, 0xFF, 0x7E, 00, // (boat 2) 0x3E
0x00, 0x00, 0x00, 0x05, 0x6E, 0xFF, 0x7E, 00 // (boat 3) 0x3F
0x00, 0x00, 0x00, 0x10, 0x38, 0xFF, 0x7E, 00, // (boat 2) 0x3E
0x00, 0x00, 0x00, 0x06, 0x6E, 0xFF, 0x7E, 00 // (boat 3) 0x3F
};
public static readonly uint[] Color_Palette_SPR =

View File

@ -149,7 +149,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
state = false;
reload_block = false;
next_free_cycle = 0;
}
}
public void SyncState(Serializer ser)
{