xm implementation of cntrl2+cntrl3

This commit is contained in:
msaarna@gmail.com 2020-05-24 10:23:47 -04:00
parent bb607b5978
commit fd3135813c
2 changed files with 17 additions and 2 deletions

View file

@ -54,6 +54,7 @@
#include "a78_carts.h"
#include "speaker.h"
extern int m_dmaactive;
//-------------------------------------------------
// constructor
@ -117,9 +118,19 @@ READ8_MEMBER(a78_xm_device::read_40xx)
if (!BIT(m_cntrl5,0))
{
if (BIT(m_cntrl1,5) && offset < 0x2000)
return m_ram[ ((offset&0x1fff) + (((m_cntrl2&15) * 0x2000))) | ((m_cntrl1&1)<<8) ];
{
if(m_dmaactive)
return m_ram[ ((offset&0x1fff) + (((m_cntrl3&15) * 0x2000))) | ((m_cntrl1&1)<<8) ];
else
return m_ram[ ((offset&0x1fff) + (((m_cntrl2&15) * 0x2000))) | ((m_cntrl1&1)<<8) ];
}
else if ( BIT(m_cntrl1,6) && offset >= 0x2000 && offset < 0x4000)
return m_ram[ ((offset&0x1fff) + ((((m_cntrl2>>4)&15) * 0x2000))) | ((m_cntrl1&2)<<7) ];
{
if(m_dmaactive)
return m_ram[ ((offset&0x1fff) + ((((m_cntrl3>>4)&15) * 0x2000))) | ((m_cntrl1&2)<<7) ];
else
return m_ram[ ((offset&0x1fff) + ((((m_cntrl2>>4)&15) * 0x2000))) | ((m_cntrl1&2)<<7) ];
}
else
return m_xmslot->read_40xx(space, offset);
}

View file

@ -117,6 +117,8 @@
#define A7800_NTSC_Y1 XTAL_14_31818MHz
#define CLK_PAL 1773447
// FIXME: global used to pass info between a7800 driver and bus devices
int m_dmaactive;
class a7800_state : public driver_device
{
@ -460,7 +462,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(a7800_state::interrupt)
TIMER_CALLBACK_MEMBER(a7800_state::maria_startdma)
{
m_dmaactive = 1;
m_maria->startdma(m_lines);
m_dmaactive = 0;
}