More appeasement of the standards gods (nw)

This commit is contained in:
Vas Crabb 2015-11-02 02:01:26 +11:00
parent 44c21dcac5
commit 99c12e17c4
53 changed files with 138 additions and 140 deletions

View File

@ -205,6 +205,6 @@ WRITE8_MEMBER(beckerport_device::write)
void beckerport_device::update_port(void)
{
device_stop();
m_dwtcpport = m_dwconfigport->read_safe(65504);
m_dwtcpport = read_safe(m_dwconfigport, 65504);
device_start();
}

View File

@ -116,7 +116,7 @@ SLOT_INTERFACE_END
coco_rtc_type_t coco_fdc_device::real_time_clock()
{
coco_rtc_type_t result = (coco_rtc_type_t) machine().root_device().ioport("real_time_clock")->read_safe(RTC_NONE);
coco_rtc_type_t result = coco_rtc_type_t(read_safe(machine().root_device().ioport("real_time_clock"), RTC_NONE));
/* check to make sure we don't have any invalid values */
if (((result == RTC_DISTO) && (m_disto_msm6242 == NULL))

View File

@ -89,7 +89,7 @@ void coco_pak_device::device_reset()
if (m_cart->exists()) {
cococart_line_value cart_line;
cart_line = machine().root_device().ioport(CART_AUTOSTART_TAG)->read_safe(0x01)
cart_line = read_safe(machine().root_device().ioport(CART_AUTOSTART_TAG), 0x01)
? COCOCART_LINE_VALUE_Q
: COCOCART_LINE_VALUE_CLEAR;

View File

@ -180,14 +180,14 @@ READ16_MEMBER(md_jcart_device::read)
if (m_jcart_io_data[0] & 0x40)
{
joy[0] = m_jcart3->read_safe(0);
joy[1] = m_jcart4->read_safe(0);
joy[0] = read_safe(m_jcart3, 0);
joy[1] = read_safe(m_jcart4, 0);
return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
}
else
{
joy[0] = ((m_jcart3->read_safe(0) & 0xc0) >> 2) | (m_jcart3->read_safe(0) & 0x03);
joy[1] = ((m_jcart4->read_safe(0) & 0xc0) >> 2) | (m_jcart4->read_safe(0) & 0x03);
joy[0] = ((read_safe(m_jcart3, 0) & 0xc0) >> 2) | (read_safe(m_jcart3, 0) & 0x03);
joy[1] = ((read_safe(m_jcart4, 0) & 0xc0) >> 2) | (read_safe(m_jcart4, 0) & 0x03);
return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
}
}
@ -223,14 +223,14 @@ READ16_MEMBER(md_seprom_codemast_device::read)
if (m_jcart_io_data[0] & 0x40)
{
joy[0] = m_jcart3->read_safe(0);
joy[1] = m_jcart4->read_safe(0);
joy[0] = read_safe(m_jcart3, 0);
joy[1] = read_safe(m_jcart4, 0);
return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
}
else
{
joy[0] = ((m_jcart3->read_safe(0) & 0xc0) >> 2) | (m_jcart3->read_safe(0) & 0x03);
joy[1] = ((m_jcart4->read_safe(0) & 0xc0) >> 2) | (m_jcart4->read_safe(0) & 0x03);
joy[0] = ((read_safe(m_jcart3, 0) & 0xc0) >> 2) | (read_safe(m_jcart3, 0) & 0x03);
joy[1] = ((read_safe(m_jcart4, 0) & 0xc0) >> 2) | (read_safe(m_jcart4, 0) & 0x03);
return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
}
}

View File

@ -1818,7 +1818,7 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, UINT16 curline )
struct SNES_SCANLINE *scanline1, *scanline2;
UINT16 c;
UINT16 prev_colour = 0;
int blurring = machine().root_device().ioport("OPTIONS")->read_safe(0) & 0x01;
int blurring = read_safe(machine().root_device().ioport("OPTIONS"), 0) & 0x01;
g_profiler.start(PROFILER_VIDEO);
@ -2828,13 +2828,13 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data)
UINT8 snes_ppu_device::dbg_video( UINT16 curline )
{
int i;
UINT8 toggles = machine().root_device().ioport("DEBUG1")->read_safe(0);
UINT8 toggles = read_safe(machine().root_device().ioport("DEBUG1"), 0);
m_debug_options.select_pri[SNES_BG1] = (toggles & 0x03);
m_debug_options.select_pri[SNES_BG2] = (toggles & 0x0c) >> 2;
m_debug_options.select_pri[SNES_BG3] = (toggles & 0x30) >> 4;
m_debug_options.select_pri[SNES_BG4] = (toggles & 0xc0) >> 6;
toggles = machine().root_device().ioport("DEBUG2")->read_safe(0);
toggles = read_safe(machine().root_device().ioport("DEBUG2"), 0);
for (i = 0; i < 4; i++)
DEBUG_TOGGLE(i, m_debug_options.bg_disabled[i], ("Debug: Disabled BG%d.\n", i + 1), ("Debug: Enabled BG%d.\n", i + 1))
DEBUG_TOGGLE(4, m_debug_options.bg_disabled[SNES_OAM], ("Debug: Disabled OAM.\n"), ("Debug: Enabled OAM.\n"))
@ -2842,11 +2842,11 @@ UINT8 snes_ppu_device::dbg_video( UINT16 curline )
DEBUG_TOGGLE(6, m_debug_options.colormath_disabled, ("Debug: Disabled Color Math.\n"), ("Debug: Enabled Color Math.\n"))
DEBUG_TOGGLE(7, m_debug_options.windows_disabled, ("Debug: Disabled Window Masks.\n"), ("Debug: Enabled Window Masks.\n"))
toggles = machine().root_device().ioport("DEBUG4")->read_safe(0);
toggles = read_safe(machine().root_device().ioport("DEBUG4"), 0);
for (i = 0; i < 8; i++)
DEBUG_TOGGLE(i, m_debug_options.mode_disabled[i], ("Debug: Disabled Mode %d drawing.\n", i), ("Debug: Enabled Mode %d drawing.\n", i))
toggles = machine().root_device().ioport("DEBUG3")->read_safe(0);
toggles = read_safe(machine().root_device().ioport("DEBUG3"), 0);
DEBUG_TOGGLE(2, m_debug_options.mosaic_disabled, ("Debug: Disabled Mosaic.\n"), ("Debug: Enabled Mosaic.\n"))
m_debug_options.sprite_reversed = BIT(toggles, 7);
m_debug_options.select_pri[SNES_OAM] = (toggles & 0x70) >> 4;

View File

@ -1204,7 +1204,6 @@ public:
// read/write to the port
ioport_value read();
ioport_value read_safe(ioport_value defval) { return (this == NULL) ? defval : read(); }
void write(ioport_value value, ioport_value mask = ~0);
// other operations
@ -1226,6 +1225,9 @@ private:
auto_pointer<ioport_port_live> m_live; // live state of port (NULL if not live)
};
inline ioport_value read_safe(ioport_port *port, ioport_value defval) { return (port == NULL) ? defval : port->read(); }
// ======================> analog_field

