summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2013-07-15 06:11:00 +0000
committer Aaron Giles <aaron@aarongiles.com>2013-07-15 06:11:00 +0000
commit856227325e060dd5ddd3be9291b09a190ff95ebf (patch)
tree2351b14e41832668b4cf7294cd117770e48ba122
parent1bd648e2720bc8e1c0e96e718d33aedacf2752f7 (diff)
Move Atari drivers to using ioport callbacks for sound communication
stuff. Added HBLANK to standard screen ports. Consolidated duplicate functions (will need another full rebuild, I think).
-rw-r--r--src/emu/ioport.h5
-rw-r--r--src/emu/screen.c11
-rw-r--r--src/emu/screen.h3
-rw-r--r--src/mame/audio/atarijsa.c43
-rw-r--r--src/mame/audio/atarijsa.h21
-rw-r--r--src/mame/drivers/atarig1.c7
-rw-r--r--src/mame/drivers/atarig42.c10
-rw-r--r--src/mame/drivers/atarigx2.c14
-rw-r--r--src/mame/drivers/atarisy1.c51
-rw-r--r--src/mame/drivers/atarisy2.c17
-rw-r--r--src/mame/drivers/badlands.c6
-rw-r--r--src/mame/drivers/batman.c15
-rw-r--r--src/mame/drivers/beathead.c22
-rw-r--r--src/mame/drivers/blstroid.c29
-rw-r--r--src/mame/drivers/cyberbal.c27
-rw-r--r--src/mame/drivers/eprom.c16
-rw-r--r--src/mame/drivers/gauntlet.c24
-rw-r--r--src/mame/drivers/offtwall.c12
-rw-r--r--src/mame/drivers/relief.c3
-rw-r--r--src/mame/drivers/skullxbo.c22
-rw-r--r--src/mame/drivers/thunderj.c8
-rw-r--r--src/mame/drivers/toobin.c22
-rw-r--r--src/mame/drivers/vindictr.c6
-rw-r--r--src/mame/drivers/xybots.c4
-rw-r--r--src/mame/includes/batman.h1
-rw-r--r--src/mame/includes/cyberbal.h2
-rw-r--r--src/mame/includes/gauntlet.h1
-rw-r--r--src/mame/includes/offtwall.h1
-rw-r--r--src/mame/includes/skullxbo.h1
-rw-r--r--src/mame/includes/toobin.h1
-rw-r--r--src/mame/machine/atarigen.h10
31 files changed, 133 insertions, 282 deletions
diff --git a/src/emu/ioport.h b/src/emu/ioport.h
index 68d67f23d35..6ed5a7658a3 100644
--- a/src/emu/ioport.h
+++ b/src/emu/ioport.h
@@ -1650,7 +1650,10 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, a
PORT_BIT( _mask, _mask & _default, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ))
#define PORT_VBLANK(_screen) \
- PORT_READ_LINE_DEVICE_MEMBER(_screen, screen_device, vblank_port_read)
+ PORT_READ_LINE_DEVICE_MEMBER(_screen, screen_device, vblank)
+
+#define PORT_HBLANK(_screen) \
+ PORT_READ_LINE_DEVICE_MEMBER(_screen, screen_device, hblank)
diff --git a/src/emu/screen.c b/src/emu/screen.c
index 1d223b13d38..024ed769418 100644
--- a/src/emu/screen.c
+++ b/src/emu/screen.c
@@ -785,17 +785,6 @@ void screen_device::register_screen_bitmap(bitmap_t &bitmap)
//-------------------------------------------------
-// vblank_port_read - custom port handler to
-// return a VBLANK state
-//-------------------------------------------------
-
-int screen_device::vblank_port_read()
-{
- return vblank() ? -1 : 0;
-}
-
-
-//-------------------------------------------------
// vblank_begin - call any external callbacks to
// signal the VBLANK period has begun
//-------------------------------------------------
diff --git a/src/emu/screen.h b/src/emu/screen.h
index 634bff28c56..4ee6a17d667 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -207,7 +207,8 @@ public:
int vpos() const;
int hpos() const;
bool vblank() const { return (machine().time() < m_vblank_end_time); }
- bool hblank() const { int curpos = hpos(); return (curpos < m_visarea.min_x || curpos > m_visarea.max_x); }
+ DECLARE_READ_LINE_MEMBER(vblank) { return (machine().time() < m_vblank_end_time) ? ASSERT_LINE : CLEAR_LINE; }
+ DECLARE_READ_LINE_MEMBER(hblank) { int curpos = hpos(); return (curpos < m_visarea.min_x || curpos > m_visarea.max_x) ? ASSERT_LINE : CLEAR_LINE; }
// timing
attotime time_until_pos(int vpos, int hpos = 0) const;
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index 04943950423..dfcd6990afc 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -275,9 +275,9 @@ INPUT_PORTS_START( jsa_i_ioports )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) // speech chip ready
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) // output buffer full
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // input buffer full
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) // self test
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("soundcomm", atari_sound_comm_device, sound_to_main_ready) // output buffer full
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("soundcomm", atari_sound_comm_device, main_to_sound_ready) // input buffer full
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER(DEVICE_SELF, atari_jsa_base_device, main_test_read_line) // self test
INPUT_PORTS_END
INPUT_PORTS_START( jsa_ii_ioports )
@@ -287,9 +287,9 @@ INPUT_PORTS_START( jsa_ii_ioports )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) // output buffer full
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // input buffer full
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) // self test
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("soundcomm", atari_sound_comm_device, sound_to_main_ready) // output buffer full
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("soundcomm", atari_sound_comm_device, main_to_sound_ready) // input buffer full
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER(DEVICE_SELF, atari_jsa_base_device, main_test_read_line) // self test
INPUT_PORTS_END
INPUT_PORTS_START( jsa_iii_ioports )
@@ -298,10 +298,10 @@ INPUT_PORTS_START( jsa_iii_ioports )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) // self test
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) // output buffer full
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) // input buffer full
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) // self test
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER(DEVICE_SELF, atari_jsa_base_device, main_test_read_line) // self test
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("soundcomm", atari_sound_comm_device, sound_to_main_ready) // output buffer full
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("soundcomm", atari_sound_comm_device, main_to_sound_ready) // input buffer full
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER(DEVICE_SELF, atari_jsa_base_device, main_test_read_line) // self test
INPUT_PORTS_END
@@ -410,6 +410,17 @@ WRITE8_MEMBER( atari_jsa_base_device::ym2151_port_w )
//-------------------------------------------------
+// main_test_read_line: Return the state of the
+// main's test line, provided by a callback
+//-------------------------------------------------
+
+READ_LINE_MEMBER(atari_jsa_base_device::main_test_read_line)
+{
+ return !m_test_read_cb();
+}
+
+
+//-------------------------------------------------
// main_int_write_line: Forward interrupt signals
// from the comm device to the owning callback
//-------------------------------------------------
@@ -674,10 +685,6 @@ READ8_MEMBER( atari_jsa_i_device::rdio_r )
UINT8 result = ioport("JSAI")->read();
if (!m_test_read_cb())
result ^= 0x80;
- if (m_soundcomm->main_to_sound_ready())
- result ^= 0x40;
- if (m_soundcomm->sound_to_main_ready())
- result ^= 0x20;
if (m_tms5220 != NULL && m_tms5220->readyq_r() == 0)
result |= 0x10;
else
@@ -888,10 +895,6 @@ READ8_MEMBER( atari_jsa_ii_device::rdio_r )
UINT8 result = ioport("JSAII")->read();
if (!m_test_read_cb())
result ^= 0x80;
- if (m_soundcomm->main_to_sound_ready())
- result ^= 0x40;
- if (m_soundcomm->sound_to_main_ready())
- result ^= 0x20;
return result;
}
@@ -960,10 +963,6 @@ READ8_MEMBER( atari_jsa_iii_device::rdio_r )
UINT8 result = ioport("JSAIII")->read();
if (!m_test_read_cb())
result ^= 0x90;
- if (m_soundcomm->main_to_sound_ready())
- result ^= 0x40;
- if (m_soundcomm->sound_to_main_ready())
- result ^= 0x20;
return result;
}
diff --git a/src/mame/audio/atarijsa.h b/src/mame/audio/atarijsa.h
index 18f79f79f7b..8a40d82090b 100644
--- a/src/mame/audio/atarijsa.h
+++ b/src/mame/audio/atarijsa.h
@@ -88,6 +88,18 @@ extern const device_type ATARI_JSA_IIIS;
//**************************************************************************
+// I/O PORT BIT HELPERS
+//**************************************************************************
+
+#define PORT_ATARI_JSA_SOUND_TO_MAIN_READY(_tag) \
+ PORT_READ_LINE_DEVICE_MEMBER(_tag, atari_jsa_base_device, sound_to_main_ready)
+
+#define PORT_ATARI_JSA_MAIN_TO_SOUND_READY(_tag) \
+ PORT_READ_LINE_DEVICE_MEMBER(_tag, atari_jsa_base_device, main_to_sound_ready)
+
+
+
+//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -107,8 +119,8 @@ public:
// getters
m6502_device &soundcpu() const { return *m_jsacpu; }
- bool main_to_sound_ready() const { return m_soundcomm->main_to_sound_ready(); }
- bool sound_to_main_ready() const { return m_soundcomm->sound_to_main_ready(); }
+ DECLARE_READ_LINE_MEMBER(main_to_sound_ready) { return m_soundcomm->main_to_sound_ready(); }
+ DECLARE_READ_LINE_MEMBER(sound_to_main_ready) { return m_soundcomm->sound_to_main_ready(); }
// main cpu accessors
DECLARE_WRITE8_MEMBER(main_command_w);
@@ -116,10 +128,11 @@ public:
DECLARE_WRITE16_MEMBER(sound_reset_w);
// read/write handlers
- DECLARE_WRITE8_MEMBER( ym2151_port_w );
+ DECLARE_WRITE8_MEMBER(ym2151_port_w);
+ DECLARE_READ_LINE_MEMBER(main_test_read_line);
// I/O lines
- DECLARE_WRITE_LINE_MEMBER( main_int_write_line );
+ DECLARE_WRITE_LINE_MEMBER(main_int_write_line);
protected:
// device-level overrides
diff --git a/src/mame/drivers/atarig1.c b/src/mame/drivers/atarig1.c
index 7d4ed87f2ef..1a9ac5862f1 100644
--- a/src/mame/drivers/atarig1.c
+++ b/src/mame/drivers/atarig1.c
@@ -84,7 +84,6 @@ WRITE16_MEMBER(atarig1_state::mo_command_w)
READ16_MEMBER(atarig1_state::special_port0_r)
{
int temp = ioport("IN0")->read();
- if (m_jsa->main_to_sound_ready()) temp ^= 0x1000;
temp ^= 0x2000; /* A2DOK always high for now */
return temp;
}
@@ -235,7 +234,7 @@ static INPUT_PORTS_START( hydra )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Right Thumb")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Boost")
PORT_BIT( 0x0fe0, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
@@ -267,7 +266,7 @@ static INPUT_PORTS_START( pitfight )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Kick")
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 Jump/Start")
PORT_BIT( 0x0f80, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
@@ -312,7 +311,7 @@ static INPUT_PORTS_START( pitfightj )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Kick")
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Jump/P1 Start")
PORT_BIT( 0x0f80, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
diff --git a/src/mame/drivers/atarig42.c b/src/mame/drivers/atarig42.c
index 979698892ab..8f12cd85164 100644
--- a/src/mame/drivers/atarig42.c
+++ b/src/mame/drivers/atarig42.c
@@ -65,8 +65,6 @@ MACHINE_RESET_MEMBER(atarig42_state,atarig42)
READ16_MEMBER(atarig42_state::special_port2_r)
{
int temp = ioport("IN2")->read();
- if (m_jsa->main_to_sound_ready()) temp ^= 0x0020;
- if (m_jsa->sound_to_main_ready()) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
return temp;
}
@@ -376,7 +374,9 @@ static INPUT_PORTS_START( roadriot )
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2") /* e00010 */
- PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa")
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -425,7 +425,9 @@ static INPUT_PORTS_START( guardian )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_START("IN2") /* e00010 */
- PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa")
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/atarigx2.c b/src/mame/drivers/atarigx2.c
index 4ce2a88f21d..5f274ba1eaa 100644
--- a/src/mame/drivers/atarigx2.c
+++ b/src/mame/drivers/atarigx2.c
@@ -56,8 +56,6 @@ MACHINE_RESET_MEMBER(atarigx2_state,atarigx2)
READ32_MEMBER(atarigx2_state::special_port2_r)
{
int temp = ioport("SERVICE")->read();
- if (m_jsa->main_to_sound_ready()) temp ^= 0x0020;
- if (m_jsa->sound_to_main_ready()) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
return (temp << 16) | temp;
}
@@ -1189,8 +1187,8 @@ static INPUT_PORTS_START( spclords )
PORT_START("SERVICE") /* 68.STATUS (A2=0) */
PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_SPECIAL ) /* +5V */
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* A2D.EOC */
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa") // /AUDIRQ
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") // /AUDFULL
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1235,8 +1233,8 @@ static INPUT_PORTS_START( motofren )
PORT_START("SERVICE") /* 68.STATUS (A2=0) */
PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) /* +5V */
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* A2D.EOC */
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa") // /AUDIRQ
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") // /AUDFULL
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1281,8 +1279,8 @@ static INPUT_PORTS_START( rrreveng )
PORT_START("SERVICE") /* 68.STATUS (A2=0) */
PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_SPECIAL ) /* +5V */
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* A2D.EOC */
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa") // /AUDIRQ
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") // /AUDFULL
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c
index 8d33846b949..520f8a92aaa 100644
--- a/src/mame/drivers/atarisy1.c
+++ b/src/mame/drivers/atarisy1.c
@@ -339,21 +339,6 @@ READ16_MEMBER(atarisy1_state::trakball_r)
/*************************************
*
- * Sound status I/O
- *
- *************************************/
-
-READ16_MEMBER(atarisy1_state::port4_r)
-{
- int temp = ioport("F60000")->read();
- if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0080;
- return temp;
-}
-
-
-
-/*************************************
- *
* Sound input
*
*************************************/
@@ -361,11 +346,7 @@ READ16_MEMBER(atarisy1_state::port4_r)
READ8_MEMBER(atarisy1_state::switch_6502_r)
{
int temp = ioport("1820")->read();
-
- if (m_soundcomm->main_to_sound_ready()) temp ^= 0x08;
- if (m_soundcomm->sound_to_main_ready()) temp ^= 0x10;
if (!(ioport("F60000")->read() & 0x0040)) temp ^= 0x80;
-
return temp;
}
@@ -478,7 +459,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy1_state )
AM_RANGE(0xf00000, 0xf00fff) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xf20000, 0xf20007) AM_READ(trakball_r)
AM_RANGE(0xf40000, 0xf4001f) AM_READWRITE(joystick_r, joystick_w)
- AM_RANGE(0xf60000, 0xf60003) AM_READ(port4_r)
+ AM_RANGE(0xf60000, 0xf60003) AM_READ_PORT("F60000")
AM_RANGE(0xf80000, 0xf80001) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff) /* used by roadbls2 */
AM_RANGE(0xfc0000, 0xfc0001) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0xfe0000, 0xfe0001) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0x00ff)
@@ -532,15 +513,15 @@ static INPUT_PORTS_START( marble )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("1820") /* 1820 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL )
INPUT_PORTS_END
@@ -571,15 +552,15 @@ static INPUT_PORTS_START( peterpak )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("1820") /* 1820 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL )
INPUT_PORTS_END
@@ -610,15 +591,15 @@ static INPUT_PORTS_START( indytemp )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("1820") /* 1820 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL )
INPUT_PORTS_END
@@ -658,15 +639,15 @@ static INPUT_PORTS_START( roadrunn )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("1820") /* 1820 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL )
INPUT_PORTS_END
@@ -693,15 +674,15 @@ static INPUT_PORTS_START( roadblst )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("1820") /* 1820 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL )
INPUT_PORTS_END
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index 5d24b112ec0..fcf6e960380 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -335,12 +335,7 @@ void atarisy2_state::device_post_load()
READ16_MEMBER(atarisy2_state::switch_r)
{
- int result = ioport("1800")->read() | (ioport("1801")->read() << 8);
-
- if (m_soundcomm->main_to_sound_ready()) result ^= 0x20;
- if (m_soundcomm->sound_to_main_ready()) result ^= 0x10;
-
- return result;
+ return ioport("1800")->read() | (ioport("1801")->read() << 8);
}
@@ -348,8 +343,6 @@ READ8_MEMBER(atarisy2_state::switch_6502_r)
{
int result = ioport("1840")->read();
- if (m_soundcomm->main_to_sound_ready()) result |= 0x01;
- if (m_soundcomm->sound_to_main_ready()) result |= 0x02;
if ((m_has_tms5220) && (machine().device<tms5220_device>("tms")->readyq_r() == 0))
result &= ~0x04;
if (!(ioport("1801")->read() & 0x80)) result |= 0x10;
@@ -830,8 +823,8 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( paperboy )
PORT_START("1840") /*(sound) */
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )
@@ -844,8 +837,8 @@ static INPUT_PORTS_START( paperboy )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
diff --git a/src/mame/drivers/badlands.c b/src/mame/drivers/badlands.c
index eedf80915ec..5b1e32d0d00 100644
--- a/src/mame/drivers/badlands.c
+++ b/src/mame/drivers/badlands.c
@@ -300,8 +300,6 @@ READ8_MEMBER(badlands_state::audio_io_r)
*/
result = ioport("AUDIO")->read();
if (!(ioport("FE4000")->read() & 0x0080)) result ^= 0x90;
- if (m_soundcomm->main_to_sound_ready()) result ^= 0x40;
- if (m_soundcomm->sound_to_main_ready()) result ^= 0x20;
result ^= 0x10;
break;
@@ -435,8 +433,8 @@ static INPUT_PORTS_START( badlands )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* self test */
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* response buffer full */
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) /* command buffer full */
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm") /* response buffer full */
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm") /* command buffer full */
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* self test */
PORT_START("PEDALS") /* fake for pedals */
diff --git a/src/mame/drivers/batman.c b/src/mame/drivers/batman.c
index 75501fff7e1..1a08aeb2ce3 100644
--- a/src/mame/drivers/batman.c
+++ b/src/mame/drivers/batman.c
@@ -80,15 +80,6 @@ WRITE16_MEMBER(batman_state::batman_atarivc_w)
*
*************************************/
-READ16_MEMBER(batman_state::special_port2_r)
-{
- int result = ioport("260010")->read();
- if (m_jsa->sound_to_main_ready()) result ^= 0x0010;
- if (m_jsa->main_to_sound_ready()) result ^= 0x0020;
- return result;
-}
-
-
WRITE16_MEMBER(batman_state::latch_w)
{
int oldword = m_latch_data;
@@ -128,7 +119,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, batman_state )
AM_RANGE(0x120000, 0x120fff) AM_MIRROR(0x01f000) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0x260000, 0x260001) AM_MIRROR(0x11ff8c) AM_READ_PORT("260000")
AM_RANGE(0x260002, 0x260003) AM_MIRROR(0x11ff8c) AM_READ_PORT("260002")
- AM_RANGE(0x260010, 0x260011) AM_MIRROR(0x11ff8e) AM_READ(special_port2_r)
+ AM_RANGE(0x260010, 0x260011) AM_MIRROR(0x11ff8e) AM_READ_PORT("260010")
AM_RANGE(0x260030, 0x260031) AM_MIRROR(0x11ff8e) AM_DEVREAD8("jsa", atari_jsa_iii_device, main_response_r, 0x00ff)
AM_RANGE(0x260040, 0x260041) AM_MIRROR(0x11ff8e) AM_DEVWRITE8("jsa", atari_jsa_iii_device, main_command_w, 0x00ff)
AM_RANGE(0x260050, 0x260051) AM_MIRROR(0x11ff8e) AM_WRITE(latch_w)
@@ -170,8 +161,8 @@ static INPUT_PORTS_START( batman )
PORT_START("260010") /* 260010 */
PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@260040) */
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa") /* Input buffer full (@260030) */
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") /* Output buffer full (@260040) */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END
diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c
index 52d76850b9d..51648299fff 100644
--- a/src/mame/drivers/beathead.c
+++ b/src/mame/drivers/beathead.c
@@ -271,22 +271,6 @@ WRITE32_MEMBER( beathead_state::eeprom_enable_w )
/*************************************
*
- * Input handling
- *
- *************************************/
-
-READ32_MEMBER( beathead_state::input_2_r )
-{
- int result = ioport("IN2")->read();
- if (m_jsa->sound_to_main_ready()) result ^= 0x10;
- if (m_jsa->main_to_sound_ready()) result ^= 0x20;
- return result;
-}
-
-
-
-/*************************************
- *
* Sound communication
*
*************************************/
@@ -329,7 +313,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, beathead_state)
AM_RANGE(0x41000204, 0x41000207) AM_READ_PORT("IN0")
AM_RANGE(0x41000208, 0x4100020f) AM_WRITE(sound_reset_w)
AM_RANGE(0x41000220, 0x41000227) AM_WRITE(coin_count_w)
- AM_RANGE(0x41000300, 0x41000303) AM_READ(input_2_r)
+ AM_RANGE(0x41000300, 0x41000303) AM_READ_PORT("IN2")
AM_RANGE(0x41000304, 0x41000307) AM_READ_PORT("IN3")
AM_RANGE(0x41000400, 0x41000403) AM_WRITEONLY AM_SHARE("palette_select")
AM_RANGE(0x41000500, 0x41000503) AM_WRITE(eeprom_enable_w)
@@ -379,8 +363,8 @@ static INPUT_PORTS_START( beathead )
PORT_START("IN2")
PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL )
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa")
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0xff80, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/blstroid.c b/src/mame/drivers/blstroid.c
index 26d840a78de..402ad25fb3b 100644
--- a/src/mame/drivers/blstroid.c
+++ b/src/mame/drivers/blstroid.c
@@ -55,24 +55,6 @@ MACHINE_RESET_MEMBER(blstroid_state,blstroid)
/*************************************
*
- * I/O read dispatch
- *
- *************************************/
-
-READ16_MEMBER(blstroid_state::inputs_r)
-{
- static const char *const iptnames[] = { "IN0", "IN1" };
- int temp = ioport(iptnames[offset & 1])->read();
-
- if (m_jsa->main_to_sound_ready()) temp ^= 0x0040;
- if (get_hblank(*machine().primary_screen)) temp ^= 0x0010;
- return temp;
-}
-
-
-
-/*************************************
- *
* Main CPU memory handlers
*
*************************************/
@@ -92,7 +74,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, blstroid_state )
AM_RANGE(0xff9400, 0xff9401) AM_MIRROR(0x7f83fe) AM_DEVREAD8("jsa", atari_jsa_i_device, main_response_r, 0x00ff)
AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL0")
AM_RANGE(0xff9804, 0xff9805) AM_MIRROR(0x7f83f8) AM_READ_PORT("DIAL1")
- AM_RANGE(0xff9c00, 0xff9c03) AM_MIRROR(0x7f83fc) AM_READ(inputs_r)
+ AM_RANGE(0xff9c00, 0xff9c01) AM_MIRROR(0x7f83fc) AM_READ_PORT("IN0")
+ AM_RANGE(0xff9c02, 0xff9c03) AM_MIRROR(0x7f83fc) AM_READ_PORT("IN1")
AM_RANGE(0xffa000, 0xffa3ff) AM_MIRROR(0x7f8c00) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")
AM_RANGE(0xffb000, 0xffb3ff) AM_MIRROR(0x7f8c00) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xffc000, 0xffcfff) AM_MIRROR(0x7f8000) AM_RAM_WRITE(playfield_w) AM_SHARE("playfield")
@@ -122,9 +105,9 @@ static INPUT_PORTS_START( blstroid )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_HBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -133,9 +116,9 @@ static INPUT_PORTS_START( blstroid )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_HBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
diff --git a/src/mame/drivers/cyberbal.c b/src/mame/drivers/cyberbal.c
index c42a1a8dd79..0ded2e978b5 100644
--- a/src/mame/drivers/cyberbal.c
+++ b/src/mame/drivers/cyberbal.c
@@ -86,22 +86,6 @@ MACHINE_RESET_MEMBER(cyberbal_state,cyberbal2p)
*
*************************************/
-READ16_MEMBER(cyberbal_state::special_port0_r)
-{
- int temp = ioport("IN0")->read();
- if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0080;
- return temp;
-}
-
-
-READ16_MEMBER(cyberbal_state::special_port2_r)
-{
- int temp = ioport("IN2")->read();
- if (m_jsa->main_to_sound_ready()) temp ^= 0x2000;
- return temp;
-}
-
-
READ16_MEMBER(cyberbal_state::sound_state_r)
{
int temp = 0xffff;
@@ -139,7 +123,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, cyberbal_state )
AM_RANGE(0xfd4000, 0xfd5fff) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0xfd6000, 0xfd7fff) AM_WRITE(p2_reset_w)
AM_RANGE(0xfd8000, 0xfd9fff) AM_DEVWRITE8("soundcomm", atari_sound_comm_device, main_command_w, 0xff00)
- AM_RANGE(0xfe0000, 0xfe0fff) AM_READ(special_port0_r)
+ AM_RANGE(0xfe0000, 0xfe0fff) AM_READ_PORT("IN0")
AM_RANGE(0xfe1000, 0xfe1fff) AM_READ_PORT("IN1")
AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE(paletteram_1_w) AM_SHARE("paletteram_1")
AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE(paletteram_0_w) AM_SHARE("paletteram_0")
@@ -166,7 +150,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( extra_map, AS_PROGRAM, 16, cyberbal_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0xfc0000, 0xfdffff) AM_WRITE(video_int_ack_w)
- AM_RANGE(0xfe0000, 0xfe0fff) AM_READ(special_port0_r)
+ AM_RANGE(0xfe0000, 0xfe0fff) AM_READ_PORT("IN0")
AM_RANGE(0xfe1000, 0xfe1fff) AM_READ_PORT("IN1")
AM_RANGE(0xfe8000, 0xfe8fff) AM_RAM_WRITE(paletteram_1_w) AM_SHARE("paletteram_1")
AM_RANGE(0xfec000, 0xfecfff) AM_RAM_WRITE(paletteram_0_w) AM_SHARE("paletteram_0")
@@ -234,7 +218,7 @@ static ADDRESS_MAP_START( cyberbal2p_map, AS_PROGRAM, 16, cyberbal_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
AM_RANGE(0xfc0000, 0xfc0003) AM_READ_PORT("IN0")
AM_RANGE(0xfc2000, 0xfc2003) AM_READ_PORT("IN1")
- AM_RANGE(0xfc4000, 0xfc4003) AM_READ(special_port2_r)
+ AM_RANGE(0xfc4000, 0xfc4003) AM_READ_PORT("IN2")
AM_RANGE(0xfc6000, 0xfc6003) AM_DEVREAD8("jsa", atari_jsa_ii_device, main_response_r, 0xff00)
AM_RANGE(0xfc8000, 0xfc8fff) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xfca000, 0xfcafff) AM_RAM_WRITE(paletteram_666_w) AM_SHARE("paletteram")
@@ -266,7 +250,8 @@ static INPUT_PORTS_START( cyberbal )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
- PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
@@ -330,7 +315,7 @@ static INPUT_PORTS_START( cyberbal2p )
PORT_START("IN2") /* fc4000 */
PORT_BIT( 0x1fff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
INPUT_PORTS_END
diff --git a/src/mame/drivers/eprom.c b/src/mame/drivers/eprom.c
index f23028fbe34..bdc9222e17c 100644
--- a/src/mame/drivers/eprom.c
+++ b/src/mame/drivers/eprom.c
@@ -64,11 +64,7 @@ MACHINE_RESET_MEMBER(eprom_state,eprom)
READ16_MEMBER(eprom_state::special_port1_r)
{
int result = ioport("260010")->read();
-
- if (m_jsa->sound_to_main_ready()) result ^= 0x0004;
- if (m_jsa->main_to_sound_ready()) result ^= 0x0008;
result ^= 0x0010;
-
return result;
}
@@ -233,8 +229,8 @@ static INPUT_PORTS_START( eprom )
PORT_START("260010")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa") /* Input buffer full (@260030) */
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") /* Output buffer full (@360030) */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) /* ADEOC, end of conversion */
PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
@@ -276,8 +272,8 @@ static INPUT_PORTS_START( klaxp )
PORT_START("260010")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa") /* Input buffer full (@260030) */
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") /* Output buffer full (@360030) */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) /* ADEOC, end of conversion */
PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
@@ -303,8 +299,8 @@ static INPUT_PORTS_START( guts )
PORT_START("260010") /* 260010 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa") /* Input buffer full (@260030) */
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") /* Output buffer full (@360030) */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) /* ADEOC, end of conversion */
PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c
index 2246dfa85bf..7eb1635fb50 100644
--- a/src/mame/drivers/gauntlet.c
+++ b/src/mame/drivers/gauntlet.c
@@ -173,22 +173,6 @@ MACHINE_RESET_MEMBER(gauntlet_state,gauntlet)
/*************************************
*
- * Controller reads
- *
- *************************************/
-
-READ16_MEMBER(gauntlet_state::port4_r)
-{
- int temp = ioport("803008")->read();
- if (m_soundcomm->main_to_sound_ready()) temp ^= 0x0020;
- if (m_soundcomm->sound_to_main_ready()) temp ^= 0x0010;
- return temp;
-}
-
-
-
-/*************************************
- *
* Sound reset
*
*************************************/
@@ -307,7 +291,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, gauntlet_state )
AM_RANGE(0x803002, 0x803003) AM_MIRROR(0x2fcef0) AM_READ_PORT("803002")
AM_RANGE(0x803004, 0x803005) AM_MIRROR(0x2fcef0) AM_READ_PORT("803004")
AM_RANGE(0x803006, 0x803007) AM_MIRROR(0x2fcef0) AM_READ_PORT("803006")
- AM_RANGE(0x803008, 0x803009) AM_MIRROR(0x2fcef0) AM_READ(port4_r)
+ AM_RANGE(0x803008, 0x803009) AM_MIRROR(0x2fcef0) AM_READ_PORT("803008")
AM_RANGE(0x80300e, 0x80300f) AM_MIRROR(0x2fcef0) AM_DEVREAD8("soundcomm", atari_sound_comm_device, main_response_r, 0x00ff)
AM_RANGE(0x803100, 0x803101) AM_MIRROR(0x2fce8e) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x803120, 0x803121) AM_MIRROR(0x2fce8e) AM_DEVWRITE("soundcomm", atari_sound_comm_device, sound_reset_w)
@@ -401,7 +385,8 @@ static INPUT_PORTS_START( gauntlet )
PORT_START("803008")
PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
- PORT_BIT( 0x0030, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED )
@@ -448,7 +433,8 @@ static INPUT_PORTS_START( vindctr2 )
PORT_START("803008")
PORT_BIT( 0x0007, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
- PORT_BIT( 0x0030, IP_ACTIVE_HIGH, IPT_SPECIAL )
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_SOUND_TO_MAIN_READY("soundcomm")
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_ATARI_COMM_MAIN_TO_SOUND_READY("soundcomm")
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff80, IP_ACTIVE_HIGH, IPT_UNUSED )
diff --git a/src/mame/drivers/offtwall.c b/src/mame/drivers/offtwall.c
index 526435ce8f6..e07ed8c8c8b 100644
--- a/src/mame/drivers/offtwall.c
+++ b/src/mame/drivers/offtwall.c
@@ -77,14 +77,6 @@ WRITE16_MEMBER(offtwall_state::offtwall_atarivc_w)
*
*************************************/
-READ16_MEMBER(offtwall_state::special_port3_r)
-{
- int result = ioport("260010")->read();
- if (m_jsa->main_to_sound_ready()) result ^= 0x0020;
- return result;
-}
-
-
WRITE16_MEMBER(offtwall_state::io_latch_w)
{
/* lower byte */
@@ -264,7 +256,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, offtwall_state )
AM_RANGE(0x120000, 0x120fff) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0x260000, 0x260001) AM_READ_PORT("260000")
AM_RANGE(0x260002, 0x260003) AM_READ_PORT("260002")
- AM_RANGE(0x260010, 0x260011) AM_READ(special_port3_r)
+ AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
AM_RANGE(0x260012, 0x260013) AM_READ_PORT("260012")
AM_RANGE(0x260020, 0x260021) AM_READ_PORT("260020")
AM_RANGE(0x260022, 0x260023) AM_READ_PORT("260022")
@@ -331,7 +323,7 @@ static INPUT_PORTS_START( offtwall )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) /* tested at a454 */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* tested at a466 */
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* tested before writing to 260040 */
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") /* tested before writing to 260040 */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/relief.c b/src/mame/drivers/relief.c
index 593ce3d6b71..dfde94b55a7 100644
--- a/src/mame/drivers/relief.c
+++ b/src/mame/drivers/relief.c
@@ -86,7 +86,6 @@ MACHINE_RESET_MEMBER(relief_state,relief)
READ16_MEMBER(relief_state::special_port2_r)
{
int result = ioport("260010")->read();
- if (m_soundcomm->main_to_sound_ready()) result ^= 0x0020;
if (!(result & 0x0080) || get_hblank(*machine().primary_screen)) result ^= 0x0001;
return result;
}
@@ -222,7 +221,7 @@ static INPUT_PORTS_START( relief )
PORT_START("260010") /* 260010 */
PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* tested before writing to 260040 */
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/skullxbo.c b/src/mame/drivers/skullxbo.c
index b647ec1b5e4..abd402b4649 100644
--- a/src/mame/drivers/skullxbo.c
+++ b/src/mame/drivers/skullxbo.c
@@ -78,22 +78,6 @@ MACHINE_RESET_MEMBER(skullxbo_state,skullxbo)
/*************************************
*
- * I/O read dispatch.
- *
- *************************************/
-
-READ16_MEMBER(skullxbo_state::special_port1_r)
-{
- int temp = ioport("FF5802")->read();
- if (m_jsa->main_to_sound_ready()) temp ^= 0x0040;
- if (get_hblank(*machine().primary_screen)) temp ^= 0x0010;
- return temp;
-}
-
-
-
-/*************************************
- *
* Who knows what this is?
*
*************************************/
@@ -133,7 +117,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, skullxbo_state )
AM_RANGE(0xff6000, 0xff6fff) AM_WRITE(eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xff5000, 0xff5001) AM_DEVREAD8("jsa", atari_jsa_ii_device, main_response_r, 0x00ff)
AM_RANGE(0xff5800, 0xff5801) AM_READ_PORT("FF5800")
- AM_RANGE(0xff5802, 0xff5803) AM_READ(special_port1_r)
+ AM_RANGE(0xff5802, 0xff5803) AM_READ_PORT("FF5802")
AM_RANGE(0xff6000, 0xff6fff) AM_READ(eeprom_r)
AM_RANGE(0xff8000, 0xff9fff) AM_RAM_WRITE(playfield_latched_lsb_w) AM_SHARE("playfield")
AM_RANGE(0xffa000, 0xffbfff) AM_RAM_WRITE(playfield_upper_w) AM_SHARE("playfield_up")
@@ -165,9 +149,9 @@ static INPUT_PORTS_START( skullxbo )
PORT_START("FF5802")
PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) /* HBLANK */
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_HBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) /* /AUDBUSY */
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") /* /AUDBUSY */
PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
diff --git a/src/mame/drivers/thunderj.c b/src/mame/drivers/thunderj.c
index c19a6aa893b..cc222294c93 100644
--- a/src/mame/drivers/thunderj.c
+++ b/src/mame/drivers/thunderj.c
@@ -63,11 +63,7 @@ MACHINE_RESET_MEMBER(thunderj_state,thunderj)
READ16_MEMBER(thunderj_state::special_port2_r)
{
int result = ioport("260012")->read();
-
- if (m_jsa->sound_to_main_ready()) result ^= 0x0004;
- if (m_jsa->main_to_sound_ready()) result ^= 0x0008;
result ^= 0x0010;
-
return result;
}
@@ -212,8 +208,8 @@ static INPUT_PORTS_START( thunderj )
PORT_START("260012")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa") /* Input buffer full (@260030) */
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") /* Output buffer full (@360030) */
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
diff --git a/src/mame/drivers/toobin.c b/src/mame/drivers/toobin.c
index 4079ff2805f..2da4e60f666 100644
--- a/src/mame/drivers/toobin.c
+++ b/src/mame/drivers/toobin.c
@@ -72,22 +72,6 @@ WRITE16_MEMBER(toobin_state::interrupt_scan_w)
/*************************************
*
- * I/O read dispatch
- *
- *************************************/
-
-READ16_MEMBER(toobin_state::special_port1_r)
-{
- int result = ioport("FF9000")->read();
- if (get_hblank(*machine().primary_screen)) result ^= 0x8000;
- if (m_jsa->main_to_sound_ready()) result ^= 0x2000;
- return result;
-}
-
-
-
-/*************************************
- *
* Main CPU memory handlers
*
*************************************/
@@ -112,7 +96,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, toobin_state )
AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x4500fe) AM_WRITE(toobin_xscroll_w) AM_SHARE("xscroll")
AM_RANGE(0xff8700, 0xff8701) AM_MIRROR(0x4500fe) AM_WRITE(toobin_yscroll_w) AM_SHARE("yscroll")
AM_RANGE(0xff8800, 0xff8801) AM_MIRROR(0x4507fe) AM_READ_PORT("FF8800")
- AM_RANGE(0xff9000, 0xff9001) AM_MIRROR(0x4507fe) AM_READ(special_port1_r)
+ AM_RANGE(0xff9000, 0xff9001) AM_MIRROR(0x4507fe) AM_READ_PORT("FF9000")
AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x4507fe) AM_DEVREAD8("jsa", atari_jsa_i_device, main_response_r, 0x00ff)
AM_RANGE(0xffa000, 0xffafff) AM_MIRROR(0x451000) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xffc000, 0xffffff) AM_MIRROR(0x450000) AM_RAM
@@ -145,9 +129,9 @@ static INPUT_PORTS_START( toobin )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x1000, IP_ACTIVE_LOW )
- PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_HBLANK("screen")
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
INPUT_PORTS_END
diff --git a/src/mame/drivers/vindictr.c b/src/mame/drivers/vindictr.c
index 6f20f4c86a8..565a53ad839 100644
--- a/src/mame/drivers/vindictr.c
+++ b/src/mame/drivers/vindictr.c
@@ -54,8 +54,6 @@ MACHINE_RESET_MEMBER(vindictr_state,vindictr)
READ16_MEMBER(vindictr_state::port1_r)
{
int result = ioport("260010")->read();
- if (m_jsa->sound_to_main_ready()) result ^= 0x0004;
- if (m_jsa->main_to_sound_ready()) result ^= 0x0008;
result ^= 0x0010;
return result;
}
@@ -114,8 +112,8 @@ static INPUT_PORTS_START( vindictr )
PORT_START("260010")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
- PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_SOUND_TO_MAIN_READY("jsa")
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa")
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
diff --git a/src/mame/drivers/xybots.c b/src/mame/drivers/xybots.c
index 37e2e821493..38d2af753f1 100644
--- a/src/mame/drivers/xybots.c
+++ b/src/mame/drivers/xybots.c
@@ -54,8 +54,6 @@ MACHINE_RESET_MEMBER(xybots_state,xybots)
READ16_MEMBER(xybots_state::special_port1_r)
{
int result = ioport("FFE200")->read();
-
- if (m_jsa->main_to_sound_ready()) result ^= 0x0200;
result ^= m_h256 ^= 0x0400;
return result;
}
@@ -120,7 +118,7 @@ static INPUT_PORTS_START( xybots )
PORT_START("FFE200")
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0100, IP_ACTIVE_LOW )
- PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) /* /AUDBUSY */
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_ATARI_JSA_MAIN_TO_SOUND_READY("jsa") /* /AUDBUSY */
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) /* 256H */
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* VBLANK */
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/includes/batman.h b/src/mame/includes/batman.h
index 04b1ef62634..f636824d53b 100644
--- a/src/mame/includes/batman.h
+++ b/src/mame/includes/batman.h
@@ -23,7 +23,6 @@ public:
virtual void scanline_update(screen_device &screen, int scanline);
DECLARE_READ16_MEMBER(batman_atarivc_r);
DECLARE_WRITE16_MEMBER(batman_atarivc_w);
- DECLARE_READ16_MEMBER(special_port2_r);
DECLARE_WRITE16_MEMBER(latch_w);
DECLARE_DRIVER_INIT(batman);
TILE_GET_INFO_MEMBER(get_alpha_tile_info);
diff --git a/src/mame/includes/cyberbal.h b/src/mame/includes/cyberbal.h
index 352bbe5b0e3..d4cf66e94cc 100644
--- a/src/mame/includes/cyberbal.h
+++ b/src/mame/includes/cyberbal.h
@@ -48,8 +48,6 @@ public:
UINT8 m_sound_data_from_6502_ready;
virtual void update_interrupts();
virtual void scanline_update(screen_device &screen, int scanline);
- DECLARE_READ16_MEMBER(special_port0_r);
- DECLARE_READ16_MEMBER(special_port2_r);
DECLARE_READ16_MEMBER(sound_state_r);
DECLARE_WRITE16_MEMBER(p2_reset_w);
DECLARE_READ8_MEMBER(special_port3_r);
diff --git a/src/mame/includes/gauntlet.h b/src/mame/includes/gauntlet.h
index 6567acab456..95e699c55b4 100644
--- a/src/mame/includes/gauntlet.h
+++ b/src/mame/includes/gauntlet.h
@@ -18,7 +18,6 @@ public:
UINT8 m_playfield_color_bank;
virtual void update_interrupts();
virtual void scanline_update(screen_device &screen, int scanline);
- DECLARE_READ16_MEMBER(port4_r);
DECLARE_WRITE16_MEMBER(sound_reset_w);
DECLARE_READ8_MEMBER(switch_6502_r);
DECLARE_WRITE8_MEMBER(sound_ctl_w);
diff --git a/src/mame/includes/offtwall.h b/src/mame/includes/offtwall.h
index 90448b1defe..f5a095dc44a 100644
--- a/src/mame/includes/offtwall.h
+++ b/src/mame/includes/offtwall.h
@@ -26,7 +26,6 @@ public:
virtual void update_interrupts();
DECLARE_READ16_MEMBER(offtwall_atarivc_r);
DECLARE_WRITE16_MEMBER(offtwall_atarivc_w);
- DECLARE_READ16_MEMBER(special_port3_r);
DECLARE_WRITE16_MEMBER(io_latch_w);
DECLARE_READ16_MEMBER(bankswitch_r);
DECLARE_READ16_MEMBER(bankrom_r);
diff --git a/src/mame/includes/skullxbo.h b/src/mame/includes/skullxbo.h
index 4b008a3812c..880acdfca29 100644
--- a/src/mame/includes/skullxbo.h
+++ b/src/mame/includes/skullxbo.h
@@ -21,7 +21,6 @@ public:
virtual void update_interrupts();
virtual void scanline_update(screen_device &screen, int scanline);
DECLARE_WRITE16_MEMBER(skullxbo_halt_until_hblank_0_w);
- DECLARE_READ16_MEMBER(special_port1_r);
DECLARE_WRITE16_MEMBER(skullxbo_mobwr_w);
DECLARE_DRIVER_INIT(skullxbo);
TILE_GET_INFO_MEMBER(get_alpha_tile_info);
diff --git a/src/mame/includes/toobin.h b/src/mame/includes/toobin.h
index 3dd1226ff34..470e6278a37 100644
--- a/src/mame/includes/toobin.h
+++ b/src/mame/includes/toobin.h
@@ -22,7 +22,6 @@ public:
bitmap_ind16 m_pfbitmap;
virtual void update_interrupts();
DECLARE_WRITE16_MEMBER(interrupt_scan_w);
- DECLARE_READ16_MEMBER(special_port1_r);
DECLARE_DRIVER_INIT(toobin);
TILE_GET_INFO_MEMBER(get_alpha_tile_info);
TILE_GET_INFO_MEMBER(get_playfield_tile_info);
diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h
index b8f8d1ba8ad..e518463cf95 100644
--- a/src/mame/machine/atarigen.h
+++ b/src/mame/machine/atarigen.h
@@ -77,6 +77,12 @@
TYPE DEFINITIONS
***************************************************************************/
+#define PORT_ATARI_COMM_SOUND_TO_MAIN_READY(_tag) \
+ PORT_READ_LINE_DEVICE_MEMBER(_tag, atari_sound_comm_device, sound_to_main_ready)
+
+#define PORT_ATARI_COMM_MAIN_TO_SOUND_READY(_tag) \
+ PORT_READ_LINE_DEVICE_MEMBER(_tag, atari_sound_comm_device, main_to_sound_ready)
+
// ======================> atari_sound_comm_device
@@ -91,8 +97,8 @@ public:
template<class _Object> static devcb2_base &set_main_int_cb(device_t &device, _Object object) { return downcast<atari_sound_comm_device &>(device).m_main_int_cb.set_callback(object); }
// getters
- bool main_to_sound_ready() const { return m_main_to_sound_ready; }
- bool sound_to_main_ready() const { return m_sound_to_main_ready; }
+ DECLARE_READ_LINE_MEMBER(main_to_sound_ready) { return m_main_to_sound_ready ? ASSERT_LINE : CLEAR_LINE; }
+ DECLARE_READ_LINE_MEMBER(sound_to_main_ready) { return m_sound_to_main_ready ? ASSERT_LINE : CLEAR_LINE; }
// main cpu accessors (forward internally to the atari_sound_comm_device)
DECLARE_WRITE8_MEMBER(main_command_w);