From 233b795c213101f48c9c4bb7e48815614715dbf3 Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Wed, 26 Mar 2014 03:41:11 +0000 Subject: [PATCH] (MESS) a7800.c: Fixed DMA regarding startup, shutdown and cycle stealing which fixes numerous recorded MAMETester bugs. Bug fixed and fine tuned the DMA timing. Corrected RIOT timing [Mike Saarna] --- src/mess/drivers/a7800.c | 4 +++- src/mess/video/a7800.c | 15 +++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mess/drivers/a7800.c b/src/mess/drivers/a7800.c index 33347e22638..14ac1157f90 100644 --- a/src/mess/drivers/a7800.c +++ b/src/mess/drivers/a7800.c @@ -80,6 +80,8 @@ 2014/02/15 Robert Tuccitto Added more details and clarification regarding the potentiometer. + + 2014/03/25 Mike Saarna Fixed Riot Timer ***************************************************************************/ #include "emu.h" @@ -1047,7 +1049,7 @@ static MACHINE_CONFIG_START( a7800_ntsc, a7800_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* devices */ - MCFG_RIOT6532_ADD("riot", A7800_NTSC_Y1/12, a7800_r6532_interface) + MCFG_RIOT6532_ADD("riot", A7800_NTSC_Y1/8, a7800_r6532_interface) MCFG_CARTSLOT_ADD("cart") MCFG_CARTSLOT_EXTENSION_LIST("bin,a78") diff --git a/src/mess/video/a7800.c b/src/mess/video/a7800.c index a74caacd01c..f050ba60eea 100644 --- a/src/mess/video/a7800.c +++ b/src/mess/video/a7800.c @@ -4,8 +4,8 @@ Routines to control the Atari 7800 video hardware - TODO: - precise DMA cycle stealing + 2014-03-24 Mike Saarna Fixed DMA regarding startup, shutdown and + cycle stealing. 2013-05-08 huygens rewrite to emulate line ram buffers (mostly fixes Kung-Fu Master Started DMA cycle stealing implementation @@ -126,7 +126,12 @@ void a7800_state::maria_draw_scanline() int x, d, c, i, pixel_cell, cells; int maria_cycles; - maria_cycles = 0; + //maria_cycles = 0; + if ( m_maria_offset == 0 ) + maria_cycles = 5+19; // DMA startup + last line shutdown + else + maria_cycles = 5+13; // DMA startup + other line shutdown + cells = 0; /* Process this DLL entry */ @@ -198,7 +203,9 @@ void a7800_state::maria_draw_scanline() } } } - m_maincpu->eat_cycles(maria_cycles/4); // Maria clock rate is 4 times that of CPU + // spin the CPU for Maria DMA, if it's not already spinning for WSYNC + if ( ! m_maria_wsync ) + m_maincpu->spin_until_time(m_maincpu->cycles_to_attotime(maria_cycles/4)); // Maria clock rate is 4 times that of the CPU // draw line buffer to screen m_active_buffer = !m_active_buffer; // switch buffers