From 4b79525e8d8bdb6e0716913eb0ff89078054d799 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Wed, 19 Jul 2017 14:55:50 -0400 Subject: [PATCH] Atari780Hawk: Bug Fixes --- .../Atari/A7800Hawk/A7800Hawk.IEmulator.cs | 1 + .../Consoles/Atari/A7800Hawk/Maria.cs | 19 ++++++++++--------- .../Consoles/Atari/A7800Hawk/MemoryMap.cs | 1 + 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs index 1ce8da055f..06ea64f01f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/A7800Hawk.IEmulator.cs @@ -35,6 +35,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk public void FrameAdvance(IController controller, bool render, bool rendersound) { + Console.WriteLine("-----------------------FRAME-----------------------"); if (_tracer.Enabled) { cpu.TraceCallback = s => _tracer.Put(s); diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs index 3d86d1568a..9bfa8635d7 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/Maria.cs @@ -122,7 +122,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk // Since long shut down loads up the next zone, this basically loads up the DLL for the first zone sl_DMA_complete = false; do_dma = false; - + Core.Maria_regs[8] = 0; // we have now left VBLank + for (int i=0; i<454;i++) { if(i==0 && Core.Maria_regs[0x1C].Bit(6) && !Core.Maria_regs[0x1C].Bit(5)) @@ -140,7 +141,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk { // schedule an NMI for one maria tick into the future // (but set to 2 since it decrements immediately) - //DLI_countdown = 2; + DLI_countdown = 2; current_DLL_DLI = false; } @@ -161,14 +162,11 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk do_dma = false; sl_DMA_complete = false; Core.cpu.RDY = true; - Core.Maria_regs[8] = 0; // we have now left VBLank - // Now proceed with the remaining scanlines // the first one is a pre-render line, since we didn't actually put any data into the buffer yet - while (scanline < 263) - { - + while (scanline < _screen_height) + { if (cycle == 28 && Core.Maria_regs[0x1C].Bit(6) && !Core.Maria_regs[0x1C].Bit(5)) { Core.cpu_halt_pending = true; @@ -205,6 +203,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk if (cycle == 440 && !sl_DMA_complete && do_dma && (DMA_phase == DMA_GRAPHICS || DMA_phase == DMA_HEADER)) { + //Console.WriteLine(scanline); + if (current_DLL_offset == 0) { DMA_phase = DMA_SHUTDOWN_LAST; @@ -213,8 +213,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk { DMA_phase = DMA_SHUTDOWN_OTHER; } - DMA_phase_counter = 0; - + + DMA_phase_counter = 0; } Core.RunCPUCycle(); @@ -443,6 +443,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk for (int i = 0; i < GFX_Objects[GFX_index, header_counter].width; i++) { addr_t = (ushort)(GFX_Objects[GFX_index, header_counter].addr + (current_DLL_offset << 8) + i); + if ((current_DLL_H16 && addr_t.Bit(12)) || (current_DLL_H8 && addr_t.Bit(11))) { GFX_Objects[GFX_index, header_counter].obj[i] = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/MemoryMap.cs b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/MemoryMap.cs index 848e06ae7d..164391b25f 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/MemoryMap.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/MemoryMap.cs @@ -118,6 +118,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk { // register 8 is read only and controlled by Maria var temp = addr & 0x1F; + if (temp != 8) Maria_regs[temp] = value;