diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs index 2feb31cb69..50e6f2783c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs @@ -31,6 +31,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk public bool right_toggle; public bool left_was_pressed; public bool right_was_pressed; + public bool p1_is_2button; + public bool p2_is_2button; // there are 4 maria cycles in a CPU cycle (fast access, both NTSC and PAL) // if the 6532 or TIA are accessed (PC goes to one of those addresses) the next access will be slower by 1/2 a CPU cycle @@ -167,6 +169,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk p2_fire = _controllerDeck.ReadFire2(controller); p1_fire_2x = _controllerDeck.ReadFire1_2x(controller); p2_fire_2x = _controllerDeck.ReadFire2_2x(controller); + p1_is_2button = _controllerDeck.Is_2_button1(controller); + p2_is_2button = _controllerDeck.Is_2_button2(controller); } public void GetConsoleState(IController controller) diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllerDeck.cs b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllerDeck.cs index a0e21053c1..3698015579 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllerDeck.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllerDeck.cs @@ -80,6 +80,16 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk return Port2.ReadFire2x(c); } + public bool Is_2_button1(IController c) + { + return Port1.Is_2_button(c); + } + + public bool Is_2_button2(IController c) + { + return Port2.Is_2_button(c); + } + public ControllerDefinition Definition { get; } public void SyncState(Serializer ser) diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllers.cs b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllers.cs index 93b79d2246..cdf1040ffc 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllers.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800HawkControllers.cs @@ -9,7 +9,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Atari.A7800Hawk { /// - /// Represents a controller plugged into a controller port on the intellivision + /// Represents a controller plugged into a controller port on the A7800 /// public interface IPort { @@ -19,6 +19,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk byte ReadFire2x(IController c); + bool Is_2_button(IController c); + ControllerDefinition Definition { get; } void SyncState(Serializer ser); @@ -53,6 +55,11 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk return 0; } + public bool Is_2_button(IController c) + { + return false; + } + public ControllerDefinition Definition { get; } public void SyncState(Serializer ser) @@ -113,8 +120,12 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk return 0; // only applicable for 2 button mode } - public ControllerDefinition Definition { get; } + public bool Is_2_button(IController c) + { + return false; + } + public ControllerDefinition Definition { get; } public void SyncState(Serializer ser) { @@ -172,7 +183,12 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk public byte ReadFire(IController c) { - return 0x80; + byte result = 0x80; + if (c.IsPressed(Definition.BoolButtons[4]) || c.IsPressed(Definition.BoolButtons[5])) + { + result = 0x00; // zero means fire is pressed + } + return result; } public byte ReadFire2x(IController c) @@ -189,8 +205,12 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk return result; } - public ControllerDefinition Definition { get; } + public bool Is_2_button(IController c) + { + return true; + } + public ControllerDefinition Definition { get; } public void SyncState(Serializer ser) { diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs index 216af94a6d..377424577f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs @@ -219,7 +219,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk if (cycle == 453 && !sl_DMA_complete && do_dma && (DMA_phase == DMA_GRAPHICS || DMA_phase == DMA_HEADER)) { overrun_dma = true; - Console.WriteLine(scanline); + //Console.WriteLine(scanline); if (current_DLL_offset == 0) { DMA_phase = DMA_SHUTDOWN_LAST; @@ -402,13 +402,13 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk if (Core.Maria_regs[0x1C].Bit(4)) { - graphics_read_time = 9 * GFX_Objects[GFX_index, header_counter].width + 3; + graphics_read_time = 9 * GFX_Objects[GFX_index, header_counter].width; ch_size = 2; GFX_Objects[GFX_index, header_counter].width *= 2; } else { - graphics_read_time = 6 * GFX_Objects[GFX_index, header_counter].width + 3; + graphics_read_time = 6 * GFX_Objects[GFX_index, header_counter].width; ch_size = 1; }