diff --git a/src/mame/drivers/midyunit.cpp b/src/mame/drivers/midyunit.cpp index 2d3c1ab7560..813faefb8c2 100644 --- a/src/mame/drivers/midyunit.cpp +++ b/src/mame/drivers/midyunit.cpp @@ -964,20 +964,16 @@ static INPUT_PORTS_START( term2 ) PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("STICK0_X") - PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE PORT_PLAYER(1) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE PORT_PLAYER(1) PORT_START("STICK0_Y") PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_PLAYER(1) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("STICK1_X") PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE PORT_PLAYER(2) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("STICK1_Y") PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_PLAYER(2) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END @@ -1248,6 +1244,15 @@ static MACHINE_CONFIG_DERIVED( yunit_adpcm_6bit_faster, yunit_core ) MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( term2, yunit_adpcm_6bit_faster ) + MCFG_ADC0844_ADD("adc") + MCFG_ADC0844_CH1_CB(IOPORT("STICK0_X")) + MCFG_ADC0844_CH2_CB(IOPORT("STICK0_Y")) + MCFG_ADC0844_CH3_CB(IOPORT("STICK1_X")) + MCFG_ADC0844_CH4_CB(IOPORT("STICK1_Y")) +MACHINE_CONFIG_END + + static MACHINE_CONFIG_DERIVED( mkyawdim, yunit_core ) /* basic machine hardware */ @@ -3077,12 +3082,12 @@ GAME( 1991, shimpactp4, shimpact, yunit_cvsd_6bit_slow, shimpact, midyunit_stat GAME( 1991, strkforc, 0, yunit_cvsd_4bit_fast, strkforc, midyunit_state, strkforc, ROT0, "Midway", "Strike Force (rev 1 02/25/91)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, term2, 0, yunit_adpcm_6bit_faster, term2, midyunit_state, term2, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (rev LA4 08/03/92)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, term2la3, term2, yunit_adpcm_6bit_faster, term2, midyunit_state, term2la3, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (rev LA3 03/27/92)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, term2la2, term2, yunit_adpcm_6bit_faster, term2, midyunit_state, term2la2, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (rev LA2 12/09/91)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, term2la1, term2, yunit_adpcm_6bit_faster, term2, midyunit_state, term2la1, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (rev LA1 11/01/91)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, term2pa2, term2, yunit_adpcm_6bit_faster, term2, midyunit_state, term2la1, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (prototype, rev PA2 10/18/91)", MACHINE_SUPPORTS_SAVE ) -GAME( 1991, term2lg1, term2, yunit_adpcm_6bit_faster, term2, midyunit_state, term2la1, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (rev LG1 11/04/91)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, term2, 0, term2, term2, midyunit_state, term2, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (rev LA4 08/03/92)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, term2la3, term2, term2, term2, midyunit_state, term2la3, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (rev LA3 03/27/92)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, term2la2, term2, term2, term2, midyunit_state, term2la2, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (rev LA2 12/09/91)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, term2la1, term2, term2, term2, midyunit_state, term2la1, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (rev LA1 11/01/91)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, term2pa2, term2, term2, term2, midyunit_state, term2la1, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (prototype, rev PA2 10/18/91)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, term2lg1, term2, term2, term2, midyunit_state, term2la1, ORIENTATION_FLIP_X, "Midway", "Terminator 2 - Judgment Day (rev LG1 11/04/91)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, mkla4, mk, yunit_adpcm_6bit_fast, mkla4, midyunit_state, mkyunit, ROT0, "Midway", "Mortal Kombat (rev 4.0 09/28/92)", MACHINE_SUPPORTS_SAVE ) GAME( 1992, mkla3, mk, yunit_adpcm_6bit_fast, mkla4, midyunit_state, mkyunit, ROT0, "Midway", "Mortal Kombat (rev 3.0 08/31/92)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h index e062f9b2fbe..ce4620cbcea 100644 --- a/src/mame/includes/midyunit.h +++ b/src/mame/includes/midyunit.h @@ -10,7 +10,7 @@ #include "audio/williams.h" #include "cpu/tms34010/tms34010.h" -#include "machine/gen_latch.h" +#include "machine/adc0844.h" #include "machine/gen_latch.h" #include "machine/nvram.h" #include "sound/okim6295.h" @@ -54,6 +54,7 @@ public: , m_cvsd_sound(*this, "cvsd") , m_adpcm_sound(*this, "adpcm") , m_soundlatch(*this, "soundlatch") + , m_term2_adc(*this, "adc") , m_generic_paletteram_16(*this, "paletteram") , m_gfx_rom(*this, "gfx_rom", 16) , m_mainram(*this, "mainram") @@ -70,6 +71,7 @@ public: optional_device m_cvsd_sound; optional_device m_adpcm_sound; optional_device m_soundlatch; + optional_device m_term2_adc; required_shared_ptr m_generic_paletteram_16; optional_shared_ptr m_gfx_rom; @@ -81,7 +83,6 @@ public: uint16_t m_prot_result; uint16_t m_prot_sequence[3]; uint8_t m_prot_index; - uint8_t m_term2_analog_select; const struct protection_data *m_prot_data; uint8_t m_cmos_w_enable; uint8_t m_chip_type; diff --git a/src/mame/machine/midyunit.cpp b/src/mame/machine/midyunit.cpp index 3ca36e5a485..03fc9a53f1d 100644 --- a/src/mame/machine/midyunit.cpp +++ b/src/mame/machine/midyunit.cpp @@ -130,14 +130,7 @@ READ16_MEMBER(midyunit_state::term2_input_r) if (offset != 2) return m_ports[offset]->read(); - switch (m_term2_analog_select) - { - default: - case 0: return ioport("STICK0_X")->read(); - case 1: return ioport("STICK0_Y")->read(); - case 2: return ioport("STICK1_X")->read(); - case 3: return ioport("STICK1_Y")->read(); - } + return m_term2_adc->read(space, 0) | 0xff00; } WRITE16_MEMBER(midyunit_state::term2_sound_w) @@ -167,7 +160,7 @@ WRITE16_MEMBER(midyunit_state::term2_sound_w) } if (offset == 0) - m_term2_analog_select = (data >> 12) & 3; + m_term2_adc->write(space, 0, ((data >> 12) & 3) | 4); m_adpcm_sound->reset_write((~data & 0x100) >> 1); m_adpcm_sound->write(space, offset, data);