ioport.c C++ conversion. Mostly internal changes, with no

intended differences from previous behavior. For drivers,
the main change is that input_port_read() no longer exists.
Instead, the port must be fetched from the appropriate device,
and then read() is called.

For member functions, this is actually simpler/cleaner:

  value = ioport("tag")->read()

For legacy functions which have a driver_data state, it goes:

  value = state->ioport("tag")->read()

For other legacy functions, they need to fetch the root device:

  value = machine.root_device().ioport("tag")->read()

The other big change for drivers is that IPT_VBLANK is gone.
Instead, it has been replaced by a device line callback on the
screen device. There's a new macro PORT_VBLANK("tag") which
automatically points things to the right spot.

Here's a set of imperfect search & replace strings to convert
the input_port_read calls and fix up IPT_VBLANK:

input_port_read( *\( *)(machine\(\)) *, *([^)]+ *\))
ioport\1\3->read\(\)

input_port_read( *\( *)(.*machine[()]*) *, *([^)]+ *\))
\2\.root_device\(\)\.ioport\1\3->read\(\)

(state = .*driver_data[^}]+)space->machine\(\)\.root_device\(\)\.
\1state->

(state = .*driver_data[^}]+)device->machine\(\)\.root_device\(\)\.
\1state->

input_port_read_safe( *\( *)(machine\(\)) *, *([^,]+), *([^)]+\))
ioport\1\3->read_safe\(\4\)

IPT_VBLANK( *\))
IPT_CUSTOM\1 PORT_VBLANK("screen")
This commit is contained in:
Aaron Giles 2012-05-03 09:00:08 +00:00
parent 605a48921b
commit 2a88e54278
881 changed files with 11573 additions and 11697 deletions

View File

@ -474,19 +474,15 @@ endif
# add the optimization flag # add the optimization flag
CCOMFLAGS += -O$(OPTIMIZE) CCOMFLAGS += -O$(OPTIMIZE)
# if we are optimizing, include optimization options # add the error warning flag
# and make all errors into warnings
ifneq ($(OPTIMIZE),0)
ifneq ($(TARGETOS),os2)
ifndef NOWERROR ifndef NOWERROR
CCOMFLAGS += -Werror -fno-strict-aliasing $(ARCHOPTS) CCOMFLAGS += -Werror
else
CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS)
endif endif
else
# if we are optimizing, include optimization options
ifneq ($(OPTIMIZE),0)
CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS) CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS)
endif endif
endif
# add a basic set of warnings # add a basic set of warnings
CCOMFLAGS += \ CCOMFLAGS += \

View File