View File

@ -114,7 +114,7 @@ WRITE_LINE_MEMBER(midway_ssio_device::reset_write)
READ8_MEMBER(midway_ssio_device::ioport_read)
{
static const char *const port[] = { "IP0", "IP1", "IP2", "IP3", "IP4" };
UINT8 result = ioport(port[offset])->read_safe(0xff);
UINT8 result = read_safe(ioport(port[offset]), 0xff);
if (!m_custom_input[offset].isnull())
result = (result & ~m_custom_input_mask[offset]) |
(m_custom_input[offset](space, offset, 0xff) & m_custom_input_mask[offset]);

View File

@ -2936,8 +2936,8 @@ INPUT_CHANGED_MEMBER(_8080bw_state::claybust_gun_trigger)
ana a
rz
*/
UINT8 gunx = ioport("GUNX")->read_safe(0x00);
UINT8 guny = ioport("GUNY")->read_safe(0x20);
UINT8 const gunx = read_safe(ioport("GUNX"), 0x00);
UINT8 const guny = read_safe(ioport("GUNY"), 0x20);
m_claybust_gun_pos = ((gunx >> 3) | (guny << 5)) + 2;
m_claybust_gun_on->adjust(attotime::from_msec(250)); // timing is a guess
}

View File

@ -198,7 +198,7 @@ void astrof_state::astrof_get_pens( pen_t *pens )
{
offs_t i;
UINT8 bank = (m_astrof_palette_bank ? 0x10 : 0x00);
UINT8 config = ioport("FAKE")->read_safe(0x00);
UINT8 config = read_safe(ioport("FAKE"), 0x00);
UINT8 *prom = memregion("proms")->base();
/* a common wire hack to the pcb causes the prom halves to be inverted */
@ -234,7 +234,7 @@ void astrof_state::tomahawk_get_pens( pen_t *pens )
{
offs_t i;
UINT8 *prom = memregion("proms")->base();
UINT8 config = ioport("FAKE")->read_safe(0x00);
UINT8 config = read_safe(ioport("FAKE"), 0x00);
for (i = 0; i < TOMAHAWK_NUM_PENS; i++)
{

View File

@ -69,13 +69,9 @@ UINT8 sc4_state::read_input_matrix(int row)
UINT8 value;
if (row<4)
{
value = ((portnames[row])->read_safe(0x00) & 0x1f) + (((portnames[row+8])->read_safe(0x00) & 0x07) << 5);
}
value = (read_safe(portnames[row], 0x00) & 0x1f) + ((read_safe(portnames[row+8], 0x00) & 0x07) << 5);
else
{
value = ((portnames[row])->read_safe(0x00) & 0x1f) + (((portnames[row+4])->read_safe(0x00) & 0x18) << 2);
}
value = (read_safe(portnames[row], 0x00) & 0x1f) + ((read_safe(portnames[row+4], 0x00) & 0x18) << 2);
return value;
}

View File

@ -265,7 +265,7 @@ READ8_MEMBER(bwidow_state::spacduel_IN3_r)
res1 = ioport("IN3")->read();
res2 = ioport("IN4")->read();
res3 = ioport("DSW2")->read_safe(0);
res3 = read_safe(ioport("DSW2"), 0);
res = 0x00;
switch (offset & 0x07)

View File

@ -150,8 +150,8 @@ READ8_MEMBER(cinemat_state::joystick_read)
return 0;
else
{
int xval = (INT16)(m_maincpu->state_int(CCPU_X) << 4) >> 4;
return (ioport(m_mux_select ? "ANALOGX" : "ANALOGY")->read_safe(0) - xval) < 0x800;
int const xval = INT16(m_maincpu->state_int(CCPU_X) << 4) >> 4;
return (read_safe(ioport(m_mux_select ? "ANALOGX" : "ANALOGY"), 0) - xval) < 0x800;
}
}
@ -169,7 +169,7 @@ READ8_MEMBER(cinemat_state::speedfrk_wheel_r)
int delta_wheel;
/* the shift register is cleared once per 'frame' */
delta_wheel = (INT8)ioport("WHEEL")->read() / 8;
delta_wheel = INT8(ioport("WHEEL")->read()) / 8;
if (delta_wheel > 3)
delta_wheel = 3;
else if (delta_wheel < -3)

View File

@ -516,11 +516,11 @@ bool cobra_jvs::switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_switc
static const char* player_ports[2] = { ":P1", ":P2" };
*buf++ = ioport(":TEST")->read_safe(0);
*buf++ = read_safe(ioport(":TEST"), 0);
for (int i=0; i < count_players; i++)
{
UINT32 pval = ioport(player_ports[i])->read_safe(0);
UINT32 pval = read_safe(ioport(player_ports[i]), 0);
for (int j=0; j < bytes_per_switch; j++)
{
*buf++ = (UINT8)(pval >> ((1-j) * 8));

View File

@ -273,7 +273,7 @@ READ8_MEMBER(combatsc_state::trackball_r)
{
UINT8 curr;
curr = ioport(tracknames[i])->read_safe(0xff);
curr = read_safe(ioport(tracknames[i]), 0xff);
dir[i] = curr - m_pos[i];
m_sign[i] = dir[i] & 0x80;

View File

@ -323,7 +323,7 @@ READ8_MEMBER(cosmic_state::cosmicg_port_0_r)
READ8_MEMBER(cosmic_state::magspot_coinage_dip_r)
{
return (ioport("DSW")->read_safe(0) & (1 << (7 - offset))) ? 0 : 1;
return (read_safe(ioport("DSW"), 0) & (1 << (7 - offset))) ? 0 : 1;
}

View File

@ -231,7 +231,7 @@ READ32_MEMBER(djmain_state::turntable_r)
UINT8 pos;
int delta;
pos = ioport(ttnames[m_turntable_select])->read_safe(0);
pos = read_safe(ioport(ttnames[m_turntable_select]), 0);
delta = pos - m_turntable_last_pos[m_turntable_select];
if (delta < -128)
delta += 256;

View File

@ -230,8 +230,8 @@ READ8_MEMBER(firetrk_state::firetrk_input_r)
/* update steering wheels */
for (i = 0; i < 2; i++)
{
UINT32 new_dial = ioport((i ? "STEER_2" : "STEER_1"))->read_safe(0);
INT32 delta = new_dial - m_dial[i];
UINT32 const new_dial = read_safe(ioport(i ? "STEER_2" : "STEER_1"), 0);
INT32 const delta = new_dial - m_dial[i];
if (delta != 0)
{
@ -242,9 +242,9 @@ READ8_MEMBER(firetrk_state::firetrk_input_r)
}
}
return ((ioport("BIT_0")->read_safe(0) & (1 << offset)) ? 0x01 : 0) |
((ioport("BIT_6")->read_safe(0) & (1 << offset)) ? 0x40 : 0) |
((ioport("BIT_7")->read_safe(0) & (1 << offset)) ? 0x80 : 0);
return ((read_safe(ioport("BIT_0"), 0) & (1 << offset)) ? 0x01 : 0) |
((read_safe(ioport("BIT_6"), 0) & (1 << offset)) ? 0x40 : 0) |
((read_safe(ioport("BIT_7"), 0) & (1 << offset)) ? 0x80 : 0);
}

View File

@ -430,10 +430,10 @@ WRITE16_MEMBER(gaelco3d_state::analog_port_latch_w)
{
if (!(data & 0xff))
{
m_analog_ports[0] = ioport("ANALOG0")->read_safe(0);
m_analog_ports[1] = ioport("ANALOG1")->read_safe(0);
m_analog_ports[2] = ioport("ANALOG2")->read_safe(0);
m_analog_ports[3] = ioport("ANALOG3")->read_safe(0);
m_analog_ports[0] = read_safe(ioport("ANALOG0"), 0);
m_analog_ports[1] = read_safe(ioport("ANALOG1"), 0);
m_analog_ports[2] = read_safe(ioport("ANALOG2"), 0);
m_analog_ports[3] = read_safe(ioport("ANALOG3"), 0);
}
}
else

View File

@ -688,7 +688,7 @@ INTERRUPT_GEN_MEMBER(galaxian_state::fakechange_interrupt_gen)
{
interrupt_gen(device);
if (ioport("FAKE_SELECT")->read_safe(0x00))
if (read_safe(ioport("FAKE_SELECT"), 0x00))
{
m_tenspot_current_game++;
m_tenspot_current_game%=10;
@ -6299,7 +6299,7 @@ READ8_MEMBER(galaxian_state::tenspot_dsw_read)
{
char tmp[64];
sprintf(tmp,"IN2_GAME%d", m_tenspot_current_game);
return ioport(tmp)->read_safe(0x00);
return read_safe(ioport(tmp), 0x00);
}

View File

@ -36,7 +36,7 @@ READ8_MEMBER(gomoku_state::input_port_r)
res = 0;
for (i = 0; i < 8; i++)
res |= ((ioport(portnames[i])->read_safe(0xff) >> offset) & 1) << i;
res |= ((read_safe(ioport(portnames[i]), 0xff) >> offset) & 1) << i;
return res;
}

View File

@ -283,8 +283,8 @@ CUSTOM_INPUT_MEMBER(gottlieb_state::analog_delta_r)
WRITE8_MEMBER(gottlieb_state::gottlieb_analog_reset_w)
{
/* reset the trackball counters */
m_track[0] = ioport("TRACKX")->read_safe(0);
m_track[1] = ioport("TRACKY")->read_safe(0);
m_track[0] = read_safe(ioport("TRACKX"), 0);
m_track[1] = read_safe(ioport("TRACKY"), 0);
}

View File

@ -87,7 +87,7 @@ Address Dir Data Description
READ8_MEMBER(jackal_state::jackalr_rotary_r)
{
return (1 << ioport(offset ? "DIAL1" : "DIAL0")->read_safe(0x00)) ^ 0xff;
return (1 << read_safe(ioport(offset ? "DIAL1" : "DIAL0"), 0x00)) ^ 0xff;
}
WRITE8_MEMBER(jackal_state::jackal_flipscreen_w)

View File

@ -389,12 +389,12 @@ INPUT_PORTS_END
READ8_MEMBER(maxaflex_state::pia_pa_r)
{
return atari_input_disabled() ? 0xff : m_joy01->read_safe(0);
return atari_input_disabled() ? 0xff : read_safe(m_joy01, 0);
}
READ8_MEMBER(maxaflex_state::pia_pb_r)
{
return atari_input_disabled() ? 0xff : m_joy23->read_safe(0);
return atari_input_disabled() ? 0xff : read_safe(m_joy23, 0);
}

View File

@ -520,7 +520,7 @@ READ32_MEMBER(mediagx_state::parallel_port_r)
if (ACCESSING_BITS_8_15)
{
UINT8 nibble = m_parallel_latched;//(ioport(m_portnames[m_parallel_pointer / 3])->read_safe(0) >> (4 * (m_parallel_pointer % 3))) & 15;
UINT8 nibble = m_parallel_latched;//(read_safe(ioport(m_portnames[m_parallel_pointer / 3]), 0) >> (4 * (m_parallel_pointer % 3))) & 15;
r |= ((~nibble & 0x08) << 12) | ((nibble & 0x07) << 11);
logerror("%08X:parallel_port_r()\n", space.device().safe_pc());
#if 0
@ -573,7 +573,7 @@ WRITE32_MEMBER(mediagx_state::parallel_port_w)
logerror("%08X:", space.device().safe_pc());
m_parallel_latched = (ioport(portnames[m_parallel_pointer / 3])->read_safe(0) >> (4 * (m_parallel_pointer % 3))) & 15;
m_parallel_latched = (read_safe(ioport(portnames[m_parallel_pointer / 3]), 0) >> (4 * (m_parallel_pointer % 3))) & 15;
//parallel_pointer++;
//logerror("[%02X] Advance pointer to %d\n", data, parallel_pointer);
switch (data & 0xfc)

View File

@ -231,10 +231,10 @@ READ8_MEMBER(meyc8088_state::meyc8088_input_r)
UINT8 ret = 0xff;
// multiplexed switch inputs
if (~m_common & 1) ret &= ioport("C0")->read_safe(0); // bit switches
if (~m_common & 2) ret &= ioport("C1")->read_safe(0); // control switches
if (~m_common & 4) ret &= ioport("C2")->read_safe(0); // light switches
if (~m_common & 8) ret &= ioport("C3")->read_safe(0); // light switches
if (~m_common & 1) ret &= read_safe(ioport("C0"), 0); // bit switches
if (~m_common & 2) ret &= read_safe(ioport("C1"), 0); // control switches
if (~m_common & 4) ret &= read_safe(ioport("C2"), 0); // light switches
if (~m_common & 8) ret &= read_safe(ioport("C3"), 0); // light switches
return ret;
}

View File

@ -142,7 +142,7 @@ WRITE32_MEMBER(midvunit_state::midvunit_adc_w)
int which = (data >> m_adc_shift) - 4;
if (which < 0 || which > 2)
logerror("adc_w: unexpected which = %02X\n", which + 4);
m_adc_data = ioport(adcnames[which])->read_safe(0);
m_adc_data = read_safe(ioport(adcnames[which]), 0);
timer_set(attotime::from_msec(1), TIMER_ADC_READY);
}
else

View File

@ -642,7 +642,7 @@ READ16_MEMBER(model1_state::io_r)
static const char *const inputnames[] = { "IN0", "IN1", "IN2" };
if(offset < 0x8)
return ioport(analognames[offset])->read_safe(0x00);
return read_safe(ioport(analognames[offset]), 0x00);
if(offset == 0x0f)
return m_lamp_state;

View File

@ -539,7 +539,7 @@ CUSTOM_INPUT_MEMBER(model2_state::_1c0001c_r)
if(m_analog_channel < 4)
{
static const char *const ports[] = { "ANA0", "ANA1", "ANA2", "ANA3" };
iptval = ioport(ports[m_analog_channel])->read_safe(0);
iptval = read_safe(ioport(ports[m_analog_channel]), 0);
++m_analog_channel;
}
return iptval;
@ -557,7 +557,7 @@ CUSTOM_INPUT_MEMBER(model2_state::_1c0001c_r)
/* Used specifically by Sega Rally, others might be different */
CUSTOM_INPUT_MEMBER(model2_state::srallyc_gearbox_r)
{
UINT8 res = ioport("GEARS")->read_safe(0);
UINT8 res = read_safe(ioport("GEARS"), 0);
int i;
const UINT8 gearvalue[5] = { 0, 2, 1, 6, 5 };
@ -1049,17 +1049,17 @@ READ32_MEMBER(model2_state::hotd_lightgun_r)
UINT16 res = 0xffff;
if(m_lightgun_mux < 8)
res = (ioport(ports[m_lightgun_mux >> 1])->read_safe(0) >> ((m_lightgun_mux & 1)*8)) & 0xff;
res = (read_safe(ioport(ports[m_lightgun_mux >> 1]), 0) >> ((m_lightgun_mux & 1)*8)) & 0xff;
else
{
UINT16 p1x,p1y,p2x,p2y;
res = 0xfffc;
p1x = ioport("P1_X")->read_safe(0);
p1y = ioport("P1_Y")->read_safe(0);
p2x = ioport("P2_X")->read_safe(0);
p2y = ioport("P2_Y")->read_safe(0);
p1x = read_safe(ioport("P1_X"), 0);
p1y = read_safe(ioport("P1_Y"), 0);
p2x = read_safe(ioport("P2_X"), 0);
p2y = read_safe(ioport("P2_Y"), 0);
/* TODO: might be better, supposedly user has to calibrate guns in order to make these settings to work ... */
if(p1x <= 0x28 || p1x >= 0x3e0 || p1y <= 0x40 || p1y >= 0x3c0)
@ -1526,7 +1526,7 @@ READ8_MEMBER(model2_state::virtuacop_lightgun_r)
static const char *const ports[] = { "P1_Y", "P1_X", "P2_Y", "P2_X" };
UINT8 res;
res = (ioport(ports[offset >> 1])->read_safe(0) >> ((offset & 1)*8)) & 0xff;
res = (read_safe(ioport(ports[offset >> 1]), 0) >> ((offset & 1)*8)) & 0xff;
return res;
}
@ -1537,10 +1537,10 @@ READ8_MEMBER(model2_state::virtuacop_lightgun_offscreen_r)
UINT16 special_res = 0xfffc;
UINT16 p1x,p1y,p2x,p2y;
p1x = ioport("P1_X")->read_safe(0);
p1y = ioport("P1_Y")->read_safe(0);
p2x = ioport("P2_X")->read_safe(0);
p2y = ioport("P2_Y")->read_safe(0);
p1x = read_safe(ioport("P1_X"), 0);
p1y = read_safe(ioport("P1_Y"), 0);
p2x = read_safe(ioport("P2_X"), 0);
p2y = read_safe(ioport("P2_Y"), 0);
/* TODO: might be better, supposedly user has to calibrate guns in order to make these settings to work ... */
if(p1x <= 0x28 || p1x >= 0x3e0 || p1y <= 0x40 || p1y >= 0x3c0)

View File

@ -1367,7 +1367,7 @@ READ64_MEMBER(model3_state::model3_ctrl_r)
if (ACCESSING_BITS_24_31) /* ADC Data read */
{
static const char *const adcnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
UINT8 adc_data = ioport(adcnames[m_adc_channel])->read_safe(0);
const UINT8 adc_data = read_safe(ioport(adcnames[m_adc_channel]), 0);
m_adc_channel++;
m_adc_channel &= 0x7;
return (UINT64)adc_data << 24;

View File

@ -337,7 +337,7 @@ WRITE8_MEMBER(multigam_state::multigam_IN0_w)
m_in_1 = ioport("P2")->read();
m_in_dsw_shift = 0;
m_in_dsw = ioport("DSW")->read_safe(0);
m_in_dsw = read_safe(ioport("DSW"), 0);
}
READ8_MEMBER(multigam_state::multigam_IN1_r)

View File

@ -302,17 +302,17 @@ READ8_MEMBER(namcofl_state::port7_r)
READ8_MEMBER(namcofl_state::dac7_r)
{
return ioport("ACCEL")->read_safe(0xff);
return read_safe(ioport("ACCEL"), 0xff);
}
READ8_MEMBER(namcofl_state::dac6_r)
{
return ioport("BRAKE")->read_safe(0xff);
return read_safe(ioport("BRAKE"), 0xff);
}
READ8_MEMBER(namcofl_state::dac5_r)
{
return ioport("WHEEL")->read_safe(0xff);
return read_safe(ioport("WHEEL"), 0xff);
}
READ8_MEMBER(namcofl_state::dac4_r){ return 0xff; }

View File

@ -738,7 +738,7 @@ READ8_MEMBER(namconb1_state::port7_r)
switch (m_nbx_port6 & 0xf0)
{
case 0x00:
return ioport("P4")->read_safe(0xff);
return read_safe(ioport("P4"), 0xff);
case 0x20:
return ioport("MISC")->read();
@ -761,42 +761,42 @@ READ8_MEMBER(namconb1_state::port7_r)
// register full scale, so it works...
READ8_MEMBER(namconb1_state::dac7_r)// bit 7
{
return ioport("P3")->read_safe(0xff)&0x80;
return read_safe(ioport("P3"), 0xff)&0x80;
}
READ8_MEMBER(namconb1_state::dac6_r)// bit 3
{
return (ioport("P3")->read_safe(0xff)<<1)&0x80;
return (read_safe(ioport("P3"), 0xff)<<1)&0x80;
}
READ8_MEMBER(namconb1_state::dac5_r)// bit 2
{
return (ioport("P3")->read_safe(0xff)<<2)&0x80;
return (read_safe(ioport("P3"), 0xff)<<2)&0x80;
}
READ8_MEMBER(namconb1_state::dac4_r)// bit 1
{
return (ioport("P3")->read_safe(0xff)<<3)&0x80;
return (read_safe(ioport("P3"), 0xff)<<3)&0x80;
}
READ8_MEMBER(namconb1_state::dac3_r)// bit 0
{
return (ioport("P3")->read_safe(0xff)<<4)&0x80;
return (read_safe(ioport("P3"), 0xff)<<4)&0x80;
}
READ8_MEMBER(namconb1_state::dac2_r)// bit 4
{
return (ioport("P3")->read_safe(0xff)<<5)&0x80;
return (read_safe(ioport("P3"), 0xff)<<5)&0x80;
}
READ8_MEMBER(namconb1_state::dac1_r)// bit 5
{
return (ioport("P3")->read_safe(0xff)<<6)&0x80;
return (read_safe(ioport("P3"), 0xff)<<6)&0x80;
}
READ8_MEMBER(namconb1_state::dac0_r)// bit 6
{
return (ioport("P3")->read_safe(0xff)<<7)&0x80;
return (read_safe(ioport("P3"), 0xff)<<7)&0x80;
}
static ADDRESS_MAP_START( namcoc75_io, AS_IO, 8, namconb1_state )

View File

@ -1686,7 +1686,7 @@ READ16_MEMBER(namcos22_state::namcos22_portbit_r)
WRITE16_MEMBER(namcos22_state::namcos22_portbit_w)
{
m_portbits[offset] = ioport((offset == 0) ? "P1" : "P2")->read_safe(0xffff);
m_portbits[offset] = read_safe(ioport((offset == 0) ? "P1" : "P2"), 0xffff);
}
READ16_MEMBER(namcos22_state::namcos22_dipswitch_r)
@ -2771,9 +2771,9 @@ WRITE8_MEMBER(namcos22_state::mcu_port5_w)
READ8_MEMBER(namcos22_state::mcu_port5_r)
{
if (m_p4 & 8)
return ioport("MCUP5A")->read_safe(0xff);
return read_safe(ioport("MCUP5A"), 0xff);
else
return ioport("MCUP5B")->read_safe(0xff);
return read_safe(ioport("MCUP5B"), 0xff);
}
WRITE8_MEMBER(namcos22_state::mcu_port6_w)
@ -2798,7 +2798,7 @@ READ8_MEMBER(namcos22_state::mcu_port7_r)
READ8_MEMBER(namcos22_state::namcos22s_mcu_adc_r)
{
UINT16 adc = m_adc_ports[offset >> 1 & 7]->read_safe(0) << 2;
UINT16 adc = read_safe(m_adc_ports[offset >> 1 & 7], 0) << 2;
return (offset & 1) ? adc >> 8 : adc;
}

View File

@ -2980,7 +2980,7 @@ WRITE16_MEMBER(namcos23_state::iob_p6_w)
READ16_MEMBER(namcos23_state::iob_analog_r)
{
return m_adc_ports[offset]->read_safe(0);
return read_safe(m_adc_ports[offset], 0);
}

View File

@ -642,7 +642,7 @@ CUSTOM_INPUT_MEMBER(neogeo_state::multiplexed_controller_r)
{ "IN0-0", "IN0-1" }, { "IN1-0", "IN1-1" }
};
return ioport(cntrl[port][m_controller_select & 0x01])->read_safe(0x00);
return read_safe(ioport(cntrl[port][m_controller_select & 0x01]), 0x00);
}
CUSTOM_INPUT_MEMBER(neogeo_state::kizuna4p_controller_r)
@ -654,7 +654,7 @@ CUSTOM_INPUT_MEMBER(neogeo_state::kizuna4p_controller_r)
{ "IN0-0", "IN0-1" }, { "IN1-0", "IN1-1" }
};
int ret = ioport(cntrl[port][m_controller_select & 0x01])->read_safe(0x00);
int ret = read_safe(ioport(cntrl[port][m_controller_select & 0x01]), 0x00);
if (m_controller_select & 0x04) ret &= ((m_controller_select & 0x01) ? ~0x20 : ~0x10);
return ret;

View File

@ -388,8 +388,8 @@ void peplus_state::device_timer(emu_timer &timer, device_timer_id id, int param,
void peplus_state::handle_lightpen()
{
int x_val = ioport("TOUCH_X")->read_safe(0x00);
int y_val = ioport("TOUCH_Y")->read_safe(0x00);
int x_val = read_safe(ioport("TOUCH_X"), 0x00);
int y_val = read_safe(ioport("TOUCH_Y"), 0x00);
const rectangle &vis_area = m_screen->visible_area();
int xt, yt;
@ -563,7 +563,7 @@ READ8_MEMBER(peplus_state::peplus_input0_r)
UINT64 curr_cycles = m_maincpu->total_cycles();
// Allow Bill Insert if DBV Enabled
if (m_bv_enable_state == 0x01 && ((ioport("DBV")->read_safe(0xff) & 0x01) == 0x00)) {
if (m_bv_enable_state == 0x01 && ((read_safe(ioport("DBV"), 0xff) & 0x01) == 0x00)) {
// If not busy
if (m_bv_busy == 0) {
m_bv_busy = 1;
@ -786,7 +786,7 @@ READ8_MEMBER(peplus_state::peplus_input_bank_a_r)
sda = m_i2cmem->read_sda();
}
if ((ioport("SENSOR")->read_safe(0x00) & 0x01) == 0x01 && m_coin_state == 0) {
if ((read_safe(ioport("SENSOR"), 0x00) & 0x01) == 0x01 && m_coin_state == 0) {
m_coin_state = 1; // Start Coin Cycle
m_last_cycles = m_maincpu->total_cycles();
} else {
@ -822,7 +822,7 @@ READ8_MEMBER(peplus_state::peplus_input_bank_a_r)
}
if (curr_cycles - m_last_door > door_wait) {
if ((ioport("DOOR")->read_safe(0xff) & 0x01) == 0x01) {
if ((read_safe(ioport("DOOR"), 0xff) & 0x01) == 0x01) {
if (m_doorcycle) {
m_door_open = (m_door_open ^ 0x01) & 0x01;
} else {

View File

@ -180,7 +180,7 @@ READ16_MEMBER( segahang_state::hangon_io_r )
case 0x3020/2: // ADC0804 data output
{
static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
return ioport(adcports[m_adc_select])->read_safe(0);
return read_safe(ioport(adcports[m_adc_select]), 0);
}
}
@ -241,7 +241,7 @@ READ16_MEMBER( segahang_state::sharrier_io_r )
case 0x0030/2: // ADC0804 data output
{
static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
return ioport(adcports[m_adc_select])->read_safe(0);
return read_safe(ioport(adcports[m_adc_select]), 0);
}
}

View File

@ -696,7 +696,7 @@ READ16_MEMBER( segaorun_state::outrun_custom_io_r )
case 0x30/2:
{
return m_adc_ports[m_adc_select]->read_safe(0x0010);
return read_safe(m_adc_ports[m_adc_select], 0x0010);
}
case 0x60/2:
@ -782,7 +782,7 @@ READ16_MEMBER( segaorun_state::shangon_custom_io_r )
case 0x3020/2:
{
return m_adc_ports[m_adc_select]->read_safe(0x0010);
return read_safe(m_adc_ports[m_adc_select], 0x0010);
}
default:

View File

@ -924,12 +924,12 @@ READ16_MEMBER( segas16a_state::sjryuko_custom_io_r )
switch (offset & 3)
{
case 1:
if (ioport(portname[m_mj_input_num])->read_safe(0xff) != 0xff)
if (read_safe(ioport(portname[m_mj_input_num]), 0xff) != 0xff)
return 0xff & ~(1 << m_mj_input_num);
return 0xff;
case 2:
return ioport(portname[m_mj_input_num])->read_safe(0xff);
return read_safe(ioport(portname[m_mj_input_num]), 0xff);
}
break;
}

View File

@ -1593,7 +1593,7 @@ WRITE16_MEMBER( segas16b_state::hwchamp_custom_io_w )
switch (offset & 0x30/2)
{
case 0x20/2:
m_hwc_input_value = ioport(portname[offset & 3])->read_safe(0xff);
m_hwc_input_value = read_safe(ioport(portname[offset & 3]), 0xff);
break;
case 0x30/2:
@ -1672,12 +1672,12 @@ READ16_MEMBER( segas16b_state::sjryuko_custom_io_r )
switch (offset & 3)
{
case 1:
if (ioport(portname[m_mj_input_num])->read_safe(0xff) != 0xff)
if (read_safe(ioport(portname[m_mj_input_num]), 0xff) != 0xff)
return 0xff & ~(1 << m_mj_input_num);
return 0xff;
case 2:
return ioport(portname[m_mj_input_num])->read_safe(0xff);
return read_safe(ioport(portname[m_mj_input_num]), 0xff);
}
break;
}

View File

@ -522,7 +522,7 @@ UINT8 segas24_state::hotrod_io_r(UINT8 port)
case 1:
return ioport("P2")->read();
case 2:
return ioport("P3")->read_safe(0xff);
return read_safe(ioport("P3"), 0xff);
case 3:
return 0xff;
case 4:
@ -629,7 +629,7 @@ WRITE16_MEMBER( segas24_state::hotrod3_ctrl_w )
if(ACCESSING_BITS_0_7)
{
data &= 3;
hotrod_ctrl_cur = ioport(portnames[data])->read_safe(0);
hotrod_ctrl_cur = read_safe(ioport(portnames[data]), 0);
}
}
@ -641,21 +641,21 @@ READ16_MEMBER( segas24_state::hotrod3_ctrl_r )
{
// Steering dials
case 0:
return ioport("DIAL1")->read_safe(0) & 0xff;
return read_safe(ioport("DIAL1"), 0) & 0xff;
case 1:
return ioport("DIAL1")->read_safe(0) >> 8;
return read_safe(ioport("DIAL1"), 0) >> 8;
case 2:
return ioport("DIAL2")->read_safe(0) & 0xff;
return read_safe(ioport("DIAL2"), 0) & 0xff;
case 3:
return ioport("DIAL2")->read_safe(0) >> 8;
return read_safe(ioport("DIAL2"), 0) >> 8;
case 4:
return ioport("DIAL3")->read_safe(0) & 0xff;
return read_safe(ioport("DIAL3"), 0) & 0xff;
case 5:
return ioport("DIAL3")->read_safe(0) >> 8;
return read_safe(ioport("DIAL3"), 0) >> 8;
case 6:
return ioport("DIAL4")->read_safe(0) & 0xff;
return read_safe(ioport("DIAL4"), 0) & 0xff;
case 7:
return ioport("DIAL4")->read_safe(0) >> 8;
return read_safe(ioport("DIAL4"), 0) >> 8;
case 8:
{

View File

@ -828,7 +828,7 @@ UINT16 segas32_state::common_io_chip_r(address_space &space, int which, offs_t o
return m_misc_io_data[which][offset];
/* otherwise, return an input port */
return ioport(portnames[which][offset])->read_safe(0xffff);
return read_safe(ioport(portnames[which][offset]), 0xffff);
/* 'SEGA' protection */
case 0x10/2:
@ -1097,7 +1097,7 @@ WRITE16_MEMBER(segas32_state::analog_custom_io_w)
case 0x12/2:
case 0x14/2:
case 0x16/2:
m_analog_value[offset & 3] = ioport(names[offset & 3])->read_safe(0);
m_analog_value[offset & 3] = read_safe(ioport(names[offset & 3]), 0);
return;
}
logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", space.device().safe_pc(), offset*2, data, mem_mask);
@ -1113,7 +1113,7 @@ READ16_MEMBER(segas32_state::extra_custom_io_r)
case 0x22/2:
case 0x24/2:
case 0x26/2:
return ioport(names[offset & 3])->read_safe(0xffff);
return read_safe(ioport(names[offset & 3]), 0xffff);
}
logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", space.device().safe_pc(), offset*2, mem_mask);
@ -1130,7 +1130,7 @@ WRITE16_MEMBER(segas32_state::orunners_custom_io_w)
case 0x12/2:
case 0x14/2:
case 0x16/2:
m_analog_value[offset & 3] = ioport(names[m_analog_bank * 4 + (offset & 3)])->read_safe(0);
m_analog_value[offset & 3] = read_safe(ioport(names[m_analog_bank * 4 + (offset & 3)]), 0);
return;
case 0x20/2:

View File

@ -468,7 +468,7 @@ READ16_MEMBER( segaxbd_state::adc_r )
// on the write, latch the selected input port and stash the value
int which = (m_iochip_regs[0][2] >> 2) & 7;
int value = ioport(ports[which])->read_safe(0x0010);
int value = read_safe(ioport(ports[which]), 0x0010);
// reverse some port values
if (m_adc_reverse[which])
@ -929,7 +929,7 @@ void segaxbd_state::smgp_iochip0_motor_w(UINT8 data)
UINT8 segaxbd_state::lastsurv_iochip1_port_r(UINT8 data)
{
static const char * const port_names[] = { "MUX0", "MUX1", "MUX2", "MUX3" };
return ioport(port_names[m_lastsurv_mux])->read_safe(0xff);
return read_safe(ioport(port_names[m_lastsurv_mux]), 0xff);
}

View File

@ -109,7 +109,7 @@ READ16_MEMBER( segaybd_state::analog_r )
WRITE16_MEMBER( segaybd_state::analog_w )
{
int selected = ((offset & 3) == 3) ? (3 + (m_misc_io_data[0x08/2] & 3)) : (offset & 3);
m_analog_data[offset & 3] = m_adc_ports[selected]->read_safe(0xff);
m_analog_data[offset & 3] = read_safe(m_adc_ports[selected], 0xff);
}

View File

@ -78,7 +78,7 @@ void seicross_state::machine_reset()
READ8_MEMBER(seicross_state::portB_r)
{
return (m_portb & 0x9f) | (ioport("DEBUG")->read_safe(0) & 0x60);
return (m_portb & 0x9f) | (read_safe(ioport("DEBUG"), 0) & 0x60);
}
WRITE8_MEMBER(seicross_state::portB_w)

View File

@ -1962,7 +1962,7 @@ WRITE16_MEMBER(seta_state::zombraid_gun_w)
READ16_MEMBER(seta_state::extra_r)
{
return ioport("EXTRA")->read_safe(0xff);
return read_safe(ioport("EXTRA"), 0xff);
}
static ADDRESS_MAP_START( wrofaero_map, AS_PROGRAM, 16, seta_state )

View File

@ -68,7 +68,7 @@ READ8_MEMBER(sidearms_state::turtship_ports_r)
{
int res = 0;
for (int i = 0; i < 5;i++)
res |= ((m_ports[i]->read_safe(0) >> offset) & 1) << i;
res |= ((read_safe(m_ports[i], 0) >> offset) & 1) << i;
return res;
}

View File

@ -320,7 +320,7 @@ static const char *const starfire_sample_names[] =
INTERRUPT_GEN_MEMBER(starfire_state::vblank_int)
{
// starfire has a jumper for disabling NMI, used to do a complete RAM test
if (ioport("NMI")->read_safe(0x01))
if (read_safe(ioport("NMI"), 0x01))
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}

View File

@ -1104,7 +1104,7 @@ CUSTOM_INPUT_MEMBER(taitoz_state::taitoz_pedal_r)
{
static const UINT8 retval[8] = { 0,1,3,2,6,7,5,4 };
const char *tag = (const char *)param;
return retval[ioport(tag)->read_safe(0) & 7];
return retval[read_safe(ioport(tag), 0) & 7];
}
@ -1113,7 +1113,7 @@ READ8_MEMBER(taitoz_state::contcirc_input_bypass_r)
/* Bypass TC0220IOC controller for analog input */
UINT8 port = m_tc0220ioc->port_r(space, 0); /* read port number */
UINT16 steer = 0xff80 + ioport("STEER")->read_safe(0x80);
UINT16 steer = 0xff80 + read_safe(ioport("STEER"), 0x80);
switch (port)
{
@ -1134,7 +1134,7 @@ READ8_MEMBER(taitoz_state::chasehq_input_bypass_r)
/* Bypass TC0220IOC controller for extra inputs */
UINT8 port = m_tc0220ioc->port_r(space, 0); /* read port number */
UINT16 steer = 0xff80 + ioport("STEER")->read_safe(0x80);
UINT16 steer = 0xff80 + read_safe(ioport("STEER"), 0x80);
switch (port)
{
@ -1221,7 +1221,7 @@ WRITE16_MEMBER(taitoz_state::bshark_stick_w)
READ16_MEMBER(taitoz_state::sci_steer_input_r)
{
UINT16 steer = 0xff80 + ioport("STEER")->read_safe(0x80);
UINT16 steer = 0xff80 + read_safe(ioport("STEER"), 0x80);
switch (offset)
{
@ -1292,7 +1292,7 @@ WRITE16_MEMBER(taitoz_state::spacegun_gun_output_w)
READ16_MEMBER(taitoz_state::dblaxle_steer_input_r)
{
UINT16 steer = 0xff80 + ioport("STEER")->read_safe(0x80);
UINT16 steer = 0xff80 + read_safe(ioport("STEER"), 0x80);
switch (offset)
{

View File

@ -754,7 +754,7 @@ WRITE8_MEMBER(taitojc_state::hc11_output_w)
READ8_MEMBER(taitojc_state::hc11_analog_r)
{
return m_analog_ports[offset]->read_safe(0);
return read_safe(m_analog_ports[offset], 0);
}

View File

@ -188,7 +188,7 @@ READ8_MEMBER(topspeed_state::input_bypass_r)
{
// Read port number
UINT8 port = m_tc0220ioc->port_r(space, 0);
UINT16 steer = 0xff80 + ioport("STEER")->read_safe(0);
UINT16 steer = 0xff80 + read_safe(ioport("STEER"), 0);
switch (port)
{
@ -207,7 +207,7 @@ CUSTOM_INPUT_MEMBER(topspeed_state::pedal_r)
{
static const UINT8 retval[8] = { 0,1,3,2,6,7,5,4 };
const char *tag = (const char *)param;
return retval[ioport(tag)->read_safe(0) & 7];
return retval[read_safe(ioport(tag), 0) & 7];
}
READ16_MEMBER(topspeed_state::motor_r)

View File

@ -1836,7 +1836,7 @@ READ8_MEMBER(amstrad_state::amstrad_cpc_io_r)
// m6845_personality_t crtc_type;
int page;
// crtc_type = ioport("crtc"->read_safe(0));
// crtc_type = read_safe(ioport("crtc"), 0);
// m6845_set_personality(crtc_type);
if(m_aleste_mode & 0x04)

View File

@ -219,7 +219,7 @@ CUSTOM_INPUT_MEMBER(naomi_state::naomi_mp_r)
for (int i = 0x80; i >= 0x08; i >>= 1)
{
if (m_mp_mux & i)
retval |= ioport(tagptr)->read_safe(0);
retval |= read_safe(ioport(tagptr), 0);
tagptr += strlen(tagptr) + 1;
}
return retval;