revx: Add ADC0848 and make that device actually work (nw)

master
AJR 2017-11-08 14:26:36 -05:00
parent 9cf4c0c89a
commit 3f798eb039
4 changed files with 29 additions and 39 deletions

View File

@ -76,6 +76,8 @@ void adc0844_device::device_start()
void adc0848_device::device_start()
{
adc0844_device::device_start();
// resolve callbacks
m_ch5_cb.resolve_safe(0xff);
m_ch6_cb.resolve_safe(0xff);

View File

@ -88,6 +88,7 @@ There's a separate sound board also, but it wasn't available so is not documente
#include "cpu/adsp2100/adsp2100.h"
#include "cpu/tms34010/tms34010.h"
#include "machine/adc0844.h"
#include "machine/nvram.h"
#include "screen.h"
@ -112,7 +113,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, midxunit_state )
AM_RANGE(0x60c00000, 0x60c0007f) AM_READ(midxunit_io_r)
AM_RANGE(0x60c00080, 0x60c000df) AM_WRITE(midxunit_io_w)
AM_RANGE(0x60c000e0, 0x60c000ff) AM_READWRITE(midxunit_security_r, midxunit_security_w)
AM_RANGE(0x80800000, 0x8080001f) AM_READWRITE(midxunit_analog_r, midxunit_analog_select_w)
AM_RANGE(0x80800000, 0x8080000f) AM_DEVREADWRITE8("adc", adc0848_device, read, write, 0x00ff)
AM_RANGE(0x80800010, 0x8080001f) AM_NOP
AM_RANGE(0x80c00000, 0x80c000ff) AM_READWRITE(midxunit_uart_r, midxunit_uart_w)
AM_RANGE(0xa0440000, 0xa047ffff) AM_READWRITE(midxunit_cmos_r, midxunit_cmos_w) AM_SHARE("nvram")
AM_RANGE(0xa0800000, 0xa08fffff) AM_READWRITE(midxunit_paletteram_r, midxunit_paletteram_w) AM_SHARE("palette")
@ -210,28 +212,22 @@ static INPUT_PORTS_START( revx )
PORT_DIPSETTING( 0x0000, DEF_STR( On ))
PORT_START("AN0")
PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)
PORT_START("AN1")
PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(1)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(1)
PORT_START("AN2")
PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2)
PORT_START("AN3")
PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(2)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(2)
PORT_START("AN4")
PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(3)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(3)
PORT_START("AN5")
PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(3)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(3)
INPUT_PORTS_END
@ -270,6 +266,15 @@ static MACHINE_CONFIG_START( midxunit )
/* serial prefixes 419, 420 */
MCFG_MIDWAY_SERIAL_PIC_UPPER(419);
MCFG_ADC0848_ADD("adc")
MCFG_ADC0848_INTR_CB(NOOP) // passed through PLSI1032; what does ADC INT actually map to?
MCFG_ADC0848_CH1_CB(IOPORT("AN0"))
MCFG_ADC0848_CH2_CB(IOPORT("AN1"))
MCFG_ADC0848_CH3_CB(IOPORT("AN2"))
MCFG_ADC0848_CH4_CB(IOPORT("AN3"))
MCFG_ADC0848_CH5_CB(IOPORT("AN4"))
MCFG_ADC0848_CH6_CB(IOPORT("AN5"))
/* sound hardware */
MCFG_DEVICE_ADD("dcs", DCS_AUDIO_2K_UART, 0)
MACHINE_CONFIG_END

View File

@ -16,21 +16,11 @@ public:
m_nvram(*this, "nvram"),
m_midway_serial_pic(*this, "serial_pic") { }
required_shared_ptr<uint16_t> m_nvram;
required_device<midway_serial_pic_device> m_midway_serial_pic;
uint8_t m_cmos_write_enable;
uint16_t m_iodata[8];
uint8_t m_ioshuffle[16];
uint8_t m_analog_port;
uint8_t m_uart[8];
uint8_t m_security_bits;
DECLARE_READ16_MEMBER(midxunit_cmos_r);
DECLARE_WRITE16_MEMBER(midxunit_cmos_w);
DECLARE_WRITE16_MEMBER(midxunit_io_w);
DECLARE_WRITE16_MEMBER(midxunit_unknown_w);
DECLARE_READ16_MEMBER(midxunit_io_r);
DECLARE_READ16_MEMBER(midxunit_analog_r);
DECLARE_WRITE16_MEMBER(midxunit_analog_select_w);
DECLARE_READ16_MEMBER(midxunit_status_r);
DECLARE_READ16_MEMBER(midxunit_uart_r);
DECLARE_WRITE16_MEMBER(midxunit_uart_w);
@ -46,4 +36,13 @@ public:
DECLARE_VIDEO_START(midxunit);
void register_state_saving();
TMS340X0_SCANLINE_IND16_CB_MEMBER(scanline_update);
private:
required_shared_ptr<uint16_t> m_nvram;
required_device<midway_serial_pic_device> m_midway_serial_pic;
uint8_t m_cmos_write_enable;
uint16_t m_iodata[8];
uint8_t m_ioshuffle[16];
uint8_t m_uart[8];
uint8_t m_security_bits;
};

View File

@ -26,7 +26,6 @@ void midxunit_state::register_state_saving()
save_item(NAME(m_cmos_write_enable));
save_item(NAME(m_iodata));
save_item(NAME(m_ioshuffle));
save_item(NAME(m_analog_port));
save_item(NAME(m_uart));
save_item(NAME(m_security_bits));
}
@ -132,21 +131,6 @@ READ16_MEMBER(midxunit_state::midxunit_io_r)
}
READ16_MEMBER(midxunit_state::midxunit_analog_r)
{
static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5" };
return ioport(portnames[m_analog_port])->read();
}
WRITE16_MEMBER(midxunit_state::midxunit_analog_select_w)
{
if (offset == 0 && ACCESSING_BITS_0_7)
m_analog_port = data - 8;
}
READ16_MEMBER(midxunit_state::midxunit_status_r)
{
/* low bit indicates whether the ADC is done reading the current input */