@ -221,11 +221,11 @@ void crosshair_init(running_machine &machine)
global.auto_time = CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT; global.auto_time = CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT;
/* determine who needs crosshairs */ /* determine who needs crosshairs */
for (input_port_config *port = machine.ioport().first_port(); port != NULL; port = port->next()) for (ioport_port *port = machine.ioport().first_port(); port != NULL; port = port->next())
for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next()) for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
if (field->crossaxis != CROSSHAIR_AXIS_NONE) if (field->crosshair_axis() != CROSSHAIR_AXIS_NONE)
{ {
int player = field->player; int player = field->player();
assert(player < MAX_PLAYERS); assert(player < MAX_PLAYERS);
@ -347,7 +347,7 @@ static void animate(running_machine &machine, screen_device &device, bool vblank
{ {
/* read all the lightgun values */ /* read all the lightgun values */
if (global.used[player]) if (global.used[player])
input_port_get_crosshair_position(device.machine(), player, &global.x[player], &global.y[player]); device.machine().ioport().crosshair_position(player, global.x[player], global.y[player]);
/* auto visibility */ /* auto visibility */
if (global.mode[player] == CROSSHAIR_VISIBILITY_AUTO) if (global.mode[player] == CROSSHAIR_VISIBILITY_AUTO)

View File

@ -63,7 +63,7 @@ UINT8 devcb_resolved_write16::s_null;
class devcb_resolver class devcb_resolver
{ {
public: public:
static const input_port_config *resolve_port(const char *tag, device_t &current); static ioport_port *resolve_port(const char *tag, device_t &current);
static device_t *resolve_device(int index, const char *tag, device_t &current); static device_t *resolve_device(int index, const char *tag, device_t &current);
static device_execute_interface *resolve_execute_interface(const char *tag, device_t &current); static device_execute_interface *resolve_execute_interface(const char *tag, device_t &current);
static address_space *resolve_space(int index, const char *tag, device_t &current); static address_space *resolve_space(int index, const char *tag, device_t &current);
@ -80,10 +80,10 @@ public:
// based on the provided tag // based on the provided tag
//------------------------------------------------- //-------------------------------------------------
const input_port_config *devcb_resolver::resolve_port(const char *tag, device_t &current) ioport_port *devcb_resolver::resolve_port(const char *tag, device_t &current)
{ {
astring fullname; astring fullname;
const input_port_config *result = current.ioport(current.siblingtag(fullname, tag)); ioport_port *result = current.ioport(current.siblingtag(fullname, tag));
if (result == NULL) if (result == NULL)
throw emu_fatalerror("Unable to find input port '%s' (requested by %s '%s')", fullname.cstr(), current.name(), current.tag()); throw emu_fatalerror("Unable to find input port '%s' (requested by %s '%s')", fullname.cstr(), current.name(), current.tag());
return result; return result;
@ -221,7 +221,7 @@ void devcb_resolved_read_line::resolve(const devcb_read_line &desc, device_t &de
int devcb_resolved_read_line::from_port() int devcb_resolved_read_line::from_port()
{ {
return (input_port_read_direct(m_object.port) & 1) ? ASSERT_LINE : CLEAR_LINE; return (m_object.port->read() & 1) ? ASSERT_LINE : CLEAR_LINE;
} }
@ -325,7 +325,7 @@ void devcb_resolved_write_line::to_null(int state)
void devcb_resolved_write_line::to_port(int state) void devcb_resolved_write_line::to_port(int state)
{ {
input_port_write_direct(m_object.port, state, 0xffffffff); m_object.port->write(state, 0xffffffff);
} }
@ -419,7 +419,7 @@ void devcb_resolved_read8::resolve(const devcb_read8 &desc, device_t &device)
UINT8 devcb_resolved_read8::from_port(offs_t offset) UINT8 devcb_resolved_read8::from_port(offs_t offset)
{ {
return input_port_read_direct(m_object.port); return m_object.port->read();
} }
@ -522,7 +522,7 @@ void devcb_resolved_write8::to_null(offs_t offset, UINT8 data)
void devcb_resolved_write8::to_port(offs_t offset, UINT8 data) void devcb_resolved_write8::to_port(offs_t offset, UINT8 data)
{ {
input_port_write_direct(m_object.port, data, 0xff); m_object.port->write(data, 0xff);
} }
@ -616,7 +616,7 @@ void devcb_resolved_read16::resolve(const devcb_read16 &desc, device_t &device)
UINT16 devcb_resolved_read16::from_port(offs_t offset, UINT16 mask) UINT16 devcb_resolved_read16::from_port(offs_t offset, UINT16 mask)
{ {
return input_port_read_direct(m_object.port); return m_object.port->read();
} }
@ -719,7 +719,7 @@ void devcb_resolved_write16::to_null(offs_t offset, UINT16 data, UINT16 mask)
void devcb_resolved_write16::to_port(offs_t offset, UINT16 data, UINT16 mask) void devcb_resolved_write16::to_port(offs_t offset, UINT16 data, UINT16 mask)
{ {
input_port_write_direct(m_object.port, data, mask); m_object.port->write(data, mask);
} }

View File

@ -203,7 +203,7 @@ void devcb_stub16(device_t *device, offs_t offset, UINT16 data, UINT16 mask)
// resolving a devcb may produce one of the following object types // resolving a devcb may produce one of the following object types
union devcb_resolved_objects union devcb_resolved_objects
{ {
const input_port_config * port; ioport_port * port;
address_space * space; address_space * space;
device_t * device; device_t * device;
device_execute_interface * execute; device_execute_interface * execute;

View File

@ -239,7 +239,7 @@ memory_bank *device_t::membank(const char *_tag) const
// object for a given port name // object for a given port name
//------------------------------------------------- //-------------------------------------------------
input_port_config *device_t::ioport(const char *tag) const ioport_port *device_t::ioport(const char *tag) const
{ {
// safety first // safety first
if (this == NULL) if (this == NULL)

View File

@ -95,7 +95,7 @@ class validity_checker;
struct rom_entry; struct rom_entry;
class machine_config; class machine_config;
class emu_timer; class emu_timer;
typedef struct _input_device_default input_device_default; struct input_device_default;
@ -188,7 +188,7 @@ public:
memory_region *memregion(const char *tag) const; memory_region *memregion(const char *tag) const;
memory_share *memshare(const char *tag) const; memory_share *memshare(const char *tag) const;
memory_bank *membank(const char *tag) const; memory_bank *membank(const char *tag) const;
input_port_config *ioport(const char *tag) const; ioport_port *ioport(const char *tag) const;
device_t *subdevice(const char *tag) const; device_t *subdevice(const char *tag) const;
device_t *siblingdevice(const char *tag) const; device_t *siblingdevice(const char *tag) const;
template<class _DeviceClass> inline _DeviceClass *subdevice(const char *tag) const { return downcast<_DeviceClass *>(subdevice(tag)); } template<class _DeviceClass> inline _DeviceClass *subdevice(const char *tag) const { return downcast<_DeviceClass *>(subdevice(tag)); }
@ -506,12 +506,12 @@ public:
// device finder template // device finder template
template<bool _Required> template<bool _Required>
class device_t::ioport_finder : public device_t::object_finder_base<input_port_config> class device_t::ioport_finder : public device_t::object_finder_base<ioport_port>
{ {
public: public:
// construction/destruction // construction/destruction
ioport_finder(device_t &base, const char *tag) ioport_finder(device_t &base, const char *tag)
: object_finder_base<input_port_config>(base, tag) { } : object_finder_base<ioport_port>(base, tag) { }
// finder // finder
virtual bool findit() virtual bool findit()
@ -927,36 +927,6 @@ private:
}; };
// ======================> device_delegate
// device_delegate is a delegate that wraps with a device tag and can be easily
// late bound without replicating logic everywhere
template<typename _Signature>
class device_delegate : public delegate<_Signature>
{
typedef delegate<_Signature> basetype;
public:
// provide same set of constructors as the base class, with additional device name
// parameter
device_delegate() : basetype(), m_device_name(NULL) { }
device_delegate(const basetype &src) : basetype(src), m_device_name(src.m_device_name) { }
device_delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object), m_device_name(src.m_device_name) { }
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
device_delegate(typename basetype::template traits<device_t>::static_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), m_device_name(NULL) { }
device_delegate(typename basetype::template traits<device_t>::static_ref_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), m_device_name(NULL) { }
device_delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; m_device_name = src.m_device_name; return *this; }
// perform the binding
void bind_relative_to(device_t &search_root);
private:
// internal state
const char *m_device_name;
};
//************************************************************************** //**************************************************************************
// INLINE FUNCTIONS // INLINE FUNCTIONS

View File

@ -81,6 +81,35 @@
class machine_config; class machine_config;
typedef device_t * (*machine_config_constructor)(machine_config &config, device_t *owner); typedef device_t * (*machine_config_constructor)(machine_config &config, device_t *owner);
// device_delegate is a delegate that wraps with a device tag and can be easily
// late bound without replicating logic everywhere
template<typename _Signature>
class device_delegate : public delegate<_Signature>
{
typedef delegate<_Signature> basetype;
public:
// provide same set of constructors as the base class, with additional device name
// parameter
device_delegate() : basetype(), m_device_name(NULL) { }
device_delegate(const basetype &src) : basetype(src), m_device_name(src.m_device_name) { }
device_delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object), m_device_name(src.m_device_name) { }
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
device_delegate(typename basetype::template traits<device_t>::static_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), m_device_name(NULL) { }
device_delegate(typename basetype::template traits<device_t>::static_ref_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), m_device_name(NULL) { }
device_delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; m_device_name = src.m_device_name; return *this; }
// perform the binding
void bind_relative_to(device_t &search_root);
private:
// internal state
const char *m_device_name;
};
// I/O // I/O
#include "input.h" #include "input.h"
#include "ioport.h" #include "ioport.h"

View File

@ -267,7 +267,7 @@ void info_xml_creator::output_one()
astring errors; astring errors;
device_iterator iter(config.root_device()); device_iterator iter(config.root_device());
for (device_t *device = iter.first(); device != NULL; device = iter.next()) for (device_t *device = iter.first(); device != NULL; device = iter.next())
input_port_list_init(*device, portlist, errors); portlist.append(*device, errors);
// print the header and the game name // print the header and the game name
fprintf(m_output, "\t<%s",emulator_info::get_xml_top()); fprintf(m_output, "\t<%s",emulator_info::get_xml_top());
@ -352,11 +352,11 @@ void info_xml_creator::output_one_device(device_t &device, const char *devtag)
astring errors; astring errors;
device_iterator iptiter(device); device_iterator iptiter(device);
for (device_t *dev = iptiter.first(); dev != NULL; dev = iptiter.next()) for (device_t *dev = iptiter.first(); dev != NULL; dev = iptiter.next())
input_port_list_init(*dev, portlist, errors); portlist.append(*dev, errors);
// check if the device adds player inputs (other than dsw and configs) to the system // check if the device adds player inputs (other than dsw and configs) to the system
for (input_port_config *port = portlist.first(); port != NULL; port = port->next()) for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next()) for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
if (field->type >= IPT_START1 && field->type < __ipt_ui_start) if (field->type() >= IPT_START1 && field->type() < IPT_UI_FIRST)
{ {
has_input = TRUE; has_input = TRUE;
break; break;
@ -830,33 +830,33 @@ void info_xml_creator::output_input(const ioport_list &portlist)
bool gambling = false; bool gambling = false;
// iterate over the ports // iterate over the ports
for (input_port_config *port = portlist.first(); port != NULL; port = port->next()) for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next()) for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
{ {
int analogtype = -1; int analogtype = -1;
// track the highest player number // track the highest player number
if (nplayer < field->player + 1) if (nplayer < field->player() + 1)
nplayer = field->player + 1; nplayer = field->player() + 1;
// switch off of the type // switch off of the type
switch (field->type) switch (field->type())
{ {
// map which joystick directions are present // map which joystick directions are present
case IPT_JOYSTICK_UP: joytype[0] |= DIR_UP | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICK_UP: joytype[0] |= DIR_UP | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICK_DOWN: joytype[0] |= DIR_DOWN | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICK_DOWN: joytype[0] |= DIR_DOWN | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICK_LEFT: joytype[0] |= DIR_LEFT | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICK_LEFT: joytype[0] |= DIR_LEFT | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICK_RIGHT: joytype[0] |= DIR_RIGHT | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICK_RIGHT: joytype[0] |= DIR_RIGHT | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICKLEFT_UP: joytype[1] |= DIR_UP | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICKLEFT_UP: joytype[1] |= DIR_UP | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICKLEFT_DOWN: joytype[1] |= DIR_DOWN | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICKLEFT_DOWN: joytype[1] |= DIR_DOWN | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICKLEFT_LEFT: joytype[1] |= DIR_LEFT | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICKLEFT_LEFT: joytype[1] |= DIR_LEFT | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICKLEFT_RIGHT: joytype[1] |= DIR_RIGHT | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICKLEFT_RIGHT: joytype[1] |= DIR_RIGHT | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICKRIGHT_UP: joytype[2] |= DIR_UP | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICKRIGHT_UP: joytype[2] |= DIR_UP | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICKRIGHT_DOWN: joytype[2] |= DIR_DOWN | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICKRIGHT_DOWN: joytype[2] |= DIR_DOWN | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICKRIGHT_LEFT: joytype[2] |= DIR_LEFT | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICKRIGHT_LEFT: joytype[2] |= DIR_LEFT | ((field->way() == 4) ? DIR_4WAY : 0); break;
case IPT_JOYSTICKRIGHT_RIGHT: joytype[2] |= DIR_RIGHT | ((field->way == 4) ? DIR_4WAY : 0); break; case IPT_JOYSTICKRIGHT_RIGHT: joytype[2] |= DIR_RIGHT | ((field->way() == 4) ? DIR_4WAY : 0); break;
// mark as an analog input, and get analog stats after switch // mark as an analog input, and get analog stats after switch
case IPT_AD_STICK_X: case IPT_AD_STICK_X:
@ -918,7 +918,7 @@ void info_xml_creator::output_input(const ioport_list &portlist)
case IPT_BUTTON14: case IPT_BUTTON14:
case IPT_BUTTON15: case IPT_BUTTON15:
case IPT_BUTTON16: case IPT_BUTTON16:
nbutton = MAX(nbutton, field->type - IPT_BUTTON1 + 1); nbutton = MAX(nbutton, field->type() - IPT_BUTTON1 + 1);
break; break;
// track maximum coin index // track maximum coin index
@ -930,7 +930,7 @@ void info_xml_creator::output_input(const ioport_list &portlist)
case IPT_COIN6: case IPT_COIN6:
case IPT_COIN7: case IPT_COIN7:
case IPT_COIN8: case IPT_COIN8:
ncoin = MAX(ncoin, field->type - IPT_COIN1 + 1); ncoin = MAX(ncoin, field->type() - IPT_COIN1 + 1);
break; break;
// track presence of these guys // track presence of these guys
@ -952,11 +952,11 @@ void info_xml_creator::output_input(const ioport_list &portlist)
break; break;
default: default:
if (field->type >= __ipt_mahjong_start && field->type <= __ipt_mahjong_end) if (field->type() > IPT_MAHJONG_FIRST && field->type() < IPT_MAHJONG_LAST)
mahjong = true; mahjong = true;
else if (field->type >= __ipt_hanafuda_start && field->type <= __ipt_hanafuda_end) else if (field->type() > IPT_HANAFUDA_FIRST && field->type() < IPT_HANAFUDA_LAST)
hanafuda = true; hanafuda = true;
else if (field->type >= __ipt_gambling_start && field->type <= __ipt_gambling_end) else if (field->type() > IPT_GAMBLING_FIRST && field->type() < IPT_GAMBLING_LAST)
gambling = true; gambling = true;
break; break;
} }
@ -964,15 +964,15 @@ void info_xml_creator::output_input(const ioport_list &portlist)
// get the analog stats // get the analog stats
if (analogtype != -1) if (analogtype != -1)
{ {
if (field->min != 0) if (field->minval() != 0)
control_info[analogtype].min = field->min; control_info[analogtype].min = field->minval();
if (field->max != 0) if (field->maxval() != 0)
control_info[analogtype].max = field->max; control_info[analogtype].max = field->maxval();
if (field->sensitivity != 0) if (field->sensitivity() != 0)
control_info[analogtype].sensitivity = field->sensitivity; control_info[analogtype].sensitivity = field->sensitivity();
if (field->delta != 0) if (field->delta() != 0)
control_info[analogtype].keydelta = field->delta; control_info[analogtype].keydelta = field->delta();
if ((field->flags & ANALOG_FLAG_REVERSE) != 0) if (field->analog_reverse() != 0)
control_info[analogtype].reverse = true; control_info[analogtype].reverse = true;
} }
} }
@ -1080,25 +1080,25 @@ void info_xml_creator::output_input(const ioport_list &portlist)
void info_xml_creator::output_switches(const ioport_list &portlist, const char *root_tag, int type, const char *outertag, const char *innertag) void info_xml_creator::output_switches(const ioport_list &portlist, const char *root_tag, int type, const char *outertag, const char *innertag)
{ {
// iterate looking for DIP switches // iterate looking for DIP switches
for (input_port_config *port = portlist.first(); port != NULL; port = port->next()) for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next()) for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
if (field->type == type) if (field->type() == type)
{ {
astring newtag(field->port().tag()), oldtag(":"); astring newtag(port->tag()), oldtag(":");
newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len()); newtag.substr(newtag.find(oldtag.cat(root_tag)) + oldtag.len());
// output the switch name information // output the switch name information
fprintf(m_output, "\t\t<%s name=\"%s\"", outertag, xml_normalize_string(input_field_name(field))); fprintf(m_output, "\t\t<%s name=\"%s\"", outertag, xml_normalize_string(field->name()));
fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag)); fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag));
fprintf(m_output, " mask=\"%u\"", field->mask); fprintf(m_output, " mask=\"%u\"", field->mask());
fprintf(m_output, ">\n"); fprintf(m_output, ">\n");
// loop over settings // loop over settings
for (input_setting_config *setting = field->settinglist().first(); setting != NULL; setting = setting->next()) for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
{ {
fprintf(m_output, "\t\t\t<%s name=\"%s\"", innertag, xml_normalize_string(setting->name)); fprintf(m_output, "\t\t\t<%s name=\"%s\"", innertag, xml_normalize_string(setting->name()));
fprintf(m_output, " value=\"%u\"", setting->value); fprintf(m_output, " value=\"%u\"", setting->value());
if (setting->value == field->defvalue) if (setting->value() == field->defvalue())
fprintf(m_output, " default=\"yes\""); fprintf(m_output, " default=\"yes\"");
fprintf(m_output, "/>\n"); fprintf(m_output, "/>\n");
} }
@ -1117,10 +1117,10 @@ void info_xml_creator::output_switches(const ioport_list &portlist, const char *
void info_xml_creator::output_adjusters(const ioport_list &portlist) void info_xml_creator::output_adjusters(const ioport_list &portlist)
{ {
// iterate looking for Adjusters // iterate looking for Adjusters
for (input_port_config *port = portlist.first(); port != NULL; port = port->next()) for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next()) for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
if (field->type == IPT_ADJUSTER) if (field->type() == IPT_ADJUSTER)
fprintf(m_output, "\t\t<adjuster name=\"%s\" default=\"%d\"/>\n", xml_normalize_string(input_field_name(field)), field->defvalue); fprintf(m_output, "\t\t<adjuster name=\"%s\" default=\"%d\"/>\n", xml_normalize_string(field->name()), field->defvalue());
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -284,9 +284,6 @@ void running_machine::start()
// allocate the gfx elements prior to device initialization // allocate the gfx elements prior to device initialization
gfx_init(*this); gfx_init(*this);
// initialize natural keyboard support
inputx_init(*this);
// initialize image devices // initialize image devices
image_init(*this); image_init(*this);
m_tilemap = auto_alloc(*this, tilemap_manager(*this)); m_tilemap = auto_alloc(*this, tilemap_manager(*this));

View File

@ -528,7 +528,7 @@ void set_led_status(running_machine &machine, int num, int on)
CUSTOM_INPUT_MEMBER( driver_device::custom_port_read ) CUSTOM_INPUT_MEMBER( driver_device::custom_port_read )
{ {
const char *tag = (const char *)param; const char *tag = (const char *)param;
return input_port_read(machine(), tag); return ioport(tag)->read();
} }

View File

@ -249,6 +249,6 @@ void jvs_device::handle_output(const char *tag, UINT8 id, UINT8 val)
case 2: jvs_outputs ^= m; break; case 2: jvs_outputs ^= m; break;
} }
input_port_write_safe(machine(), tag, jvs_outputs, m); machine().root_device().ioport(tag)->write_safe(jvs_outputs, m);
} }

View File

@ -82,8 +82,8 @@ void microtouch_device::send_format_decimal_packet(int x, int y)
void microtouch_device::send_touch_packet() void microtouch_device::send_touch_packet()
{ {
int tx = input_port_read(*this, "TOUCH_X"); int tx = ioport("TOUCH_X")->read();
int ty = input_port_read(*this, "TOUCH_Y"); int ty = ioport("TOUCH_Y")->read();
if ( m_out_touch_cb == NULL || if ( m_out_touch_cb == NULL ||
m_out_touch_cb( &tx, &ty ) != 0 ) m_out_touch_cb( &tx, &ty ) != 0 )
@ -127,7 +127,7 @@ void microtouch_device::device_timer(emu_timer &timer, device_timer_id id, int p
} }
// send format tablet packet // send format tablet packet
if ( input_port_read(*this, "TOUCH") & 0x01 ) if ( ioport("TOUCH")->read() & 0x01 )
{ {
send_touch_packet(); send_touch_packet();
} }

View File

@ -397,7 +397,7 @@ public:
void set_legacy_func(device_t &device, read64_device_func func, const char *name, UINT64 mask = 0); void set_legacy_func(device_t &device, read64_device_func func, const char *name, UINT64 mask = 0);
// configure I/O port access // configure I/O port access
void set_ioport(const input_port_config &ioport); void set_ioport(ioport_port &ioport);
// read via the underlying delegates // read via the underlying delegates
UINT8 read8(address_space &space, offs_t offset, UINT8 mask) const { return m_read.r8(space, offset, mask); } UINT8 read8(address_space &space, offs_t offset, UINT8 mask) const { return m_read.r8(space, offset, mask); }
@ -419,7 +419,7 @@ private:
// stubs for reading I/O ports // stubs for reading I/O ports
template<typename _UintType> template<typename _UintType>
_UintType read_stub_ioport(address_space &space, offs_t offset, _UintType mask) { return input_port_read_direct(m_ioport); } _UintType read_stub_ioport(address_space &space, offs_t offset, _UintType mask) { return m_ioport->read(); }
// internal helper // internal helper
virtual void remove_subunit(int entry); virtual void remove_subunit(int entry);
@ -427,7 +427,7 @@ private:
// internal state // internal state
access_handler m_read; access_handler m_read;
access_handler m_subread[8]; access_handler m_subread[8];
const input_port_config * m_ioport; ioport_port * m_ioport;
bool m_sub_is_legacy[8]; bool m_sub_is_legacy[8];
legacy_info m_legacy_info; legacy_info m_legacy_info;
@ -504,7 +504,7 @@ public:
void set_legacy_func(device_t &device, write64_device_func func, const char *name, UINT64 mask = 0); void set_legacy_func(device_t &device, write64_device_func func, const char *name, UINT64 mask = 0);
// configure I/O port access // configure I/O port access
void set_ioport(const input_port_config &ioport); void set_ioport(ioport_port &ioport);
// write via the underlying delegates // write via the underlying delegates
void write8(address_space &space, offs_t offset, UINT8 data, UINT8 mask) const { m_write.w8(space, offset, data, mask); } void write8(address_space &space, offs_t offset, UINT8 data, UINT8 mask) const { m_write.w8(space, offset, data, mask); }
@ -526,7 +526,7 @@ private:
// stubs for writing I/O ports // stubs for writing I/O ports
template<typename _UintType> template<typename _UintType>
void write_stub_ioport(address_space &space, offs_t offset, _UintType data, _UintType mask) { input_port_write_direct(m_ioport, data, mask); } void write_stub_ioport(address_space &space, offs_t offset, _UintType data, _UintType mask) { m_ioport->write(data, mask); }
// internal helper // internal helper
virtual void remove_subunit(int entry); virtual void remove_subunit(int entry);
@ -534,7 +534,7 @@ private:
// internal state // internal state
access_handler m_write; access_handler m_write;
access_handler m_subwrite[8]; access_handler m_subwrite[8];
const input_port_config * m_ioport; ioport_port * m_ioport;
bool m_sub_is_legacy[8]; bool m_sub_is_legacy[8];
legacy_info m_legacy_info; legacy_info m_legacy_info;
@ -571,7 +571,7 @@ public:
} }
// forward I/O port access configuration // forward I/O port access configuration
void set_ioport(const input_port_config &ioport) const { void set_ioport(ioport_port &ioport) const {
for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); i++) for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); i++)
(*i)->set_ioport(ioport); (*i)->set_ioport(ioport);
} }
@ -2323,7 +2323,7 @@ void address_space::install_readwrite_port(offs_t addrstart, offs_t addrend, off
{ {
// find the port // find the port
astring fulltag; astring fulltag;
input_port_config *port = machine().root_device().ioport(device().siblingtag(fulltag, rtag)); ioport_port *port = machine().root_device().ioport(device().siblingtag(fulltag, rtag));
if (port == NULL) if (port == NULL)
throw emu_fatalerror("Attempted to map non-existent port '%s' for read in space %s of device '%s'\n", rtag, m_name, m_device.tag()); throw emu_fatalerror("Attempted to map non-existent port '%s' for read in space %s of device '%s'\n", rtag, m_name, m_device.tag());
@ -2335,7 +2335,7 @@ void address_space::install_readwrite_port(offs_t addrstart, offs_t addrend, off
{ {
// find the port // find the port
astring fulltag; astring fulltag;
input_port_config *port = machine().root_device().ioport(device().siblingtag(fulltag, wtag)); ioport_port *port = machine().root_device().ioport(device().siblingtag(fulltag, wtag));
if (port == NULL) if (port == NULL)
fatalerror("Attempted to map non-existent port '%s' for write in space %s of device '%s'\n", wtag, m_name, m_device.tag()); fatalerror("Attempted to map non-existent port '%s' for write in space %s of device '%s'\n", wtag, m_name, m_device.tag());
@ -4958,7 +4958,7 @@ void handler_entry_read::set_legacy_func(device_t &device, read64_device_func fu
// of the appropriate size // of the appropriate size
//------------------------------------------------- //-------------------------------------------------
void handler_entry_read::set_ioport(const input_port_config &ioport) void handler_entry_read::set_ioport(ioport_port &ioport)
{ {
m_ioport = &ioport; m_ioport = &ioport;
if (m_datawidth == 8) if (m_datawidth == 8)
@ -5413,7 +5413,7 @@ void handler_entry_write::set_legacy_func(device_t &device, write64_device_func
// of the appropriate size // of the appropriate size
//------------------------------------------------- //-------------------------------------------------
void handler_entry_write::set_ioport(const input_port_config &ioport) void handler_entry_write::set_ioport(ioport_port &ioport)
{ {
m_ioport = &ioport; m_ioport = &ioport;
if (m_datawidth == 8) if (m_datawidth == 8)

View File

@ -2208,9 +2208,13 @@ int layout_view::item::state() const
// if configured to an input, fetch the input value // if configured to an input, fetch the input value
else if (m_input_tag[0] != 0) else if (m_input_tag[0] != 0)
{ {
const input_field_config *field = input_field_by_tag_and_mask(m_element->machine(), m_input_tag, m_input_mask); ioport_port *port = m_element->machine().root_device().ioport(m_input_tag);
if (port != NULL)
{
ioport_field *field = port->field(m_input_mask);
if (field != NULL) if (field != NULL)
state = ((input_port_read_safe(m_element->machine(), m_input_tag, 0) ^ field->defvalue) & m_input_mask) ? 1 : 0; state = ((port->read() ^ field->defvalue()) & m_input_mask) ? 1 : 0;
}
} }
return state; return state;
} }

View File

@ -781,6 +781,17 @@ 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();
}
//------------------------------------------------- //-------------------------------------------------
// vblank_begin - call any external callbacks to // vblank_begin - call any external callbacks to
// signal the VBLANK period has begun // signal the VBLANK period has begun

View File

@ -227,6 +227,7 @@ public:
// additional helpers // additional helpers
void register_vblank_callback(vblank_state_delegate vblank_callback); void register_vblank_callback(vblank_state_delegate vblank_callback);
void register_screen_bitmap(bitmap_t &bitmap); void register_screen_bitmap(bitmap_t &bitmap);
int vblank_port_read();
// internal to the video system // internal to the video system
bool update_quads(); bool update_quads();

View File

@ -149,7 +149,7 @@ public:
void step(void); void step(void);
void reset(void); void reset(void);
private: private:
const input_port_config *m_port; ioport_port *m_port;
INT32 m_lastpval; INT32 m_lastpval;
INT32 m_pmin; INT32 m_pmin;
double m_pscale; double m_pscale;

View File

@ -55,7 +55,7 @@ WRITE8_DEVICE_HANDLER(discrete_sound_w)
DISCRETE_STEP(dss_adjustment) DISCRETE_STEP(dss_adjustment)
{ {
INT32 rawportval = input_port_read_direct(m_port); INT32 rawportval = m_port->read();
/* only recompute if the value changed from last time */ /* only recompute if the value changed from last time */
if (UNEXPECTED(rawportval != m_lastpval)) if (UNEXPECTED(rawportval != m_lastpval))

View File

@ -935,7 +935,7 @@ static astring &warnings_string(running_machine &machine, astring &string)
string.cat(" have not been correctly dumped.\n"); string.cat(" have not been correctly dumped.\n");
} }
/* add one line per warning flag */ /* add one line per warning flag */
if (input_machine_has_keyboard(machine)) if (machine.ioport().has_keyboard())
string.cat("The keyboard emulation may not be 100% accurate.\n"); string.cat("The keyboard emulation may not be 100% accurate.\n");
if (machine.system().flags & GAME_IMPERFECT_COLORS) if (machine.system().flags & GAME_IMPERFECT_COLORS)
string.cat("The colors aren't 100% accurate.\n"); string.cat("The colors aren't 100% accurate.\n");
@ -1213,7 +1213,7 @@ static void process_natural_keyboard(running_machine &machine)
{ {
/* if this was a UI_EVENT_CHAR event, post it */ /* if this was a UI_EVENT_CHAR event, post it */
if (event.event_type == UI_EVENT_CHAR) if (event.event_type == UI_EVENT_CHAR)
inputx_postc(machine, event.ch); machine.ioport().natkeyboard().post(event.ch);
} }
/* process natural keyboard keys that don't get UI_EVENT_CHARs */ /* process natural keyboard keys that don't get UI_EVENT_CHARs */
@ -1236,7 +1236,7 @@ static void process_natural_keyboard(running_machine &machine)
*key_down_ptr |= key_down_mask; *key_down_ptr |= key_down_mask;
/* post the key */ /* post the key */
inputx_postc(machine, UCHAR_MAMEKEY_BEGIN + code.item_id()); machine.ioport().natkeyboard().post(UCHAR_MAMEKEY_BEGIN + code.item_id());
} }
else if (!pressed && (*key_down_ptr & key_down_mask)) else if (!pressed && (*key_down_ptr & key_down_mask))
{ {
@ -1259,7 +1259,7 @@ void ui_paste(running_machine &machine)
if (text != NULL) if (text != NULL)
{ {
/* post the text */ /* post the text */
inputx_post_utf8(machine, text); machine.ioport().natkeyboard().post_utf8(text);
/* free the string */ /* free the string */
osd_free(text); osd_free(text);
@ -1317,10 +1317,10 @@ static UINT32 handler_ingame(running_machine &machine, render_container *contain
} }
/* determine if we should disable the rest of the UI */ /* determine if we should disable the rest of the UI */
int ui_disabled = (input_machine_has_keyboard(machine) && !machine.ui_active()); int ui_disabled = (machine.ioport().has_keyboard() && !machine.ui_active());
/* is ScrLk UI toggling applicable here? */ /* is ScrLk UI toggling applicable here? */
if (input_machine_has_keyboard(machine)) if (machine.ioport().has_keyboard())
{ {
/* are we toggling the UI with ScrLk? */ /* are we toggling the UI with ScrLk? */
if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI)) if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI))
@ -1488,7 +1488,7 @@ static UINT32 handler_ingame(running_machine &machine, render_container *contain
machine.video().set_throttled(!machine.video().throttled()); machine.video().set_throttled(!machine.video().throttled());
/* check for fast forward */ /* check for fast forward */
if (input_type_pressed(machine, IPT_UI_FAST_FORWARD, 0)) if (machine.ioport().type_pressed(IPT_UI_FAST_FORWARD))
{ {
machine.video().set_fastforward(true); machine.video().set_fastforward(true);
ui_show_fps_temp(0.5); ui_show_fps_temp(0.5);
@ -1640,8 +1640,8 @@ static slider_state *slider_alloc(running_machine &machine, const char *title, I
static slider_state *slider_init(running_machine &machine) static slider_state *slider_init(running_machine &machine)
{ {
input_field_config *field; ioport_field *field;
input_port_config *port; ioport_port *port;
slider_state *listhead = NULL; slider_state *listhead = NULL;
slider_state **tailptr = &listhead; slider_state **tailptr = &listhead;
astring string; astring string;
@ -1666,11 +1666,11 @@ static slider_state *slider_init(running_machine &machine)
/* add analog adjusters */ /* add analog adjusters */
for (port = machine.ioport().first_port(); port != NULL; port = port->next()) for (port = machine.ioport().first_port(); port != NULL; port = port->next())
for (field = port->fieldlist().first(); field != NULL; field = field->next()) for (field = port->first_field(); field != NULL; field = field->next())
if (field->type == IPT_ADJUSTER) if (field->type() == IPT_ADJUSTER)
{ {
void *param = (void *)field; void *param = (void *)field;
*tailptr = slider_alloc(machine, field->name, 0, field->defvalue, 100, 1, slider_adjuster, param); *tailptr = slider_alloc(machine, field->name(), 0, field->defvalue(), 100, 1, slider_adjuster, param);
tailptr = &(*tailptr)->next; tailptr = &(*tailptr)->next;
} }
@ -1772,14 +1772,14 @@ static slider_state *slider_init(running_machine &machine)
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
/* add crosshair adjusters */ /* add crosshair adjusters */
for (port = machine.ioport().first_port(); port != NULL; port = port->next()) for (port = machine.ioport().first_port(); port != NULL; port = port->next())
for (field = port->fieldlist().first(); field != NULL; field = field->next()) for (field = port->first_field(); field != NULL; field = field->next())
if (field->crossaxis != CROSSHAIR_AXIS_NONE && field->player == 0) if (field->crosshair_axis() != CROSSHAIR_AXIS_NONE && field->player() == 0)
{ {
void *param = (void *)field; void *param = (void *)field;
string.printf("Crosshair Scale %s", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y"); string.printf("Crosshair Scale %s", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y");
*tailptr = slider_alloc(machine, string, -3000, 1000, 3000, 100, slider_crossscale, param); *tailptr = slider_alloc(machine, string, -3000, 1000, 3000, 100, slider_crossscale, param);
tailptr = &(*tailptr)->next; tailptr = &(*tailptr)->next;
string.printf("Crosshair Offset %s", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y"); string.printf("Crosshair Offset %s", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y");
*tailptr = slider_alloc(machine, string, -3000, 0, 3000, 100, slider_crossoffset, param); *tailptr = slider_alloc(machine, string, -3000, 0, 3000, 100, slider_crossoffset, param);
tailptr = &(*tailptr)->next; tailptr = &(*tailptr)->next;
} }
@ -1832,14 +1832,14 @@ static INT32 slider_mixervol(running_machine &machine, void *arg, astring *strin
static INT32 slider_adjuster(running_machine &machine, void *arg, astring *string, INT32 newval) static INT32 slider_adjuster(running_machine &machine, void *arg, astring *string, INT32 newval)
{ {
const input_field_config *field = (const input_field_config *)arg; ioport_field *field = (ioport_field *)arg;
input_field_user_settings settings; ioport_field::user_settings settings;
input_field_get_user_settings(field, &settings); field->get_user_settings(settings);
if (newval != SLIDER_NOCHANGE) if (newval != SLIDER_NOCHANGE)
{ {
settings.value = newval; settings.value = newval;
input_field_set_user_settings(field, &settings); field->set_user_settings(settings);
} }
if (string != NULL) if (string != NULL)
string->printf("%d%%", settings.value); string->printf("%d%%", settings.value);
@ -2185,13 +2185,13 @@ static char *slider_get_screen_desc(screen_device &screen)
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval) static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{ {
input_field_config *field = (input_field_config *)arg; ioport_field *field = (ioport_field *)arg;
if (newval != SLIDER_NOCHANGE) if (newval != SLIDER_NOCHANGE)
field->crossscale = (float)newval * 0.001f; field->set_crosshair_scale(float(newval) * 0.001);
if (string != NULL) if (string != NULL)
string->printf("%s %s %1.3f", "Crosshair Scale", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y", (float)newval * 0.001f); string->printf("%s %s %1.3f", "Crosshair Scale", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
return floor(field->crossscale * 1000.0f + 0.5f); return floor(field->crosshair_scale() * 1000.0f + 0.5f);
} }
#endif #endif
@ -2204,13 +2204,13 @@ static INT32 slider_crossscale(running_machine &machine, void *arg, astring *str
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval) static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{ {
input_field_config *field = (input_field_config *)arg; ioport_field *field = (ioport_field *)arg;
if (newval != SLIDER_NOCHANGE) if (newval != SLIDER_NOCHANGE)
field->crossoffset = (float)newval * 0.001f; field->set_crosshair_offset(float(newval) * 0.001f);
if (string != NULL) if (string != NULL)
string->printf("%s %s %1.3f", "Crosshair Offset", (field->crossaxis == CROSSHAIR_AXIS_X) ? "X" : "Y", (float)newval * 0.001f); string->printf("%s %s %1.3f", "Crosshair Offset", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
return field->crossoffset; return field->crosshair_offset();
} }
#endif #endif

View File

@ -37,8 +37,8 @@ enum
struct _ui_input_private struct _ui_input_private
{ {
/* pressed states; retrieved with ui_input_pressed() */ /* pressed states; retrieved with ui_input_pressed() */
osd_ticks_t next_repeat[__ipt_max]; osd_ticks_t next_repeat[IPT_COUNT];
UINT8 seqpressed[__ipt_max]; UINT8 seqpressed[IPT_COUNT];
/* mouse position/info */ /* mouse position/info */
render_target * current_mouse_target; render_target * current_mouse_target;
@ -97,12 +97,11 @@ void ui_input_init(running_machine &machine)
void ui_input_frame_update(running_machine &machine) void ui_input_frame_update(running_machine &machine)
{ {
ui_input_private *uidata = machine.ui_input_data; ui_input_private *uidata = machine.ui_input_data;
int code;
/* update the state of all the UI keys */ /* update the state of all the UI keys */
for (code = __ipt_ui_start; code <= __ipt_ui_end; code++) for (ioport_type code = ioport_type(IPT_UI_FIRST + 1); code < IPT_UI_LAST; code++)
{ {
int pressed = machine.input().seq_pressed(input_type_seq(machine, code, 0, SEQ_TYPE_STANDARD)); bool pressed = machine.ioport().type_pressed(code);
if (!pressed || uidata->seqpressed[code] != SEQ_PRESSED_RESET) if (!pressed || uidata->seqpressed[code] != SEQ_PRESSED_RESET)
uidata->seqpressed[code] = pressed; uidata->seqpressed[code] = pressed;
} }
@ -199,7 +198,7 @@ void ui_input_reset(running_machine &machine)
uidata->events_start = 0; uidata->events_start = 0;
uidata->events_end = 0; uidata->events_end = 0;
for (code = __ipt_ui_start; code <= __ipt_ui_end; code++) for (code = IPT_UI_FIRST + 1; code < IPT_UI_LAST; code++)
{ {
uidata->seqpressed[code] = SEQ_PRESSED_RESET; uidata->seqpressed[code] = SEQ_PRESSED_RESET;
uidata->next_repeat[code] = 0; uidata->next_repeat[code] = 0;

View File

@ -109,8 +109,8 @@ ui_menu_main::ui_menu_main(running_machine &machine, render_container *container
void ui_menu_main::populate() void ui_menu_main::populate()
{ {
input_field_config *field; ioport_field *field;
input_port_config *port; ioport_port *port;
int has_configs = false; int has_configs = false;
int has_analog = false; int has_analog = false;
int has_dips = false; int has_dips = false;
@ -118,13 +118,13 @@ void ui_menu_main::populate()
astring menu_text; astring menu_text;
/* scan the input port array to see what options we need to enable */ /* scan the input port array to see what options we need to enable */
for (port = machine().ioport().first_port(); port != NULL; port = port->next()) for (port = machine().ioport().first_port(); port != NULL; port = port->next())
for (field = port->fieldlist().first(); field != NULL; field = field->next()) for (field = port->first_field(); field != NULL; field = field->next())
{ {
if (field->type == IPT_DIPSWITCH) if (field->type() == IPT_DIPSWITCH)
has_dips = true; has_dips = true;
if (field->type == IPT_CONFIG) if (field->type() == IPT_CONFIG)
has_configs = true; has_configs = true;
if (input_type_is_analog(field->type)) if (field->is_analog())
has_analog = true; has_analog = true;
} }
device_iterator deviter(machine().root_device()); device_iterator deviter(machine().root_device());
@ -192,7 +192,7 @@ void ui_menu_main::populate()
} }
/* add keyboard mode menu */ /* add keyboard mode menu */
if (input_machine_has_keyboard(machine()) && inputx_can_post(machine())) if (machine().ioport().has_keyboard() && machine().ioport().natkeyboard().can_post())
item_append("Keyboard Mode", NULL, 0, (void *)KEYBOARD_MODE); item_append("Keyboard Mode", NULL, 0, (void *)KEYBOARD_MODE);
/* add sliders menu */ /* add sliders menu */
@ -671,10 +671,10 @@ void ui_menu_input_general::populate()
suborder[SEQ_TYPE_INCREMENT] = 2; suborder[SEQ_TYPE_INCREMENT] = 2;
/* iterate over the input ports and add menu items */ /* iterate over the input ports and add menu items */
for (input_type_entry *entry = input_type_list(machine()).first(); entry != NULL; entry = entry->next()) for (input_type_entry *entry = machine().ioport().first_type(); entry != NULL; entry = entry->next())
/* add if we match the group and we have a valid name */ /* add if we match the group and we have a valid name */
if (entry->group == group && entry->name != NULL && entry->name[0] != 0) if (entry->group() == group && entry->name() != NULL && entry->name()[0] != 0)
{ {
input_seq_type seqtype; input_seq_type seqtype;
@ -689,11 +689,11 @@ void ui_menu_input_general::populate()
if(pollingitem && pollingref == entry && pollingseq == seqtype) if(pollingitem && pollingref == entry && pollingseq == seqtype)
pollingitem = item; pollingitem = item;
item->seqtype = seqtype; item->seqtype = seqtype;
item->seq = input_type_seq(machine(), entry->type, entry->player, seqtype); item->seq = machine().ioport().type_seq(entry->type(), entry->player(), seqtype);
item->defseq = &entry->defseq[seqtype]; item->defseq = &entry->defseq(seqtype);
item->sortorder = sortorder * 4 + suborder[seqtype]; item->sortorder = sortorder * 4 + suborder[seqtype];
item->type = input_type_is_analog(entry->type) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL; item->type = ioport_manager::type_is_analog(entry->type()) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
item->name = entry->name; item->name = entry->name();
item->next = itemlist; item->next = itemlist;
itemlist = item; itemlist = item;
@ -723,8 +723,8 @@ ui_menu_input_specific::ui_menu_input_specific(running_machine &machine, render_
void ui_menu_input_specific::populate() void ui_menu_input_specific::populate()
{ {
input_item_data *itemlist = NULL; input_item_data *itemlist = NULL;
input_field_config *field; ioport_field *field;
input_port_config *port; ioport_port *port;
int suborder[SEQ_TYPE_TOTAL]; int suborder[SEQ_TYPE_TOTAL];
astring tempstring; astring tempstring;
@ -735,22 +735,22 @@ void ui_menu_input_specific::populate()
/* iterate over the input ports and add menu items */ /* iterate over the input ports and add menu items */
for (port = machine().ioport().first_port(); port != NULL; port = port->next()) for (port = machine().ioport().first_port(); port != NULL; port = port->next())
for (field = port->fieldlist().first(); field != NULL; field = field->next()) for (field = port->first_field(); field != NULL; field = field->next())
{ {
const char *name = input_field_name(field); const char *name = field->name();
/* add if we match the group and we have a valid name */ /* add if we match the group and we have a valid name */
if (name != NULL && input_condition_true(machine(), &field->condition, port->owner()) && if (name != NULL && field->enabled() &&
((field->type == IPT_OTHER && field->name != NULL) || input_type_group(machine(), field->type, field->player) != IPG_INVALID)) ((field->type() == IPT_OTHER && field->name() != NULL) || machine().ioport().type_group(field->type(), field->player()) != IPG_INVALID))
{ {
input_seq_type seqtype; input_seq_type seqtype;
UINT16 sortorder; UINT16 sortorder;
/* determine the sorting order */ /* determine the sorting order */
if (field->type >= IPT_START1 && field->type <= __ipt_analog_end) if (field->type() >= IPT_START1 && field->type() < IPT_ANALOG_LAST)
sortorder = (field->type << 2) | (field->player << 12); sortorder = (field->type() << 2) | (field->player() << 12);
else else
sortorder = field->type | 0xf000; sortorder = field->type() | 0xf000;
/* loop over all sequence types */ /* loop over all sequence types */
for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
@ -762,10 +762,10 @@ void ui_menu_input_specific::populate()
item->seqtype = seqtype; item->seqtype = seqtype;
if(pollingitem && pollingref == field && pollingseq == seqtype) if(pollingitem && pollingref == field && pollingseq == seqtype)
pollingitem = item; pollingitem = item;
item->seq = input_field_seq(field, seqtype); item->seq = field->seq(seqtype);
item->defseq = &get_field_default_seq(field, seqtype); item->defseq = &get_field_default_seq(field, seqtype);
item->sortorder = sortorder + suborder[seqtype]; item->sortorder = sortorder + suborder[seqtype];
item->type = input_type_is_analog(field->type) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL; item->type = field->is_analog() ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL;
item->name = name; item->name = name;
item->next = itemlist; item->next = itemlist;
itemlist = item; itemlist = item;
@ -820,12 +820,12 @@ void ui_menu_input::toggle_none_default(input_seq &selected_seq, input_seq &orig
to the default sequence for the given field to the default sequence for the given field
-------------------------------------------------*/ -------------------------------------------------*/
const input_seq &ui_menu_input::get_field_default_seq(input_field_config *field, input_seq_type seqtype) const input_seq &ui_menu_input::get_field_default_seq(ioport_field *field, input_seq_type seqtype)
{ {
if (field->seq[seqtype].is_default()) if (field->seq(seqtype).is_default())
return input_type_seq(field->machine(), field->type, field->player, seqtype); return field->machine().ioport().type_seq(field->type(), field->player(), seqtype);
else else
return field->seq[seqtype]; return field->seq(seqtype);
} }
void ui_menu_input::handle() void ui_menu_input::handle()
@ -916,16 +916,16 @@ void ui_menu_input::handle()
void ui_menu_input_general::update_input(struct input_item_data *seqchangeditem) void ui_menu_input_general::update_input(struct input_item_data *seqchangeditem)
{ {
const input_type_entry *entry = (const input_type_entry *)seqchangeditem->ref; const input_type_entry *entry = (const input_type_entry *)seqchangeditem->ref;
input_type_set_seq(machine(), entry->type, entry->player, seqchangeditem->seqtype, &seqchangeditem->seq); machine().ioport().set_type_seq(entry->type(), entry->player(), seqchangeditem->seqtype, seqchangeditem->seq);
} }
void ui_menu_input_specific::update_input(struct input_item_data *seqchangeditem) void ui_menu_input_specific::update_input(struct input_item_data *seqchangeditem)
{ {
input_field_user_settings settings; ioport_field::user_settings settings;
input_field_get_user_settings((input_field_config *)seqchangeditem->ref, &settings); ((ioport_field *)seqchangeditem->ref)->get_user_settings(settings);
settings.seq[seqchangeditem->seqtype] = seqchangeditem->seq; settings.seq[seqchangeditem->seqtype] = seqchangeditem->seq;
input_field_set_user_settings((input_field_config *)seqchangeditem->ref, &settings); ((ioport_field *)seqchangeditem->ref)->set_user_settings(settings);
} }
@ -1047,29 +1047,29 @@ void ui_menu_settings::handle()
/* handle events */ /* handle events */
if (menu_event != NULL && menu_event->itemref != NULL) if (menu_event != NULL && menu_event->itemref != NULL)
{ {
input_field_config *field = (input_field_config *)menu_event->itemref; ioport_field *field = (ioport_field *)menu_event->itemref;
input_field_user_settings settings; ioport_field::user_settings settings;
int changed = false; int changed = false;
switch (menu_event->iptkey) switch (menu_event->iptkey)
{ {
/* if selected, reset to default value */ /* if selected, reset to default value */
case IPT_UI_SELECT: case IPT_UI_SELECT:
input_field_get_user_settings(field, &settings); field->get_user_settings(settings);
settings.value = field->defvalue; settings.value = field->defvalue();
input_field_set_user_settings(field, &settings); field->set_user_settings(settings);
changed = true; changed = true;
break; break;
/* left goes to previous setting */ /* left goes to previous setting */
case IPT_UI_LEFT: case IPT_UI_LEFT:
input_field_select_previous_setting(field); field->select_previous_setting();
changed = true; changed = true;
break; break;
/* right goes to next setting */ /* right goes to next setting */
case IPT_UI_RIGHT: case IPT_UI_RIGHT:
input_field_select_next_setting(field); field->select_next_setting();
changed = true; changed = true;
break; break;
} }
@ -1093,8 +1093,8 @@ ui_menu_settings::ui_menu_settings(running_machine &machine, render_container *c
void ui_menu_settings::populate() void ui_menu_settings::populate()
{ {
input_field_config *field; ioport_field *field;
input_port_config *port; ioport_port *port;
dip_descriptor **diplist_tailptr; dip_descriptor **diplist_tailptr;
/* reset the dip switch tracking */ /* reset the dip switch tracking */
@ -1104,39 +1104,39 @@ void ui_menu_settings::populate()
/* loop over input ports and set up the current values */ /* loop over input ports and set up the current values */
for (port = machine().ioport().first_port(); port != NULL; port = port->next()) for (port = machine().ioport().first_port(); port != NULL; port = port->next())
for (field = port->fieldlist().first(); field != NULL; field = field->next()) for (field = port->first_field(); field != NULL; field = field->next())
if (field->type == type && input_condition_true(machine(), &field->condition, port->owner())) if (field->type() == type && field->enabled())
{ {
UINT32 flags = 0; UINT32 flags = 0;
/* set the left/right flags appropriately */ /* set the left/right flags appropriately */
if (input_field_has_previous_setting(field)) if (field->has_previous_setting())
flags |= MENU_FLAG_LEFT_ARROW; flags |= MENU_FLAG_LEFT_ARROW;
if (input_field_has_next_setting(field)) if (field->has_next_setting())
flags |= MENU_FLAG_RIGHT_ARROW; flags |= MENU_FLAG_RIGHT_ARROW;
/* add the menu item */ /* add the menu item */
item_append(input_field_name(field), input_field_setting_name(field), flags, (void *)field); item_append(field->name(), field->setting_name(), flags, (void *)field);
/* for DIP switches, build up the model */ /* for DIP switches, build up the model */
if (type == IPT_DIPSWITCH && field->diploclist().count() != 0) if (type == IPT_DIPSWITCH && field->first_diplocation() != NULL)
{ {
const input_field_diplocation *diploc; const ioport_diplocation *diploc;
input_field_user_settings settings; ioport_field::user_settings settings;
UINT32 accummask = field->mask; UINT32 accummask = field->mask();
/* get current settings */ /* get current settings */
input_field_get_user_settings(field, &settings); field->get_user_settings(settings);
/* iterate over each bit in the field */ /* iterate over each bit in the field */
for (diploc = field->diploclist().first(); diploc != NULL; diploc = diploc->next()) for (diploc = field->first_diplocation(); diploc != NULL; diploc = diploc->next())
{ {
UINT32 mask = accummask & ~(accummask - 1); UINT32 mask = accummask & ~(accummask - 1);
dip_descriptor *dip; dip_descriptor *dip;
/* find the matching switch name */ /* find the matching switch name */
for (dip = diplist; dip != NULL; dip = dip->next) for (dip = diplist; dip != NULL; dip = dip->next)
if (strcmp(dip->name, diploc->swname) == 0) if (strcmp(dip->name, diploc->name()) == 0)
break; break;
/* allocate new if none */ /* allocate new if none */
@ -1144,7 +1144,7 @@ void ui_menu_settings::populate()
{ {
dip = (dip_descriptor *)m_pool_alloc(sizeof(*dip)); dip = (dip_descriptor *)m_pool_alloc(sizeof(*dip));
dip->next = NULL; dip->next = NULL;
dip->name = diploc->swname; dip->name = diploc->name();
dip->mask = dip->state = 0; dip->mask = dip->state = 0;
*diplist_tailptr = dip; *diplist_tailptr = dip;
diplist_tailptr = &dip->next; diplist_tailptr = &dip->next;
@ -1153,9 +1153,9 @@ void ui_menu_settings::populate()
} }
/* apply the bits */ /* apply the bits */
dip->mask |= 1 << (diploc->swnum - 1); dip->mask |= 1 << (diploc->number() - 1);
if (((settings.value & mask) != 0 && !diploc->invert) || ((settings.value & mask) == 0 && diploc->invert)) if (((settings.value & mask) != 0 && !diploc->inverted()) || ((settings.value & mask) == 0 && diploc->inverted()))
dip->state |= 1 << (diploc->swnum - 1); dip->state |= 1 << (diploc->number() - 1);
/* clear the relevant bit in the accumulated mask */ /* clear the relevant bit in the accumulated mask */
accummask &= ~mask; accummask &= ~mask;
@ -1177,7 +1177,7 @@ ui_menu_settings::~ui_menu_settings()
void ui_menu_settings_dip_switches::custom_render(void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) void ui_menu_settings_dip_switches::custom_render(void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
{ {
input_field_config *field = (input_field_config *)selectedref; ioport_field *field = (ioport_field *)selectedref;
dip_descriptor *dip; dip_descriptor *dip;
/* add borders */ /* add borders */
@ -1193,14 +1193,14 @@ void ui_menu_settings_dip_switches::custom_render(void *selectedref, float top,
{ {
if (mame_stricmp(dip->name, "FAKE") != 0) if (mame_stricmp(dip->name, "FAKE") != 0)
{ {
const input_field_diplocation *diploc; const ioport_diplocation *diploc;
UINT32 selectedmask = 0; UINT32 selectedmask = 0;
/* determine the mask of selected bits */ /* determine the mask of selected bits */
if (field != NULL) if (field != NULL)
for (diploc = field->diploclist().first(); diploc != NULL; diploc = diploc->next()) for (diploc = field->first_diplocation(); diploc != NULL; diploc = diploc->next())
if (strcmp(dip->name, diploc->swname) == 0) if (strcmp(dip->name, diploc->name()) == 0)
selectedmask |= 1 << (diploc->swnum - 1); selectedmask |= 1 << (diploc->number() - 1);
/* draw one switch */ /* draw one switch */
custom_render_one(x1, y1, x2, y1 + DIP_SWITCH_HEIGHT, dip, selectedmask); custom_render_one(x1, y1, x2, y1 + DIP_SWITCH_HEIGHT, dip, selectedmask);
@ -1322,10 +1322,10 @@ void ui_menu_analog::handle()
/* if things changed, update */ /* if things changed, update */
if (newval != data->cur) if (newval != data->cur)
{ {
input_field_user_settings settings; ioport_field::user_settings settings;
/* get the settings and set the new value */ /* get the settings and set the new value */
input_field_get_user_settings(data->field, &settings); data->field->get_user_settings(settings);
switch (data->type) switch (data->type)
{ {
case ANALOG_ITEM_KEYSPEED: settings.delta = newval; break; case ANALOG_ITEM_KEYSPEED: settings.delta = newval; break;
@ -1333,7 +1333,7 @@ void ui_menu_analog::handle()
case ANALOG_ITEM_REVERSE: settings.reverse = newval; break; case ANALOG_ITEM_REVERSE: settings.reverse = newval; break;
case ANALOG_ITEM_SENSITIVITY: settings.sensitivity = newval; break; case ANALOG_ITEM_SENSITIVITY: settings.sensitivity = newval; break;
} }
input_field_set_user_settings(data->field, &settings); data->field->set_user_settings(settings);
/* rebuild the menu */ /* rebuild the menu */
reset(UI_MENU_RESET_REMEMBER_POSITION); reset(UI_MENU_RESET_REMEMBER_POSITION);
@ -1353,26 +1353,26 @@ ui_menu_analog::ui_menu_analog(running_machine &machine, render_container *conta
void ui_menu_analog::populate() void ui_menu_analog::populate()
{ {
input_field_config *field; ioport_field *field;
input_port_config *port; ioport_port *port;
astring subtext; astring subtext;
astring text; astring text;
/* loop over input ports and add the items */ /* loop over input ports and add the items */
for (port = machine().ioport().first_port(); port != NULL; port = port->next()) for (port = machine().ioport().first_port(); port != NULL; port = port->next())
for (field = port->fieldlist().first(); field != NULL; field = field->next()) for (field = port->first_field(); field != NULL; field = field->next())
if (input_type_is_analog(field->type) && input_condition_true(machine(), &field->condition, port->owner())) if (field->is_analog() && field->enabled())
{ {
input_field_user_settings settings; ioport_field::user_settings settings;
int use_autocenter = false; int use_autocenter = false;
int type; int type;
/* based on the type, determine if we enable autocenter */ /* based on the type, determine if we enable autocenter */
switch (field->type) switch (field->type())
{ {
case IPT_POSITIONAL: case IPT_POSITIONAL:
case IPT_POSITIONAL_V: case IPT_POSITIONAL_V:
if (field->flags & ANALOG_FLAG_WRAPS) if (field->analog_wraps())
break; break;
case IPT_AD_STICK_X: case IPT_AD_STICK_X:
@ -1385,10 +1385,13 @@ void ui_menu_analog::populate()
case IPT_PEDAL3: case IPT_PEDAL3:
use_autocenter = true; use_autocenter = true;
break; break;
default:
break;
} }
/* get the user settings */ /* get the user settings */
input_field_get_user_settings(field, &settings); field->get_user_settings(settings);
/* iterate over types */ /* iterate over types */
for (type = 0; type < ANALOG_ITEM_COUNT; type++) for (type = 0; type < ANALOG_ITEM_COUNT; type++)
@ -1407,39 +1410,39 @@ void ui_menu_analog::populate()
{ {
default: default:
case ANALOG_ITEM_KEYSPEED: case ANALOG_ITEM_KEYSPEED:
text.printf("%s Digital Speed", input_field_name(field)); text.printf("%s Digital Speed", field->name());
subtext.printf("%d", settings.delta); subtext.printf("%d", settings.delta);
data->min = 0; data->min = 0;
data->max = 255; data->max = 255;
data->cur = settings.delta; data->cur = settings.delta;
data->defvalue = field->delta; data->defvalue = field->delta();
break; break;
case ANALOG_ITEM_CENTERSPEED: case ANALOG_ITEM_CENTERSPEED:
text.printf("%s Autocenter Speed", input_field_name(field)); text.printf("%s Autocenter Speed", field->name());
subtext.printf("%d", settings.centerdelta); subtext.printf("%d", settings.centerdelta);
data->min = 0; data->min = 0;
data->max = 255; data->max = 255;
data->cur = settings.centerdelta; data->cur = settings.centerdelta;
data->defvalue = field->centerdelta; data->defvalue = field->centerdelta();
break; break;
case ANALOG_ITEM_REVERSE: case ANALOG_ITEM_REVERSE:
text.printf("%s Reverse", input_field_name(field)); text.printf("%s Reverse", field->name());
subtext.cpy(settings.reverse ? "On" : "Off"); subtext.cpy(settings.reverse ? "On" : "Off");
data->min = 0; data->min = 0;
data->max = 1; data->max = 1;
data->cur = settings.reverse; data->cur = settings.reverse;
data->defvalue = ((field->flags & ANALOG_FLAG_REVERSE) != 0); data->defvalue = field->analog_reverse();
break; break;
case ANALOG_ITEM_SENSITIVITY: case ANALOG_ITEM_SENSITIVITY:
text.printf("%s Sensitivity", input_field_name(field)); text.printf("%s Sensitivity", field->name());
subtext.printf("%d", settings.sensitivity); subtext.printf("%d", settings.sensitivity);
data->min = 1; data->min = 1;
data->max = 255; data->max = 255;
data->cur = settings.sensitivity; data->cur = settings.sensitivity;
data->defvalue = field->sensitivity; data->defvalue = field->sensitivity();
break; break;
} }

View File

@ -121,7 +121,7 @@ protected:
void populate_and_sort(struct input_item_data *itemlist); void populate_and_sort(struct input_item_data *itemlist);
virtual void update_input(struct input_item_data *seqchangeditem) = 0; virtual void update_input(struct input_item_data *seqchangeditem) = 0;
void toggle_none_default(input_seq &selected_seq, input_seq &original_seq, const input_seq &selected_defseq); void toggle_none_default(input_seq &selected_seq, input_seq &original_seq, const input_seq &selected_defseq);
const input_seq &get_field_default_seq(input_field_config *field, input_seq_type seqtype); const input_seq &get_field_default_seq(ioport_field *field, input_seq_type seqtype);
protected: protected:
const void * pollingref; const void * pollingref;
@ -212,7 +212,7 @@ private:
/* internal analog menu item data */ /* internal analog menu item data */
struct analog_item_data { struct analog_item_data {
input_field_config *field; ioport_field *field;
int type; int type;
int min, max; int min, max;
int cur; int cur;

View File

@ -907,7 +907,7 @@ void ui_menu::handle_keys(UINT32 flags)
/* see if any other UI keys are pressed */ /* see if any other UI keys are pressed */
if (menu_event.iptkey == IPT_INVALID) if (menu_event.iptkey == IPT_INVALID)
for (code = __ipt_ui_start; code <= __ipt_ui_end; code++) for (code = IPT_UI_FIRST + 1; code < IPT_UI_LAST; code++)
{ {
if (code == IPT_UI_CONFIGURE || (code == IPT_UI_LEFT && ignoreleft) || (code == IPT_UI_RIGHT && ignoreright) || (code == IPT_UI_PAUSE && ignorepause)) if (code == IPT_UI_CONFIGURE || (code == IPT_UI_LEFT && ignoreleft) || (code == IPT_UI_RIGHT && ignoreright) || (code == IPT_UI_PAUSE && ignorepause))
continue; continue;

View File

@ -71,7 +71,7 @@ UINT8 your_ptr64_flag_is_wrong[(int)(5 - sizeof(void *))];
inline const char *validity_checker::ioport_string_from_index(UINT32 index) inline const char *validity_checker::ioport_string_from_index(UINT32 index)
{ {
return input_port_string_from_token((const char *)(FPTR)index); return ioport_configurer::string_from_token((const char *)(FPTR)index);
} }
@ -808,38 +808,38 @@ void validity_checker::validate_gfx()
// analog input field // analog input field
//------------------------------------------------- //-------------------------------------------------
void validity_checker::validate_analog_input_field(input_field_config &field) void validity_checker::validate_analog_input_field(ioport_field &field)
{ {
// analog ports must have a valid sensitivity // analog ports must have a valid sensitivity
if (field.sensitivity == 0) if (field.sensitivity() == 0)
mame_printf_error("Analog port with zero sensitivity\n"); mame_printf_error("Analog port with zero sensitivity\n");
// check that the default falls in the bitmask range // check that the default falls in the bitmask range
if (field.defvalue & ~field.mask) if (field.defvalue() & ~field.mask())
mame_printf_error("Analog port with a default value (%X) out of the bitmask range (%X)\n", field.defvalue, field.mask); mame_printf_error("Analog port with a default value (%X) out of the bitmask range (%X)\n", field.defvalue(), field.mask());
// tests for positional devices // tests for positional devices
if (field.type == IPT_POSITIONAL || field.type == IPT_POSITIONAL_V) if (field.type() == IPT_POSITIONAL || field.type() == IPT_POSITIONAL_V)
{ {
int shift; int shift;
for (shift = 0; shift <= 31 && (~field.mask & (1 << shift)) != 0; shift++) ; for (shift = 0; shift <= 31 && (~field.mask() & (1 << shift)) != 0; shift++) ;
// convert the positional max value to be in the bitmask for testing // convert the positional max value to be in the bitmask for testing
INT32 analog_max = field.max; INT32 analog_max = field.maxval();
analog_max = (analog_max - 1) << shift; analog_max = (analog_max - 1) << shift;
// positional port size must fit in bits used // positional port size must fit in bits used
if ((field.mask >> shift) + 1 < field.max) if ((field.mask() >> shift) + 1 < field.maxval())
mame_printf_error("Analog port with a positional port size bigger then the mask size\n"); mame_printf_error("Analog port with a positional port size bigger then the mask size\n");
} }
// tests for absolute devices // tests for absolute devices
else if (field.type >= __ipt_analog_absolute_start && field.type <= __ipt_analog_absolute_end) else if (field.type() > IPT_ANALOG_ABSOLUTE_FIRST && field.type() < IPT_ANALOG_ABSOLUTE_LAST)
{ {
// adjust for signed values // adjust for signed values
INT32 default_value = field.defvalue; INT32 default_value = field.defvalue();
INT32 analog_min = field.min; INT32 analog_min = field.minval();
INT32 analog_max = field.max; INT32 analog_max = field.maxval();
if (analog_min > analog_max) if (analog_min > analog_max)
{ {
analog_min = -analog_min; analog_min = -analog_min;
@ -849,19 +849,19 @@ void validity_checker::validate_analog_input_field(input_field_config &field)
// check that the default falls in the MINMAX range // check that the default falls in the MINMAX range
if (default_value < analog_min || default_value > analog_max) if (default_value < analog_min || default_value > analog_max)
mame_printf_error("Analog port with a default value (%X) out of PORT_MINMAX range (%X-%X)\n", field.defvalue, field.min, field.max); mame_printf_error("Analog port with a default value (%X) out of PORT_MINMAX range (%X-%X)\n", field.defvalue(), field.minval(), field.maxval());
// check that the MINMAX falls in the bitmask range // check that the MINMAX falls in the bitmask range
// we use the unadjusted min for testing // we use the unadjusted min for testing
if (field.min & ~field.mask || analog_max & ~field.mask) if (field.minval() & ~field.mask() || analog_max & ~field.mask())
mame_printf_error("Analog port with a PORT_MINMAX (%X-%X) value out of the bitmask range (%X)\n", field.min, field.max, field.mask); mame_printf_error("Analog port with a PORT_MINMAX (%X-%X) value out of the bitmask range (%X)\n", field.minval(), field.maxval(), field.mask());
// absolute analog ports do not use PORT_RESET // absolute analog ports do not use PORT_RESET
if (field.flags & ANALOG_FLAG_RESET) if (field.analog_reset())
mame_printf_error("Absolute analog port using PORT_RESET\n"); mame_printf_error("Absolute analog port using PORT_RESET\n");
// absolute analog ports do not use PORT_WRAPS // absolute analog ports do not use PORT_WRAPS
if (field.flags & ANALOG_FLAG_WRAPS) if (field.analog_wraps())
mame_printf_error("Absolute analog port using PORT_WRAPS\n"); mame_printf_error("Absolute analog port using PORT_WRAPS\n");
} }
@ -869,16 +869,16 @@ void validity_checker::validate_analog_input_field(input_field_config &field)
else else
{ {
// relative devices do not use PORT_MINMAX // relative devices do not use PORT_MINMAX
if (field.min != 0 || field.max != field.mask) if (field.minval() != 0 || field.maxval() != field.mask())
mame_printf_error("Relative port using PORT_MINMAX\n"); mame_printf_error("Relative port using PORT_MINMAX\n");
// relative devices do not use a default value // relative devices do not use a default value
// the counter is at 0 on power up // the counter is at 0 on power up
if (field.defvalue != 0) if (field.defvalue() != 0)
mame_printf_error("Relative port using non-0 default value\n"); mame_printf_error("Relative port using non-0 default value\n");
// relative analog ports do not use PORT_WRAPS // relative analog ports do not use PORT_WRAPS
if (field.flags & ANALOG_FLAG_WRAPS) if (field.analog_wraps())
mame_printf_error("Absolute analog port using PORT_WRAPS\n"); mame_printf_error("Absolute analog port using PORT_WRAPS\n");
} }
} }
@ -889,7 +889,7 @@ void validity_checker::validate_analog_input_field(input_field_config &field)
// setting // setting
//------------------------------------------------- //-------------------------------------------------
void validity_checker::validate_dip_settings(input_field_config &field) void validity_checker::validate_dip_settings(ioport_field &field)
{ {
const char *demo_sounds = ioport_string_from_index(INPUT_STRING_Demo_Sounds); const char *demo_sounds = ioport_string_from_index(INPUT_STRING_Demo_Sounds);
const char *flipscreen = ioport_string_from_index(INPUT_STRING_Flip_Screen); const char *flipscreen = ioport_string_from_index(INPUT_STRING_Flip_Screen);
@ -897,46 +897,46 @@ void validity_checker::validate_dip_settings(input_field_config &field)
bool coin_error = false; bool coin_error = false;
// iterate through the settings // iterate through the settings
for (const input_setting_config *setting = field.settinglist().first(); setting != NULL; setting = setting->next()) for (ioport_setting *setting = field.first_setting(); setting != NULL; setting = setting->next())
{ {
// note any coinage strings // note any coinage strings
int strindex = get_defstr_index(setting->name); int strindex = get_defstr_index(setting->name());
if (strindex >= __input_string_coinage_start && strindex <= __input_string_coinage_end) if (strindex >= __input_string_coinage_start && strindex <= __input_string_coinage_end)
coin_list[strindex - __input_string_coinage_start] = 1; coin_list[strindex - __input_string_coinage_start] = 1;
// make sure demo sounds default to on // make sure demo sounds default to on
if (field.name == demo_sounds && strindex == INPUT_STRING_On && field.defvalue != setting->value) if (field.name() == demo_sounds && strindex == INPUT_STRING_On && field.defvalue() != setting->value())
mame_printf_error("Demo Sounds must default to On\n"); mame_printf_error("Demo Sounds must default to On\n");
// check for bad demo sounds options // check for bad demo sounds options
if (field.name == demo_sounds && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No)) if (field.name() == demo_sounds && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No))
mame_printf_error("Demo Sounds option must be Off/On, not %s\n", setting->name); mame_printf_error("Demo Sounds option must be Off/On, not %s\n", setting->name());
// check for bad flip screen options // check for bad flip screen options
if (field.name == flipscreen && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No)) if (field.name() == flipscreen && (strindex == INPUT_STRING_Yes || strindex == INPUT_STRING_No))
mame_printf_error("Flip Screen option must be Off/On, not %s\n", setting->name); mame_printf_error("Flip Screen option must be Off/On, not %s\n", setting->name());
// if we have a neighbor, compare ourselves to him // if we have a neighbor, compare ourselves to him
if (setting->next() != NULL) if (setting->next() != NULL)
{ {
// check for inverted off/on dispswitch order // check for inverted off/on dispswitch order
int next_strindex = get_defstr_index(setting->next()->name, true); int next_strindex = get_defstr_index(setting->next()->name(), true);
if (strindex == INPUT_STRING_On && next_strindex == INPUT_STRING_Off) if (strindex == INPUT_STRING_On && next_strindex == INPUT_STRING_Off)
mame_printf_error("%s option must have Off/On options in the order: Off, On\n", field.name); mame_printf_error("%s option must have Off/On options in the order: Off, On\n", field.name());
// check for inverted yes/no dispswitch order // check for inverted yes/no dispswitch order
else if (strindex == INPUT_STRING_Yes && next_strindex == INPUT_STRING_No) else if (strindex == INPUT_STRING_Yes && next_strindex == INPUT_STRING_No)
mame_printf_error("%s option must have Yes/No options in the order: No, Yes\n", field.name); mame_printf_error("%s option must have Yes/No options in the order: No, Yes\n", field.name());
// check for inverted upright/cocktail dispswitch order // check for inverted upright/cocktail dispswitch order
else if (strindex == INPUT_STRING_Cocktail && next_strindex == INPUT_STRING_Upright) else if (strindex == INPUT_STRING_Cocktail && next_strindex == INPUT_STRING_Upright)
mame_printf_error("%s option must have Upright/Cocktail options in the order: Upright, Cocktail\n", field.name); mame_printf_error("%s option must have Upright/Cocktail options in the order: Upright, Cocktail\n", field.name());
// check for proper coin ordering // check for proper coin ordering
else if (strindex >= __input_string_coinage_start && strindex <= __input_string_coinage_end && next_strindex >= __input_string_coinage_start && next_strindex <= __input_string_coinage_end && else if (strindex >= __input_string_coinage_start && strindex <= __input_string_coinage_end && next_strindex >= __input_string_coinage_start && next_strindex <= __input_string_coinage_end &&
strindex >= next_strindex && memcmp(&setting->condition, &setting->next()->condition, sizeof(setting->condition)) == 0) strindex >= next_strindex && setting->condition() == setting->next()->condition())
{ {
mame_printf_error("%s option has unsorted coinage %s > %s\n", field.name, setting->name, setting->next()->name); mame_printf_error("%s option has unsorted coinage %s > %s\n", field.name(), setting->name(), setting->next()->name());
coin_error = true; coin_error = true;
} }
} }
@ -958,15 +958,15 @@ void validity_checker::validate_dip_settings(input_field_config &field)
// stored within an ioport field or setting // stored within an ioport field or setting
//------------------------------------------------- //-------------------------------------------------
void validity_checker::validate_condition(input_condition &condition, device_t &device, int_map &port_map) void validity_checker::validate_condition(ioport_condition &condition, device_t &device, int_map &port_map)
{ {
// resolve the tag // resolve the tag
astring porttag; astring porttag;
device.subtag(porttag, condition.tag); device.subtag(porttag, condition.tag());
// then find a matching port // then find a matching port
if (port_map.find(porttag) == 0) if (port_map.find(porttag) == 0)
mame_printf_error("Condition referencing non-existent ioport tag '%s'\n", condition.tag); mame_printf_error("Condition referencing non-existent ioport tag '%s'\n", condition.tag());
} }
@ -992,38 +992,38 @@ void validity_checker::validate_inputs()
// allocate the input ports // allocate the input ports
ioport_list portlist; ioport_list portlist;
astring errorbuf; astring errorbuf;
input_port_list_init(*device, portlist, errorbuf); portlist.append(*device, errorbuf);
// report any errors during construction // report any errors during construction
if (errorbuf) if (errorbuf)
mame_printf_error("I/O port error during construction:\n%s\n", errorbuf.cstr()); mame_printf_error("I/O port error during construction:\n%s\n", errorbuf.cstr());
// do a first pass over ports to add their names and find duplicates // do a first pass over ports to add their names and find duplicates
for (input_port_config *port = portlist.first(); port != NULL; port = port->next()) for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
if (port_map.add(port->tag(), 1, false) == TMERR_DUPLICATE) if (port_map.add(port->tag(), 1, false) == TMERR_DUPLICATE)
mame_printf_error("Multiple I/O ports with the same tag '%s' defined\n", port->tag()); mame_printf_error("Multiple I/O ports with the same tag '%s' defined\n", port->tag());
// iterate over ports // iterate over ports
for (input_port_config *port = portlist.first(); port != NULL; port = port->next()) for (ioport_port *port = portlist.first(); port != NULL; port = port->next())
{ {
m_current_ioport = port->tag(); m_current_ioport = port->tag();
// iterate through the fields on this port // iterate through the fields on this port
for (input_field_config *field = port->fieldlist().first(); field != NULL; field = field->next()) for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
{ {
// verify analog inputs // verify analog inputs
if (input_type_is_analog(field->type)) if (field->is_analog())
validate_analog_input_field(*field); validate_analog_input_field(*field);
// look for invalid (0) types which should be mapped to IPT_OTHER // look for invalid (0) types which should be mapped to IPT_OTHER
if (field->type == IPT_INVALID) if (field->type() == IPT_INVALID)
mame_printf_error("Field has an invalid type (0); use IPT_OTHER instead\n"); mame_printf_error("Field has an invalid type (0); use IPT_OTHER instead\n");
// verify dip switches // verify dip switches
if (field->type == IPT_DIPSWITCH) if (field->type() == IPT_DIPSWITCH)
{ {
// dip switch fields must have a name // dip switch fields must have a name
if (field->name == NULL) if (field->name() == NULL)
mame_printf_error("DIP switch has a NULL name\n"); mame_printf_error("DIP switch has a NULL name\n");
// verify the settings list // verify the settings list
@ -1031,32 +1031,33 @@ void validity_checker::validate_inputs()
} }
// verify names // verify names
if (field->name != NULL) const char *name = field->specific_name();
if (name != NULL)
{ {
// check for empty string // check for empty string
if (field->name[0] == 0) if (name[0] == 0)
mame_printf_error("Field name is an empty string\n"); mame_printf_error("Field name is an empty string\n");
// check for trailing spaces // check for trailing spaces
if (field->name[0] != 0 && field->name[strlen(field->name) - 1] == ' ') if (name[0] != 0 && name[strlen(name) - 1] == ' ')
mame_printf_error("Field '%s' has trailing spaces\n", field->name); mame_printf_error("Field '%s' has trailing spaces\n", name);
// check for invalid UTF-8 // check for invalid UTF-8
if (!utf8_is_valid_string(field->name)) if (!utf8_is_valid_string(name))
mame_printf_error("Field '%s' has invalid characters\n", field->name); mame_printf_error("Field '%s' has invalid characters\n", name);
// look up the string and print an error if default strings are not used // look up the string and print an error if default strings are not used
/*strindex =get_defstr_index(defstr_map, field->name, driver, &error);*/ /*strindex =get_defstr_index(defstr_map, name, driver, &error);*/
} }
// verify conditions on the field // verify conditions on the field
if (field->condition.tag != NULL) if (!field->condition().none())
validate_condition(field->condition, *device, port_map); validate_condition(field->condition(), *device, port_map);
// verify conditions on the settings // verify conditions on the settings
for (input_setting_config *setting = field->settinglist().first(); setting != NULL; setting = setting->next()) for (ioport_setting *setting = field->first_setting(); setting != NULL; setting = setting->next())
if (setting->condition.tag != NULL) if (!setting->condition().none())
validate_condition(setting->condition, *device, port_map); validate_condition(setting->condition(), *device, port_map);
} }
// done with this port // done with this port

View File

@ -93,9 +93,9 @@ private:
void validate_roms(); void validate_roms();
void validate_display(); void validate_display();
void validate_gfx(); void validate_gfx();
void validate_analog_input_field(input_field_config &field); void validate_analog_input_field(ioport_field &field);
void validate_dip_settings(input_field_config &field); void validate_dip_settings(ioport_field &field);
void validate_condition(input_condition &condition, device_t &device, int_map &port_map); void validate_condition(ioport_condition &condition, device_t &device, int_map &port_map);
void validate_inputs(); void validate_inputs();
void validate_devices(); void validate_devices();

View File

@ -138,10 +138,10 @@ INPUT_PORTS_START( pcvideo_pc1512 )
INPUT_PORTS_END INPUT_PORTS_END
/* Dipswitch for font selection */ /* Dipswitch for font selection */
#define CGA_FONT (input_port_read_direct(cga.config_input_port)&3) #define CGA_FONT (cga.config_input_port->read()&3)
/* Dipswitch for monitor selection */ /* Dipswitch for monitor selection */
#define CGA_MONITOR (input_port_read_direct(cga.config_input_port)&0x1C) #define CGA_MONITOR (cga.config_input_port->read()&0x1C)
#define CGA_MONITOR_RGB 0x00 /* Colour RGB */ #define CGA_MONITOR_RGB 0x00 /* Colour RGB */
#define CGA_MONITOR_MONO 0x04 /* Greyscale RGB */ #define CGA_MONITOR_MONO 0x04 /* Greyscale RGB */
#define CGA_MONITOR_COMPOSITE 0x08 /* Colour composite */ #define CGA_MONITOR_COMPOSITE 0x08 /* Colour composite */
@ -150,7 +150,7 @@ INPUT_PORTS_END
/* Dipswitch for chipset selection */ /* Dipswitch for chipset selection */
#define CGA_CHIPSET (input_port_read_direct(cga.config_input_port)&0xE0) #define CGA_CHIPSET (cga.config_input_port->read()&0xE0)
#define CGA_CHIPSET_IBM 0x00 /* Original IBM CGA */ #define CGA_CHIPSET_IBM 0x00 /* Original IBM CGA */
#define CGA_CHIPSET_PC1512 0x20 /* PC1512 CGA subset */ #define CGA_CHIPSET_PC1512 0x20 /* PC1512 CGA subset */
#define CGA_CHIPSET_PC200 0x40 /* PC200 in CGA mode */ #define CGA_CHIPSET_PC200 0x40 /* PC200 in CGA mode */
@ -242,7 +242,7 @@ static struct
UINT8 *chr_gen; UINT8 *chr_gen;
const input_port_config *config_input_port; ioport_port *config_input_port;
mc6845_update_row_func update_row; mc6845_update_row_func update_row;
UINT8 palette_lut_2bpp[4]; UINT8 palette_lut_2bpp[4];

View File

@ -97,7 +97,7 @@ protected:
// internal state // internal state
astring m_filename; astring m_filename;
input_port_value m_last_controls; ioport_value m_last_controls;
bool m_playing; bool m_playing;
required_device<laserdisc_device> m_laserdisc; required_device<laserdisc_device> m_laserdisc;
}; };
@ -217,7 +217,7 @@ chd_file *ldplayer_state::get_disc()
void ldplayer_state::process_commands() void ldplayer_state::process_commands()
{ {
input_port_value controls = input_port_read(machine(), "controls"); ioport_value controls = machine().root_device().ioport("controls")->read();
int number; int number;
// step backwards // step backwards

View File

@ -865,7 +865,7 @@ WRITE8_MEMBER(_8080bw_state::schaser_sh_port_2_w)
m_schaser_background_disable = (data >> 3) & 0x01; m_schaser_background_disable = (data >> 3) & 0x01;
m_schaser_background_select = (data >> 4) & 0x01; m_schaser_background_select = (data >> 4) & 0x01;
m_c8080bw_flip_screen = (data & 0x20) && (input_port_read(machine(), CABINET_PORT_TAG) & 0x01); m_c8080bw_flip_screen = (data & 0x20) && (ioport(CABINET_PORT_TAG)->read() & 0x01);
m_port_2_last_extra = data; m_port_2_last_extra = data;
} }
@ -1032,7 +1032,7 @@ WRITE8_MEMBER(_8080bw_state::lupin3_sh_port_2_w)
m_color_map = data & 0x40; m_color_map = data & 0x40;
m_c8080bw_flip_screen = (data & 0x20) && (input_port_read(machine(), "IN2") & 0x04); m_c8080bw_flip_screen = (data & 0x20) && (ioport("IN2")->read() & 0x04);
m_port_2_last_extra = data; m_port_2_last_extra = data;
} }

View File

@ -227,8 +227,8 @@ static READ8_HANDLER( jsa1_io_r )
0x02 = coin 2 0x02 = coin 2
0x01 = coin 1 0x01 = coin 1
*/ */
result = input_port_read(space->machine(), "JSAI"); result = space->machine().root_device().ioport("JSAI")->read();
if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x80; if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40; if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20; if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
if ((tms5220 != NULL) && (tms5220_readyq_r(tms5220) == 0)) if ((tms5220 != NULL) && (tms5220_readyq_r(tms5220) == 0))
@ -360,8 +360,8 @@ static READ8_HANDLER( jsa2_io_r )
0x02 = coin 2 0x02 = coin 2
0x01 = coin 1 0x01 = coin 1
*/ */
result = input_port_read(space->machine(), "JSAII"); result = space->machine().root_device().ioport("JSAII")->read();
if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x80; if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x80;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40; if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20; if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
break; break;
@ -483,8 +483,8 @@ static READ8_HANDLER( jsa3_io_r )
0x02 = coin L (active high) 0x02 = coin L (active high)
0x01 = coin R (active high) 0x01 = coin R (active high)
*/ */
result = input_port_read(space->machine(), "JSAIII"); result = space->machine().root_device().ioport("JSAIII")->read();
if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x90; if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40; if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20; if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
break; break;
@ -617,8 +617,8 @@ static READ8_HANDLER( jsa3s_io_r )
0x02 = coin L (active high) 0x02 = coin L (active high)
0x01 = coin R (active high) 0x01 = coin R (active high)
*/ */
result = input_port_read(space->machine(), "JSAIII"); result = space->machine().root_device().ioport("JSAIII")->read();
if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x90; if (!(space->machine().root_device().ioport(test_port)->read() & test_mask)) result ^= 0x90;
if (atarigen->m_cpu_to_sound_ready) result ^= 0x40; if (atarigen->m_cpu_to_sound_ready) result ^= 0x40;
if (atarigen->m_sound_to_cpu_ready) result ^= 0x20; if (atarigen->m_sound_to_cpu_ready) result ^= 0x20;
break; break;

View File

@ -32,7 +32,7 @@ INPUT_CHANGED_MEMBER(cchasm_state::cchasm_set_coin_flag )
READ8_MEMBER(cchasm_state::cchasm_coin_sound_r) READ8_MEMBER(cchasm_state::cchasm_coin_sound_r)
{ {
UINT8 coin = (input_port_read(machine(), "IN3") >> 4) & 0x7; UINT8 coin = (ioport("IN3")->read() >> 4) & 0x7;
return m_sound_flags | (m_coin_flag << 3) | coin; return m_sound_flags | (m_coin_flag << 3) | coin;
} }
@ -85,11 +85,11 @@ READ16_MEMBER(cchasm_state::cchasm_io_r)
m_sound_flags &= ~0x40; m_sound_flags &= ~0x40;
return soundlatch4_byte_r(space,offset) << 8; return soundlatch4_byte_r(space,offset) << 8;
case 0x2: case 0x2:
return (m_sound_flags| (input_port_read(machine(), "IN3") & 0x07) | 0x08) << 8; return (m_sound_flags| (ioport("IN3")->read() & 0x07) | 0x08) << 8;
case 0x5: case 0x5:
return input_port_read(machine(), "IN2") << 8; return ioport("IN2")->read() << 8;
case 0x8: case 0x8:
return input_port_read(machine(), "IN1") << 8; return ioport("IN1")->read() << 8;
default: default:
return 0xff << 8; return 0xff << 8;
} }

View File

@ -37,8 +37,8 @@ void cyberbal_sound_reset(running_machine &machine)
READ8_MEMBER(cyberbal_state::cyberbal_special_port3_r) READ8_MEMBER(cyberbal_state::cyberbal_special_port3_r)
{ {
int temp = input_port_read(machine(), "JSAII"); int temp = ioport("JSAII")->read();
if (!(input_port_read(machine(), "IN0") & 0x8000)) temp ^= 0x80; if (!(ioport("IN0")->read() & 0x8000)) temp ^= 0x80;
if (m_cpu_to_sound_ready) temp ^= 0x40; if (m_cpu_to_sound_ready) temp ^= 0x40;
if (m_sound_to_cpu_ready) temp ^= 0x20; if (m_sound_to_cpu_ready) temp ^= 0x20;
return temp; return temp;

View File

@ -144,7 +144,7 @@ READ16_MEMBER(harddriv_state::hdsnd68k_status_r)
// D13 = Test Switch // D13 = Test Switch
// D12 = 5220 Ready Flag (0=Ready) // D12 = 5220 Ready Flag (0=Ready)
logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(&space.device()), offset); logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(&space.device()), offset);
return (m_mainflag << 15) | (m_soundflag << 14) | 0x2000 | 0;//((input_port_read(machine(), "IN0") & 0x0020) << 8) | 0; return (m_mainflag << 15) | (m_soundflag << 14) | 0x2000 | 0;//((ioport("IN0")->read() & 0x0020) << 8) | 0;
} }

View File

@ -416,7 +416,7 @@ static SOUND_START( mario )
mario_state *state = machine.driver_data<mario_state>(); mario_state *state = machine.driver_data<mario_state>();
device_t *audiocpu = machine.device("audiocpu"); device_t *audiocpu = machine.device("audiocpu");
#if USE_8039 #if USE_8039
UINT8 *SND = machine.root_device().memregion("audiocpu")->base(); UINT8 *SND = state->memregion("audiocpu")->base();
SND[0x1001] = 0x01; SND[0x1001] = 0x01;
#endif #endif
@ -426,7 +426,7 @@ static SOUND_START( mario )
{ {
state->m_eabank = "bank1"; state->m_eabank = "bank1";
audiocpu->memory().space(AS_PROGRAM)->install_read_bank(0x000, 0x7ff, "bank1"); audiocpu->memory().space(AS_PROGRAM)->install_read_bank(0x000, 0x7ff, "bank1");
state->membank("bank1")->configure_entry(0, machine.root_device().memregion("audiocpu")->base()); state->membank("bank1")->configure_entry(0, state->memregion("audiocpu")->base());
state->membank("bank1")->configure_entry(1, state->memregion("audiocpu")->base() + 0x1000); state->membank("bank1")->configure_entry(1, state->memregion("audiocpu")->base() + 0x1000);
} }

View File

@ -407,7 +407,7 @@ READ8_MEMBER(micro3d_state::micro3d_sound_io_r)
switch (offset) switch (offset)
{ {
case 0x01: return (m_sound_port_latch[offset] & 0x7f) | input_port_read(machine(), "SOUND_SW"); case 0x01: return (m_sound_port_latch[offset] & 0x7f) | ioport("SOUND_SW")->read();
case 0x03: return (m_sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(machine().device("upd7759")) ? 0x08 : 0); case 0x03: return (m_sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(machine().device("upd7759")) ? 0x08 : 0);
default: return 0; default: return 0;
} }

View File

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

View File

@ -575,7 +575,7 @@ MACHINE_CONFIG_END
void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state) void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state)
{ {
/* controls need to be active low */ /* controls need to be active low */
int controls = ~input_port_read(device->machine(), "IN0") & 0xff; int controls = ~device->machine().root_device().ioport("IN0")->read() & 0xff;
discrete_sound_w(device, MAZE_TONE_TIMING, maze_tone_timing_state); discrete_sound_w(device, MAZE_TONE_TIMING, maze_tone_timing_state);
discrete_sound_w(device, MAZE_P1_DATA, controls & 0x0f); discrete_sound_w(device, MAZE_P1_DATA, controls & 0x0f);
@ -587,7 +587,7 @@ void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state)
/* A better option might be to update it at vblank or set a timer to do it. */ /* A better option might be to update it at vblank or set a timer to do it. */
/* The only noticeable difference doing it here, is that the controls don't */ /* The only noticeable difference doing it here, is that the controls don't */
/* immediately start making tones if pressed right after the coin is inserted. */ /* immediately start making tones if pressed right after the coin is inserted. */
discrete_sound_w(device, MAZE_COIN, (~input_port_read(device->machine(), "IN1") >> 3) & 0x01); discrete_sound_w(device, MAZE_COIN, (~device->machine().root_device().ioport("IN1")->read() >> 3) & 0x01);
} }

View File

@ -52,7 +52,7 @@ SAMPLES_START( suna8_sh_start )
{ {
suna8_state *state = device.machine().driver_data<suna8_state>(); suna8_state *state = device.machine().driver_data<suna8_state>();
running_machine &machine = device.machine(); running_machine &machine = device.machine();
int i, len = machine.root_device().memregion("samples")->bytes(); int i, len = state->memregion("samples")->bytes();
UINT8 *ROM = state->memregion("samples")->base(); UINT8 *ROM = state->memregion("samples")->base();
state->m_samplebuf = auto_alloc_array(machine, INT16, len); state->m_samplebuf = auto_alloc_array(machine, INT16, len);

View File

@ -73,10 +73,10 @@ READ16_MEMBER(_2mindril_state::drill_io_r)
switch(offset) switch(offset)
{ {
case 0x0/2: return input_port_read(machine(), "DSW"); case 0x0/2: return ioport("DSW")->read();
case 0x2/2: case 0x2/2:
{ {
int arm_pwr = input_port_read(machine(), "IN0");//throw int arm_pwr = ioport("IN0")->read();//throw
//popmessage("PC=%08x %02x",cpu_get_pc(&space.device()),arm_pwr); //popmessage("PC=%08x %02x",cpu_get_pc(&space.device()),arm_pwr);
if(arm_pwr > 0xe0) return ~0x1800; if(arm_pwr > 0xe0) return ~0x1800;
@ -86,7 +86,7 @@ READ16_MEMBER(_2mindril_state::drill_io_r)
else return ~0x0000; else return ~0x0000;
} }
case 0x4/2: return (m_defender_sensor) | (m_shutter_sensor); case 0x4/2: return (m_defender_sensor) | (m_shutter_sensor);
case 0xe/2: return input_port_read(machine(), "IN2");//coins case 0xe/2: return ioport("IN2")->read();//coins
// default: printf("PC=%08x [%04x] -> %04x R\n", cpu_get_pc(&space.device()), offset * 2, m_iodata[offset]); // default: printf("PC=%08x [%04x] -> %04x R\n", cpu_get_pc(&space.device()), offset * 2, m_iodata[offset]);
} }

View File

@ -93,10 +93,10 @@ READ8_MEMBER(namco_30test_state::namco_30test_mux_r)
switch(m_mux_data) switch(m_mux_data)
{ {
case 0x01: res = input_port_read(machine(), "IN0"); break; case 0x01: res = ioport("IN0")->read(); break;
case 0x02: res = input_port_read(machine(), "IN1"); break; case 0x02: res = ioport("IN1")->read(); break;
case 0x04: res = input_port_read(machine(), "IN2"); break; case 0x04: res = ioport("IN2")->read(); break;
case 0x08: res = input_port_read(machine(), "IN3"); break; case 0x08: res = ioport("IN3")->read(); break;
} }
return res; return res;

View File

@ -1377,7 +1377,7 @@ READ32_MEMBER(_39in1_state::cpld_r)
} }
else if (cpu_get_pc(&space.device()) == 0xe3af4) else if (cpu_get_pc(&space.device()) == 0xe3af4)
{ {
return input_port_read(machine(), "MCUIPT"); return ioport("MCUIPT")->read();
} }
else else
{ {

View File

@ -135,7 +135,7 @@ static MACHINE_RESET( 3do )
state->m_maincpu = downcast<legacy_cpu_device*>( machine.device("maincpu") ); state->m_maincpu = downcast<legacy_cpu_device*>( machine.device("maincpu") );
state->membank("bank2")->set_base(machine.root_device().memregion("user1")->base()); state->membank("bank2")->set_base(state->memregion("user1")->base());
/* configure overlay */ /* configure overlay */
state->membank("bank1")->configure_entry(0, state->m_dram); state->membank("bank1")->configure_entry(0, state->m_dram);

View File

@ -578,7 +578,7 @@ static DRIVER_INIT( undoukai )
static DRIVER_INIT( 40love ) static DRIVER_INIT( 40love )
{ {
fortyl_state *state = machine.driver_data<fortyl_state>(); fortyl_state *state = machine.driver_data<fortyl_state>();
UINT8 *ROM = machine.root_device().memregion("maincpu")->base(); UINT8 *ROM = state->memregion("maincpu")->base();
state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000); state->membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000);
#if 0 #if 0

View File

@ -591,10 +591,10 @@ static READ8_DEVICE_HANDLER( mux_port_r )
_5clown_state *state = device->machine().driver_data<_5clown_state>(); _5clown_state *state = device->machine().driver_data<_5clown_state>();
switch( state->m_mux_data & 0xf0 ) /* bits 4-7 */ switch( state->m_mux_data & 0xf0 ) /* bits 4-7 */
{ {
case 0x10: return input_port_read(device->machine(), "IN0-0"); case 0x10: return state->ioport("IN0-0")->read();
case 0x20: return input_port_read(device->machine(), "IN0-1"); case 0x20: return state->ioport("IN0-1")->read();
case 0x40: return input_port_read(device->machine(), "IN0-2"); case 0x40: return state->ioport("IN0-2")->read();
case 0x80: return input_port_read(device->machine(), "IN0-3"); case 0x80: return state->ioport("IN0-3")->read();
} }
return 0xff; return 0xff;

View File

@ -1892,7 +1892,7 @@ static INPUT_PORTS_START( shuttlei )
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
@ -1932,7 +1932,7 @@ static INPUT_PORTS_START( skylove )
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) // must be off to boot PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) // must be off to boot
PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )

View File

@ -248,7 +248,7 @@ static INPUT_PORTS_START( ace )
//c012 //c012
PORT_START("c014") /* VBLANK??? */ PORT_START("c014") /* VBLANK??? */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("c015") /* coin input */ PORT_START("c015") /* coin input */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )

View File

@ -179,9 +179,9 @@ CUSTOM_INPUT_MEMBER(acefruit_state::sidewndr_payout_r)
switch (bit_mask) switch (bit_mask)
{ {
case 0x01: case 0x01:
return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 0); return ((ioport("PAYOUT")->read() & bit_mask) >> 0);
case 0x02: case 0x02:
return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 1); return ((ioport("PAYOUT")->read() & bit_mask) >> 1);
default: default:
logerror("sidewndr_payout_r : invalid %02X bit_mask\n",bit_mask); logerror("sidewndr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0; return 0;
@ -195,13 +195,13 @@ CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_coinage_r)
switch (bit_mask) switch (bit_mask)
{ {
case 0x01: case 0x01:
return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 0); return ((ioport("COINAGE")->read() & bit_mask) >> 0);
case 0x02: case 0x02:
return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 1); return ((ioport("COINAGE")->read() & bit_mask) >> 1);
case 0x04: case 0x04:
return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 2); return ((ioport("COINAGE")->read() & bit_mask) >> 2);
case 0x08: case 0x08:
return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 3); return ((ioport("COINAGE")->read() & bit_mask) >> 3);
default: default:
logerror("starspnr_coinage_r : invalid %02X bit_mask\n",bit_mask); logerror("starspnr_coinage_r : invalid %02X bit_mask\n",bit_mask);
return 0; return 0;
@ -215,11 +215,11 @@ CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_payout_r)
switch (bit_mask) switch (bit_mask)
{ {
case 0x01: case 0x01:
return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 0); return ((ioport("PAYOUT")->read() & bit_mask) >> 0);
case 0x02: case 0x02:
return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 1); return ((ioport("PAYOUT")->read() & bit_mask) >> 1);
case 0x04: case 0x04:
return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 2); return ((ioport("PAYOUT")->read() & bit_mask) >> 2);
default: default:
logerror("starspnr_payout_r : invalid %02X bit_mask\n",bit_mask); logerror("starspnr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0; return 0;
@ -316,7 +316,7 @@ static INPUT_PORTS_START( sidewndr )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Stop Nudge/Nudge Up or Down" ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Stop Nudge/Nudge Up or Down" )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Gamble" ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Gamble" )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) /* "Cash in" */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) /* "Cash in" */
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK ) /* active low or high?? */ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* active low or high?? */
PORT_BIT( 0xd8, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0xd8, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN1") // 1 PORT_START("IN1") // 1
@ -437,7 +437,7 @@ static INPUT_PORTS_START( starspnr )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
/* tested at 0xef77 after IN5 bit 1 and before IN2 bit 2 - after coins are tested - table at 0xefa5 (3 bytes) */ /* tested at 0xef77 after IN5 bit 1 and before IN2 bit 2 - after coins are tested - table at 0xefa5 (3 bytes) */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK ) /* active low or high?? */ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* active low or high?? */
PORT_START("IN1") // 1 PORT_START("IN1") // 1
/* tested at 0xe77c - call from 0x012c */ /* tested at 0xe77c - call from 0x012c */

View File

@ -321,7 +321,7 @@ READ16_MEMBER(acommand_state::ac_devices_r)
---- ---- ---- --x- (Activate Test) ---- ---- ---- --x- (Activate Test)
---- ---- ---- ---x (Advance through Tests) ---- ---- ---- ---x (Advance through Tests)
*/ */
return input_port_read(machine(), "IN0"); return ioport("IN0")->read();
case 0x0014/2: case 0x0014/2:
case 0x0016/2: case 0x0016/2:
return machine().device<okim6295_device>("oki1")->read(space,0); return machine().device<okim6295_device>("oki1")->read(space,0);
@ -392,7 +392,7 @@ READ16_MEMBER(acommand_state::ac_devices_r)
xxxx xxxx ---- ---- DIPSW4 xxxx xxxx ---- ---- DIPSW4
---- ---- xxxx xxxx DIPSW3 ---- ---- xxxx xxxx DIPSW3
*/ */
return input_port_read(machine(), "IN1"); return ioport("IN1")->read();
} }
return m_ac_devram[offset]; return m_ac_devram[offset];
} }

View File

@ -43,11 +43,11 @@ READ8_MEMBER(actfancr_state::triothep_control_r)
{ {
switch (m_trio_control_select) switch (m_trio_control_select)
{ {
case 0: return input_port_read(machine(), "P1"); case 0: return ioport("P1")->read();
case 1: return input_port_read(machine(), "P2"); case 1: return ioport("P2")->read();
case 2: return input_port_read(machine(), "DSW1"); case 2: return ioport("DSW1")->read();
case 3: return input_port_read(machine(), "DSW2"); case 3: return ioport("DSW2")->read();
case 4: return input_port_read(machine(), "SYSTEM"); /* VBL */ case 4: return ioport("SYSTEM")->read(); /* VBL */
} }
return 0xff; return 0xff;
@ -154,7 +154,7 @@ static INPUT_PORTS_START( actfancr )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1") PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2")

View File

@ -287,7 +287,7 @@ WRITE8_MEMBER( adp_state::microtouch_tx )
static UINT8 duart_input( device_t *device ) static UINT8 duart_input( device_t *device )
{ {
return input_port_read(device->machine(), "DSW1"); return device->machine().root_device().ioport("DSW1")->read();
} }
static const microtouch_interface adb_microtouch_config = static const microtouch_interface adb_microtouch_config =
@ -386,22 +386,22 @@ READ16_MEMBER(adp_state::test_r)
switch (m_mux_data) switch (m_mux_data)
{ {
case 0x00: value = input_port_read(machine(), "x0"); break; case 0x00: value = ioport("x0")->read(); break;
case 0x01: value = input_port_read(machine(), "x1"); break; case 0x01: value = ioport("x1")->read(); break;
case 0x02: value = input_port_read(machine(), "x2"); break; case 0x02: value = ioport("x2")->read(); break;
case 0x03: value = input_port_read(machine(), "1P_UP"); break; case 0x03: value = ioport("1P_UP")->read(); break;
case 0x04: value = input_port_read(machine(), "1P_B1"); break; case 0x04: value = ioport("1P_B1")->read(); break;
case 0x05: value = input_port_read(machine(), "x5"); break; case 0x05: value = ioport("x5")->read(); break;
case 0x06: value = input_port_read(machine(), "1P_RIGHT"); break; case 0x06: value = ioport("1P_RIGHT")->read(); break;
case 0x07: value = input_port_read(machine(), "1P_DOWN"); break; case 0x07: value = ioport("1P_DOWN")->read(); break;
case 0x08: value = input_port_read(machine(), "1P_LEFT"); break; case 0x08: value = ioport("1P_LEFT")->read(); break;
case 0x09: value = input_port_read(machine(), "x9"); break; case 0x09: value = ioport("x9")->read(); break;
case 0x0a: value = input_port_read(machine(), "x10"); break; case 0x0a: value = ioport("x10")->read(); break;
case 0x0b: value = input_port_read(machine(), "x11"); break; case 0x0b: value = ioport("x11")->read(); break;
case 0x0c: value = input_port_read(machine(), "x12"); break; case 0x0c: value = ioport("x12")->read(); break;
case 0x0d: value = input_port_read(machine(), "x13"); break; case 0x0d: value = ioport("x13")->read(); break;
case 0x0e: value = input_port_read(machine(), "1P_START"); break; case 0x0e: value = ioport("1P_START")->read(); break;
case 0x0f: value = input_port_read(machine(), "1P_COIN"); break; case 0x0f: value = ioport("1P_COIN")->read(); break;
} }
m_mux_data++; m_mux_data++;

View File

@ -227,7 +227,7 @@ static MACHINE_START( formatz )
{ {
aeroboto_state *state = machine.driver_data<aeroboto_state>(); aeroboto_state *state = machine.driver_data<aeroboto_state>();
state->m_stars_rom = machine.root_device().memregion("gfx2")->base(); state->m_stars_rom = state->memregion("gfx2")->base();
state->m_stars_length = state->memregion("gfx2")->bytes(); state->m_stars_length = state->memregion("gfx2")->bytes();
state->save_item(NAME(state->m_disable_irq)); state->save_item(NAME(state->m_disable_irq));

View File

@ -439,23 +439,23 @@ static INPUT_PORTS_START( airbustr )
PORT_DIPSETTING( 0x08, "Mode 1" ) // routine at 0x056d: 11 21 12 16 (bit 3 active) PORT_DIPSETTING( 0x08, "Mode 1" ) // routine at 0x056d: 11 21 12 16 (bit 3 active)
PORT_DIPSETTING( 0x00, "Mode 2" ) // 11 21 13 14 (bit 3 not active) PORT_DIPSETTING( 0x00, "Mode 2" ) // 11 21 13 14 (bit 3 not active)
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6") PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00) PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00) PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00) PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00) PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00) PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00) PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00) PORT_DIPSETTING( 0x10, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00) PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8") PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00) PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00) PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00) PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_NOTEQUALS, 0x00) PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSW1", 0x08, NOTEQUALS, 0x00)
PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00) PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00) PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00) PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, PORTCOND_EQUALS, 0x00) PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSW1", 0x08, EQUALS, 0x00)
PORT_START("DSW2") PORT_START("DSW2")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
@ -571,8 +571,8 @@ static INTERRUPT_GEN( slave_interrupt )
static MACHINE_START( airbustr ) static MACHINE_START( airbustr )
{ {
airbustr_state *state = machine.driver_data<airbustr_state>(); airbustr_state *state = machine.driver_data<airbustr_state>();
UINT8 *MASTER = machine.root_device().memregion("master")->base(); UINT8 *MASTER = state->memregion("master")->base();
UINT8 *SLAVE = machine.root_device().memregion("slave")->base(); UINT8 *SLAVE = state->memregion("slave")->base();
UINT8 *AUDIO = state->memregion("audiocpu")->base(); UINT8 *AUDIO = state->memregion("audiocpu")->base();
state->membank("bank1")->configure_entries(0, 3, &MASTER[0x00000], 0x4000); state->membank("bank1")->configure_entries(0, 3, &MASTER[0x00000], 0x4000);

View File

@ -154,13 +154,13 @@ static READ8_DEVICE_HANDLER( mux_r )
albazg_state *state = device->machine().driver_data<albazg_state>(); albazg_state *state = device->machine().driver_data<albazg_state>();
switch(state->m_mux_data) switch(state->m_mux_data)
{ {
case 0x00: return input_port_read(device->machine(), "IN0"); case 0x00: return state->ioport("IN0")->read();
case 0x01: return input_port_read(device->machine(), "IN1"); case 0x01: return state->ioport("IN1")->read();
case 0x02: return input_port_read(device->machine(), "IN2"); case 0x02: return state->ioport("IN2")->read();
case 0x04: return input_port_read(device->machine(), "IN3"); case 0x04: return state->ioport("IN3")->read();
case 0x08: return input_port_read(device->machine(), "IN4"); case 0x08: return state->ioport("IN4")->read();
case 0x10: return input_port_read(device->machine(), "IN5"); case 0x10: return state->ioport("IN5")->read();
case 0x20: return input_port_read(device->machine(), "IN6"); case 0x20: return state->ioport("IN6")->read();
} }
return 0xff; return 0xff;
@ -276,32 +276,32 @@ static INPUT_PORTS_START( yumefuda )
PORT_START("IN1") PORT_START("IN1")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_START("IN2") PORT_START("IN2")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_START("IN3") PORT_START("IN3")
PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 BET Button") PORT_CODE(KEYCODE_3) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
/* Some bits of these three are actually used if you use the Royal Panel type */ /* Some bits of these three are actually used if you use the Royal Panel type */
PORT_START("IN4") PORT_START("IN4")
@ -309,10 +309,10 @@ static INPUT_PORTS_START( yumefuda )
PORT_START("IN5") PORT_START("IN5")
PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x08) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x08)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, PORTCOND_EQUALS, 0x00) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_CONDITION("DSW2", 0x08, EQUALS, 0x00)
PORT_START("IN6") PORT_START("IN6")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )

View File

@ -199,12 +199,12 @@ static READ32_HANDLER( aleck_dips_r )
switch( offset ) switch( offset )
{ {
case 0: case 0:
return (input_port_read(space->machine(), "IN0")); /* mtetrisc has regular inputs here */ return (space->machine().root_device().ioport("IN0")->read()); /* mtetrisc has regular inputs here */
case 1: case 1:
return (input_port_read(space->machine(), "IN1")); return (space->machine().root_device().ioport("IN1")->read());
case 2: case 2:
{ {
UINT32 val = input_port_read(space->machine(), "INMJ"); UINT32 val = space->machine().root_device().ioport("INMJ")->read();
switch( dip_read_offset >> 8 & 0xff ) switch( dip_read_offset >> 8 & 0xff )
{ {

View File

@ -61,8 +61,8 @@ static int get_lightgun_pos(screen_device &screen, int player, int *x, int *y)
{ {
const rectangle &visarea = screen.visible_area(); const rectangle &visarea = screen.visible_area();
int xpos = input_port_read_safe(screen.machine(), (player == 0) ? "GUN1X" : "GUN2X", 0xffffffff); int xpos = screen.machine().root_device().ioport((player == 0) ? "GUN1X" : "GUN2X")->read_safe(0xffffffff);
int ypos = input_port_read_safe(screen.machine(), (player == 0) ? "GUN1Y" : "GUN2Y", 0xffffffff); int ypos = screen.machine().root_device().ioport((player == 0) ? "GUN1Y" : "GUN2Y")->read_safe(0xffffffff);
if (xpos == -1 || ypos == -1) if (xpos == -1 || ypos == -1)
return FALSE; return FALSE;
@ -201,7 +201,7 @@ CUSTOM_INPUT_MEMBER(alg_state::lightgun_trigger_r)
{ {
/* read the trigger control based on the input select */ /* read the trigger control based on the input select */
return (input_port_read(machine(), "TRIGGERS") >> m_input_select) & 1; return (ioport("TRIGGERS")->read() >> m_input_select) & 1;
} }
@ -209,7 +209,7 @@ CUSTOM_INPUT_MEMBER(alg_state::lightgun_holster_r)
{ {
/* read the holster control based on the input select */ /* read the holster control based on the input select */
return (input_port_read(machine(), "TRIGGERS") >> (2 + m_input_select)) & 1; return (ioport("TRIGGERS")->read() >> (2 + m_input_select)) & 1;
} }
@ -240,7 +240,7 @@ static WRITE8_DEVICE_HANDLER( alg_cia_0_porta_w )
static READ8_DEVICE_HANDLER( alg_cia_0_porta_r ) static READ8_DEVICE_HANDLER( alg_cia_0_porta_r )
{ {
return input_port_read(device->machine(), "FIRE") | 0x3f; return device->machine().root_device().ioport("FIRE")->read() | 0x3f;
} }

View File

@ -233,40 +233,40 @@ WRITE16_MEMBER(alpha68k_state::alpha_microcontroller_w)
READ16_MEMBER(alpha68k_state::kyros_dip_r) READ16_MEMBER(alpha68k_state::kyros_dip_r)
{ {
return input_port_read(machine(), "IN1") << 8; return ioport("IN1")->read() << 8;
} }
READ16_MEMBER(alpha68k_state::control_1_r) READ16_MEMBER(alpha68k_state::control_1_r)
{ {
if (m_invert_controls) if (m_invert_controls)
return ~(input_port_read(machine(), "IN0") + (input_port_read(machine(), "IN1") << 8)); return ~(ioport("IN0")->read() + (ioport("IN1")->read() << 8));
return (input_port_read(machine(), "IN0") + (input_port_read(machine(), "IN1") << 8)); return (ioport("IN1")->read() << 8);
} }
READ16_MEMBER(alpha68k_state::control_2_r) READ16_MEMBER(alpha68k_state::control_2_r)
{ {
if (m_invert_controls) if (m_invert_controls)
return ~(input_port_read(machine(), "IN3") + ((~(1 << input_port_read(machine(), "IN5"))) << 8)); return ~(ioport("IN3")->read() + ((~(1 << ioport("IN5")->read())) << 8));
return input_port_read(machine(), "IN3") + /* Low byte of CN1 */ return ioport("IN3")->read() + /* Low byte of CN1 */
((~(1 << input_port_read(machine(), "IN5"))) << 8); ((~(1 << ioport("IN5")->read())) << 8);
} }
READ16_MEMBER(alpha68k_state::control_2_V_r) READ16_MEMBER(alpha68k_state::control_2_V_r)
{ {
return input_port_read(machine(), "IN3"); return ioport("IN3")->read();
} }
READ16_MEMBER(alpha68k_state::control_3_r) READ16_MEMBER(alpha68k_state::control_3_r)
{ {
if (m_invert_controls) if (m_invert_controls)
return ~(((~(1 << input_port_read(machine(), "IN6"))) << 8) & 0xff00); return ~(((~(1 << ioport("IN6")->read())) << 8) & 0xff00);
return ((~(1 << input_port_read(machine(), "IN6"))) << 8) & 0xff00; return ((~(1 << ioport("IN6")->read())) << 8) & 0xff00;
} }
/* High 4 bits of CN1 & CN2 */ /* High 4 bits of CN1 & CN2 */
@ -274,20 +274,20 @@ READ16_MEMBER(alpha68k_state::control_4_r)
{ {
if (m_invert_controls) if (m_invert_controls)
return ~((((~(1 << input_port_read(machine(), "IN6"))) << 4) & 0xf000) return ~((((~(1 << ioport("IN6")->read())) << 4) & 0xf000)
+ (((~(1 << input_port_read(machine(), "IN5")))) & 0x0f00)); + (((~(1 << ioport("IN5")->read()))) & 0x0f00));
return (((~(1 << input_port_read(machine(), "IN6"))) << 4) & 0xf000) return (((~(1 << ioport("IN6")->read())) << 4) & 0xf000)
+ (((~(1 << input_port_read(machine(), "IN5")))) & 0x0f00); + (((~(1 << ioport("IN5")->read()))) & 0x0f00);
} }
READ16_MEMBER(alpha68k_state::jongbou_inputs_r) READ16_MEMBER(alpha68k_state::jongbou_inputs_r)
{ {
UINT8 inp1 = input_port_read(machine(), "IN3"); UINT8 inp1 = ioport("IN3")->read();
UINT8 inp2 = input_port_read(machine(), "IN4"); UINT8 inp2 = ioport("IN4")->read();
inp1 = ((inp1 & 0x01) << 3) + ((inp1 & 0x02) << 1) + ((inp1 & 0x04) >> 1) + ((inp1 & 0x08) >> 3); inp1 = ((inp1 & 0x01) << 3) + ((inp1 & 0x02) << 1) + ((inp1 & 0x04) >> 1) + ((inp1 & 0x08) >> 3);
inp2 = ((inp2 & 0x01) << 3) + ((inp2 & 0x02) << 1) + ((inp2 & 0x04) >> 1) + ((inp2 & 0x08) >> 3); inp2 = ((inp2 & 0x01) << 3) + ((inp2 & 0x02) << 1) + ((inp2 & 0x04) >> 1) + ((inp2 & 0x08) >> 3);
return input_port_read(machine(), "IN0") | inp1 | inp2 << 4; return ioport("IN0")->read() | inp1 | inp2 << 4;
} }
@ -353,15 +353,15 @@ READ16_MEMBER(alpha68k_state::kyros_alpha_trigger_r)
return 0; return 0;
case 0x29: /* Query microcontroller for coin insert */ case 0x29: /* Query microcontroller for coin insert */
m_trigstate++; m_trigstate++;
if ((input_port_read(machine(), "IN2") & 0x3) == 3) if ((ioport("IN2")->read() & 0x3) == 3)
m_latch = 0; m_latch = 0;
if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch) if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
{ {
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
m_shared_ram[0x22] = (source & 0xff00) | 0x0; m_shared_ram[0x22] = (source & 0xff00) | 0x0;
m_latch = 1; m_latch = 1;
m_coinvalue = (~input_port_read(machine(), "IN1") >> 1) & 7; m_coinvalue = (~ioport("IN1")->read() >> 1) & 7;
m_deposits1++; m_deposits1++;
if (m_deposits1 == coinage1[m_coinvalue][0]) if (m_deposits1 == coinage1[m_coinvalue][0])
{ {
@ -371,13 +371,13 @@ READ16_MEMBER(alpha68k_state::kyros_alpha_trigger_r)
else else
m_credits = 0; m_credits = 0;
} }
else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch) else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
{ {
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id >> 8); // coinB m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id >> 8); // coinB
m_shared_ram[0x22] = (source & 0xff00) | 0x0; m_shared_ram[0x22] = (source & 0xff00) | 0x0;
m_latch = 1; m_latch = 1;
m_coinvalue = (~input_port_read(machine(), "IN1") >>1 ) & 7; m_coinvalue = (~ioport("IN1")->read() >>1 ) & 7;
m_deposits2++; m_deposits2++;
if (m_deposits2 == coinage2[m_coinvalue][0]) if (m_deposits2 == coinage2[m_coinvalue][0])
{ {
@ -430,7 +430,7 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
switch (offset) switch (offset)
{ {
case 0: /* Dipswitch 2 */ case 0: /* Dipswitch 2 */
m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "IN4"); m_shared_ram[0] = (source & 0xff00) | ioport("IN4")->read();
return 0; return 0;
case 0x22: /* Coin value */ case 0x22: /* Coin value */
@ -438,9 +438,9 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
return 0; return 0;
case 0x29: /* Query microcontroller for coin insert */ case 0x29: /* Query microcontroller for coin insert */
if ((input_port_read(machine(), "IN2") & 0x3) == 3) if ((ioport("IN2")->read() & 0x3) == 3)
m_latch = 0; m_latch = 0;
if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch) if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
{ {
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
m_shared_ram[0x22] = (source & 0xff00) | 0x0; m_shared_ram[0x22] = (source & 0xff00) | 0x0;
@ -449,9 +449,9 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
if ((m_coin_id & 0xff) == 0x22) if ((m_coin_id & 0xff) == 0x22)
{ {
if (m_game_id == ALPHA68K_BTLFIELDB) if (m_game_id == ALPHA68K_BTLFIELDB)
m_coinvalue = (input_port_read(machine(), "IN4") >> 0) & 7; m_coinvalue = (ioport("IN4")->read() >> 0) & 7;
else else
m_coinvalue = (~input_port_read(machine(), "IN4") >> 0) & 7; m_coinvalue = (~ioport("IN4")->read() >> 0) & 7;
m_deposits1++; m_deposits1++;
if (m_deposits1 == coinage1[m_coinvalue][0]) if (m_deposits1 == coinage1[m_coinvalue][0])
@ -463,7 +463,7 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
m_credits = 0; m_credits = 0;
} }
} }
else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch) else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
{ {
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id >> 8); // coinB m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id >> 8); // coinB
m_shared_ram[0x22] = (source & 0xff00) | 0x0; m_shared_ram[0x22] = (source & 0xff00) | 0x0;
@ -472,9 +472,9 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r)
if ((m_coin_id >> 8) == 0x22) if ((m_coin_id >> 8) == 0x22)
{ {
if (m_game_id == ALPHA68K_BTLFIELDB) if (m_game_id == ALPHA68K_BTLFIELDB)
m_coinvalue = (input_port_read(machine(), "IN4") >> 0) & 7; m_coinvalue = (ioport("IN4")->read() >> 0) & 7;
else else
m_coinvalue = (~input_port_read(machine(), "IN4") >> 0) & 7; m_coinvalue = (~ioport("IN4")->read() >> 0) & 7;
m_deposits2++; m_deposits2++;
if (m_deposits2 == coinage2[m_coinvalue][0]) if (m_deposits2 == coinage2[m_coinvalue][0])
@ -524,15 +524,15 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
switch (offset) switch (offset)
{ {
case 0: /* Dipswitch 1 */ case 0: /* Dipswitch 1 */
m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "IN4"); m_shared_ram[0] = (source & 0xff00) | ioport("IN4")->read();
return 0; return 0;
case 0x22: /* Coin value */ case 0x22: /* Coin value */
m_shared_ram[0x22] = (source & 0xff00) | (m_credits & 0x00ff); m_shared_ram[0x22] = (source & 0xff00) | (m_credits & 0x00ff);
return 0; return 0;
case 0x29: /* Query microcontroller for coin insert */ case 0x29: /* Query microcontroller for coin insert */
if ((input_port_read(machine(), "IN2") & 0x3) == 3) if ((ioport("IN2")->read() & 0x3) == 3)
m_latch = 0; m_latch = 0;
if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch) if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
{ {
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
m_shared_ram[0x22] = (source & 0xff00) | 0x0; m_shared_ram[0x22] = (source & 0xff00) | 0x0;
@ -540,7 +540,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
if ((m_coin_id & 0xff) == 0x22) if ((m_coin_id & 0xff) == 0x22)
{ {
m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7; m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
m_deposits1++; m_deposits1++;
if (m_deposits1 == coinage1[m_coinvalue][0]) if (m_deposits1 == coinage1[m_coinvalue][0])
{ {
@ -551,7 +551,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
m_credits = 0; m_credits = 0;
} }
} }
else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch) else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
{ {
m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id>>8); // coinB m_shared_ram[0x29] = (source & 0xff00) | (m_coin_id>>8); // coinB
m_shared_ram[0x22] = (source & 0xff00) | 0x0; m_shared_ram[0x22] = (source & 0xff00) | 0x0;
@ -559,7 +559,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
if ((m_coin_id >> 8) == 0x22) if ((m_coin_id >> 8) == 0x22)
{ {
m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7; m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
m_deposits2++; m_deposits2++;
if (m_deposits2 == coinage2[m_coinvalue][0]) if (m_deposits2 == coinage2[m_coinvalue][0])
{ {
@ -585,12 +585,12 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
break; break;
case 0x1f00: /* Dipswitch 1 */ case 0x1f00: /* Dipswitch 1 */
m_shared_ram[0x1f00] = (source & 0xff00) | input_port_read(machine(), "IN4"); m_shared_ram[0x1f00] = (source & 0xff00) | ioport("IN4")->read();
return 0; return 0;
case 0x1f29: /* Query microcontroller for coin insert */ case 0x1f29: /* Query microcontroller for coin insert */
if ((input_port_read(machine(), "IN2") & 0x3) == 3) if ((ioport("IN2")->read() & 0x3) == 3)
m_latch = 0; m_latch = 0;
if ((input_port_read(machine(), "IN2") & 0x1) == 0 && !m_latch) if ((ioport("IN2")->read() & 0x1) == 0 && !m_latch)
{ {
m_shared_ram[0x1f29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA m_shared_ram[0x1f29] = (source & 0xff00) | (m_coin_id & 0xff); // coinA
m_shared_ram[0x1f22] = (source & 0xff00) | 0x0; m_shared_ram[0x1f22] = (source & 0xff00) | 0x0;
@ -598,7 +598,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
if ((m_coin_id & 0xff) == 0x22) if ((m_coin_id & 0xff) == 0x22)
{ {
m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7; m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
m_deposits1++; m_deposits1++;
if (m_deposits1 == coinage1[m_coinvalue][0]) if (m_deposits1 == coinage1[m_coinvalue][0])
{ {
@ -609,7 +609,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
m_credits = 0; m_credits = 0;
} }
} }
else if ((input_port_read(machine(), "IN2") & 0x2) == 0 && !m_latch) else if ((ioport("IN2")->read() & 0x2) == 0 && !m_latch)
{ {
m_shared_ram[0x1f29] = (source & 0xff00) | (m_coin_id >> 8); // coinB m_shared_ram[0x1f29] = (source & 0xff00) | (m_coin_id >> 8); // coinB
m_shared_ram[0x1f22] = (source & 0xff00) | 0x0; m_shared_ram[0x1f22] = (source & 0xff00) | 0x0;
@ -617,7 +617,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
if ((m_coin_id >> 8) == 0x22) if ((m_coin_id >> 8) == 0x22)
{ {
m_coinvalue = (~input_port_read(machine(), "IN4") >> 1) & 7; m_coinvalue = (~ioport("IN4")->read() >> 1) & 7;
m_deposits2++; m_deposits2++;
if (m_deposits2 == coinage2[m_coinvalue][0]) if (m_deposits2 == coinage2[m_coinvalue][0])
{ {
@ -638,7 +638,7 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r)
the microcontroller supplies it (it does for all the other games, the microcontroller supplies it (it does for all the other games,
but usually to 0x0 in RAM) when 0x21 is read (code at 0x009332) */ but usually to 0x0 in RAM) when 0x21 is read (code at 0x009332) */
source = m_shared_ram[0x0163]; source = m_shared_ram[0x0163];
m_shared_ram[0x0163] = (source & 0x00ff) | (input_port_read(machine(), "IN4") << 8); m_shared_ram[0x0163] = (source & 0x00ff) | (ioport("IN4")->read() << 8);
return 0; return 0;
case 0x1ffe: /* Custom ID check */ case 0x1ffe: /* Custom ID check */
@ -1568,10 +1568,10 @@ static INPUT_PORTS_START( tnextspc )
PORT_DIPSETTING( 0x03, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x03, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x01, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,PORTCOND_EQUALS,0x08) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,EQUALS,0x08)
PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( On ) ) PORT_DIPSETTING( 0x04, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, "Game Mode" ) PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,PORTCOND_EQUALS,0x00) PORT_DIPNAME( 0x04, 0x04, "Game Mode" ) PORT_DIPLOCATION("SW2:3") PORT_CONDITION("DSW2",0x08,EQUALS,0x00)
PORT_DIPSETTING( 0x00, "Freeze" ) PORT_DIPSETTING( 0x00, "Freeze" )
PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)") PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)")
PORT_DIPNAME( 0x08, 0x08, "SW2:3 Demo Sound/Game Mode" ) PORT_DIPLOCATION("SW2:4") PORT_DIPNAME( 0x08, 0x08, "SW2:3 Demo Sound/Game Mode" ) PORT_DIPLOCATION("SW2:4")

View File

@ -703,10 +703,10 @@ static INPUT_PORTS_START( ampoker2 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */ PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x08) PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x08)
PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x08) PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x08)
PORT_DIPSETTING( 0x08, "Cred x 20" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */ PORT_DIPSETTING( 0x08, "Cred x 20" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x00) /* x100 in ampkr95 */
PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1", 0x08, PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1", 0x08, EQUALS,0x00)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Black Card") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Black Card")
PORT_START("IN4") PORT_START("IN4")
@ -788,10 +788,10 @@ static INPUT_PORTS_START( ampkr95 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */ PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08) PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08) PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */ PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00) /* x100 in ampkr95 */
PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Black Card") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Black Card")
PORT_START("IN4") PORT_START("IN4")
@ -873,10 +873,10 @@ static INPUT_PORTS_START( sigmapkr )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper Out") PORT_CODE(KEYCODE_G)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Supervisor Key") PORT_TOGGLE PORT_CODE(KEYCODE_0)
PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */ PORT_DIPNAME( 0x08, 0x08, "Remote Credits" ) PORT_DIPLOCATION("SW1:1") /* DSW1 */
PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08) PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x08) PORT_DIPSETTING( 0x00, "Cred x 50" ) PORT_CONDITION("IN1",0x08,EQUALS,0x08)
PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) /* x100 in ampkr95 */ PORT_DIPSETTING( 0x08, "Cred x 100" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00) /* x100 in ampkr95 */
PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0x00, "Remote Off" ) PORT_CONDITION("IN1",0x08,EQUALS,0x00)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double") PORT_CODE(KEYCODE_S) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double") PORT_CODE(KEYCODE_S)
PORT_START("IN4") PORT_START("IN4")

View File

@ -38,7 +38,7 @@ static UINT8 amspdwy_wheel_r( running_machine &machine, int index )
{ {
amspdwy_state *state = machine.driver_data<amspdwy_state>(); amspdwy_state *state = machine.driver_data<amspdwy_state>();
static const char *const portnames[] = { "WHEEL1", "WHEEL2", "AN1", "AN2" }; static const char *const portnames[] = { "WHEEL1", "WHEEL2", "AN1", "AN2" };
UINT8 wheel = input_port_read(machine, portnames[2 + index]); UINT8 wheel = machine.root_device().ioport(portnames[2 + index])->read();
if (wheel != state->m_wheel_old[index]) if (wheel != state->m_wheel_old[index])
{ {
wheel = (wheel & 0x7fff) - (wheel & 0x8000); wheel = (wheel & 0x7fff) - (wheel & 0x8000);
@ -49,7 +49,7 @@ static UINT8 amspdwy_wheel_r( running_machine &machine, int index )
state->m_wheel_old[index] = wheel; state->m_wheel_old[index] = wheel;
} }
return state->m_wheel_return[index] | input_port_read(machine, portnames[index]); return state->m_wheel_return[index] | machine.root_device().ioport(portnames[index])->read();
} }
READ8_MEMBER(amspdwy_state::amspdwy_wheel_0_r) READ8_MEMBER(amspdwy_state::amspdwy_wheel_0_r)
@ -64,7 +64,7 @@ READ8_MEMBER(amspdwy_state::amspdwy_wheel_1_r)
static READ8_DEVICE_HANDLER( amspdwy_sound_r ) static READ8_DEVICE_HANDLER( amspdwy_sound_r )
{ {
return (ym2151_status_port_r(device, 0) & ~ 0x30) | input_port_read(device->machine(), "IN0"); return (ym2151_status_port_r(device, 0) & ~ 0x30) | device->machine().root_device().ioport("IN0")->read();
} }
WRITE8_MEMBER(amspdwy_state::amspdwy_sound_w) WRITE8_MEMBER(amspdwy_state::amspdwy_sound_w)

View File

@ -160,9 +160,9 @@ READ8_MEMBER(angelkds_state::angelkds_input_r)
static const char *const portnames[] = { "I81", "I82" }; static const char *const portnames[] = { "I81", "I82" };
static const char *const fakenames[] = { "FAKE1", "FAKE2" }; static const char *const fakenames[] = { "FAKE1", "FAKE2" };
fake = input_port_read(machine(), fakenames[offset]); fake = ioport(fakenames[offset])->read();
return ((fake & 0x01) ? fake : input_port_read(machine(), portnames[offset])); return ((fake & 0x01) ? fake : ioport(portnames[offset])->read());
} }
#else #else
@ -171,7 +171,7 @@ READ8_MEMBER(angelkds_state::angelkds_input_r)
{ {
static const char *const portnames[] = { "I81", "I82" }; static const char *const portnames[] = { "I81", "I82" };
return input_port_read(machine(), portnames[offset]); return ioport(portnames[offset])->read();
} }
#endif #endif

View File

@ -46,7 +46,7 @@ READ16_MEMBER(aquarium_state::aquarium_coins_r)
{ {
int data; int data;
data = (input_port_read(machine(), "SYSTEM") & 0x7fff); data = (ioport("SYSTEM")->read() & 0x7fff);
data |= m_aquarium_snd_ack; data |= m_aquarium_snd_ack;
m_aquarium_snd_ack = 0; m_aquarium_snd_ack = 0;

View File

@ -145,7 +145,7 @@ READ8_MEMBER(arabian_state::mcu_portk_r)
{ {
if (~sel & (1 << i)) if (~sel & (1 << i))
{ {
val = input_port_read(machine(), comnames[i]); val = ioport(comnames[i])->read();
break; break;
} }
} }

View File

@ -208,7 +208,7 @@ static INPUT_PORTS_START( arcadecl )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("COIN") PORT_START("COIN")
@ -268,7 +268,7 @@ static INPUT_PORTS_START( sparkz )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("COIN") PORT_START("COIN")

View File

@ -321,7 +321,7 @@ INLINE void uBackgroundColour(running_machine &machine)
There are 4 possible combinations for colour select via SW7, colours vary based on software installed. There are 4 possible combinations for colour select via SW7, colours vary based on software installed.
*/ */
switch(input_port_read(machine, "SW7")) switch(state->ioport("SW7")->read())
{ {
case 0x00: case 0x00:
// restore defaults // restore defaults
@ -380,12 +380,12 @@ static SCREEN_UPDATE_IND16(aristmk4)
READ8_MEMBER(aristmk4_state::ldsw) READ8_MEMBER(aristmk4_state::ldsw)
{ {
int U3_p2_ret= input_port_read(machine(), "5002"); int U3_p2_ret= ioport("5002")->read();
if(U3_p2_ret & 0x1) if(U3_p2_ret & 0x1)
{ {
return 0; return 0;
} }
return m_cgdrsw = input_port_read(machine(), "5005"); return m_cgdrsw = ioport("5005")->read();
} }
READ8_MEMBER(aristmk4_state::cgdrr) READ8_MEMBER(aristmk4_state::cgdrr)
@ -420,8 +420,8 @@ WRITE8_MEMBER(aristmk4_state::u3_p0)
READ8_MEMBER(aristmk4_state::u3_p2) READ8_MEMBER(aristmk4_state::u3_p2)
{ {
int u3_p2_ret= input_port_read(machine(), "5002"); int u3_p2_ret= ioport("5002")->read();
int u3_p3_ret= input_port_read(machine(), "5003"); int u3_p3_ret= ioport("5003")->read();
output_set_lamp_value(19, (u3_p2_ret >> 4) & 1); //auditkey light output_set_lamp_value(19, (u3_p2_ret >> 4) & 1); //auditkey light
output_set_lamp_value(20, (u3_p3_ret >> 2) & 1); //jackpotkey light output_set_lamp_value(20, (u3_p3_ret >> 2) & 1); //jackpotkey light
@ -434,7 +434,7 @@ READ8_MEMBER(aristmk4_state::u3_p2)
if (m_inscrd==0) if (m_inscrd==0)
{ {
m_inscrd=input_port_read(machine(), "insertcoin"); m_inscrd=ioport("insertcoin")->read();
} }
if (m_inscrd==1) if (m_inscrd==1)
@ -446,7 +446,7 @@ READ8_MEMBER(aristmk4_state::u3_p2)
READ8_MEMBER(aristmk4_state::u3_p3) READ8_MEMBER(aristmk4_state::u3_p3)
{ {
int u3_p3_ret= input_port_read(machine(), "5003"); int u3_p3_ret= ioport("5003")->read();
if ((m_printer_motor)==1) // Printer Motor Off if ((m_printer_motor)==1) // Printer Motor Off
@ -474,7 +474,7 @@ READ8_MEMBER(aristmk4_state::bv_p0)
switch(m_insnote) switch(m_insnote)
{ {
case 0x01: case 0x01:
bv_p0_ret=input_port_read(machine(), "NS")+0x81; //check note selector bv_p0_ret=ioport("NS")->read()+0x81; //check note selector
m_insnote++; m_insnote++;
break; break;
case 0x02: case 0x02:
@ -496,7 +496,7 @@ READ8_MEMBER(aristmk4_state::bv_p1)
int bv_p1_ret=0x00; int bv_p1_ret=0x00;
if (m_insnote==0) if (m_insnote==0)
m_insnote=input_port_read(machine(), "insertnote"); m_insnote=ioport("insertnote")->read();
if (m_insnote==1) if (m_insnote==1)
bv_p1_ret=0x08; bv_p1_ret=0x08;
@ -645,7 +645,7 @@ static READ8_DEVICE_HANDLER(via_b_r)
{ {
aristmk4_state *state = device->machine().driver_data<aristmk4_state>(); aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
int ret=input_port_read(device->machine(), "via_port_b"); int ret=state->ioport("via_port_b")->read();
// Not expecting to read anything from port B on the AY8910's ( controls BC1, BC2 and BDIR ) // Not expecting to read anything from port B on the AY8910's ( controls BC1, BC2 and BDIR )
// However there are extra 4 bits not going to the AY8910's on the schematics, which get read from here. // However there are extra 4 bits not going to the AY8910's on the schematics, which get read from here.
@ -1561,12 +1561,12 @@ static const mc6845_interface mc6845_intf =
static READ8_DEVICE_HANDLER(pa1_r) static READ8_DEVICE_HANDLER(pa1_r)
{ {
return (input_port_read(device->machine(), "SW3") << 4) + input_port_read(device->machine(), "SW4"); return (device->machine().root_device().ioport("SW3")->read() << 4) + device->machine().root_device().ioport("SW4")->read();
} }
static READ8_DEVICE_HANDLER(pb1_r) static READ8_DEVICE_HANDLER(pb1_r)
{ {
return (input_port_read(device->machine(), "SW5") << 4) + input_port_read(device->machine(), "SW6"); return (device->machine().root_device().ioport("SW5")->read() << 4) + device->machine().root_device().ioport("SW6")->read();
} }
static READ8_DEVICE_HANDLER(pc1_r) static READ8_DEVICE_HANDLER(pc1_r)
@ -1630,7 +1630,7 @@ static MACHINE_START( aristmk4 )
static MACHINE_RESET( aristmk4 ) static MACHINE_RESET( aristmk4 )
{ {
/* mark 4 has a link on the motherboard to switch between 1.5MHz and 3MHz clock speed */ /* mark 4 has a link on the motherboard to switch between 1.5MHz and 3MHz clock speed */
switch(input_port_read(machine, "LK13")) // CPU speed control... 3mhz or 1.5MHz switch(machine.root_device().ioport("LK13")->read()) // CPU speed control... 3mhz or 1.5MHz
{ {
case 0x00: case 0x00:
machine.device("maincpu")->set_unscaled_clock(MAIN_CLOCK/4); // 3 MHz machine.device("maincpu")->set_unscaled_clock(MAIN_CLOCK/4); // 3 MHz
@ -1659,7 +1659,7 @@ static TIMER_DEVICE_CALLBACK( aristmk4_pf )
Note: The use of 1 Hz in the timer is to avoid unintentional triggering the NMI ( ie.. hold down L for at least 1 second ) Note: The use of 1 Hz in the timer is to avoid unintentional triggering the NMI ( ie.. hold down L for at least 1 second )
*/ */
if(input_port_read(timer.machine(), "powerfail")) // send NMI signal if L pressed if(timer.machine().root_device().ioport("powerfail")->read()) // send NMI signal if L pressed
{ {
cputag_set_input_line( timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE ); cputag_set_input_line( timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE );
} }

View File

@ -392,13 +392,13 @@ static MACHINE_RESET( aristmk5 )
/* load the roms according to what the operator wants */ /* load the roms according to what the operator wants */
{ {
UINT8 *ROM = machine.root_device().memregion("maincpu")->base(); UINT8 *ROM = state->memregion("maincpu")->base();
UINT8 *PRG;// = state->memregion("prg_code")->base(); UINT8 *PRG;// = state->memregion("prg_code")->base();
int i; int i;
UINT8 op_mode; UINT8 op_mode;
static const char *const rom_region[] = { "set_chip_4.04", "set_chip_4.4", "clear_chip", "game_prg" }; static const char *const rom_region[] = { "set_chip_4.04", "set_chip_4.4", "clear_chip", "game_prg" };
op_mode = input_port_read(machine, "ROM_LOAD"); op_mode = machine.root_device().ioport("ROM_LOAD")->read();
PRG = machine.root_device().memregion(rom_region[op_mode & 3])->base(); PRG = machine.root_device().memregion(rom_region[op_mode & 3])->base();

View File

@ -1643,7 +1643,7 @@ static DRIVER_INIT( paddle2 )
static DRIVER_INIT( tetrsark ) static DRIVER_INIT( tetrsark )
{ {
arkanoid_state *state = machine.driver_data<arkanoid_state>(); arkanoid_state *state = machine.driver_data<arkanoid_state>();
UINT8 *ROM = machine.root_device().memregion("maincpu")->base(); UINT8 *ROM = state->memregion("maincpu")->base();
int x; int x;
for (x = 0; x < 0x8000; x++) for (x = 0; x < 0x8000; x++)

View File

@ -556,16 +556,16 @@ READ16_MEMBER(bigfghtr_state::sharedram_r)
break; break;
case 0x642/2: case 0x642/2:
return (input_port_read(machine(), "DSW0") & 0xffff) ^ 0xffff; return (ioport("DSW0")->read() & 0xffff) ^ 0xffff;
case 0x644/2: case 0x644/2:
return (input_port_read(machine(), "DSW1") & 0xffff) ^ 0xffff; return (ioport("DSW1")->read() & 0xffff) ^ 0xffff;
case 0x646/2: case 0x646/2:
return (input_port_read(machine(), "P1") & 0xffff) ^ 0xffff; return (ioport("P1")->read() & 0xffff) ^ 0xffff;
case 0x648/2: case 0x648/2:
return (input_port_read(machine(), "P2") & 0xffff) ^ 0xffff; return (ioport("P2")->read() & 0xffff) ^ 0xffff;
} }
} }
@ -581,16 +581,16 @@ READ16_MEMBER(bigfghtr_state::sharedram_r)
} }
break; break;
case 0x642/2: case 0x642/2:
return (input_port_read(machine(), "DSW0") & 0xffff) ^ 0xffff; return (ioport("DSW0")->read() & 0xffff) ^ 0xffff;
case 0x644/2: case 0x644/2:
return (input_port_read(machine(), "DSW1") & 0xffff) ^ 0xffff; return (ioport("DSW1")->read() & 0xffff) ^ 0xffff;
case 0x646/2: case 0x646/2:
return (input_port_read(machine(), "P1") & 0xffff) ^ 0xffff; return (ioport("P1")->read() & 0xffff) ^ 0xffff;
case 0x648/2: case 0x648/2:
return (input_port_read(machine(), "P2") & 0xffff) ^ 0xffff; return (ioport("P2")->read() & 0xffff) ^ 0xffff;
/* /*
protection controls where the program code should jump to. protection controls where the program code should jump to.

View File

@ -152,7 +152,7 @@ READ16_MEMBER(artmagic_state::ultennis_hack_r)
update_irq_state(machine()); update_irq_state(machine());
machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off)); machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
} }
return input_port_read(machine(), "300000"); return ioport("300000")->read();
} }

View File

@ -46,7 +46,7 @@ WRITE16_MEMBER(asterix_state::control2_w)
/* bit 0 is data */ /* bit 0 is data */
/* bit 1 is cs (active low) */ /* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */ /* bit 2 is clock (active high) */
input_port_write(machine(), "EEPROMOUT", data, 0xff); ioport("EEPROMOUT")->write(data, 0xff);
/* bit 5 is select tile bank */ /* bit 5 is select tile bank */
k056832_set_tile_bank(m_k056832, (data & 0x20) >> 5); k056832_set_tile_bank(m_k056832, (data & 0x20) >> 5);

View File

@ -422,14 +422,14 @@ static INPUT_PORTS_START( asterock )
PORT_DIPSETTING ( 0x00, DEF_STR( Normal ) ) PORT_DIPSETTING ( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING ( 0x20, "Special" ) PORT_DIPSETTING ( 0x20, "Special" )
PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:7,8") PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:7,8")
PORT_DIPSETTING ( 0xc0, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00) PORT_DIPSETTING ( 0xc0, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
PORT_DIPSETTING ( 0x80, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00) PORT_DIPSETTING ( 0x80, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
PORT_DIPSETTING ( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00) PORT_DIPSETTING ( 0x40, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
// PORT_DIPSETTING ( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x20,PORTCOND_EQUALS,0x00) // PORT_DIPSETTING ( 0x00, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
PORT_DIPSETTING ( 0xc0, "Coin A 2/1 Coin B 2/1 Coin C 1/1" ) PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00) PORT_DIPSETTING ( 0xc0, "Coin A 2/1 Coin B 2/1 Coin C 1/1" ) PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
PORT_DIPSETTING ( 0x80, "Coin A 1/1 Coin B 1/1 Coin C 1/2" ) PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00) PORT_DIPSETTING ( 0x80, "Coin A 1/1 Coin B 1/1 Coin C 1/2" ) PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
PORT_DIPSETTING ( 0x40, "Coin A 1/2 Coin B 1/2 Coin C 1/4" ) PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00) PORT_DIPSETTING ( 0x40, "Coin A 1/2 Coin B 1/2 Coin C 1/4" ) PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
// PORT_DIPSETTING ( 0x00, "Coin A 1/1 Coin B 1/1 Coin C 1/2" ) PORT_CONDITION("DSW1",0x20,PORTCOND_NOTEQUALS,0x00) // PORT_DIPSETTING ( 0x00, "Coin A 1/1 Coin B 1/1 Coin C 1/2" ) PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
INPUT_PORTS_END INPUT_PORTS_END

View File

@ -352,7 +352,7 @@ static WRITE8_DEVICE_HANDLER( astinvad_sound2_w )
if (bits_gone_hi & 0x08) state->m_samples->start(5, SND_FLEET4); if (bits_gone_hi & 0x08) state->m_samples->start(5, SND_FLEET4);
if (bits_gone_hi & 0x10) state->m_samples->start(4, SND_UFOHIT); if (bits_gone_hi & 0x10) state->m_samples->start(4, SND_UFOHIT);
state->m_screen_flip = (input_port_read(device->machine(), "CABINET") & data & 0x20) ? 0xff : 0x00; state->m_screen_flip = (state->ioport("CABINET")->read() & data & 0x20) ? 0xff : 0x00;
} }
@ -383,7 +383,7 @@ WRITE8_MEMBER(astinvad_state::spaceint_sound2_w)
if (bits_gone_hi & 0x04) m_samples->start(3, SND_INVADERHIT); if (bits_gone_hi & 0x04) m_samples->start(3, SND_INVADERHIT);
m_screen_flip = (input_port_read(machine(), "CABINET") & data & 0x80) ? 0xff : 0x00; m_screen_flip = (ioport("CABINET")->read() & data & 0x80) ? 0xff : 0x00;
} }
@ -460,7 +460,7 @@ static INPUT_PORTS_START( kamikaze )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
PORT_START("IN2") PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("CABINET") PORT_START("CABINET")

View File

@ -256,7 +256,7 @@ WRITE8_MEMBER(astrocde_state::seawolf2_sound_2_w)// Port 41
CUSTOM_INPUT_MEMBER(astrocde_state::ebases_trackball_r) CUSTOM_INPUT_MEMBER(astrocde_state::ebases_trackball_r)
{ {
static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" }; static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" };
return input_port_read(machine(), names[m_input_select]); return ioport(names[m_input_select])->read();
} }
@ -283,7 +283,7 @@ READ8_MEMBER(astrocde_state::spacezap_io_r)
{ {
coin_counter_w(machine(), 0, (offset >> 8) & 1); coin_counter_w(machine(), 0, (offset >> 8) & 1);
coin_counter_w(machine(), 1, (offset >> 9) & 1); coin_counter_w(machine(), 1, (offset >> 9) & 1);
return input_port_read_safe(machine(), "P3HANDLE", 0xff); return ioport("P3HANDLE")->read_safe(0xff);
} }
@ -482,7 +482,7 @@ READ8_MEMBER(astrocde_state::demndrgn_io_r)
CUSTOM_INPUT_MEMBER(astrocde_state::demndragn_joystick_r) CUSTOM_INPUT_MEMBER(astrocde_state::demndragn_joystick_r)
{ {
static const char *const names[] = { "MOVEX", "MOVEY" }; static const char *const names[] = { "MOVEX", "MOVEY" };
return input_port_read(machine(), names[m_input_select]); return ioport(names[m_input_select])->read();
} }

View File

@ -177,7 +177,7 @@ WRITE16_MEMBER(astrocorp_state::astrocorp_eeprom_w)
{ {
if (ACCESSING_BITS_0_7) if (ACCESSING_BITS_0_7)
{ {
input_port_write(machine(), "EEPROMOUT", data, 0xff); ioport("EEPROMOUT")->write(data, 0xff);
} }
} }

View File

@ -120,7 +120,7 @@ INPUT_CHANGED_MEMBER(astrof_state::service_coin_inserted)
CUSTOM_INPUT_MEMBER(astrof_state::astrof_p1_controls_r) CUSTOM_INPUT_MEMBER(astrof_state::astrof_p1_controls_r)
{ {
return input_port_read(machine(), "P1"); return ioport("P1")->read();
} }
@ -131,10 +131,10 @@ CUSTOM_INPUT_MEMBER(astrof_state::astrof_p2_controls_r)
/* on an upright cabinet, a single set of controls /* on an upright cabinet, a single set of controls
is connected to both sets of pins on the edge is connected to both sets of pins on the edge
connector */ connector */
if (input_port_read(machine(), "CAB")) if (ioport("CAB")->read())
ret = input_port_read(machine(), "P2"); ret = ioport("P2")->read();
else else
ret = input_port_read(machine(), "P1"); ret = ioport("P1")->read();
return ret; return ret;
} }
@ -149,9 +149,9 @@ CUSTOM_INPUT_MEMBER(astrof_state::tomahawk_controls_r)
(not verified on pcb) */ (not verified on pcb) */
if (m_flipscreen) if (m_flipscreen)
ret = input_port_read(machine(), "P2"); ret = ioport("P2")->read();
else else
ret = input_port_read(machine(), "P1"); ret = ioport("P1")->read();
return ret; return ret;
} }
@ -204,7 +204,7 @@ static void astrof_get_pens( running_machine &machine, pen_t *pens )
astrof_state *state = machine.driver_data<astrof_state>(); astrof_state *state = machine.driver_data<astrof_state>();
offs_t i; offs_t i;
UINT8 bank = (state->m_astrof_palette_bank ? 0x10 : 0x00); UINT8 bank = (state->m_astrof_palette_bank ? 0x10 : 0x00);
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00); UINT8 config = state->ioport("FAKE")->read_safe(0x00);
UINT8 *prom = state->memregion("proms")->base(); UINT8 *prom = state->memregion("proms")->base();
/* a common wire hack to the pcb causes the prom halves to be inverted */ /* a common wire hack to the pcb causes the prom halves to be inverted */
@ -240,7 +240,7 @@ static void tomahawk_get_pens( running_machine &machine, pen_t *pens )
{ {
offs_t i; offs_t i;
UINT8 *prom = machine.root_device().memregion("proms")->base(); UINT8 *prom = machine.root_device().memregion("proms")->base();
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00); UINT8 config = machine.root_device().ioport("FAKE")->read_safe(0x00);
for (i = 0; i < TOMAHAWK_NUM_PENS; i++) for (i = 0; i < TOMAHAWK_NUM_PENS; i++)
{ {
@ -295,7 +295,7 @@ WRITE8_MEMBER(astrof_state::tomahawk_videoram_w)
WRITE8_MEMBER(astrof_state::video_control_1_w) WRITE8_MEMBER(astrof_state::video_control_1_w)
{ {
m_flipscreen = ((data >> 0) & 0x01) & input_port_read(machine(), "CAB"); m_flipscreen = ((data >> 0) & 0x01) & ioport("CAB")->read();
/* this ties to the CLR pin of the shift registers */ /* this ties to the CLR pin of the shift registers */
m_screen_off = (data & 0x02) ? TRUE : FALSE; m_screen_off = (data & 0x02) ? TRUE : FALSE;
@ -690,7 +690,7 @@ static INPUT_PORTS_START( astrof )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW:7") PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x40, DEF_STR( Hard ) )
PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB") PORT_START("CAB")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8")
@ -745,7 +745,7 @@ static INPUT_PORTS_START( abattle )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW:7") PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x40, DEF_STR( Hard ) )
PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB") PORT_START("CAB")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8")
@ -797,7 +797,7 @@ static INPUT_PORTS_START( spfghmk2 )
PORT_DIPSETTING( 0x20, "2500" ) PORT_DIPSETTING( 0x20, "2500" )
PORT_DIPSETTING( 0x30, "3000" ) PORT_DIPSETTING( 0x30, "3000" )
PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW:7" ) PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW:7" )
PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB") PORT_START("CAB")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8")
@ -852,7 +852,7 @@ static INPUT_PORTS_START( spfghmk22 )
PORT_DIPNAME( 0x40, 0x00, "Kill Saucer after Invaders" ) PORT_DIPLOCATION("SW:7") PORT_DIPNAME( 0x40, 0x00, "Kill Saucer after Invaders" ) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) /* if saucer lands, game is over */ PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) /* if saucer lands, game is over */
PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB") PORT_START("CAB")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8")
@ -911,7 +911,7 @@ static INPUT_PORTS_START( tomahawk )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW:7") PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x40, DEF_STR( Hard ) )
PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("CAB") PORT_START("CAB")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW:8")

View File

@ -655,23 +655,23 @@ static INPUT_PORTS_START( galmedes )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:5,6") PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:5,6")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80) PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80) PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80) PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80) PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:7,8") PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:7,8")
PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80) PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80) PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80) PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x80) PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x80)
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWB",0x80,PORTCOND_EQUALS,0x00) PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) ) PORT_CONDITION("DSWB",0x80,EQUALS,0x00)
/* 0x400002 -> 0x100984 */ /* 0x400002 -> 0x100984 */
PORT_MODIFY("DSWB") PORT_MODIFY("DSWB")
@ -842,7 +842,7 @@ static MACHINE_START( asuka )
state->m_tc0100scn = machine.device("tc0100scn"); state->m_tc0100scn = machine.device("tc0100scn");
/* configure the banks */ /* configure the banks */
state->membank("bank1")->configure_entry(0, machine.root_device().memregion("audiocpu")->base()); state->membank("bank1")->configure_entry(0, state->memregion("audiocpu")->base());
state->membank("bank1")->configure_entries(1, 3, state->memregion("audiocpu")->base() + 0x10000, 0x04000); state->membank("bank1")->configure_entries(1, 3, state->memregion("audiocpu")->base() + 0x10000, 0x04000);
state->save_item(NAME(state->m_adpcm_pos)); state->save_item(NAME(state->m_adpcm_pos));

View File

@ -240,7 +240,7 @@ static INPUT_PORTS_START( atarifb )
PORT_BIT ( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT ( 0x0f, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT ( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_START("IN1") PORT_START("IN1")
@ -310,7 +310,7 @@ static INPUT_PORTS_START( atarifb4 )
PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT ( 0x38, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT ( 0x38, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
INPUT_PORTS_END INPUT_PORTS_END
@ -387,7 +387,7 @@ static INPUT_PORTS_START( soccer )
PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused on schematics */ PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused on schematics */
PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_TILT )
PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT ( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1") PORT_START("DSW1")
PORT_DIPNAME( 0x07, 0x00, "Time per coin" ) PORT_DIPLOCATION("SW1:1,2,3") PORT_DIPNAME( 0x07, 0x00, "Time per coin" ) PORT_DIPLOCATION("SW1:1,2,3")

View File

@ -92,7 +92,7 @@ WRITE16_MEMBER(atarig1_state::mo_command_w)
READ16_MEMBER(atarig1_state::special_port0_r) READ16_MEMBER(atarig1_state::special_port0_r)
{ {
int temp = input_port_read(machine(), "IN0"); int temp = ioport("IN0")->read();
if (m_cpu_to_sound_ready) temp ^= 0x1000; if (m_cpu_to_sound_ready) temp ^= 0x1000;
temp ^= 0x2000; /* A2DOK always high for now */ temp ^= 0x2000; /* A2DOK always high for now */
return temp; return temp;
@ -111,11 +111,11 @@ READ16_MEMBER(atarig1_state::a2d_data_r)
/* Pit Fighter has no A2D, just another input port */ /* Pit Fighter has no A2D, just another input port */
if (m_is_pitfight) if (m_is_pitfight)
return input_port_read(machine(), "ADC0"); return ioport("ADC0")->read();
/* otherwise, assume it's hydra */ /* otherwise, assume it's hydra */
if (m_which_input < 3) if (m_which_input < 3)
return input_port_read(machine(), adcnames[m_which_input]) << 8; return ioport(adcnames[m_which_input])->read() << 8;
return 0; return 0;
} }
@ -247,7 +247,7 @@ static INPUT_PORTS_START( hydra )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW ) PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("ADC0") /* ADC 0 @ fc8000 */ PORT_START("ADC0") /* ADC 0 @ fc8000 */
PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
@ -279,7 +279,7 @@ static INPUT_PORTS_START( pitfight )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW ) PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("ADC0") /* fc8000 */ PORT_START("ADC0") /* fc8000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
@ -324,7 +324,7 @@ static INPUT_PORTS_START( pitfightj )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW ) PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("ADC0") /* fc8000 */ PORT_START("ADC0") /* fc8000 */
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )

View File

@ -72,7 +72,7 @@ static MACHINE_RESET( atarig42 )
READ16_MEMBER(atarig42_state::special_port2_r) READ16_MEMBER(atarig42_state::special_port2_r)
{ {
int temp = input_port_read(machine(), "IN2"); int temp = ioport("IN2")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0020; if (m_cpu_to_sound_ready) temp ^= 0x0020;
if (m_sound_to_cpu_ready) temp ^= 0x0010; if (m_sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */ temp ^= 0x0008; /* A2D.EOC always high for now */
@ -84,7 +84,7 @@ WRITE16_MEMBER(atarig42_state::a2d_select_w)
{ {
static const char *const portnames[] = { "A2D0", "A2D1" }; static const char *const portnames[] = { "A2D0", "A2D1" };
m_analog_data = input_port_read(machine(), portnames[offset != 0]); m_analog_data = ioport(portnames[offset != 0])->read();
} }
@ -386,7 +386,7 @@ static INPUT_PORTS_START( roadriot )
PORT_START("IN2") /* e00010 */ PORT_START("IN2") /* e00010 */
PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_INCLUDE( atarijsa_iii ) /* audio board port */ PORT_INCLUDE( atarijsa_iii ) /* audio board port */
@ -437,7 +437,7 @@ static INPUT_PORTS_START( guardian )
PORT_START("IN2") /* e00010 */ PORT_START("IN2") /* e00010 */
PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_INCLUDE( atarijsa_iii ) /* audio board port */ PORT_INCLUDE( atarijsa_iii ) /* audio board port */

View File

@ -99,7 +99,7 @@ static void cage_irq_callback(running_machine &machine, int reason)
READ32_MEMBER(atarigt_state::special_port2_r) READ32_MEMBER(atarigt_state::special_port2_r)
{ {
int temp = input_port_read(machine(), "SERVICE"); int temp = ioport("SERVICE")->read();
temp ^= 0x0001; /* /A2DRDY always high for now */ temp ^= 0x0001; /* /A2DRDY always high for now */
temp ^= 0x0008; /* A2D.EOC always high for now */ temp ^= 0x0008; /* A2D.EOC always high for now */
return (temp << 16) | temp; return (temp << 16) | temp;
@ -108,7 +108,7 @@ READ32_MEMBER(atarigt_state::special_port2_r)
READ32_MEMBER(atarigt_state::special_port3_r) READ32_MEMBER(atarigt_state::special_port3_r)
{ {
int temp = input_port_read(machine(), "COIN"); int temp = ioport("COIN")->read();
if (m_video_int_state) temp ^= 0x0001; if (m_video_int_state) temp ^= 0x0001;
if (m_scanline_int_state) temp ^= 0x0002; if (m_scanline_int_state) temp ^= 0x0002;
return (temp << 16) | temp; return (temp << 16) | temp;
@ -118,7 +118,7 @@ READ32_MEMBER(atarigt_state::special_port3_r)
#if (HACK_TMEK_CONTROLS) #if (HACK_TMEK_CONTROLS)
INLINE void compute_fake_pots(int *pots) INLINE void compute_fake_pots(int *pots)
{ {
int fake = input_port_read(machine, "FAKE"); int fake = machine.root_device().ioport("FAKE")->read();
pots[0] = pots[1] = pots[2] = pots[3] = 0x80; pots[0] = pots[1] = pots[2] = pots[3] = 0x80;
@ -155,7 +155,7 @@ READ32_MEMBER(atarigt_state::analog_port0_r)
compute_fake_pots(pots); compute_fake_pots(pots);
return (pots[0] << 24) | (pots[3] << 8); return (pots[0] << 24) | (pots[3] << 8);
#else #else
return (input_port_read(machine(), "AN1") << 24) | (input_port_read(machine(), "AN2") << 8); return (ioport("AN2")->read() << 8);
#endif #endif
} }
@ -167,7 +167,7 @@ READ32_MEMBER(atarigt_state::analog_port1_r)
compute_fake_pots(pots); compute_fake_pots(pots);
return (pots[2] << 24) | (pots[1] << 8); return (pots[2] << 24) | (pots[1] << 8);
#else #else
return (input_port_read(machine(), "AN3") << 24) | (input_port_read(machine(), "AN4") << 8); return (ioport("AN4")->read() << 8);
#endif #endif
} }
@ -658,7 +658,7 @@ static INPUT_PORTS_START( common )
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* A2D.EOC */ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* A2D.EOC */
PORT_BIT( 0x0030, IP_ACTIVE_LOW, IPT_UNUSED ) /* NC */ PORT_BIT( 0x0030, IP_ACTIVE_LOW, IPT_UNUSED ) /* NC */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) /* SELFTEST */ PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) /* SELFTEST */
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK ) /* VBLANK */ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") /* VBLANK */
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("COIN") /* 68.STATUS (A2=1) */ PORT_START("COIN") /* 68.STATUS (A2=1) */

View File

@ -67,7 +67,7 @@ static MACHINE_RESET( atarigx2 )
READ32_MEMBER(atarigx2_state::special_port2_r) READ32_MEMBER(atarigx2_state::special_port2_r)
{ {
int temp = input_port_read(machine(), "SERVICE"); int temp = ioport("SERVICE")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0020; if (m_cpu_to_sound_ready) temp ^= 0x0020;
if (m_sound_to_cpu_ready) temp ^= 0x0010; if (m_sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */ temp ^= 0x0008; /* A2D.EOC always high for now */
@ -77,7 +77,7 @@ READ32_MEMBER(atarigx2_state::special_port2_r)
READ32_MEMBER(atarigx2_state::special_port3_r) READ32_MEMBER(atarigx2_state::special_port3_r)
{ {
int temp = input_port_read(machine(), "SPECIAL"); int temp = ioport("SPECIAL")->read();
return (temp << 16) | temp; return (temp << 16) | temp;
} }
@ -89,9 +89,9 @@ READ32_MEMBER(atarigx2_state::a2d_data_r)
switch (offset) switch (offset)
{ {
case 0: case 0:
return (input_port_read(machine(), "A2D0") << 24) | (input_port_read(machine(), "A2D1") << 8); return (ioport("A2D1")->read() << 8);
case 1: case 1:
return (input_port_read(machine(), "A2D2") << 24) | (input_port_read(machine(), "A2D3") << 8); return (ioport("A2D3")->read() << 8);
} }
return 0; return 0;
@ -1205,7 +1205,7 @@ static INPUT_PORTS_START( spclords )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SPECIAL") /* 68.STATUS (A2=1) */ PORT_START("SPECIAL") /* 68.STATUS (A2=1) */
@ -1253,7 +1253,7 @@ static INPUT_PORTS_START( motofren )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SPECIAL") /* 68.STATUS (A2=1) */ PORT_START("SPECIAL") /* 68.STATUS (A2=1) */
@ -1301,7 +1301,7 @@ static INPUT_PORTS_START( rrreveng )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDFULL */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SPECIAL") /* 68.STATUS (A2=1) */ PORT_START("SPECIAL") /* 68.STATUS (A2=1) */

View File

@ -268,15 +268,15 @@ READ16_MEMBER(atarisy1_state::joystick_r)
/* digital joystick type */ /* digital joystick type */
if (m_joystick_type == 1) if (m_joystick_type == 1)
newval = (input_port_read(machine(), "IN0") & (0x80 >> offset)) ? 0xf0 : 0x00; newval = (ioport("IN0")->read() & (0x80 >> offset)) ? 0xf0 : 0x00;
/* Hall-effect analog joystick */ /* Hall-effect analog joystick */
else if (m_joystick_type == 2) else if (m_joystick_type == 2)
newval = input_port_read(machine(), portnames[offset & 1]); newval = ioport(portnames[offset & 1])->read();
/* Road Blasters gas pedal */ /* Road Blasters gas pedal */
else if (m_joystick_type == 3) else if (m_joystick_type == 3)
newval = input_port_read(machine(), "IN1"); newval = ioport("IN1")->read();
/* the A4 bit enables/disables joystick IRQs */ /* the A4 bit enables/disables joystick IRQs */
m_joystick_int_enable = ((offset >> 3) & 1) ^ 1; m_joystick_int_enable = ((offset >> 3) & 1) ^ 1;
@ -321,13 +321,13 @@ READ16_MEMBER(atarisy1_state::trakball_r)
if (player == 0) if (player == 0)
{ {
posx = (INT8)input_port_read(machine(), "IN0"); posx = (INT8)ioport("IN0")->read();
posy = (INT8)input_port_read(machine(), "IN1"); posy = (INT8)ioport("IN1")->read();
} }
else else
{ {
posx = (INT8)input_port_read(machine(), "IN2"); posx = (INT8)ioport("IN2")->read();
posy = (INT8)input_port_read(machine(), "IN3"); posy = (INT8)ioport("IN3")->read();
} }
m_cur[player][0] = posx + posy; m_cur[player][0] = posx + posy;
@ -339,7 +339,7 @@ READ16_MEMBER(atarisy1_state::trakball_r)
/* Road Blasters steering wheel */ /* Road Blasters steering wheel */
else if (m_trackball_type == 2) else if (m_trackball_type == 2)
result = input_port_read(machine(), "IN0"); result = ioport("IN0")->read();
return result; return result;
} }
@ -354,7 +354,7 @@ READ16_MEMBER(atarisy1_state::trakball_r)
READ16_MEMBER(atarisy1_state::port4_r) READ16_MEMBER(atarisy1_state::port4_r)
{ {
int temp = input_port_read(machine(), "F60000"); int temp = ioport("F60000")->read();
if (m_cpu_to_sound_ready) temp ^= 0x0080; if (m_cpu_to_sound_ready) temp ^= 0x0080;
return temp; return temp;
} }
@ -369,11 +369,11 @@ READ16_MEMBER(atarisy1_state::port4_r)
READ8_MEMBER(atarisy1_state::switch_6502_r) READ8_MEMBER(atarisy1_state::switch_6502_r)
{ {
int temp = input_port_read(machine(), "1820"); int temp = ioport("1820")->read();
if (m_cpu_to_sound_ready) temp ^= 0x08; if (m_cpu_to_sound_ready) temp ^= 0x08;
if (m_sound_to_cpu_ready) temp ^= 0x10; if (m_sound_to_cpu_ready) temp ^= 0x10;
if (!(input_port_read(machine(), "F60000") & 0x0040)) temp ^= 0x80; if (!(ioport("F60000")->read() & 0x0040)) temp ^= 0x80;
return temp; return temp;
} }
@ -534,7 +534,7 @@ static INPUT_PORTS_START( marble )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
@ -573,7 +573,7 @@ static INPUT_PORTS_START( peterpak )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Throw/P2 Start") PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Throw/P2 Start")
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Jump") PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Jump")
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
@ -612,7 +612,7 @@ static INPUT_PORTS_START( indytemp )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Whip/P2 Start") PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Whip/P2 Start")
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* freeze? */ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* freeze? */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
@ -659,7 +659,7 @@ static INPUT_PORTS_START( roadrunn )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Hop/P2 Start") PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Hop/P2 Start")
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Unused Button 1") PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Unused Button 1")
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Unused Button 2") PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Unused Button 2")
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
@ -694,7 +694,7 @@ static INPUT_PORTS_START( roadblst )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Lasers") PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Lasers")
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )

View File

@ -360,7 +360,7 @@ static void bankselect_postload(running_machine &machine)
READ16_MEMBER(atarisy2_state::switch_r) READ16_MEMBER(atarisy2_state::switch_r)
{ {
int result = input_port_read(machine(), "1800") | (input_port_read(machine(), "1801") << 8); int result = ioport("1800")->read() | (ioport("1801")->read() << 8);
if (m_cpu_to_sound_ready) result ^= 0x20; if (m_cpu_to_sound_ready) result ^= 0x20;
if (m_sound_to_cpu_ready) result ^= 0x10; if (m_sound_to_cpu_ready) result ^= 0x10;
@ -371,13 +371,13 @@ READ16_MEMBER(atarisy2_state::switch_r)
READ8_MEMBER(atarisy2_state::switch_6502_r) READ8_MEMBER(atarisy2_state::switch_6502_r)
{ {
int result = input_port_read(machine(), "1840"); int result = ioport("1840")->read();
if (m_cpu_to_sound_ready) result |= 0x01; if (m_cpu_to_sound_ready) result |= 0x01;
if (m_sound_to_cpu_ready) result |= 0x02; if (m_sound_to_cpu_ready) result |= 0x02;
if ((m_has_tms5220) && (tms5220_readyq_r(machine().device("tms")) == 0)) if ((m_has_tms5220) && (tms5220_readyq_r(machine().device("tms")) == 0))
result &= ~0x04; result &= ~0x04;
if (!(input_port_read(machine(), "1801") & 0x80)) result |= 0x10; if (!(ioport("1801")->read() & 0x80)) result |= 0x10;
return result; return result;
} }
@ -412,9 +412,9 @@ READ16_MEMBER(atarisy2_state::adc_r)
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" }; static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
if (m_which_adc < m_pedal_count) if (m_which_adc < m_pedal_count)
return ~input_port_read(machine(), adcnames[m_which_adc]); return ~ioport(adcnames[m_which_adc])->read();
return input_port_read(machine(), adcnames[m_which_adc]) | 0xff00; return ioport(adcnames[m_which_adc])->read() | 0xff00;
} }
@ -424,7 +424,7 @@ READ8_MEMBER(atarisy2_state::leta_r)
if (offset <= 1 && m_pedal_count == -1) /* 720 */ if (offset <= 1 && m_pedal_count == -1) /* 720 */
{ {
switch (input_port_read(machine(), "SELECT")) switch (ioport("SELECT")->read())
{ {
case 0: /* Real */ case 0: /* Real */
break; break;
@ -432,8 +432,8 @@ READ8_MEMBER(atarisy2_state::leta_r)
case 1: /* Fake Joystick */ case 1: /* Fake Joystick */
/* special thanks to MAME Analog+ for the mapping code */ /* special thanks to MAME Analog+ for the mapping code */
{ {
int analogx = input_port_read(machine(), "FAKE_JOY_X") - 128; int analogx = ioport("FAKE_JOY_X")->read() - 128;
int analogy = input_port_read(machine(), "FAKE_JOY_Y") - 128; int analogy = ioport("FAKE_JOY_Y")->read() - 128;
double angle; double angle;
/* if the joystick is centered, leave the rest of this alone */ /* if the joystick is centered, leave the rest of this alone */
@ -472,7 +472,7 @@ READ8_MEMBER(atarisy2_state::leta_r)
{ {
INT32 diff; INT32 diff;
UINT32 temp; UINT32 temp;
UINT32 rotate_count = input_port_read(machine(), "FAKE_SPINNER") & 0xffff; UINT32 rotate_count = ioport("FAKE_SPINNER")->read() & 0xffff;
/* rotate_count behaves the same as the real LEAT1 Rotate encoder /* rotate_count behaves the same as the real LEAT1 Rotate encoder
* we use it to generate the LETA0 Center encoder count * we use it to generate the LETA0 Center encoder count
*/ */
@ -550,7 +550,7 @@ READ8_MEMBER(atarisy2_state::leta_r)
return 0xff; return 0xff;
} }
} }
return input_port_read(machine(), letanames[offset]); return ioport(letanames[offset])->read();
} }
@ -962,25 +962,25 @@ static INPUT_PORTS_START( 720 )
/* Center disc */ /* Center disc */
/* X1, X2 LETA inputs */ /* X1, X2 LETA inputs */
PORT_MODIFY("LETA0") /* not direct mapped */ PORT_MODIFY("LETA0") /* not direct mapped */
PORT_BIT( 0xff, 0x00, IPT_DIAL_V ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("Center") PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00) PORT_BIT( 0xff, 0x00, IPT_DIAL_V ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("Center") PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
/* Rotate disc */ /* Rotate disc */
/* Y1, Y2 LETA inputs */ /* Y1, Y2 LETA inputs */
/* The disc has 72 teeth which are read by the hardware at 2x */ /* The disc has 72 teeth which are read by the hardware at 2x */
/* Computer hardware reads at 4x, so we set the sensitivity to 50% */ /* Computer hardware reads at 4x, so we set the sensitivity to 50% */
PORT_MODIFY("LETA1") /* not direct mapped */ PORT_MODIFY("LETA1") /* not direct mapped */
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_FULL_TURN_COUNT(144) PORT_NAME("Rotate") PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x00) PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_FULL_TURN_COUNT(144) PORT_NAME("Rotate") PORT_CONDITION("SELECT",0x03,EQUALS,0x00)
PORT_START("FAKE_JOY_X") /* not direct mapped */ PORT_START("FAKE_JOY_X") /* not direct mapped */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01) PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
PORT_START("FAKE_JOY_Y") /* not direct mapped */ PORT_START("FAKE_JOY_Y") /* not direct mapped */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x01) PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_CONDITION("SELECT",0x03,EQUALS,0x01)
/* Let's assume we are using a 1200 count spinner. We scale to get a 144 count. /* Let's assume we are using a 1200 count spinner. We scale to get a 144 count.
* 144/1200 = 0.12 = 12% */ * 144/1200 = 0.12 = 12% */
PORT_START("FAKE_SPINNER") /* not direct mapped */ PORT_START("FAKE_SPINNER") /* not direct mapped */
PORT_BIT( 0xffff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,PORTCOND_EQUALS,0x02) PORT_BIT( 0xffff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10) PORT_CONDITION("SELECT",0x03,EQUALS,0x02)
PORT_START("SELECT") PORT_START("SELECT")
PORT_CONFNAME( 0x03, 0x02, "Controller Type" ) PORT_CONFNAME( 0x03, 0x02, "Controller Type" )

View File

@ -687,7 +687,7 @@ ADDRESS_MAP_END
READ16_MEMBER(atarisy4_state::analog_r) READ16_MEMBER(atarisy4_state::analog_r)
{ {
return (input_port_read(machine(), "STICKX") << 8) | input_port_read(machine(), "STICKY"); return (ioport("STICKX")->read() << 8) | ioport("STICKY")->read();
} }
static INPUT_PORTS_START( atarisy4 ) static INPUT_PORTS_START( atarisy4 )
@ -969,8 +969,8 @@ static DRIVER_INIT( laststar )
state->m_shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x2000); state->m_shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x2000);
/* Populate the 68000 address space with data from the HEX files */ /* Populate the 68000 address space with data from the HEX files */
load_hexfile(main, machine.root_device().memregion("code")->base()); load_hexfile(main, state->memregion("code")->base());
load_hexfile(main, machine.root_device().memregion("data")->base()); load_hexfile(main, state->memregion("data")->base());
/* Set up the DSP */ /* Set up the DSP */
state->membank("dsp0_bank0")->set_base(state->m_shared_ram[0]); state->membank("dsp0_bank0")->set_base(state->m_shared_ram[0]);
@ -986,12 +986,12 @@ static DRIVER_INIT( airrace )
state->m_shared_ram[1] = auto_alloc_array_clear(machine, UINT16, 0x4000); state->m_shared_ram[1] = auto_alloc_array_clear(machine, UINT16, 0x4000);
/* Populate RAM with data from the HEX files */ /* Populate RAM with data from the HEX files */
load_hexfile(machine.device("maincpu")->memory().space(AS_PROGRAM), machine.root_device().memregion("code")->base()); load_hexfile(machine.device("maincpu")->memory().space(AS_PROGRAM), state->memregion("code")->base());
/* Set up the first DSP */ /* Set up the first DSP */
state->membank("dsp0_bank0")->set_base(state->m_shared_ram[0]); state->membank("dsp0_bank0")->set_base(state->m_shared_ram[0]);
state->membank("dsp0_bank1")->set_base(&state->m_shared_ram[0][0x800]); state->membank("dsp0_bank1")->set_base(&state->m_shared_ram[0][0x800]);
load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), machine.root_device().memregion("dsp")->base()); load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), state->memregion("dsp")->base());
/* Set up the second DSP */ /* Set up the second DSP */
state->membank("dsp1_bank0")->set_base(state->m_shared_ram[1]); state->membank("dsp1_bank0")->set_base(state->m_shared_ram[1]);

View File

@ -115,7 +115,7 @@ static INPUT_PORTS_START( ataxx )
PORT_START("IN1") /* 0xF7 */ PORT_START("IN1") /* 0xF7 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2") /* 0x20 */ PORT_START("IN2") /* 0x20 */
@ -146,7 +146,7 @@ static INPUT_PORTS_START( wsf )
PORT_START("IN1") /* 0xF7 */ PORT_START("IN1") /* 0xF7 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2") /* 0x20 */ PORT_START("IN2") /* 0x20 */
@ -198,7 +198,7 @@ static INPUT_PORTS_START( indyheat )
PORT_START("IN1") /* 0xF7 */ PORT_START("IN1") /* 0xF7 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2") /* 0x20 */ PORT_START("IN2") /* 0x20 */
@ -244,7 +244,7 @@ static INPUT_PORTS_START( brutforc )
PORT_START("IN1") /* 0xF7 */ PORT_START("IN1") /* 0xF7 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SLAVEHALT )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN2") /* 0x20 */ PORT_START("IN2") /* 0x20 */

View File

@ -255,7 +255,7 @@ static INPUT_PORTS_START( atetris )
PORT_DIPSETTING( 0x08, DEF_STR( On ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "50H:!2" ) /* Listed As "SPARE2 (Unused)" */ PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "50H:!2" ) /* Listed As "SPARE2 (Unused)" */
PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "50H:!1" ) /* Listed As "SPARE1 (Unused)" */ PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "50H:!1" ) /* Listed As "SPARE1 (Unused)" */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
PORT_START("IN1") PORT_START("IN1")

View File

@ -104,8 +104,8 @@ READ8_MEMBER(attckufo_state::attckufo_io_r)
{ {
switch(offset) switch(offset)
{ {
case 0: return input_port_read(machine(), "DSW"); case 0: return ioport("DSW")->read();
case 2: return input_port_read(machine(), "INPUT"); case 2: return ioport("INPUT")->read();
} }
return 0xff; return 0xff;
} }

View File

@ -181,7 +181,7 @@ static INPUT_PORTS_START( avalnche )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* SLAM */ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* SLAM */
PORT_SERVICE( 0x20, IP_ACTIVE_HIGH) PORT_SERVICE( 0x20, IP_ACTIVE_HIGH)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Serve */ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* Serve */
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) /* VBLANK */ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* VBLANK */
PORT_START("PADDLE") PORT_START("PADDLE")
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x40, 0xb7) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x40, 0xb7) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)

View File

@ -63,8 +63,8 @@ READ16_MEMBER(aztarac_state::nvram_r)
READ16_MEMBER(aztarac_state::joystick_r) READ16_MEMBER(aztarac_state::joystick_r)
{ {
return (((input_port_read(machine(), "STICKZ") - 0xf) << 8) | return (((ioport("STICKZ")->read() - 0xf) << 8) |
((input_port_read(machine(), "STICKY") - 0xf) & 0xff)); ((ioport("STICKY")->read() - 0xf) & 0xff));
} }

View File

@ -177,16 +177,16 @@ static READ32_DEVICE_HANDLER( backfire_eeprom_r )
/* some kind of screen indicator? checked by backfirea set before it will boot */ /* some kind of screen indicator? checked by backfirea set before it will boot */
int backfire_screen = device->machine().rand() & 1; int backfire_screen = device->machine().rand() & 1;
eeprom_device *eeprom = downcast<eeprom_device *>(device); eeprom_device *eeprom = downcast<eeprom_device *>(device);
return ((eeprom->read_bit() << 24) | input_port_read(device->machine(), "IN0") return ((eeprom->read_bit() << 24) | device->machine().root_device().ioport("IN0")->read()
| ((input_port_read(device->machine(), "IN2") & 0xbf) << 16) | ((device->machine().root_device().ioport("IN2")->read() & 0xbf) << 16)
| ((input_port_read(device->machine(), "IN3") & 0x40) << 16)) ^ (backfire_screen << 26) ; | ((device->machine().root_device().ioport("IN3")->read() & 0x40) << 16)) ^ (backfire_screen << 26) ;
} }
READ32_MEMBER(backfire_state::backfire_control2_r) READ32_MEMBER(backfire_state::backfire_control2_r)
{ {
// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space.device()), offset << 1, mem_mask); // logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space.device()), offset << 1, mem_mask);
return (m_eeprom->read_bit() << 24) | input_port_read(machine(), "IN1") | (input_port_read(machine(), "IN1") << 16); return (m_eeprom->read_bit() << 24) | ioport("IN1")->read() | (ioport("IN1")->read() << 16);
} }
#ifdef UNUSED_FUNCTION #ifdef UNUSED_FUNCTION
@ -194,7 +194,7 @@ READ32_MEMBER(backfire_state::backfire_control3_r)
{ {
// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space.device()), offset << 1, mem_mask); // logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(&space.device()), offset << 1, mem_mask);
return (m_eeprom->read_bit() << 24) | input_port_read(machine(), "IN2") | (input_port_read(machine(), "IN2") << 16); return (m_eeprom->read_bit() << 24) | ioport("IN2")->read() | (ioport("IN2")->read() << 16);
} }
#endif #endif
@ -233,7 +233,7 @@ WRITE32_MEMBER(backfire_state::backfire_pf4_rowscroll_w){ data &= 0x0000ffff; me
#ifdef UNUSED_FUNCTION #ifdef UNUSED_FUNCTION
READ32_MEMBER(backfire_state::backfire_unknown_wheel_r) READ32_MEMBER(backfire_state::backfire_unknown_wheel_r)
{ {
return input_port_read(machine(), "PADDLE0"); return ioport("PADDLE0")->read();
} }
READ32_MEMBER(backfire_state::backfire_wheel1_r) READ32_MEMBER(backfire_state::backfire_wheel1_r)
@ -339,7 +339,7 @@ static INPUT_PORTS_START( backfire )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW ) PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
@ -354,7 +354,7 @@ static INPUT_PORTS_START( backfire )
PORT_START("IN3") PORT_START("IN3")
PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED ) /* all other bits like low IN2 */ PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED ) /* all other bits like low IN2 */
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("PADDLE0") PORT_START("PADDLE0")

View File

@ -192,7 +192,7 @@ static void scanline_update(screen_device &screen, int scanline)
/* sound IRQ is on 32V */ /* sound IRQ is on 32V */
if (scanline & 32) if (scanline & 32)
atarigen_6502_irq_ack_r(space, 0); atarigen_6502_irq_ack_r(space, 0);
else if (!(input_port_read(screen.machine(), "FE4000") & 0x40)) else if (!(screen.machine().root_device().ioport("FE4000")->read() & 0x40))
atarigen_6502_irq_gen(screen.machine().device("audiocpu")); atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
} }
@ -232,7 +232,7 @@ static MACHINE_RESET( badlands )
static INTERRUPT_GEN( vblank_int ) static INTERRUPT_GEN( vblank_int )
{ {
badlands_state *state = device->machine().driver_data<badlands_state>(); badlands_state *state = device->machine().driver_data<badlands_state>();
int pedal_state = input_port_read(device->machine(), "PEDALS"); int pedal_state = state->ioport("PEDALS")->read();
int i; int i;
/* update the pedals once per frame */ /* update the pedals once per frame */
@ -306,8 +306,8 @@ READ8_MEMBER(badlands_state::audio_io_r)
0x02 = coin 2 0x02 = coin 2
0x01 = coin 1 0x01 = coin 1
*/ */
result = input_port_read(machine(), "AUDIO"); result = ioport("AUDIO")->read();
if (!(input_port_read(machine(), "FE4000") & 0x0080)) result ^= 0x90; if (!(ioport("FE4000")->read() & 0x0080)) result ^= 0x90;
if (m_cpu_to_sound_ready) result ^= 0x40; if (m_cpu_to_sound_ready) result ^= 0x40;
if (m_sound_to_cpu_ready) result ^= 0x20; if (m_sound_to_cpu_ready) result ^= 0x20;
result ^= 0x10; result ^= 0x10;
@ -426,7 +426,7 @@ static INPUT_PORTS_START( badlands )
PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
@ -586,7 +586,7 @@ static DRIVER_INIT( badlands )
badlands_state *state = machine.driver_data<badlands_state>(); badlands_state *state = machine.driver_data<badlands_state>();
/* initialize the audio system */ /* initialize the audio system */
state->m_bank_base = &machine.root_device().memregion("audiocpu")->base()[0x03000]; state->m_bank_base = &state->memregion("audiocpu")->base()[0x03000];
state->m_bank_source_data = &state->memregion("audiocpu")->base()[0x10000]; state->m_bank_source_data = &state->memregion("audiocpu")->base()[0x10000];
} }
@ -688,7 +688,7 @@ static void scanline_update_bootleg(screen_device &screen, int scanline)
/* sound IRQ is on 32V */ /* sound IRQ is on 32V */
// if (scanline & 32) // if (scanline & 32)
// atarigen_6502_irq_ack_r(screen.machine(), 0); // atarigen_6502_irq_ack_r(screen.machine(), 0);
// else if (!(input_port_read(machine, "FE4000") & 0x40)) // else if (!(machine.root_device().ioport("FE4000")->read() & 0x40))
// atarigen_6502_irq_gen(screen.machine().device("audiocpu")); // atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
} }

View File

@ -379,7 +379,7 @@ static READ8_DEVICE_HANDLER( dial_input_p1_r )
bagman_state *state = device->machine().driver_data<bagman_state>(); bagman_state *state = device->machine().driver_data<bagman_state>();
UINT8 dial_val; UINT8 dial_val;
dial_val = input_port_read(device->machine(), "DIAL_P1"); dial_val = state->ioport("DIAL_P1")->read();
if(state->m_p1_res != 0x60) if(state->m_p1_res != 0x60)
state->m_p1_res = 0x60; state->m_p1_res = 0x60;
@ -392,7 +392,7 @@ static READ8_DEVICE_HANDLER( dial_input_p1_r )
state->m_p1_old_val = dial_val; state->m_p1_old_val = dial_val;
return (input_port_read(device->machine(), "P1") & 0x9f) | (state->m_p1_res); return (state->ioport("P1")->read() & 0x9f) | (state->m_p1_res);
} }
static READ8_DEVICE_HANDLER( dial_input_p2_r ) static READ8_DEVICE_HANDLER( dial_input_p2_r )
@ -400,7 +400,7 @@ static READ8_DEVICE_HANDLER( dial_input_p2_r )
bagman_state *state = device->machine().driver_data<bagman_state>(); bagman_state *state = device->machine().driver_data<bagman_state>();
UINT8 dial_val; UINT8 dial_val;
dial_val = input_port_read(device->machine(), "DIAL_P2"); dial_val = state->ioport("DIAL_P2")->read();
if(state->m_p2_res != 0x60) if(state->m_p2_res != 0x60)
state->m_p2_res = 0x60; state->m_p2_res = 0x60;
@ -413,7 +413,7 @@ static READ8_DEVICE_HANDLER( dial_input_p2_r )
state->m_p2_old_val = dial_val; state->m_p2_old_val = dial_val;
return (input_port_read(device->machine(), "P2") & 0x9f) | (state->m_p2_res); return (state->ioport("P2")->read() & 0x9f) | (state->m_p2_res);
} }
static const ay8910_interface ay8910_dial_config = static const ay8910_interface ay8910_dial_config =

View File

@ -385,7 +385,7 @@ static INPUT_PORTS_START( sentetst )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
/* Analog ports */ /* Analog ports */
PORT_START("AN0") PORT_START("AN0")

View File

@ -129,19 +129,19 @@ READ8_MEMBER(baraduke_state::inputport_r)
switch (m_inputport_selected) switch (m_inputport_selected)
{ {
case 0x00: /* DSW A (bits 0-4) */ case 0x00: /* DSW A (bits 0-4) */
return (input_port_read(machine(), "DSWA") & 0xf8) >> 3; return (ioport("DSWA")->read() & 0xf8) >> 3;
case 0x01: /* DSW A (bits 5-7), DSW B (bits 0-1) */ case 0x01: /* DSW A (bits 5-7), DSW B (bits 0-1) */
return ((input_port_read(machine(), "DSWA") & 0x07) << 2) | ((input_port_read(machine(), "DSWB") & 0xc0) >> 6); return ((ioport("DSWA")->read() & 0x07) << 2) | ((ioport("DSWB")->read() & 0xc0) >> 6);
case 0x02: /* DSW B (bits 2-6) */ case 0x02: /* DSW B (bits 2-6) */
return (input_port_read(machine(), "DSWB") & 0x3e) >> 1; return (ioport("DSWB")->read() & 0x3e) >> 1;
case 0x03: /* DSW B (bit 7), DSW C (bits 0-3) */ case 0x03: /* DSW B (bit 7), DSW C (bits 0-3) */
return ((input_port_read(machine(), "DSWB") & 0x01) << 4) | (input_port_read(machine(), "EDGE") & 0x0f); return ((ioport("DSWB")->read() & 0x01) << 4) | (ioport("EDGE")->read() & 0x0f);
case 0x04: /* coins, start */ case 0x04: /* coins, start */
return input_port_read(machine(), "IN0"); return ioport("IN0")->read();
case 0x05: /* 2P controls */ case 0x05: /* 2P controls */
return input_port_read(machine(), "IN2"); return ioport("IN2")->read();
case 0x06: /* 1P controls */ case 0x06: /* 1P controls */
return input_port_read(machine(), "IN1"); return ioport("IN1")->read();
default: default:
return 0xff; return 0xff;
} }

View File

@ -89,7 +89,7 @@ WRITE16_MEMBER(batman_state::batman_atarivc_w)
READ16_MEMBER(batman_state::special_port2_r) READ16_MEMBER(batman_state::special_port2_r)
{ {
int result = input_port_read(machine(), "260010"); int result = ioport("260010")->read();
if (m_sound_to_cpu_ready) result ^= 0x0010; if (m_sound_to_cpu_ready) result ^= 0x0010;
if (m_cpu_to_sound_ready) result ^= 0x0020; if (m_cpu_to_sound_ready) result ^= 0x0020;
return result; return result;
@ -180,7 +180,7 @@ static INPUT_PORTS_START( batman )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) /* Input buffer full (@260030) */ 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( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@260040) */
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_INCLUDE( atarijsa_iii ) /* audio board port */ PORT_INCLUDE( atarijsa_iii ) /* audio board port */
INPUT_PORTS_END INPUT_PORTS_END

View File

@ -137,7 +137,7 @@ static INPUT_PORTS_START( battlane )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_START("DSW1") PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,2")

View File

@ -51,11 +51,11 @@ READ8_MEMBER(battlera_state::control_data_r)
{ {
switch (m_control_port_select) switch (m_control_port_select)
{ {
case 0xfe: return input_port_read(machine(), "IN0"); /* Player 1 */ case 0xfe: return ioport("IN0")->read(); /* Player 1 */
case 0xfd: return input_port_read(machine(), "IN1"); /* Player 2 */ case 0xfd: return ioport("IN1")->read(); /* Player 2 */
case 0xfb: return input_port_read(machine(), "IN2"); /* Coins */ case 0xfb: return ioport("IN2")->read(); /* Coins */
case 0xf7: return input_port_read(machine(), "DSW2"); /* Dip 2 */ case 0xf7: return ioport("DSW2")->read(); /* Dip 2 */
case 0xef: return input_port_read(machine(), "DSW1"); /* Dip 1 */ case 0xef: return ioport("DSW1")->read(); /* Dip 1 */
} }
return 0xff; return 0xff;

View File

@ -269,7 +269,7 @@ READ16_MEMBER(bbusters_state::control_3_r)
{ {
static const char *const port[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2", "GUNX3", "GUNY3" }; static const char *const port[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2", "GUNX3", "GUNY3" };
UINT16 retdata = input_port_read(machine(), port[m_gun_select]); UINT16 retdata = ioport(port[m_gun_select])->read();
retdata >>=1; // by lowering the precision of the gun reading hardware the game seems to work better retdata >>=1; // by lowering the precision of the gun reading hardware the game seems to work better
@ -309,8 +309,8 @@ READ16_MEMBER(bbusters_state::mechatt_gun_r)
{ {
int x, y; int x, y;
x = input_port_read(machine(), offset ? "GUNX2" : "GUNX1"); x = ioport(offset ? "GUNX2" : "GUNX1")->read();
y = input_port_read(machine(), offset ? "GUNY2" : "GUNY1"); y = ioport(offset ? "GUNY2" : "GUNY1")->read();
/* Todo - does the hardware really clamp like this? */ /* Todo - does the hardware really clamp like this? */
x += 0x18; x += 0x18;

View File

@ -221,7 +221,7 @@ WRITE8_MEMBER(beaminv_state::controller_select_w)
READ8_MEMBER(beaminv_state::controller_r) READ8_MEMBER(beaminv_state::controller_r)
{ {
return input_port_read(machine(), (m_controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG); return ioport((m_controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG)->read();
} }

View File

@ -256,7 +256,7 @@ WRITE32_MEMBER( beathead_state::eeprom_enable_w )
READ32_MEMBER( beathead_state::input_2_r ) READ32_MEMBER( beathead_state::input_2_r )
{ {
int result = input_port_read(machine(), "IN2"); int result = ioport("IN2")->read();
if (m_sound_to_cpu_ready) result ^= 0x10; if (m_sound_to_cpu_ready) result ^= 0x10;
if (m_cpu_to_sound_ready) result ^= 0x20; if (m_cpu_to_sound_ready) result ^= 0x20;
return result; return result;

View File

@ -426,7 +426,7 @@ static void get_pens(running_machine &machine, pen_t *pens)
int color; int color;
double color_weights[2]; double color_weights[2];
if (input_port_read(machine, MONITOR_TYPE_PORT_TAG) == 0) if (machine.root_device().ioport(MONITOR_TYPE_PORT_TAG)->read() == 0)
compute_resistor_weights(0, 0xff, -1.0, compute_resistor_weights(0, 0xff, -1.0,
2, resistances_wg, color_weights, 0, 270, 2, resistances_wg, color_weights, 0, 270,
2, resistances_wg, color_weights, 0, 270, 2, resistances_wg, color_weights, 0, 270,
@ -903,9 +903,9 @@ READ8_MEMBER(berzerk_state::moonwarp_p1_r)
// one difference is it lacks the strobe input (does it?), which if not active causes // one difference is it lacks the strobe input (does it?), which if not active causes
// the dial input to go open bus. This is used in moon war 2 to switch between player 1 // the dial input to go open bus. This is used in moon war 2 to switch between player 1
// and player 2 dials, which share a single port. moonwarp uses separate ports for the dials. // and player 2 dials, which share a single port. moonwarp uses separate ports for the dials.
signed char dialread = input_port_read(machine(),"P1_DIAL"); signed char dialread = ioport("P1_DIAL")->read();
UINT8 ret; UINT8 ret;
UINT8 buttons = (input_port_read(machine(),"P1")&0xe0); UINT8 buttons = (ioport("P1")->read()&0xe0);
if (dialread < 0) m_p1_direction = 0; if (dialread < 0) m_p1_direction = 0;
else if (dialread > 0) m_p1_direction = 0x10; else if (dialread > 0) m_p1_direction = 0x10;
m_p1_counter_74ls161 += abs(dialread); m_p1_counter_74ls161 += abs(dialread);
@ -918,9 +918,9 @@ READ8_MEMBER(berzerk_state::moonwarp_p1_r)
READ8_MEMBER(berzerk_state::moonwarp_p2_r) READ8_MEMBER(berzerk_state::moonwarp_p2_r)
{ {
// same as above, but for player 2 in cocktail mode // same as above, but for player 2 in cocktail mode
signed char dialread = input_port_read(machine(),"P2_DIAL"); signed char dialread = ioport("P2_DIAL")->read();
UINT8 ret; UINT8 ret;
UINT8 buttons = (input_port_read(machine(),"P2")&0xe0); UINT8 buttons = (ioport("P2")->read()&0xe0);
if (dialread < 0) m_p2_direction = 0; if (dialread < 0) m_p2_direction = 0;
else if (dialread > 0) m_p2_direction = 0x10; else if (dialread > 0) m_p2_direction = 0x10;
m_p2_counter_74ls161 += abs(dialread); m_p2_counter_74ls161 += abs(dialread);

Some files were not shown because too many files have changed in this diff Show More