Renamed input port functions:

readinputport           -> input_port_read_indexed
  readinputportbytag      -> input_port_read
  readinputportbytag_safe -> input_port_read_safe

Added machine parameter to input port functions. Updated
many drivers to accomplish this.
This commit is contained in:
Aaron Giles 2008-04-06 22:02:39 +00:00
parent edb6e3de5a
commit 8a914b3d22
543 changed files with 3084 additions and 3077 deletions

View File

@ -1034,7 +1034,7 @@ static void input_port_exit(running_machine *machine);
static void input_port_frame(running_machine *machine); static void input_port_frame(running_machine *machine);
static void input_port_load(int config_type, xml_data_node *parentnode); static void input_port_load(int config_type, xml_data_node *parentnode);
static void input_port_save(int config_type, xml_data_node *parentnode); static void input_port_save(int config_type, xml_data_node *parentnode);
static void update_digital_joysticks(void); static void update_digital_joysticks(running_machine *machine);
static void update_analog_port(int port); static void update_analog_port(int port);
static void autoselect_device(const input_port_entry *ipt, int type1, int type2, int type3, const char *option, const char *ananame); static void autoselect_device(const input_port_entry *ipt, int type1, int type2, int type3, const char *option, const char *ananame);
@ -2605,9 +2605,9 @@ int input_port_condition(const input_port_entry *in)
switch (in->condition.condition) switch (in->condition.condition)
{ {
case PORTCOND_EQUALS: case PORTCOND_EQUALS:
return ((readinputport(in->condition.portnum) & in->condition.mask) == in->condition.value); return ((input_port_read_indexed(Machine, in->condition.portnum) & in->condition.mask) == in->condition.value);
case PORTCOND_NOTEQUALS: case PORTCOND_NOTEQUALS:
return ((readinputport(in->condition.portnum) & in->condition.mask) != in->condition.value); return ((input_port_read_indexed(Machine, in->condition.portnum) & in->condition.mask) != in->condition.value);
} }
return 1; return 1;
} }
@ -2771,7 +2771,7 @@ profiler_mark(PROFILER_INPUT);
update_analog_port(portnum); update_analog_port(portnum);
/* update the digital joysticks first */ /* update the digital joysticks first */
update_digital_joysticks(); update_digital_joysticks(machine);
/* compute default values for all the ports */ /* compute default values for all the ports */
input_port_update_defaults(); input_port_update_defaults();
@ -2884,7 +2884,7 @@ profiler_mark(PROFILER_INPUT);
{ {
input_port_entry *portentry = changed->portentry; input_port_entry *portentry = changed->portentry;
UINT32 new_unmasked_value = readinputport(portnum); UINT32 new_unmasked_value = input_port_read_indexed(machine, portnum);
UINT32 newval = (new_unmasked_value & portentry->mask) >> changed->shift; UINT32 newval = (new_unmasked_value & portentry->mask) >> changed->shift;
UINT32 oldval = (portentry->changed_last_value & portentry->mask) >> changed->shift; UINT32 oldval = (portentry->changed_last_value & portentry->mask) >> changed->shift;
@ -2918,7 +2918,7 @@ profiler_mark(PROFILER_END);
* *
*************************************/ *************************************/
static void update_digital_joysticks(void) static void update_digital_joysticks(running_machine *machine)
{ {
int player, joyindex; int player, joyindex;
@ -2984,7 +2984,7 @@ static void update_digital_joysticks(void)
if ((info->current4way & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) && if ((info->current4way & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) &&
(info->current4way & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT))) (info->current4way & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT)))
{ {
if (mame_rand(Machine) & 1) if (mame_rand(machine) & 1)
info->current4way &= ~(JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT); info->current4way &= ~(JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT);
else else
info->current4way &= ~(JOYDIR_UP_BIT | JOYDIR_DOWN_BIT); info->current4way &= ~(JOYDIR_UP_BIT | JOYDIR_DOWN_BIT);
@ -3279,7 +3279,7 @@ profiler_mark(PROFILER_END);
* *
*************************************/ *************************************/
UINT32 readinputport(int portnum) UINT32 input_port_read_indexed(running_machine *machine, int portnum)
{ {
input_port_info *portinfo = &port_info[portnum]; input_port_info *portinfo = &port_info[portnum];
custom_port_info *custom; custom_port_info *custom;
@ -3298,7 +3298,7 @@ UINT32 readinputport(int portnum)
/* replace the bits with bits from the custom routine */ /* replace the bits with bits from the custom routine */
input_port_entry *portentry = custom->portentry; input_port_entry *portentry = custom->portentry;
result &= ~portentry->mask; result &= ~portentry->mask;
result |= ((*portentry->custom)(Machine, portentry->custom_param) << custom->shift) & portentry->mask; result |= ((*portentry->custom)(machine, portentry->custom_param) << custom->shift) & portentry->mask;
} }
/* handle VBLANK bits */ /* handle VBLANK bits */
@ -3308,18 +3308,18 @@ UINT32 readinputport(int portnum)
result = (result & ~portinfo->vblank) | (portinfo->defvalue & portinfo->vblank); result = (result & ~portinfo->vblank) | (portinfo->defvalue & portinfo->vblank);
/* toggle VBLANK if we're in a VBLANK state */ /* toggle VBLANK if we're in a VBLANK state */
if (video_screen_get_vblank(Machine->primary_screen)) if (video_screen_get_vblank(machine->primary_screen))
result ^= portinfo->vblank; result ^= portinfo->vblank;
} }
return result; return result;
} }
UINT32 readinputportbytag(const char *tag) UINT32 input_port_read(running_machine *machine, const char *tag)
{ {
int portnum = port_tag_to_index(tag); int portnum = port_tag_to_index(tag);
if (portnum != -1) if (portnum != -1)
return readinputport(portnum); return input_port_read_indexed(machine, portnum);
/* otherwise fail horribly */ /* otherwise fail horribly */
fatalerror("Unable to locate input port '%s'", tag); fatalerror("Unable to locate input port '%s'", tag);
@ -3327,11 +3327,11 @@ UINT32 readinputportbytag(const char *tag)
} }
UINT32 readinputportbytag_safe(const char *tag, UINT32 defvalue) UINT32 input_port_read_safe(running_machine *machine, const char *tag, UINT32 defvalue)
{ {
int portnum = port_tag_to_index(tag); int portnum = port_tag_to_index(tag);
if (portnum != -1) if (portnum != -1)
return readinputport(portnum); return input_port_read_indexed(machine, portnum);
return defvalue; return defvalue;
} }

View File

@ -938,8 +938,8 @@ void input_port_update_defaults(void);
UINT32 get_crosshair_pos(int port_num, UINT8 player, UINT8 axis); UINT32 get_crosshair_pos(int port_num, UINT8 player, UINT8 axis);
UINT32 readinputport(int port); UINT32 input_port_read_indexed(running_machine *machine, int port);
UINT32 readinputportbytag(const char *tag); UINT32 input_port_read(running_machine *machine, const char *tag);
UINT32 readinputportbytag_safe(const char *tag, UINT32 defvalue); UINT32 input_port_read_safe(running_machine *machine, const char *tag, UINT32 defvalue);
#endif /* __INPTPORT_H__ */ #endif /* __INPTPORT_H__ */

View File

@ -713,112 +713,112 @@ READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(machine); return 0xfffffff
8-bit read handlers 8-bit read handlers
-------------------------------------------------*/ -------------------------------------------------*/
READ8_HANDLER( input_port_0_r ) { return readinputport(0); } READ8_HANDLER( input_port_0_r ) { return input_port_read_indexed(machine, 0); }
READ8_HANDLER( input_port_1_r ) { return readinputport(1); } READ8_HANDLER( input_port_1_r ) { return input_port_read_indexed(machine, 1); }
READ8_HANDLER( input_port_2_r ) { return readinputport(2); } READ8_HANDLER( input_port_2_r ) { return input_port_read_indexed(machine, 2); }
READ8_HANDLER( input_port_3_r ) { return readinputport(3); } READ8_HANDLER( input_port_3_r ) { return input_port_read_indexed(machine, 3); }
READ8_HANDLER( input_port_4_r ) { return readinputport(4); } READ8_HANDLER( input_port_4_r ) { return input_port_read_indexed(machine, 4); }
READ8_HANDLER( input_port_5_r ) { return readinputport(5); } READ8_HANDLER( input_port_5_r ) { return input_port_read_indexed(machine, 5); }
READ8_HANDLER( input_port_6_r ) { return readinputport(6); } READ8_HANDLER( input_port_6_r ) { return input_port_read_indexed(machine, 6); }
READ8_HANDLER( input_port_7_r ) { return readinputport(7); } READ8_HANDLER( input_port_7_r ) { return input_port_read_indexed(machine, 7); }
READ8_HANDLER( input_port_8_r ) { return readinputport(8); } READ8_HANDLER( input_port_8_r ) { return input_port_read_indexed(machine, 8); }
READ8_HANDLER( input_port_9_r ) { return readinputport(9); } READ8_HANDLER( input_port_9_r ) { return input_port_read_indexed(machine, 9); }
READ8_HANDLER( input_port_10_r ) { return readinputport(10); } READ8_HANDLER( input_port_10_r ) { return input_port_read_indexed(machine, 10); }
READ8_HANDLER( input_port_11_r ) { return readinputport(11); } READ8_HANDLER( input_port_11_r ) { return input_port_read_indexed(machine, 11); }
READ8_HANDLER( input_port_12_r ) { return readinputport(12); } READ8_HANDLER( input_port_12_r ) { return input_port_read_indexed(machine, 12); }
READ8_HANDLER( input_port_13_r ) { return readinputport(13); } READ8_HANDLER( input_port_13_r ) { return input_port_read_indexed(machine, 13); }
READ8_HANDLER( input_port_14_r ) { return readinputport(14); } READ8_HANDLER( input_port_14_r ) { return input_port_read_indexed(machine, 14); }
READ8_HANDLER( input_port_15_r ) { return readinputport(15); } READ8_HANDLER( input_port_15_r ) { return input_port_read_indexed(machine, 15); }
READ8_HANDLER( input_port_16_r ) { return readinputport(16); } READ8_HANDLER( input_port_16_r ) { return input_port_read_indexed(machine, 16); }
READ8_HANDLER( input_port_17_r ) { return readinputport(17); } READ8_HANDLER( input_port_17_r ) { return input_port_read_indexed(machine, 17); }
READ8_HANDLER( input_port_18_r ) { return readinputport(18); } READ8_HANDLER( input_port_18_r ) { return input_port_read_indexed(machine, 18); }
READ8_HANDLER( input_port_19_r ) { return readinputport(19); } READ8_HANDLER( input_port_19_r ) { return input_port_read_indexed(machine, 19); }
READ8_HANDLER( input_port_20_r ) { return readinputport(20); } READ8_HANDLER( input_port_20_r ) { return input_port_read_indexed(machine, 20); }
READ8_HANDLER( input_port_21_r ) { return readinputport(21); } READ8_HANDLER( input_port_21_r ) { return input_port_read_indexed(machine, 21); }
READ8_HANDLER( input_port_22_r ) { return readinputport(22); } READ8_HANDLER( input_port_22_r ) { return input_port_read_indexed(machine, 22); }
READ8_HANDLER( input_port_23_r ) { return readinputport(23); } READ8_HANDLER( input_port_23_r ) { return input_port_read_indexed(machine, 23); }
READ8_HANDLER( input_port_24_r ) { return readinputport(24); } READ8_HANDLER( input_port_24_r ) { return input_port_read_indexed(machine, 24); }
READ8_HANDLER( input_port_25_r ) { return readinputport(25); } READ8_HANDLER( input_port_25_r ) { return input_port_read_indexed(machine, 25); }
READ8_HANDLER( input_port_26_r ) { return readinputport(26); } READ8_HANDLER( input_port_26_r ) { return input_port_read_indexed(machine, 26); }
READ8_HANDLER( input_port_27_r ) { return readinputport(27); } READ8_HANDLER( input_port_27_r ) { return input_port_read_indexed(machine, 27); }
READ8_HANDLER( input_port_28_r ) { return readinputport(28); } READ8_HANDLER( input_port_28_r ) { return input_port_read_indexed(machine, 28); }
READ8_HANDLER( input_port_29_r ) { return readinputport(29); } READ8_HANDLER( input_port_29_r ) { return input_port_read_indexed(machine, 29); }
READ8_HANDLER( input_port_30_r ) { return readinputport(30); } READ8_HANDLER( input_port_30_r ) { return input_port_read_indexed(machine, 30); }
READ8_HANDLER( input_port_31_r ) { return readinputport(31); } READ8_HANDLER( input_port_31_r ) { return input_port_read_indexed(machine, 31); }
/*------------------------------------------------- /*-------------------------------------------------
16-bit read handlers 16-bit read handlers
-------------------------------------------------*/ -------------------------------------------------*/
READ16_HANDLER( input_port_0_word_r ) { return readinputport(0); } READ16_HANDLER( input_port_0_word_r ) { return input_port_read_indexed(machine, 0); }
READ16_HANDLER( input_port_1_word_r ) { return readinputport(1); } READ16_HANDLER( input_port_1_word_r ) { return input_port_read_indexed(machine, 1); }
READ16_HANDLER( input_port_2_word_r ) { return readinputport(2); } READ16_HANDLER( input_port_2_word_r ) { return input_port_read_indexed(machine, 2); }
READ16_HANDLER( input_port_3_word_r ) { return readinputport(3); } READ16_HANDLER( input_port_3_word_r ) { return input_port_read_indexed(machine, 3); }
READ16_HANDLER( input_port_4_word_r ) { return readinputport(4); } READ16_HANDLER( input_port_4_word_r ) { return input_port_read_indexed(machine, 4); }
READ16_HANDLER( input_port_5_word_r ) { return readinputport(5); } READ16_HANDLER( input_port_5_word_r ) { return input_port_read_indexed(machine, 5); }
READ16_HANDLER( input_port_6_word_r ) { return readinputport(6); } READ16_HANDLER( input_port_6_word_r ) { return input_port_read_indexed(machine, 6); }
READ16_HANDLER( input_port_7_word_r ) { return readinputport(7); } READ16_HANDLER( input_port_7_word_r ) { return input_port_read_indexed(machine, 7); }
READ16_HANDLER( input_port_8_word_r ) { return readinputport(8); } READ16_HANDLER( input_port_8_word_r ) { return input_port_read_indexed(machine, 8); }
READ16_HANDLER( input_port_9_word_r ) { return readinputport(9); } READ16_HANDLER( input_port_9_word_r ) { return input_port_read_indexed(machine, 9); }
READ16_HANDLER( input_port_10_word_r ) { return readinputport(10); } READ16_HANDLER( input_port_10_word_r ) { return input_port_read_indexed(machine, 10); }
READ16_HANDLER( input_port_11_word_r ) { return readinputport(11); } READ16_HANDLER( input_port_11_word_r ) { return input_port_read_indexed(machine, 11); }
READ16_HANDLER( input_port_12_word_r ) { return readinputport(12); } READ16_HANDLER( input_port_12_word_r ) { return input_port_read_indexed(machine, 12); }
READ16_HANDLER( input_port_13_word_r ) { return readinputport(13); } READ16_HANDLER( input_port_13_word_r ) { return input_port_read_indexed(machine, 13); }
READ16_HANDLER( input_port_14_word_r ) { return readinputport(14); } READ16_HANDLER( input_port_14_word_r ) { return input_port_read_indexed(machine, 14); }
READ16_HANDLER( input_port_15_word_r ) { return readinputport(15); } READ16_HANDLER( input_port_15_word_r ) { return input_port_read_indexed(machine, 15); }
READ16_HANDLER( input_port_16_word_r ) { return readinputport(16); } READ16_HANDLER( input_port_16_word_r ) { return input_port_read_indexed(machine, 16); }
READ16_HANDLER( input_port_17_word_r ) { return readinputport(17); } READ16_HANDLER( input_port_17_word_r ) { return input_port_read_indexed(machine, 17); }
READ16_HANDLER( input_port_18_word_r ) { return readinputport(18); } READ16_HANDLER( input_port_18_word_r ) { return input_port_read_indexed(machine, 18); }
READ16_HANDLER( input_port_19_word_r ) { return readinputport(19); } READ16_HANDLER( input_port_19_word_r ) { return input_port_read_indexed(machine, 19); }
READ16_HANDLER( input_port_20_word_r ) { return readinputport(20); } READ16_HANDLER( input_port_20_word_r ) { return input_port_read_indexed(machine, 20); }
READ16_HANDLER( input_port_21_word_r ) { return readinputport(21); } READ16_HANDLER( input_port_21_word_r ) { return input_port_read_indexed(machine, 21); }
READ16_HANDLER( input_port_22_word_r ) { return readinputport(22); } READ16_HANDLER( input_port_22_word_r ) { return input_port_read_indexed(machine, 22); }
READ16_HANDLER( input_port_23_word_r ) { return readinputport(23); } READ16_HANDLER( input_port_23_word_r ) { return input_port_read_indexed(machine, 23); }
READ16_HANDLER( input_port_24_word_r ) { return readinputport(24); } READ16_HANDLER( input_port_24_word_r ) { return input_port_read_indexed(machine, 24); }
READ16_HANDLER( input_port_25_word_r ) { return readinputport(25); } READ16_HANDLER( input_port_25_word_r ) { return input_port_read_indexed(machine, 25); }
READ16_HANDLER( input_port_26_word_r ) { return readinputport(26); } READ16_HANDLER( input_port_26_word_r ) { return input_port_read_indexed(machine, 26); }
READ16_HANDLER( input_port_27_word_r ) { return readinputport(27); } READ16_HANDLER( input_port_27_word_r ) { return input_port_read_indexed(machine, 27); }
READ16_HANDLER( input_port_28_word_r ) { return readinputport(28); } READ16_HANDLER( input_port_28_word_r ) { return input_port_read_indexed(machine, 28); }
READ16_HANDLER( input_port_29_word_r ) { return readinputport(29); } READ16_HANDLER( input_port_29_word_r ) { return input_port_read_indexed(machine, 29); }
READ16_HANDLER( input_port_30_word_r ) { return readinputport(30); } READ16_HANDLER( input_port_30_word_r ) { return input_port_read_indexed(machine, 30); }
READ16_HANDLER( input_port_31_word_r ) { return readinputport(31); } READ16_HANDLER( input_port_31_word_r ) { return input_port_read_indexed(machine, 31); }
/*------------------------------------------------- /*-------------------------------------------------
32-bit read handlers 32-bit read handlers
-------------------------------------------------*/ -------------------------------------------------*/
READ32_HANDLER( input_port_0_dword_r ) { return readinputport(0); } READ32_HANDLER( input_port_0_dword_r ) { return input_port_read_indexed(machine, 0); }
READ32_HANDLER( input_port_1_dword_r ) { return readinputport(1); } READ32_HANDLER( input_port_1_dword_r ) { return input_port_read_indexed(machine, 1); }
READ32_HANDLER( input_port_2_dword_r ) { return readinputport(2); } READ32_HANDLER( input_port_2_dword_r ) { return input_port_read_indexed(machine, 2); }
READ32_HANDLER( input_port_3_dword_r ) { return readinputport(3); } READ32_HANDLER( input_port_3_dword_r ) { return input_port_read_indexed(machine, 3); }
READ32_HANDLER( input_port_4_dword_r ) { return readinputport(4); } READ32_HANDLER( input_port_4_dword_r ) { return input_port_read_indexed(machine, 4); }
READ32_HANDLER( input_port_5_dword_r ) { return readinputport(5); } READ32_HANDLER( input_port_5_dword_r ) { return input_port_read_indexed(machine, 5); }
READ32_HANDLER( input_port_6_dword_r ) { return readinputport(6); } READ32_HANDLER( input_port_6_dword_r ) { return input_port_read_indexed(machine, 6); }
READ32_HANDLER( input_port_7_dword_r ) { return readinputport(7); } READ32_HANDLER( input_port_7_dword_r ) { return input_port_read_indexed(machine, 7); }
READ32_HANDLER( input_port_8_dword_r ) { return readinputport(8); } READ32_HANDLER( input_port_8_dword_r ) { return input_port_read_indexed(machine, 8); }
READ32_HANDLER( input_port_9_dword_r ) { return readinputport(9); } READ32_HANDLER( input_port_9_dword_r ) { return input_port_read_indexed(machine, 9); }
READ32_HANDLER( input_port_10_dword_r ) { return readinputport(10); } READ32_HANDLER( input_port_10_dword_r ) { return input_port_read_indexed(machine, 10); }
READ32_HANDLER( input_port_11_dword_r ) { return readinputport(11); } READ32_HANDLER( input_port_11_dword_r ) { return input_port_read_indexed(machine, 11); }
READ32_HANDLER( input_port_12_dword_r ) { return readinputport(12); } READ32_HANDLER( input_port_12_dword_r ) { return input_port_read_indexed(machine, 12); }
READ32_HANDLER( input_port_13_dword_r ) { return readinputport(13); } READ32_HANDLER( input_port_13_dword_r ) { return input_port_read_indexed(machine, 13); }
READ32_HANDLER( input_port_14_dword_r ) { return readinputport(14); } READ32_HANDLER( input_port_14_dword_r ) { return input_port_read_indexed(machine, 14); }
READ32_HANDLER( input_port_15_dword_r ) { return readinputport(15); } READ32_HANDLER( input_port_15_dword_r ) { return input_port_read_indexed(machine, 15); }
READ32_HANDLER( input_port_16_dword_r ) { return readinputport(16); } READ32_HANDLER( input_port_16_dword_r ) { return input_port_read_indexed(machine, 16); }
READ32_HANDLER( input_port_17_dword_r ) { return readinputport(17); } READ32_HANDLER( input_port_17_dword_r ) { return input_port_read_indexed(machine, 17); }
READ32_HANDLER( input_port_18_dword_r ) { return readinputport(18); } READ32_HANDLER( input_port_18_dword_r ) { return input_port_read_indexed(machine, 18); }
READ32_HANDLER( input_port_19_dword_r ) { return readinputport(19); } READ32_HANDLER( input_port_19_dword_r ) { return input_port_read_indexed(machine, 19); }
READ32_HANDLER( input_port_20_dword_r ) { return readinputport(20); } READ32_HANDLER( input_port_20_dword_r ) { return input_port_read_indexed(machine, 20); }
READ32_HANDLER( input_port_21_dword_r ) { return readinputport(21); } READ32_HANDLER( input_port_21_dword_r ) { return input_port_read_indexed(machine, 21); }
READ32_HANDLER( input_port_22_dword_r ) { return readinputport(22); } READ32_HANDLER( input_port_22_dword_r ) { return input_port_read_indexed(machine, 22); }
READ32_HANDLER( input_port_23_dword_r ) { return readinputport(23); } READ32_HANDLER( input_port_23_dword_r ) { return input_port_read_indexed(machine, 23); }
READ32_HANDLER( input_port_24_dword_r ) { return readinputport(24); } READ32_HANDLER( input_port_24_dword_r ) { return input_port_read_indexed(machine, 24); }
READ32_HANDLER( input_port_25_dword_r ) { return readinputport(25); } READ32_HANDLER( input_port_25_dword_r ) { return input_port_read_indexed(machine, 25); }
READ32_HANDLER( input_port_26_dword_r ) { return readinputport(26); } READ32_HANDLER( input_port_26_dword_r ) { return input_port_read_indexed(machine, 26); }
READ32_HANDLER( input_port_27_dword_r ) { return readinputport(27); } READ32_HANDLER( input_port_27_dword_r ) { return input_port_read_indexed(machine, 27); }
READ32_HANDLER( input_port_28_dword_r ) { return readinputport(28); } READ32_HANDLER( input_port_28_dword_r ) { return input_port_read_indexed(machine, 28); }
READ32_HANDLER( input_port_29_dword_r ) { return readinputport(29); } READ32_HANDLER( input_port_29_dword_r ) { return input_port_read_indexed(machine, 29); }
READ32_HANDLER( input_port_30_dword_r ) { return readinputport(30); } READ32_HANDLER( input_port_30_dword_r ) { return input_port_read_indexed(machine, 30); }
READ32_HANDLER( input_port_31_dword_r ) { return readinputport(31); } READ32_HANDLER( input_port_31_dword_r ) { return input_port_read_indexed(machine, 31); }

View File

@ -122,7 +122,7 @@ static void dss_adjustment_step(node_description *node)
if (DSS_ADJUSTMENT__ENABLE) if (DSS_ADJUSTMENT__ENABLE)
{ {
struct dss_adjustment_context *context = node->context; struct dss_adjustment_context *context = node->context;
INT32 rawportval = readinputport(context->port); INT32 rawportval = input_port_read_indexed(Machine, context->port);
/* only recompute if the value changed from last time */ /* only recompute if the value changed from last time */
if (rawportval != context->lastpval) if (rawportval != context->lastpval)

View File

@ -60,7 +60,7 @@ WRITE8_HANDLER( invadpt2_sh_port_2_w )
if (rising_bits & 0x08) sample_start_n(0, 4, 6, 0); /* FLEET */ if (rising_bits & 0x08) sample_start_n(0, 4, 6, 0); /* FLEET */
if (rising_bits & 0x10) sample_start_n(0, 3, 7, 0); /* SAUCER HIT */ if (rising_bits & 0x10) sample_start_n(0, 3, 7, 0); /* SAUCER HIT */
c8080bw_flip_screen_w(data & 0x20); c8080bw_flip_screen_w(machine, data & 0x20);
port_2_last = data; port_2_last = data;
} }
@ -145,7 +145,7 @@ WRITE8_HANDLER( lrescue_sh_port_2_w )
if (rising_bits & 0x10) sample_start(3, 6, 0); /* Shooting Star and Rescue Ship sounds */ if (rising_bits & 0x10) sample_start(3, 6, 0); /* Shooting Star and Rescue Ship sounds */
if (~data & 0x10 && port_2_last & 0x10) sample_stop (3); /* This makes the rescue ship sound beep on and off */ if (~data & 0x10 && port_2_last & 0x10) sample_stop (3); /* This makes the rescue ship sound beep on and off */
c8080bw_flip_screen_w(data & 0x20); c8080bw_flip_screen_w(machine, data & 0x20);
port_2_last = data; port_2_last = data;
} }
@ -196,7 +196,7 @@ WRITE8_HANDLER( ballbomb_sh_port_2_w )
if (data & 0x04) sample_start(0, 4, 0); /* Plane is dropping new balloons at start of level */ if (data & 0x04) sample_start(0, 4, 0); /* Plane is dropping new balloons at start of level */
if (rising_bits & 0x10) sample_start(2, 2, 0); /* Balloon hit and bomb drops */ if (rising_bits & 0x10) sample_start(2, 2, 0); /* Balloon hit and bomb drops */
c8080bw_flip_screen_w(data & 0x20); c8080bw_flip_screen_w(machine, data & 0x20);
port_2_last = data; port_2_last = data;
} }
@ -623,7 +623,7 @@ WRITE8_HANDLER( polaris_sh_port_3_w )
coin_lockout_global_w(data & 0x04); /* SX8 */ coin_lockout_global_w(data & 0x04); /* SX8 */
c8080bw_flip_screen_w(data & 0x20); /* SX11 */ c8080bw_flip_screen_w(machine, data & 0x20); /* SX11 */
/* 0x01 - SX6 - Plane Down */ /* 0x01 - SX6 - Plane Down */
discrete_sound_w(machine, POLARIS_SX6_EN, data & 0x01); discrete_sound_w(machine, POLARIS_SX6_EN, data & 0x01);
@ -854,7 +854,7 @@ WRITE8_HANDLER( schaser_sh_port_2_w )
schaser_background_control_w(data & 0x18); schaser_background_control_w(data & 0x18);
c8080bw_flip_screen_w(data & 0x20); c8080bw_flip_screen_w(machine, data & 0x20);
} }
@ -998,7 +998,7 @@ WRITE8_HANDLER( lupin3_sh_port_2_w )
if (rising_bits & 0x08) sample_start(3, 0, 0); /* start intermission, end game */ if (rising_bits & 0x08) sample_start(3, 0, 0); /* start intermission, end game */
//if (rising_bits & 0x10) sample_start(3, 9, 0); /* Dog barking */ //if (rising_bits & 0x10) sample_start(3, 9, 0); /* Dog barking */
c8080bw_flip_screen_w(data & 0x20); c8080bw_flip_screen_w(machine, data & 0x20);
port_2_last = data; port_2_last = data;
} }
@ -1030,7 +1030,7 @@ WRITE8_HANDLER( schasrcv_sh_port_2_w )
sound_global_enable(data & 0x10); sound_global_enable(data & 0x10);
c8080bw_flip_screen_w(data & 0x20); c8080bw_flip_screen_w(machine, data & 0x20);
} }
@ -1065,7 +1065,7 @@ WRITE8_HANDLER( yosakdon_sh_port_2_w )
if (rising_bits & 0x10) sample_start(2, 7, 0); /* Game Over */ if (rising_bits & 0x10) sample_start(2, 7, 0); /* Game Over */
c8080bw_flip_screen_w(data & 0x20); c8080bw_flip_screen_w(machine, data & 0x20);
port_2_last = data; port_2_last = data;
} }

View File

@ -221,8 +221,8 @@ static READ8_HANDLER( jsa1_io_r )
0x02 = coin 2 0x02 = coin 2
0x01 = coin 1 0x01 = coin 1
*/ */
result = readinputportbytag("JSAI"); result = input_port_read(machine, "JSAI");
if (!(readinputport(test_port) & test_mask)) result ^= 0x80; if (!(input_port_read_indexed(machine, test_port) & test_mask)) result ^= 0x80;
if (atarigen_cpu_to_sound_ready) result ^= 0x40; if (atarigen_cpu_to_sound_ready) result ^= 0x40;
if (atarigen_sound_to_cpu_ready) result ^= 0x20; if (atarigen_sound_to_cpu_ready) result ^= 0x20;
if (!has_tms5220 || tms5220_ready_r()) result ^= 0x10; if (!has_tms5220 || tms5220_ready_r()) result ^= 0x10;
@ -348,8 +348,8 @@ static READ8_HANDLER( jsa2_io_r )
0x02 = coin 2 0x02 = coin 2
0x01 = coin 1 0x01 = coin 1
*/ */
result = readinputportbytag("JSAII"); result = input_port_read(machine, "JSAII");
if (!(readinputport(test_port) & test_mask)) result ^= 0x80; if (!(input_port_read_indexed(machine, test_port) & test_mask)) result ^= 0x80;
if (atarigen_cpu_to_sound_ready) result ^= 0x40; if (atarigen_cpu_to_sound_ready) result ^= 0x40;
if (atarigen_sound_to_cpu_ready) result ^= 0x20; if (atarigen_sound_to_cpu_ready) result ^= 0x20;
break; break;
@ -467,8 +467,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 = readinputportbytag("JSAIII"); result = input_port_read(machine, "JSAIII");
if (!(readinputport(test_port) & test_mask)) result ^= 0x90; if (!(input_port_read_indexed(machine, test_port) & test_mask)) result ^= 0x90;
if (atarigen_cpu_to_sound_ready) result ^= 0x40; if (atarigen_cpu_to_sound_ready) result ^= 0x40;
if (atarigen_sound_to_cpu_ready) result ^= 0x20; if (atarigen_sound_to_cpu_ready) result ^= 0x20;
break; break;
@ -604,8 +604,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 = readinputportbytag("JSAIII"); result = input_port_read(machine, "JSAIII");
if (!(readinputport(test_port) & test_mask)) result ^= 0x90; if (!(input_port_read_indexed(machine, test_port) & test_mask)) result ^= 0x90;
if (atarigen_cpu_to_sound_ready) result ^= 0x40; if (atarigen_cpu_to_sound_ready) result ^= 0x40;
if (atarigen_sound_to_cpu_ready) result ^= 0x20; if (atarigen_sound_to_cpu_ready) result ^= 0x20;
break; break;

View File

@ -41,8 +41,8 @@ void cyberbal_sound_reset(void)
READ8_HANDLER( cyberbal_special_port3_r ) READ8_HANDLER( cyberbal_special_port3_r )
{ {
int temp = readinputport(3); int temp = input_port_read_indexed(machine, 3);
if (!(readinputport(0) & 0x8000)) temp ^= 0x80; if (!(input_port_read_indexed(machine, 0) & 0x8000)) temp ^= 0x80;
if (atarigen_cpu_to_sound_ready) temp ^= 0x40; if (atarigen_cpu_to_sound_ready) temp ^= 0x40;
if (atarigen_sound_to_cpu_ready) temp ^= 0x20; if (atarigen_sound_to_cpu_ready) temp ^= 0x20;
return temp; return temp;

View File

@ -179,7 +179,7 @@ READ16_HANDLER( 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", activecpu_get_previouspc(), offset); logerror("%06X:hdsnd68k_status_r(%04X)\n", activecpu_get_previouspc(), offset);
return (mainflag << 15) | (soundflag << 14) | 0x2000 | 0;//((readinputport(0) & 0x0020) << 8) | 0; return (mainflag << 15) | (soundflag << 14) | 0x2000 | 0;//((input_port_read_indexed(machine, 0) & 0x0020) << 8) | 0;
} }

View File

@ -414,7 +414,7 @@ void ssio_reset_w(int state)
READ8_HANDLER( ssio_input_port_r ) READ8_HANDLER( ssio_input_port_r )
{ {
static const char *const port[] = { "SSIO.IP0", "SSIO.IP1", "SSIO.IP2", "SSIO.IP3", "SSIO.IP4" }; static const char *const port[] = { "SSIO.IP0", "SSIO.IP1", "SSIO.IP2", "SSIO.IP3", "SSIO.IP4" };
UINT8 result = readinputportbytag_safe(port[offset], 0xff); UINT8 result = input_port_read_safe(machine, port[offset], 0xff);
if (ssio_custom_input[offset]) if (ssio_custom_input[offset])
result = (result & ~ssio_custom_input_mask[offset]) | result = (result & ~ssio_custom_input_mask[offset]) |
((*ssio_custom_input[offset])(machine, offset) & ssio_custom_input_mask[offset]); ((*ssio_custom_input[offset])(machine, offset) & ssio_custom_input_mask[offset]);

View File

@ -321,7 +321,7 @@ WRITE8_HANDLER( tornbase_audio_w )
/* if (data & 0x10) enable CHEER sound */ /* if (data & 0x10) enable CHEER sound */
if (tornbase_get_cabinet_type() == TORNBASE_CAB_TYPE_UPRIGHT_OLD) if (tornbase_get_cabinet_type(machine) == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
{ {
/* if (data & 0x20) enable WHISTLE sound */ /* if (data & 0x20) enable WHISTLE sound */
@ -570,7 +570,7 @@ MACHINE_DRIVER_END
void maze_write_discrete(running_machine *machine, UINT8 maze_tone_timing_state) void maze_write_discrete(running_machine *machine, UINT8 maze_tone_timing_state)
{ {
/* controls need to be active low */ /* controls need to be active low */
int controls = ~readinputport(0) & 0xff; int controls = ~input_port_read_indexed(machine, 0) & 0xff;
discrete_sound_w(machine, MAZE_TONE_TIMING, maze_tone_timing_state); discrete_sound_w(machine, MAZE_TONE_TIMING, maze_tone_timing_state);
discrete_sound_w(machine, MAZE_P1_DATA, controls & 0x0f); discrete_sound_w(machine, MAZE_P1_DATA, controls & 0x0f);
@ -582,7 +582,7 @@ void maze_write_discrete(running_machine *machine, 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 */
/* imediately start making tones if pressed right after the coin is inserted. */ /* imediately start making tones if pressed right after the coin is inserted. */
discrete_sound_w(machine, MAZE_COIN, (~readinputport(1) >> 3) & 0x01); discrete_sound_w(machine, MAZE_COIN, (~input_port_read_indexed(machine, 1) >> 3) & 0x01);
} }
@ -3659,7 +3659,7 @@ WRITE8_HANDLER( invaders_audio_2_w )
discrete_sound_w(machine, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10); discrete_sound_w(machine, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
/* the flip screen line is only connected on the cocktail PCB */ /* the flip screen line is only connected on the cocktail PCB */
if (invaders_is_cabinet_cocktail()) if (invaders_is_cabinet_cocktail(machine))
{ {
invaders_set_flip_screen((data >> 5) & 0x01); invaders_set_flip_screen((data >> 5) & 0x01);
} }

View File

@ -78,9 +78,9 @@ static READ8_HANDLER( cheat1_r )
static int cheat = 0; static int cheat = 0;
static const int bits[] = { 0xee, 0xff, 0xbb, 0xaa }; static const int bits[] = { 0xee, 0xff, 0xbb, 0xaa };
res = readinputportbytag("IN1"); res = input_port_read(machine, "IN1");
if ((readinputportbytag("IN0") & 0x08) == 0) if ((input_port_read(machine, "IN0") & 0x08) == 0)
{ {
res |= 0x55; res |= 0x55;
res &= bits[cheat]; res &= bits[cheat];
@ -96,9 +96,9 @@ static READ8_HANDLER( cheat2_r )
static int cheat = 0; static int cheat = 0;
static const int bits[] = { 0xee, 0xff, 0xbb, 0xaa }; static const int bits[] = { 0xee, 0xff, 0xbb, 0xaa };
res = readinputportbytag("IN2"); res = input_port_read(machine, "IN2");
if ((readinputportbytag("IN0") & 0x08) == 0) if ((input_port_read(machine, "IN0") & 0x08) == 0)
{ {
res |= 0x55; res |= 0x55;
res &= bits[cheat]; res &= bits[cheat];

View File

@ -146,9 +146,9 @@ static CUSTOM_INPUT( sidewndr_payout_r )
switch (bit_mask) switch (bit_mask)
{ {
case 0x01: case 0x01:
return ((readinputportbytag("PAYOUT") & bit_mask) >> 0); return ((input_port_read(machine, "PAYOUT") & bit_mask) >> 0);
case 0x02: case 0x02:
return ((readinputportbytag("PAYOUT") & bit_mask) >> 1); return ((input_port_read(machine, "PAYOUT") & 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;
@ -162,13 +162,13 @@ static CUSTOM_INPUT( starspnr_coinage_r )
switch (bit_mask) switch (bit_mask)
{ {
case 0x01: case 0x01:
return ((readinputportbytag("COINAGE") & bit_mask) >> 0); return ((input_port_read(machine, "COINAGE") & bit_mask) >> 0);
case 0x02: case 0x02:
return ((readinputportbytag("COINAGE") & bit_mask) >> 1); return ((input_port_read(machine, "COINAGE") & bit_mask) >> 1);
case 0x04: case 0x04:
return ((readinputportbytag("COINAGE") & bit_mask) >> 2); return ((input_port_read(machine, "COINAGE") & bit_mask) >> 2);
case 0x08: case 0x08:
return ((readinputportbytag("COINAGE") & bit_mask) >> 3); return ((input_port_read(machine, "COINAGE") & 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;
@ -182,11 +182,11 @@ static CUSTOM_INPUT( starspnr_payout_r )
switch (bit_mask) switch (bit_mask)
{ {
case 0x01: case 0x01:
return ((readinputportbytag("PAYOUT") & bit_mask) >> 0); return ((input_port_read(machine, "PAYOUT") & bit_mask) >> 0);
case 0x02: case 0x02:
return ((readinputportbytag("PAYOUT") & bit_mask) >> 1); return ((input_port_read(machine, "PAYOUT") & bit_mask) >> 1);
case 0x04: case 0x04:
return ((readinputportbytag("PAYOUT") & bit_mask) >> 2); return ((input_port_read(machine, "PAYOUT") & 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;

View File

@ -48,16 +48,16 @@ static UINT8 *actfancr_ram;
static READ8_HANDLER( actfan_control_0_r ) static READ8_HANDLER( actfan_control_0_r )
{ {
return readinputport(2); /* VBL */ return input_port_read_indexed(machine, 2); /* VBL */
} }
static READ8_HANDLER( actfan_control_1_r ) static READ8_HANDLER( actfan_control_1_r )
{ {
switch (offset) { switch (offset) {
case 0: return readinputport(0); /* Player 1 */ case 0: return input_port_read_indexed(machine, 0); /* Player 1 */
case 1: return readinputport(1); /* Player 2 */ case 1: return input_port_read_indexed(machine, 1); /* Player 2 */
case 2: return readinputport(3); /* Dip 1 */ case 2: return input_port_read_indexed(machine, 3); /* Dip 1 */
case 3: return readinputport(4); /* Dip 2 */ case 3: return input_port_read_indexed(machine, 4); /* Dip 2 */
} }
return 0xff; return 0xff;
} }
@ -72,11 +72,11 @@ static WRITE8_HANDLER( triothep_control_select_w )
static READ8_HANDLER( triothep_control_r ) static READ8_HANDLER( triothep_control_r )
{ {
switch (trio_control_select) { switch (trio_control_select) {
case 0: return readinputportbytag("IN0"); /* Player 1 */ case 0: return input_port_read(machine, "IN0"); /* Player 1 */
case 1: return readinputportbytag("IN1"); /* Player 2 */ case 1: return input_port_read(machine, "IN1"); /* Player 2 */
case 2: return readinputportbytag("DSW1"); /* Dip 1 */ case 2: return input_port_read(machine, "DSW1"); /* Dip 1 */
case 3: return readinputportbytag("DSW2"); /* Dip 2 */ case 3: return input_port_read(machine, "DSW2"); /* Dip 2 */
case 4: return readinputportbytag("IN2"); /* VBL */ case 4: return input_port_read(machine, "IN2"); /* VBL */
} }
return 0xff; return 0xff;

View File

@ -143,9 +143,9 @@ static WRITE16_HANDLER( aladbl_w )
static READ16_HANDLER( aladbl_r ) static READ16_HANDLER( aladbl_r )
{ {
if (activecpu_get_pc()==0x1b2a56) return (readinputportbytag("MCU") & 0xff0f); // coins if (activecpu_get_pc()==0x1b2a56) return (input_port_read(machine, "MCU") & 0xff0f); // coins
if (activecpu_get_pc()==0x1b2a72) return 0x0000; if (activecpu_get_pc()==0x1b2a72) return 0x0000;
if (activecpu_get_pc()==0x1b2d24) return (readinputportbytag("MCU") & 0x00f0) | 0x1200; // difficulty if (activecpu_get_pc()==0x1b2d24) return (input_port_read(machine, "MCU") & 0x00f0) | 0x1200; // difficulty
if (activecpu_get_pc()==0x1b2d4e) return 0x0000; if (activecpu_get_pc()==0x1b2d4e) return 0x0000;
logerror("aladbl_r : %06x\n",activecpu_get_pc()); logerror("aladbl_r : %06x\n",activecpu_get_pc());

View File

@ -175,11 +175,11 @@ static READ32_HANDLER( aleck_dips_r )
{ {
if (offset == 0) if (offset == 0)
{ {
return (readinputport(3)); return (input_port_read_indexed(machine, 3));
} }
else if (offset == 1) else if (offset == 1)
{ {
return (readinputport(4)); return (input_port_read_indexed(machine, 4));
} }
return 0; return 0;

View File

@ -22,6 +22,7 @@
#include "driver.h" #include "driver.h"
#include "render.h" #include "render.h"
#include "deprecat.h"
#include "includes/amiga.h" #include "includes/amiga.h"
#include "machine/laserdsc.h" #include "machine/laserdsc.h"
@ -50,8 +51,8 @@ static int get_lightgun_pos(const device_config *screen, int player, int *x, int
{ {
const rectangle *visarea = video_screen_get_visible_area(screen); const rectangle *visarea = video_screen_get_visible_area(screen);
int xpos = readinputportbytag_safe((player == 0) ? "GUN1X" : "GUN2X", -1); int xpos = input_port_read_safe(screen->machine, (player == 0) ? "GUN1X" : "GUN2X", -1);
int ypos = readinputportbytag_safe((player == 0) ? "GUN1Y" : "GUN2Y", -1); int ypos = input_port_read_safe(screen->machine, (player == 0) ? "GUN1Y" : "GUN2Y", -1);
if (xpos == -1 || ypos == -1) if (xpos == -1 || ypos == -1)
return FALSE; return FALSE;
@ -251,14 +252,14 @@ static CUSTOM_INPUT( lightgun_pos_r )
static CUSTOM_INPUT( lightgun_trigger_r ) static CUSTOM_INPUT( lightgun_trigger_r )
{ {
/* read the trigger control based on the input select */ /* read the trigger control based on the input select */
return (readinputportbytag("TRIGGERS") >> input_select) & 1; return (input_port_read(machine, "TRIGGERS") >> input_select) & 1;
} }
static CUSTOM_INPUT( lightgun_holster_r ) static CUSTOM_INPUT( lightgun_holster_r )
{ {
/* read the holster control based on the input select */ /* read the holster control based on the input select */
return (readinputportbytag("TRIGGERS") >> (2 + input_select)) & 1; return (input_port_read(machine, "TRIGGERS") >> (2 + input_select)) & 1;
} }
@ -287,7 +288,7 @@ static void alg_cia_0_porta_w(UINT8 data)
static UINT8 alg_cia_0_porta_r(void) static UINT8 alg_cia_0_porta_r(void)
{ {
return readinputportbytag("FIRE") | 0x3f; return input_port_read(Machine, "FIRE") | 0x3f;
} }

View File

@ -265,57 +265,57 @@ static WRITE16_HANDLER( alpha_microcontroller_w )
static READ16_HANDLER( kyros_dip_r ) static READ16_HANDLER( kyros_dip_r )
{ {
return readinputportbytag("IN1")<<8; return input_port_read(machine, "IN1")<<8;
} }
static READ16_HANDLER( control_1_r ) static READ16_HANDLER( control_1_r )
{ {
if (invert_controls) if (invert_controls)
return ~(readinputportbytag("IN0") + (readinputportbytag("IN1") << 8)); return ~(input_port_read(machine, "IN0") + (input_port_read(machine, "IN1") << 8));
return (readinputport(0) + (readinputport(1) << 8)); return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
} }
static READ16_HANDLER( control_2_r ) static READ16_HANDLER( control_2_r )
{ {
if (invert_controls) if (invert_controls)
return ~(readinputportbytag("IN3") + ((~(1 << (readinputportbytag("IN5") * 12 / 256))) << 8)); return ~(input_port_read(machine, "IN3") + ((~(1 << (input_port_read(machine, "IN5") * 12 / 256))) << 8));
return readinputportbytag("IN3") + /* Low byte of CN1 */ return input_port_read(machine, "IN3") + /* Low byte of CN1 */
((~(1 << (readinputportbytag("IN5") * 12 / 256))) << 8); ((~(1 << (input_port_read(machine, "IN5") * 12 / 256))) << 8);
} }
static READ16_HANDLER( control_2_V_r ) static READ16_HANDLER( control_2_V_r )
{ {
return readinputportbytag("IN3"); return input_port_read(machine, "IN3");
} }
static READ16_HANDLER( control_3_r ) static READ16_HANDLER( control_3_r )
{ {
if (invert_controls) if (invert_controls)
return ~((( ~(1 << (readinputportbytag("IN6") * 12 / 256)) )<<8)&0xff00); return ~((( ~(1 << (input_port_read(machine, "IN6") * 12 / 256)) )<<8)&0xff00);
return (( ~(1 << (readinputportbytag("IN6") * 12 / 256)) )<<8)&0xff00; return (( ~(1 << (input_port_read(machine, "IN6") * 12 / 256)) )<<8)&0xff00;
} }
/* High 4 bits of CN1 & CN2 */ /* High 4 bits of CN1 & CN2 */
static READ16_HANDLER( control_4_r ) static READ16_HANDLER( control_4_r )
{ {
if (invert_controls) if (invert_controls)
return ~(((( ~(1 << (readinputportbytag("IN6") * 12 / 256)) ) <<4)&0xf000) return ~(((( ~(1 << (input_port_read(machine, "IN6") * 12 / 256)) ) <<4)&0xf000)
+ ((( ~(1 << (readinputportbytag("IN5") * 12 / 256)) ) )&0x0f00)); + ((( ~(1 << (input_port_read(machine, "IN5") * 12 / 256)) ) )&0x0f00));
return ((( ~(1 << (readinputportbytag("IN6") * 12 / 256)) ) <<4)&0xf000) return ((( ~(1 << (input_port_read(machine, "IN6") * 12 / 256)) ) <<4)&0xf000)
+ ((( ~(1 << (readinputportbytag("IN5") * 12 / 256)) ) )&0x0f00); + ((( ~(1 << (input_port_read(machine, "IN5") * 12 / 256)) ) )&0x0f00);
} }
static READ16_HANDLER( jongbou_inputs_r ) static READ16_HANDLER( jongbou_inputs_r )
{ {
UINT8 inp1 = readinputportbytag("IN3"); UINT8 inp1 = input_port_read(machine, "IN3");
UINT8 inp2 = readinputportbytag("IN4"); UINT8 inp2 = input_port_read(machine, "IN4");
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 readinputportbytag("IN0") | inp1 | inp2 << 4; return input_port_read(machine, "IN0") | inp1 | inp2 << 4;
} }
/******************************************************************************/ /******************************************************************************/
@ -381,14 +381,14 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
return 0; return 0;
case 0x29: /* Query microcontroller for coin insert */ case 0x29: /* Query microcontroller for coin insert */
trigstate++; trigstate++;
if ((readinputportbytag("IN2")&0x3)==3) latch=0; if ((input_port_read(machine, "IN2")&0x3)==3) latch=0;
if ((readinputportbytag("IN2")&0x1)==0 && !latch) if ((input_port_read(machine, "IN2")&0x1)==0 && !latch)
{ {
shared_ram[0x29] = (source&0xff00)|(coin_id&0xff); // coinA shared_ram[0x29] = (source&0xff00)|(coin_id&0xff); // coinA
shared_ram[0x22] = (source&0xff00)|0x0; shared_ram[0x22] = (source&0xff00)|0x0;
latch=1; latch=1;
coinvalue = (~readinputportbytag("IN1")>>1) & 7; coinvalue = (~input_port_read(machine, "IN1")>>1) & 7;
deposits1++; deposits1++;
if (deposits1 == coinage1[coinvalue][0]) if (deposits1 == coinage1[coinvalue][0])
{ {
@ -398,13 +398,13 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
else else
credits = 0; credits = 0;
} }
else if ((readinputportbytag("IN2")&0x2)==0 && !latch) else if ((input_port_read(machine, "IN2")&0x2)==0 && !latch)
{ {
shared_ram[0x29] = (source&0xff00)|(coin_id>>8); // coinB shared_ram[0x29] = (source&0xff00)|(coin_id>>8); // coinB
shared_ram[0x22] = (source&0xff00)|0x0; shared_ram[0x22] = (source&0xff00)|0x0;
latch=1; latch=1;
coinvalue = (~readinputportbytag("IN1")>>1) & 7; coinvalue = (~input_port_read(machine, "IN1")>>1) & 7;
deposits2++; deposits2++;
if (deposits2 == coinage2[coinvalue][0]) if (deposits2 == coinage2[coinvalue][0])
{ {
@ -460,7 +460,7 @@ static READ16_HANDLER( alpha_II_trigger_r )
switch (offset) switch (offset)
{ {
case 0: /* Dipswitch 2 */ case 0: /* Dipswitch 2 */
shared_ram[0] = (source&0xff00)|readinputportbytag("IN4"); shared_ram[0] = (source&0xff00)|input_port_read(machine, "IN4");
return 0; return 0;
case 0x22: /* Coin value */ case 0x22: /* Coin value */
@ -468,8 +468,8 @@ static READ16_HANDLER( alpha_II_trigger_r )
return 0; return 0;
case 0x29: /* Query microcontroller for coin insert */ case 0x29: /* Query microcontroller for coin insert */
if ((readinputportbytag("IN2")&0x3)==3) latch=0; if ((input_port_read(machine, "IN2")&0x3)==3) latch=0;
if ((readinputportbytag("IN2")&0x1)==0 && !latch) if ((input_port_read(machine, "IN2")&0x1)==0 && !latch)
{ {
shared_ram[0x29] = (source&0xff00)|(coin_id&0xff); // coinA shared_ram[0x29] = (source&0xff00)|(coin_id&0xff); // coinA
shared_ram[0x22] = (source&0xff00)|0x0; shared_ram[0x22] = (source&0xff00)|0x0;
@ -478,9 +478,9 @@ static READ16_HANDLER( alpha_II_trigger_r )
if ((coin_id&0xff) == 0x22) if ((coin_id&0xff) == 0x22)
{ {
if(!strcmp(machine->gamedrv->name, "btlfildb")) if(!strcmp(machine->gamedrv->name, "btlfildb"))
coinvalue = (readinputportbytag("IN4")>>0) & 7; coinvalue = (input_port_read(machine, "IN4")>>0) & 7;
else else
coinvalue = (~readinputportbytag("IN4")>>0) & 7; coinvalue = (~input_port_read(machine, "IN4")>>0) & 7;
deposits1++; deposits1++;
if (deposits1 == coinage1[coinvalue][0]) if (deposits1 == coinage1[coinvalue][0])
@ -492,7 +492,7 @@ static READ16_HANDLER( alpha_II_trigger_r )
credits = 0; credits = 0;
} }
} }
else if ((readinputportbytag("IN2")&0x2)==0 && !latch) else if ((input_port_read(machine, "IN2")&0x2)==0 && !latch)
{ {
shared_ram[0x29] = (source&0xff00)|(coin_id>>8); // coinB shared_ram[0x29] = (source&0xff00)|(coin_id>>8); // coinB
shared_ram[0x22] = (source&0xff00)|0x0; shared_ram[0x22] = (source&0xff00)|0x0;
@ -501,9 +501,9 @@ static READ16_HANDLER( alpha_II_trigger_r )
if ((coin_id>>8) == 0x22) if ((coin_id>>8) == 0x22)
{ {
if(!strcmp(machine->gamedrv->name, "btlfildb")) if(!strcmp(machine->gamedrv->name, "btlfildb"))
coinvalue = (readinputportbytag("IN4")>>0) & 7; coinvalue = (input_port_read(machine, "IN4")>>0) & 7;
else else
coinvalue = (~readinputportbytag("IN4")>>0) & 7; coinvalue = (~input_port_read(machine, "IN4")>>0) & 7;
deposits2++; deposits2++;
if (deposits2 == coinage2[coinvalue][0]) if (deposits2 == coinage2[coinvalue][0])
@ -556,14 +556,14 @@ static READ16_HANDLER( alpha_V_trigger_r )
switch (offset) switch (offset)
{ {
case 0: /* Dipswitch 1 */ case 0: /* Dipswitch 1 */
shared_ram[0] = (source&0xff00)|readinputportbytag("IN4"); shared_ram[0] = (source&0xff00)|input_port_read(machine, "IN4");
return 0; return 0;
case 0x22: /* Coin value */ case 0x22: /* Coin value */
shared_ram[0x22] = (source&0xff00)|(credits&0x00ff); shared_ram[0x22] = (source&0xff00)|(credits&0x00ff);
return 0; return 0;
case 0x29: /* Query microcontroller for coin insert */ case 0x29: /* Query microcontroller for coin insert */
if ((readinputportbytag("IN2")&0x3)==3) latch=0; if ((input_port_read(machine, "IN2")&0x3)==3) latch=0;
if ((readinputportbytag("IN2")&0x1)==0 && !latch) if ((input_port_read(machine, "IN2")&0x1)==0 && !latch)
{ {
shared_ram[0x29] = (source&0xff00)|(coin_id&0xff); // coinA shared_ram[0x29] = (source&0xff00)|(coin_id&0xff); // coinA
shared_ram[0x22] = (source&0xff00)|0x0; shared_ram[0x22] = (source&0xff00)|0x0;
@ -571,7 +571,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((coin_id&0xff) == 0x22) if ((coin_id&0xff) == 0x22)
{ {
coinvalue = (~readinputportbytag("IN4")>>1) & 7; coinvalue = (~input_port_read(machine, "IN4")>>1) & 7;
deposits1++; deposits1++;
if (deposits1 == coinage1[coinvalue][0]) if (deposits1 == coinage1[coinvalue][0])
{ {
@ -582,7 +582,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
credits = 0; credits = 0;
} }
} }
else if ((readinputportbytag("IN2")&0x2)==0 && !latch) else if ((input_port_read(machine, "IN2")&0x2)==0 && !latch)
{ {
shared_ram[0x29] = (source&0xff00)|(coin_id>>8); // coinB shared_ram[0x29] = (source&0xff00)|(coin_id>>8); // coinB
shared_ram[0x22] = (source&0xff00)|0x0; shared_ram[0x22] = (source&0xff00)|0x0;
@ -590,7 +590,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((coin_id>>8) == 0x22) if ((coin_id>>8) == 0x22)
{ {
coinvalue = (~readinputportbytag("IN4")>>1) & 7; coinvalue = (~input_port_read(machine, "IN4")>>1) & 7;
deposits2++; deposits2++;
if (deposits2 == coinage2[coinvalue][0]) if (deposits2 == coinage2[coinvalue][0])
{ {
@ -616,11 +616,11 @@ static READ16_HANDLER( alpha_V_trigger_r )
break; break;
case 0x1f00: /* Dipswitch 1 */ case 0x1f00: /* Dipswitch 1 */
shared_ram[0x1f00] = (source&0xff00)|readinputportbytag("IN4"); shared_ram[0x1f00] = (source&0xff00)|input_port_read(machine, "IN4");
return 0; return 0;
case 0x1f29: /* Query microcontroller for coin insert */ case 0x1f29: /* Query microcontroller for coin insert */
if ((readinputportbytag("IN2")&0x3)==3) latch=0; if ((input_port_read(machine, "IN2")&0x3)==3) latch=0;
if ((readinputportbytag("IN2")&0x1)==0 && !latch) if ((input_port_read(machine, "IN2")&0x1)==0 && !latch)
{ {
shared_ram[0x1f29] = (source&0xff00)|(coin_id&0xff); // coinA shared_ram[0x1f29] = (source&0xff00)|(coin_id&0xff); // coinA
shared_ram[0x1f22] = (source&0xff00)|0x0; shared_ram[0x1f22] = (source&0xff00)|0x0;
@ -628,7 +628,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((coin_id&0xff) == 0x22) if ((coin_id&0xff) == 0x22)
{ {
coinvalue = (~readinputportbytag("IN4")>>1) & 7; coinvalue = (~input_port_read(machine, "IN4")>>1) & 7;
deposits1++; deposits1++;
if (deposits1 == coinage1[coinvalue][0]) if (deposits1 == coinage1[coinvalue][0])
{ {
@ -639,7 +639,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
credits = 0; credits = 0;
} }
} }
else if ((readinputportbytag("IN2")&0x2)==0 && !latch) else if ((input_port_read(machine, "IN2")&0x2)==0 && !latch)
{ {
shared_ram[0x1f29] = (source&0xff00)|(coin_id>>8); // coinB shared_ram[0x1f29] = (source&0xff00)|(coin_id>>8); // coinB
shared_ram[0x1f22] = (source&0xff00)|0x0; shared_ram[0x1f22] = (source&0xff00)|0x0;
@ -647,7 +647,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((coin_id>>8) == 0x22) if ((coin_id>>8) == 0x22)
{ {
coinvalue = (~readinputportbytag("IN4")>>1) & 7; coinvalue = (~input_port_read(machine, "IN4")>>1) & 7;
deposits2++; deposits2++;
if (deposits2 == coinage2[coinvalue][0]) if (deposits2 == coinage2[coinvalue][0])
{ {
@ -668,7 +668,7 @@ static READ16_HANDLER( 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=shared_ram[0x0163]; source=shared_ram[0x0163];
shared_ram[0x0163] = (source&0x00ff)|(readinputportbytag("IN4")<<8); shared_ram[0x0163] = (source&0x00ff)|(input_port_read(machine, "IN4")<<8);
return 0; return 0;
case 0x1ffe: /* Custom ID check */ case 0x1ffe: /* Custom ID check */

View File

@ -47,7 +47,7 @@ VIDEO_UPDATE( amspdwy );
static READ8_HANDLER( amspdwy_wheel_##_n_##_r ) \ static READ8_HANDLER( amspdwy_wheel_##_n_##_r ) \
{ \ { \
static UINT8 wheel_old, ret; \ static UINT8 wheel_old, ret; \
UINT8 wheel = readinputport(5 + _n_); \ UINT8 wheel = input_port_read_indexed(machine, 5 + _n_); \
if (wheel != wheel_old) \ if (wheel != wheel_old) \
{ \ { \
wheel = (wheel & 0x7fff) - (wheel & 0x8000); \ wheel = (wheel & 0x7fff) - (wheel & 0x8000); \
@ -55,7 +55,7 @@ static READ8_HANDLER( amspdwy_wheel_##_n_##_r ) \
else ret = ((-wheel) & 0xf) | 0x10; \ else ret = ((-wheel) & 0xf) | 0x10; \
wheel_old = wheel; \ wheel_old = wheel; \
} \ } \
return ret | readinputport(2 + _n_); \ return ret | input_port_read_indexed(machine, 2 + _n_); \
} }
AMSPDWY_WHEEL_R( 0 ) AMSPDWY_WHEEL_R( 0 )
AMSPDWY_WHEEL_R( 1 ) AMSPDWY_WHEEL_R( 1 )
@ -63,7 +63,7 @@ AMSPDWY_WHEEL_R( 1 )
static READ8_HANDLER( amspdwy_sound_r ) static READ8_HANDLER( amspdwy_sound_r )
{ {
return (YM2151_status_port_0_r(machine,0) & ~ 0x30) | readinputport(4); return (YM2151_status_port_0_r(machine,0) & ~ 0x30) | input_port_read_indexed(machine, 4);
} }
static WRITE8_HANDLER( amspdwy_sound_w ) static WRITE8_HANDLER( amspdwy_sound_w )

View File

@ -181,16 +181,16 @@ these make the game a bit easier for testing purposes
static READ8_HANDLER( angelkds_input_r ) static READ8_HANDLER( angelkds_input_r )
{ {
int fake = readinputport(6+offset); int fake = input_port_read_indexed(machine, 6+offset);
return ((fake & 0x01) ? fake : readinputport(4+offset)); return ((fake & 0x01) ? fake : input_port_read_indexed(machine, 4+offset));
} }
#else #else
static READ8_HANDLER( angelkds_input_r ) static READ8_HANDLER( angelkds_input_r )
{ {
return readinputport(4+offset); return input_port_read_indexed(machine, 4+offset);
} }
#endif #endif

View File

@ -75,7 +75,7 @@ VIDEO_UPDATE(aquarium);
static MACHINE_RESET( aquarium ) static MACHINE_RESET( aquarium )
{ {
UINT16 *RAM = (UINT16 *)memory_region(REGION_CPU1); UINT16 *RAM = (UINT16 *)memory_region(REGION_CPU1);
int data = readinputportbytag("FAKE"); int data = input_port_read(machine, "FAKE");
/* Language : 0x0000 = Japanese - Other value = English */ /* Language : 0x0000 = Japanese - Other value = English */

View File

@ -148,7 +148,7 @@ static READ8_HANDLER( custom_cpu_r )
case 3: case 3:
case 4: case 4:
case 5: case 5:
return readinputport(2 + offset); return input_port_read_indexed(machine, 2 + offset);
/* busy flag; this is polled to check the custom CPU's readiness */ /* busy flag; this is polled to check the custom CPU's readiness */
/* we just toggle it on and off until the main CPU gets the result */ /* we just toggle it on and off until the main CPU gets the result */

View File

@ -48,6 +48,7 @@
***************************************************************************/ ***************************************************************************/
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "sound/custom.h" #include "sound/custom.h"
#include "includes/amiga.h" #include "includes/amiga.h"
@ -93,7 +94,7 @@ static WRITE16_HANDLER( arcadia_multibios_change_game )
static UINT8 arcadia_cia_0_porta_r(void) static UINT8 arcadia_cia_0_porta_r(void)
{ {
return readinputportbytag("CIA0PORTA"); return input_port_read(Machine, "CIA0PORTA");
} }
static void arcadia_cia_0_porta_w(UINT8 data) static void arcadia_cia_0_porta_w(UINT8 data)
@ -133,7 +134,7 @@ static void arcadia_cia_0_porta_w(UINT8 data)
static UINT8 arcadia_cia_0_portb_r(void) static UINT8 arcadia_cia_0_portb_r(void)
{ {
return readinputportbytag("CIA0PORTB"); return input_port_read(Machine, "CIA0PORTB");
} }
static void arcadia_cia_0_portb_w(UINT8 data) static void arcadia_cia_0_portb_w(UINT8 data)

View File

@ -148,7 +148,7 @@ static READ16_HANDLER( ultennis_hack_r )
hack_irq = 0; hack_irq = 0;
update_irq_state(Machine); update_irq_state(Machine);
} }
return readinputport(0); return input_port_read_indexed(machine, 0);
} }
@ -378,7 +378,7 @@ static void stonebal_protection(running_machine *machine)
static READ16_HANDLER( special_port5_r ) static READ16_HANDLER( special_port5_r )
{ {
return readinputport(5) | prot_output_bit; return input_port_read_indexed(machine, 5) | prot_output_bit;
} }

View File

@ -272,7 +272,7 @@ static WRITE8_HANDLER( astinvad_sound2_w )
if (bits_gone_hi & 0x08) sample_start(5, SND_FLEET4, 0); if (bits_gone_hi & 0x08) sample_start(5, SND_FLEET4, 0);
if (bits_gone_hi & 0x10) sample_start(4, SND_UFOHIT, 0); if (bits_gone_hi & 0x10) sample_start(4, SND_UFOHIT, 0);
screen_flip = (readinputport(3) & data & 0x20) ? 0xff : 0x00; screen_flip = (input_port_read_indexed(machine, 3) & data & 0x20) ? 0xff : 0x00;
} }
@ -303,7 +303,7 @@ static WRITE8_HANDLER( spaceint_sound2_w )
if (bits_gone_hi & 0x04) sample_start(3, SND_INVADERHIT, 0); if (bits_gone_hi & 0x04) sample_start(3, SND_INVADERHIT, 0);
screen_flip = (readinputport(3) & data & 0x80) ? 0xff : 0x00; screen_flip = (input_port_read_indexed(machine, 3) & data & 0x80) ? 0xff : 0x00;
} }

View File

@ -258,7 +258,7 @@ static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
static CUSTOM_INPUT( ebases_trackball_r ) static CUSTOM_INPUT( ebases_trackball_r )
{ {
static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" }; static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" };
return readinputportbytag(names[input_select]); return input_port_read(machine, names[input_select]);
} }
@ -285,7 +285,7 @@ static READ8_HANDLER( spacezap_io_r )
{ {
coin_counter_w(0, (offset >> 8) & 1); coin_counter_w(0, (offset >> 8) & 1);
coin_counter_w(1, (offset >> 9) & 1); coin_counter_w(1, (offset >> 9) & 1);
return readinputportbytag_safe("P3HANDLE", 0xff); return input_port_read_safe(machine, "P3HANDLE", 0xff);
} }
@ -474,7 +474,7 @@ static READ8_HANDLER( demndrgn_io_r )
static CUSTOM_INPUT( demndragn_joystick_r ) static CUSTOM_INPUT( demndragn_joystick_r )
{ {
static const char *const names[] = { "MOVEX", "MOVEY" }; static const char *const names[] = { "MOVEX", "MOVEY" };
return readinputportbytag(names[input_select]); return input_port_read(machine, names[input_select]);
} }

View File

@ -123,7 +123,7 @@ static INPUT_CHANGED( service_coin_inserted )
static CUSTOM_INPUT( astrof_p1_controls_r ) static CUSTOM_INPUT( astrof_p1_controls_r )
{ {
return readinputportbytag("P1"); return input_port_read(machine, "P1");
} }
@ -134,10 +134,10 @@ static CUSTOM_INPUT( astrof_p2_controls_r )
/* on an upright cabinets, a single set of controls /* on an upright cabinets, 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 (readinputportbytag("CAB")) if (input_port_read(machine, "CAB"))
ret = readinputportbytag("P2"); ret = input_port_read(machine, "P2");
else else
ret = readinputportbytag("P1"); ret = input_port_read(machine, "P1");
return ret; return ret;
} }
@ -223,7 +223,7 @@ static WRITE8_HANDLER( tomahawk_videoram_w )
static WRITE8_HANDLER( video_control_1_w ) static WRITE8_HANDLER( video_control_1_w )
{ {
flipscreen = ((data >> 0) & 0x01) & readinputportbytag("FLIP"); flipscreen = ((data >> 0) & 0x01) & input_port_read(machine, "FLIP");
/* this ties to the CLR pin of the shift registers */ /* this ties to the CLR pin of the shift registers */
screen_off = (data & 0x02) ? TRUE : FALSE; screen_off = (data & 0x02) ? TRUE : FALSE;

View File

@ -110,7 +110,7 @@ static WRITE16_HANDLER( mo_command_w )
static READ16_HANDLER( special_port0_r ) static READ16_HANDLER( special_port0_r )
{ {
int temp = readinputport(0); int temp = input_port_read_indexed(machine, 0);
if (atarigen_cpu_to_sound_ready) temp ^= 0x1000; if (atarigen_cpu_to_sound_ready) temp ^= 0x1000;
temp ^= 0x2000; /* A2DOK always high for now */ temp ^= 0x2000; /* A2DOK always high for now */
return temp; return temp;
@ -127,11 +127,11 @@ static READ16_HANDLER( a2d_data_r )
{ {
/* Pit Fighter has no A2D, just another input port */ /* Pit Fighter has no A2D, just another input port */
if (atarig1_pitfight) if (atarig1_pitfight)
return readinputport(1); return input_port_read_indexed(machine, 1);
/* otherwise, assume it's hydra */ /* otherwise, assume it's hydra */
if (which_input < 3) if (which_input < 3)
return readinputport(1 + which_input) << 8; return input_port_read_indexed(machine, 1 + which_input) << 8;
return 0; return 0;
} }

View File

@ -83,7 +83,7 @@ static MACHINE_RESET( atarig42 )
static READ16_HANDLER( special_port2_r ) static READ16_HANDLER( special_port2_r )
{ {
int temp = readinputport(2); int temp = input_port_read_indexed(machine, 2);
if (atarigen_cpu_to_sound_ready) temp ^= 0x0020; if (atarigen_cpu_to_sound_ready) temp ^= 0x0020;
if (atarigen_sound_to_cpu_ready) temp ^= 0x0010; if (atarigen_sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */ temp ^= 0x0008; /* A2D.EOC always high for now */
@ -93,7 +93,7 @@ static READ16_HANDLER( special_port2_r )
static WRITE16_HANDLER( a2d_select_w ) static WRITE16_HANDLER( a2d_select_w )
{ {
analog_data = readinputport(4 + (offset != 0)); analog_data = input_port_read_indexed(machine, 4 + (offset != 0));
} }

View File

@ -106,13 +106,13 @@ static void cage_irq_callback(int reason)
static READ32_HANDLER( inputs_01_r ) static READ32_HANDLER( inputs_01_r )
{ {
return (readinputportbytag("IN0") << 16) | readinputportbytag("IN1"); return (input_port_read(machine, "IN0") << 16) | input_port_read(machine, "IN1");
} }
static READ32_HANDLER( special_port2_r ) static READ32_HANDLER( special_port2_r )
{ {
int temp = readinputportbytag("IN2"); int temp = input_port_read(machine, "IN2");
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;
@ -121,7 +121,7 @@ static READ32_HANDLER( special_port2_r )
static READ32_HANDLER( special_port3_r ) static READ32_HANDLER( special_port3_r )
{ {
int temp = readinputportbytag("IN3"); int temp = input_port_read(machine, "IN3");
if (atarigen_video_int_state) temp ^= 0x0001; if (atarigen_video_int_state) temp ^= 0x0001;
if (atarigen_scanline_int_state) temp ^= 0x0002; if (atarigen_scanline_int_state) temp ^= 0x0002;
return (temp << 16) | temp; return (temp << 16) | temp;
@ -131,7 +131,7 @@ static READ32_HANDLER( 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 = readinputportbytag("FAKE"); int fake = input_port_read(machine, "FAKE");
pots[0] = pots[1] = pots[2] = pots[3] = 0x80; pots[0] = pots[1] = pots[2] = pots[3] = 0x80;
@ -168,7 +168,7 @@ static READ32_HANDLER( 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 (readinputportbytag("IN4") << 24) | (readinputportbytag("IN5") << 8); return (input_port_read(machine, "IN4") << 24) | (input_port_read(machine, "IN5") << 8);
#endif #endif
} }
@ -180,7 +180,7 @@ static READ32_HANDLER( 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 (readinputportbytag("IN6") << 24) | (readinputportbytag("IN7") << 8); return (input_port_read(machine, "IN6") << 24) | (input_port_read(machine, "IN7") << 8);
#endif #endif
} }

View File

@ -81,7 +81,7 @@ static MACHINE_RESET( atarigx2 )
static READ32_HANDLER( special_port2_r ) static READ32_HANDLER( special_port2_r )
{ {
int temp = readinputport(2); int temp = input_port_read_indexed(machine, 2);
if (atarigen_cpu_to_sound_ready) temp ^= 0x0020; if (atarigen_cpu_to_sound_ready) temp ^= 0x0020;
if (atarigen_sound_to_cpu_ready) temp ^= 0x0010; if (atarigen_sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */ temp ^= 0x0008; /* A2D.EOC always high for now */
@ -91,7 +91,7 @@ static READ32_HANDLER( special_port2_r )
static READ32_HANDLER( special_port3_r ) static READ32_HANDLER( special_port3_r )
{ {
int temp = readinputport(3); int temp = input_port_read_indexed(machine, 3);
return (temp << 16) | temp; return (temp << 16) | temp;
} }
@ -111,9 +111,9 @@ static READ32_HANDLER( a2d_data_r )
switch (offset) switch (offset)
{ {
case 0: case 0:
return (readinputport(5) << 24) | (readinputport(6) << 8); return (input_port_read_indexed(machine, 5) << 24) | (input_port_read_indexed(machine, 6) << 8);
case 1: case 1:
return (readinputport(7) << 24) | (readinputport(8) << 8); return (input_port_read_indexed(machine, 7) << 24) | (input_port_read_indexed(machine, 8) << 8);
} }
return 0; return 0;
@ -1169,7 +1169,7 @@ static READ32_HANDLER( atarigx2_protection_r )
static READ32_HANDLER( inputs_01_r ) static READ32_HANDLER( inputs_01_r )
{ {
return (readinputport(0) << 16) | readinputport(1); return (input_port_read_indexed(machine, 0) << 16) | input_port_read_indexed(machine, 1);
} }

View File

@ -214,15 +214,15 @@ static READ16_HANDLER( joystick_r )
/* digital joystick type */ /* digital joystick type */
if (joystick_type == 1) if (joystick_type == 1)
newval = (readinputport(0) & (0x80 >> offset)) ? 0xf0 : 0x00; newval = (input_port_read_indexed(machine, 0) & (0x80 >> offset)) ? 0xf0 : 0x00;
/* Hall-effect analog joystick */ /* Hall-effect analog joystick */
else if (joystick_type == 2) else if (joystick_type == 2)
newval = readinputport(offset & 1); newval = input_port_read_indexed(machine, offset & 1);
/* Road Blasters gas pedal */ /* Road Blasters gas pedal */
else if (joystick_type == 3) else if (joystick_type == 3)
newval = readinputport(1); newval = input_port_read_indexed(machine, 1);
/* the A4 bit enables/disables joystick IRQs */ /* the A4 bit enables/disables joystick IRQs */
joystick_int_enable = ((offset >> 3) & 1) ^ 1; joystick_int_enable = ((offset >> 3) & 1) ^ 1;
@ -268,13 +268,13 @@ static READ16_HANDLER( trakball_r )
if (player == 0) if (player == 0)
{ {
posx = (INT8)readinputport(0); posx = (INT8)input_port_read_indexed(machine, 0);
posy = (INT8)readinputport(1); posy = (INT8)input_port_read_indexed(machine, 1);
} }
else else
{ {
posx = (INT8)readinputport(2); posx = (INT8)input_port_read_indexed(machine, 2);
posy = (INT8)readinputport(3); posy = (INT8)input_port_read_indexed(machine, 3);
} }
cur[player][0] = posx + posy; cur[player][0] = posx + posy;
@ -286,7 +286,7 @@ static READ16_HANDLER( trakball_r )
/* Road Blasters steering wheel */ /* Road Blasters steering wheel */
else if (trackball_type == 2) else if (trackball_type == 2)
result = readinputport(0); result = input_port_read_indexed(machine, 0);
return result; return result;
} }
@ -301,7 +301,7 @@ static READ16_HANDLER( trakball_r )
static READ16_HANDLER( port4_r ) static READ16_HANDLER( port4_r )
{ {
int temp = readinputport(4); int temp = input_port_read_indexed(machine, 4);
if (atarigen_cpu_to_sound_ready) temp ^= 0x0080; if (atarigen_cpu_to_sound_ready) temp ^= 0x0080;
return temp; return temp;
} }
@ -316,11 +316,11 @@ static READ16_HANDLER( port4_r )
static READ8_HANDLER( switch_6502_r ) static READ8_HANDLER( switch_6502_r )
{ {
int temp = readinputport(5); int temp = input_port_read_indexed(machine, 5);
if (atarigen_cpu_to_sound_ready) temp ^= 0x08; if (atarigen_cpu_to_sound_ready) temp ^= 0x08;
if (atarigen_sound_to_cpu_ready) temp ^= 0x10; if (atarigen_sound_to_cpu_ready) temp ^= 0x10;
if (!(readinputport(4) & 0x0040)) temp ^= 0x80; if (!(input_port_read_indexed(machine, 4) & 0x0040)) temp ^= 0x80;
return temp; return temp;
} }

View File

@ -425,9 +425,9 @@ static WRITE16_HANDLER( adc_strobe_w )
static READ16_HANDLER( adc_r ) static READ16_HANDLER( adc_r )
{ {
if (which_adc < pedal_count) if (which_adc < pedal_count)
return ~readinputport(3 + which_adc); return ~input_port_read_indexed(machine, 3 + which_adc);
return readinputport(3 + which_adc) | 0xff00; return input_port_read_indexed(machine, 3 + which_adc) | 0xff00;
} }
@ -444,8 +444,8 @@ static READ8_HANDLER( leta_r )
static double last_angle; static double last_angle;
static int rotations; static int rotations;
int analogx = readinputport(7) - 128; int analogx = input_port_read_indexed(machine, 7) - 128;
int analogy = readinputport(8) - 128; int analogy = input_port_read_indexed(machine, 8) - 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 */
@ -481,7 +481,7 @@ static READ8_HANDLER( leta_r )
} }
} }
return readinputport(7 + (offset & 3)); return input_port_read_indexed(machine, 7 + (offset & 3));
} }

View File

@ -231,20 +231,20 @@ static READ32_HANDLER(backfire_eeprom_r)
{ {
/* some kind of screen indicator? checked by backfira set before it will boot */ /* some kind of screen indicator? checked by backfira set before it will boot */
int backfire_screen = mame_rand(Machine)&1; int backfire_screen = mame_rand(Machine)&1;
return ((EEPROM_read_bit()<<24) | readinputport(0) | (readinputport(3)<<16)) ^ (backfire_screen << 26) ; return ((EEPROM_read_bit()<<24) | input_port_read_indexed(machine, 0) | (input_port_read_indexed(machine, 3)<<16)) ^ (backfire_screen << 26) ;
} }
static READ32_HANDLER(backfire_control2_r) static READ32_HANDLER(backfire_control2_r)
{ {
// logerror("%08x:Read eprom %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask); // logerror("%08x:Read eprom %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask);
return (EEPROM_read_bit()<<24) | readinputport(1) | (readinputport(1)<<16); return (EEPROM_read_bit()<<24) | input_port_read_indexed(machine, 1) | (input_port_read_indexed(machine, 1)<<16);
} }
#ifdef UNUSED_FUNCTION #ifdef UNUSED_FUNCTION
static READ32_HANDLER(backfire_control3_r) static READ32_HANDLER(backfire_control3_r)
{ {
// logerror("%08x:Read eprom %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask); // logerror("%08x:Read eprom %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask);
return (EEPROM_read_bit()<<24) | readinputport(2) | (readinputport(2)<<16); return (EEPROM_read_bit()<<24) | input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 2)<<16);
} }
#endif #endif
@ -306,7 +306,7 @@ static WRITE32_HANDLER( backfire_pf4_data_w ) { data &=0x0000ffff; mem_mask &=0x
#ifdef UNUSED_FUNCTION #ifdef UNUSED_FUNCTION
READ32_HANDLER( backfire_unknown_wheel_r ) READ32_HANDLER( backfire_unknown_wheel_r )
{ {
return readinputport(4); return input_port_read_indexed(machine, 4);
} }
READ32_HANDLER( backfire_wheel1_r ) READ32_HANDLER( backfire_wheel1_r )

View File

@ -139,7 +139,7 @@ static void scanline_update(const device_config *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 (!(readinputport(0) & 0x40)) else if (!(input_port_read_indexed(screen->machine, 0) & 0x40))
atarigen_6502_irq_gen(screen->machine, 0); atarigen_6502_irq_gen(screen->machine, 0);
} }
@ -240,8 +240,8 @@ static READ8_HANDLER( audio_io_r )
0x02 = coin 2 0x02 = coin 2
0x01 = coin 1 0x01 = coin 1
*/ */
result = readinputport(3); result = input_port_read_indexed(machine, 3);
if (!(readinputport(0) & 0x0080)) result ^= 0x90; if (!(input_port_read_indexed(machine, 0) & 0x0080)) result ^= 0x90;
if (atarigen_cpu_to_sound_ready) result ^= 0x40; if (atarigen_cpu_to_sound_ready) result ^= 0x40;
if (atarigen_sound_to_cpu_ready) result ^= 0x20; if (atarigen_sound_to_cpu_ready) result ^= 0x20;
result ^= 0x10; result ^= 0x10;
@ -633,7 +633,7 @@ static void scanline_update_bootleg(const device_config *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 (!(readinputport(0) & 0x40)) // else if (!(input_port_read_indexed(machine, 0) & 0x40))
// atarigen_6502_irq_gen(screen->machine, 0); // atarigen_6502_irq_gen(screen->machine, 0);
} }

View File

@ -144,19 +144,19 @@ static READ8_HANDLER( inputport_r )
switch (inputport_selected) switch (inputport_selected)
{ {
case 0x00: /* DSW A (bits 0-4) */ case 0x00: /* DSW A (bits 0-4) */
return (readinputport(0) & 0xf8) >> 3; break; return (input_port_read_indexed(machine, 0) & 0xf8) >> 3; break;
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 ((readinputport(0) & 0x07) << 2) | ((readinputport(1) & 0xc0) >> 6); break; return ((input_port_read_indexed(machine, 0) & 0x07) << 2) | ((input_port_read_indexed(machine, 1) & 0xc0) >> 6); break;
case 0x02: /* DSW B (bits 2-6) */ case 0x02: /* DSW B (bits 2-6) */
return (readinputport(1) & 0x3e) >> 1; break; return (input_port_read_indexed(machine, 1) & 0x3e) >> 1; break;
case 0x03: /* DSW B (bit 7), DSW C (bits 0-3) */ case 0x03: /* DSW B (bit 7), DSW C (bits 0-3) */
return ((readinputport(1) & 0x01) << 4) | (readinputport(2) & 0x0f); break; return ((input_port_read_indexed(machine, 1) & 0x01) << 4) | (input_port_read_indexed(machine, 2) & 0x0f); break;
case 0x04: /* coins, start */ case 0x04: /* coins, start */
return readinputport(3); break; return input_port_read_indexed(machine, 3); break;
case 0x05: /* 2P controls */ case 0x05: /* 2P controls */
return readinputport(5); break; return input_port_read_indexed(machine, 5); break;
case 0x06: /* 1P controls */ case 0x06: /* 1P controls */
return readinputport(4); break; return input_port_read_indexed(machine, 4); break;
default: default:
return 0xff; return 0xff;
} }

View File

@ -97,7 +97,7 @@ static WRITE16_HANDLER( batman_atarivc_w )
static READ16_HANDLER( special_port2_r ) static READ16_HANDLER( special_port2_r )
{ {
int result = readinputport(2); int result = input_port_read_indexed(machine, 2);
if (atarigen_sound_to_cpu_ready) result ^= 0x0010; if (atarigen_sound_to_cpu_ready) result ^= 0x0010;
if (atarigen_cpu_to_sound_ready) result ^= 0x0020; if (atarigen_cpu_to_sound_ready) result ^= 0x0020;
return result; return result;

View File

@ -62,11 +62,11 @@ static WRITE8_HANDLER( control_data_w )
static READ8_HANDLER( control_data_r ) static READ8_HANDLER( control_data_r )
{ {
switch (control_port_select) { switch (control_port_select) {
case 0xfe: return readinputportbytag("IN0"); /* Player 1 */ case 0xfe: return input_port_read(machine, "IN0"); /* Player 1 */
case 0xfd: return readinputportbytag("IN1"); /* Player 2 */ case 0xfd: return input_port_read(machine, "IN1"); /* Player 2 */
case 0xfb: return readinputportbytag("IN2"); /* Coins */ case 0xfb: return input_port_read(machine, "IN2"); /* Coins */
case 0xf7: return readinputportbytag("DSW2"); /* Dip 2 */ case 0xf7: return input_port_read(machine, "DSW2"); /* Dip 2 */
case 0xef: return readinputportbytag("DSW1"); /* Dip 1 */ case 0xef: return input_port_read(machine, "DSW1"); /* Dip 1 */
} }
return 0xff; return 0xff;

View File

@ -211,7 +211,7 @@ WRITE16_HANDLER( bbuster_video_w );
static MACHINE_RESET( bbusters ) static MACHINE_RESET( bbusters )
{ {
UINT16 *RAM = (UINT16 *)memory_region(REGION_CPU1); UINT16 *RAM = (UINT16 *)memory_region(REGION_CPU1);
int data = readinputportbytag("FAKE1") & 0x03; int data = input_port_read(machine, "FAKE1") & 0x03;
/* Country/Version : /* Country/Version :
- 0x0000 : Japan? - 0x0000 : Japan?
@ -230,7 +230,7 @@ static MACHINE_RESET( bbusters )
static MACHINE_RESET( mechatt ) static MACHINE_RESET( mechatt )
{ {
UINT16 *RAM = (UINT16 *)memory_region(REGION_CPU1); UINT16 *RAM = (UINT16 *)memory_region(REGION_CPU1);
int data = readinputportbytag("FAKE1") & 0x03; int data = input_port_read(machine, "FAKE1") & 0x03;
/* Country : /* Country :
- 0x0000 : Japan - 0x0000 : Japan
@ -260,7 +260,7 @@ static int gun_select;
static READ16_HANDLER( control_3_r ) static READ16_HANDLER( control_3_r )
{ {
return readinputport(gun_select); return input_port_read_indexed(machine, gun_select);
} }
static WRITE16_HANDLER( gun_select_w ) static WRITE16_HANDLER( gun_select_w )
@ -272,12 +272,12 @@ static WRITE16_HANDLER( gun_select_w )
static READ16_HANDLER( kludge_r ) static READ16_HANDLER( kludge_r )
{ {
bbuster_ram[0xa692/2]=readinputportbytag("IN5")<<1; bbuster_ram[0xa692/2]=input_port_read(machine, "IN5")<<1;
bbuster_ram[0xa694/2]=readinputportbytag("IN6")<<1; bbuster_ram[0xa694/2]=input_port_read(machine, "IN6")<<1;
bbuster_ram[0xa696/2]=readinputportbytag("IN7")<<1; bbuster_ram[0xa696/2]=input_port_read(machine, "IN7")<<1;
bbuster_ram[0xa698/2]=readinputportbytag("IN8")<<1; bbuster_ram[0xa698/2]=input_port_read(machine, "IN8")<<1;
bbuster_ram[0xa69a/2]=readinputportbytag("IN9")<<1; bbuster_ram[0xa69a/2]=input_port_read(machine, "IN9")<<1;
bbuster_ram[0xa69c/2]=readinputportbytag("IN10")<<1; bbuster_ram[0xa69c/2]=input_port_read(machine, "IN10")<<1;
return 0; return 0;
} }
@ -292,8 +292,8 @@ static READ16_HANDLER( mechatt_gun_r )
int baseport=2,x,y; int baseport=2,x,y;
if (offset) baseport=4; /* Player 2 */ if (offset) baseport=4; /* Player 2 */
x=readinputport(baseport); x=input_port_read_indexed(machine, baseport);
y=readinputport(baseport+1); y=input_port_read_indexed(machine, baseport+1);
/* Todo - does the hardware really clamp like this? */ /* Todo - does the hardware really clamp like this? */
x+=0x18; x+=0x18;

View File

@ -192,7 +192,7 @@ static WRITE8_HANDLER( controller_select_w )
static READ8_HANDLER( controller_r ) static READ8_HANDLER( controller_r )
{ {
return readinputportbytag((controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG); return input_port_read(machine, (controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG);
} }

View File

@ -270,19 +270,19 @@ static WRITE32_HANDLER( eeprom_enable_w )
static READ32_HANDLER( input_0_r ) static READ32_HANDLER( input_0_r )
{ {
return readinputport(0); return input_port_read_indexed(machine, 0);
} }
static READ32_HANDLER( input_1_r ) static READ32_HANDLER( input_1_r )
{ {
return readinputport(1); return input_port_read_indexed(machine, 1);
} }
static READ32_HANDLER( input_2_r ) static READ32_HANDLER( input_2_r )
{ {
int result = readinputport(2); int result = input_port_read_indexed(machine, 2);
if (atarigen_sound_to_cpu_ready) result ^= 0x10; if (atarigen_sound_to_cpu_ready) result ^= 0x10;
if (atarigen_cpu_to_sound_ready) result ^= 0x20; if (atarigen_cpu_to_sound_ready) result ^= 0x20;
return result; return result;
@ -291,7 +291,7 @@ static READ32_HANDLER( input_2_r )
static READ32_HANDLER( input_3_r ) static READ32_HANDLER( input_3_r )
{ {
return readinputport(3); return input_port_read_indexed(machine, 3);
} }

View File

@ -383,7 +383,7 @@ static READ8_HANDLER( intercept_v256_r )
} }
static void get_pens(pen_t *pens) static void get_pens(running_machine *machine, pen_t *pens)
{ {
static const int resistances_wg[] = { 750, 0 }; static const int resistances_wg[] = { 750, 0 };
static const int resistances_el[] = { 1.0 / ((1.0 / 750.0) + (1.0 / 360.0)), 0 }; static const int resistances_el[] = { 1.0 / ((1.0 / 750.0) + (1.0 / 360.0)), 0 };
@ -391,7 +391,7 @@ static void get_pens(pen_t *pens)
int color; int color;
double color_weights[2]; double color_weights[2];
if (readinputportbytag(MONITOR_TYPE_PORT_TAG) == 0) if (input_port_read(machine, MONITOR_TYPE_PORT_TAG) == 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,
@ -423,7 +423,7 @@ static VIDEO_UPDATE( berzerk )
pen_t pens[NUM_PENS]; pen_t pens[NUM_PENS];
offs_t offs; offs_t offs;
get_pens(pens); get_pens(screen->machine, pens);
for (offs = 0; offs < berzerk_videoram_size; offs++) for (offs = 0; offs < berzerk_videoram_size; offs++)
{ {

View File

@ -865,7 +865,7 @@ static READ8_HANDLER( chipset_r )
} }
case 0x22: case 0x22:
{ {
val = 0x40 | readinputportbytag("JOYSTICK"); val = 0x40 | input_port_read(machine, "JOYSTICK");
break; break;
} }
default: default:
@ -1409,7 +1409,7 @@ static WRITE8_HANDLER( latch_w )
/* Clock is low */ /* Clock is low */
if (!(data & 0x08)) if (!(data & 0x08))
mux_input = readinputport(input_strobe); mux_input = input_port_read_indexed(machine, input_strobe);
} }
break; break;
} }

View File

@ -655,11 +655,11 @@ static READ8_HANDLER( mux_input_r )
t1 = input_override[offset]; // strobe 0-7 data 0-4 t1 = input_override[offset]; // strobe 0-7 data 0-4
t2 = input_override[offset+idx]; // strobe 8-B data 0-4 t2 = input_override[offset+idx]; // strobe 8-B data 0-4
t1 = (sc2_Inputs[offset] & t1) | ( ( readinputport(offset+1) & ~t1) & 0x1F); t1 = (sc2_Inputs[offset] & t1) | ( ( input_port_read_indexed(machine, offset+1) & ~t1) & 0x1F);
if (idx == 8) if (idx == 8)
t2 = (sc2_Inputs[offset+8] & t2) | ( ( readinputport(offset+1+8) & ~t2) << 5); t2 = (sc2_Inputs[offset+8] & t2) | ( ( input_port_read_indexed(machine, offset+1+8) & ~t2) << 5);
else else
t2 = (sc2_Inputs[offset+4] & t2) | ( ( ( readinputport(offset+1+4) & ~t2) << 2) & 0x60); t2 = (sc2_Inputs[offset+4] & t2) | ( ( ( input_port_read_indexed(machine, offset+1+4) & ~t2) << 2) & 0x60);
sc2_Inputs[offset] = (sc2_Inputs[offset] & ~0x1F) | t1; sc2_Inputs[offset] = (sc2_Inputs[offset] & ~0x1F) | t1;
sc2_Inputs[offset+idx] = (sc2_Inputs[offset+idx] & ~0x60) | t2; sc2_Inputs[offset+idx] = (sc2_Inputs[offset+idx] & ~0x60) | t2;

View File

@ -377,7 +377,7 @@ static READ8_HANDLER( sub_cpu_mcu_coin_port_r )
*/ */
bit5 ^= 0x20; bit5 ^= 0x20;
return bigevglf_mcu_status_r(machine,0) | (readinputport(1) & 3) | bit5; /* bit 0 and bit 1 - coin inputs */ return bigevglf_mcu_status_r(machine,0) | (input_port_read_indexed(machine, 1) & 3) | bit5; /* bit 0 and bit 1 - coin inputs */
} }
static ADDRESS_MAP_START( bigevglf_sub_readport, ADDRESS_SPACE_IO, 8 ) static ADDRESS_MAP_START( bigevglf_sub_readport, ADDRESS_SPACE_IO, 8 )

View File

@ -96,13 +96,13 @@ logerror("%06x: hacked_controls_r %04x %04x\n",activecpu_get_pc(),offset,bionicc
static WRITE16_HANDLER( bionicc_mpu_trigger_w ) static WRITE16_HANDLER( bionicc_mpu_trigger_w )
{ {
data = readinputport(0) >> 12; data = input_port_read_indexed(machine, 0) >> 12;
bionicc_inp[0] = data ^ 0x0f; bionicc_inp[0] = data ^ 0x0f;
data = readinputport(3); /* player 2 controls */ data = input_port_read_indexed(machine, 3); /* player 2 controls */
bionicc_inp[1] = data ^ 0xff; bionicc_inp[1] = data ^ 0xff;
data = readinputport(2); /* player 1 controls */ data = input_port_read_indexed(machine, 2); /* player 1 controls */
bionicc_inp[2] = data ^ 0xff; bionicc_inp[2] = data ^ 0xff;
} }

View File

@ -224,10 +224,10 @@ static READ16_HANDLER( bishjan_input_r )
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
if (bishjan_input & (1 << i)) if (bishjan_input & (1 << i))
res = readinputport(4+i); res = input_port_read_indexed(machine, 4+i);
return (res << 8) | return (res << 8) |
readinputport(3) | input_port_read_indexed(machine, 3) |
((bishjan_hopper && !(video_screen_get_frame_number(machine->primary_screen)%10)) ? 0x00 : 0x04) // bit 2: hopper sensor ((bishjan_hopper && !(video_screen_get_frame_number(machine->primary_screen)%10)) ? 0x00 : 0x04) // bit 2: hopper sensor
; ;
} }

View File

@ -57,7 +57,7 @@ static READ8_HANDLER( trackball_r )
int curr,delta; int curr,delta;
curr = readinputport(5 + offset); curr = input_port_read_indexed(machine, 5 + offset);
delta = (curr - last[offset]) & 0xff; delta = (curr - last[offset]) & 0xff;
last[offset] = curr; last[offset] = curr;
return (delta & 0x80) | (curr >> 1); return (delta & 0x80) | (curr >> 1);

View File

@ -54,7 +54,7 @@ static WRITE8_HANDLER( blktiger_bankswitch_w )
static WRITE8_HANDLER( blktiger_coinlockout_w ) static WRITE8_HANDLER( blktiger_coinlockout_w )
{ {
if (readinputportbytag("COIN_LOCKOUT") & 0x01) if (input_port_read(machine, "COIN_LOCKOUT") & 0x01)
{ {
coin_lockout_w(0,~data & 0x01); coin_lockout_w(0,~data & 0x01);
coin_lockout_w(1,~data & 0x02); coin_lockout_w(1,~data & 0x02);

View File

@ -77,7 +77,7 @@ static UINT8 pot_wheel = 0;
static WRITE16_HANDLER( blmbycar_pot_wheel_reset_w ) static WRITE16_HANDLER( blmbycar_pot_wheel_reset_w )
{ {
if (ACCESSING_BITS_0_7) if (ACCESSING_BITS_0_7)
pot_wheel = ~readinputport(2) & 0xff; pot_wheel = ~input_port_read_indexed(machine, 2) & 0xff;
} }
static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w ) static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w )
@ -102,7 +102,7 @@ static READ16_HANDLER( blmbycar_pot_wheel_r )
static READ16_HANDLER( blmbycar_opt_wheel_r ) static READ16_HANDLER( blmbycar_opt_wheel_r )
{ {
return (~readinputport(2) & 0xff) << 8; return (~input_port_read_indexed(machine, 2) & 0xff) << 8;
} }

View File

@ -72,7 +72,7 @@ static MACHINE_RESET( blstroid )
static READ16_HANDLER( inputs_r ) static READ16_HANDLER( inputs_r )
{ {
int temp = readinputport(2 + (offset & 1)); int temp = input_port_read_indexed(machine, 2 + (offset & 1));
if (atarigen_cpu_to_sound_ready) temp ^= 0x0040; if (atarigen_cpu_to_sound_ready) temp ^= 0x0040;
if (atarigen_get_hblank(machine->primary_screen)) temp ^= 0x0010; if (atarigen_get_hblank(machine->primary_screen)) temp ^= 0x0010;
return temp; return temp;

View File

@ -1202,28 +1202,28 @@ static READ32_HANDLER( bnstars1_r )
return 0xffffffff; return 0xffffffff;
case 0x0000: case 0x0000:
return readinputport(0); return input_port_read_indexed(machine, 0);
case 0x0080: case 0x0080:
return readinputport(1); return input_port_read_indexed(machine, 1);
case 0x2000: case 0x2000:
return readinputport(2); return input_port_read_indexed(machine, 2);
case 0x2080: case 0x2080:
return readinputport(3); return input_port_read_indexed(machine, 3);
} }
} }
static READ32_HANDLER( bnstars2_r ) static READ32_HANDLER( bnstars2_r )
{ {
return readinputport(4); return input_port_read_indexed(machine, 4);
} }
static READ32_HANDLER( bnstars3_r ) static READ32_HANDLER( bnstars3_r )
{ {
return readinputport(5); return input_port_read_indexed(machine, 5);
} }
static WRITE32_HANDLER( bnstars1_mahjong_select_w ) static WRITE32_HANDLER( bnstars1_mahjong_select_w )

View File

@ -45,12 +45,12 @@ static TIMER_CALLBACK( periodic_callback )
memset(mask, 0, sizeof mask); memset(mask, 0, sizeof mask);
mask[readinputport(3)] |= 0x01; mask[input_port_read_indexed(machine, 3)] |= 0x01;
mask[readinputport(4)] |= 0x02; mask[input_port_read_indexed(machine, 4)] |= 0x02;
mask[readinputport(5)] |= 0x04; mask[input_port_read_indexed(machine, 5)] |= 0x04;
mask[readinputport(6)] |= 0x08; mask[input_port_read_indexed(machine, 6)] |= 0x08;
mask[readinputport(7)] |= 0x10; mask[input_port_read_indexed(machine, 7)] |= 0x10;
mask[readinputport(8)] |= 0x20; mask[input_port_read_indexed(machine, 8)] |= 0x20;
for (i = 1; i < 256; i++) for (i = 1; i < 256; i++)
if (mask[i] != 0) if (mask[i] != 0)
@ -88,9 +88,9 @@ static MACHINE_RESET( boxer )
static READ8_HANDLER( boxer_input_r ) static READ8_HANDLER( boxer_input_r )
{ {
UINT8 val = readinputport(0); UINT8 val = input_port_read_indexed(machine, 0);
if (readinputport(9) < video_screen_get_vpos(machine->primary_screen)) if (input_port_read_indexed(machine, 9) < video_screen_get_vpos(machine->primary_screen))
val |= 0x02; val |= 0x02;
return (val << ((offset & 7) ^ 7)) & 0x80; return (val << ((offset & 7) ^ 7)) & 0x80;
@ -112,11 +112,11 @@ static READ8_HANDLER( boxer_misc_r )
break; break;
case 2: case 2:
val = readinputport(1); val = input_port_read_indexed(machine, 1);
break; break;
case 3: case 3:
val = readinputport(2); val = input_port_read_indexed(machine, 2);
break; break;
} }

View File

@ -84,7 +84,7 @@ static WRITE16_HANDLER( main_sound_w )
static READ16_HANDLER( special_port_4_r ) static READ16_HANDLER( special_port_4_r )
{ {
int result = readinputport(4) & ~0x81; int result = input_port_read_indexed(machine, 4) & ~0x81;
if (sound_to_main_ready) if (sound_to_main_ready)
result |= 0x01; result |= 0x01;

View File

@ -253,8 +253,8 @@ static READ8_HANDLER( spacduel_IN3_r )
int res1; int res1;
int res2; int res2;
res1 = readinputportbytag("IN3"); res1 = input_port_read(machine, "IN3");
res2 = readinputportbytag("IN4"); res2 = input_port_read(machine, "IN4");
res = 0x00; res = 0x00;
switch (offset & 0x07) switch (offset & 0x07)

View File

@ -78,14 +78,14 @@ static INTERRUPT_GEN ( bwp1_interrupt )
break; break;
case 1: case 1:
if (~readinputport(4) & 0x03) if (~input_port_read_indexed(machine, 4) & 0x03)
{ if (!coin) { coin = 1; cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); } } { if (!coin) { coin = 1; cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, ASSERT_LINE); } }
else else
coin = 0; coin = 0;
break; break;
case 2: case 2:
if (readinputport(5)) cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE); if (input_port_read_indexed(machine, 5)) cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE);
break; break;
} }
} }
@ -104,11 +104,11 @@ static WRITE8_HANDLER( bwp3_nmimask_w ) { bwp3_nmimask = data & 0x80; }
static READ8_HANDLER( bwp1_io_r ) static READ8_HANDLER( bwp1_io_r )
{ {
if (offset == 0) return(readinputport(0)); if (offset == 0) return(input_port_read_indexed(machine, 0));
if (offset == 1) return(readinputport(1)); if (offset == 1) return(input_port_read_indexed(machine, 1));
if (offset == 2) return(readinputport(2)); if (offset == 2) return(input_port_read_indexed(machine, 2));
if (offset == 3) return(readinputport(3)); if (offset == 3) return(input_port_read_indexed(machine, 3));
if (offset == 4) return(readinputport(4)); if (offset == 4) return(input_port_read_indexed(machine, 4));
return((bwp123_membase[0])[0x1b00 + offset]); return((bwp123_membase[0])[0x1b00 + offset]);
} }

View File

@ -252,7 +252,7 @@ static MACHINE_START( redbaron )
static INTERRUPT_GEN( bzone_interrupt ) static INTERRUPT_GEN( bzone_interrupt )
{ {
if (readinputport(0) & 0x10) if (input_port_read_indexed(machine, 0) & 0x10)
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
} }
@ -268,7 +268,7 @@ READ8_HANDLER( bzone_IN0_r )
{ {
int res; int res;
res = readinputportbytag("IN0"); res = input_port_read(machine, "IN0");
if (activecpu_gettotalcycles() & 0x100) if (activecpu_gettotalcycles() & 0x100)
res |= IN0_3KHZ; res |= IN0_3KHZ;
@ -299,7 +299,7 @@ static WRITE8_HANDLER( bzone_coin_counter_w )
static READ8_HANDLER( redbaron_joy_r ) static READ8_HANDLER( redbaron_joy_r )
{ {
return readinputport(rb_input_select ? 5 : 6); return input_port_read_indexed(machine, rb_input_select ? 5 : 6);
} }
@ -807,7 +807,7 @@ static READ8_HANDLER( analog_data_r )
static WRITE8_HANDLER( analog_select_w ) static WRITE8_HANDLER( analog_select_w )
{ {
if (offset <= 2) if (offset <= 2)
analog_data = readinputport(6 + offset); analog_data = input_port_read_indexed(machine, 6 + offset);
} }

View File

@ -87,7 +87,7 @@ static WRITE16_HANDLER( track_reset_w )
int i; int i;
for (i = 0;i < 4;i++) for (i = 0;i < 4;i++)
last[i] = readinputport(3+i); last[i] = input_port_read_indexed(machine, 3+i);
} }
static READ16_HANDLER( track_r ) static READ16_HANDLER( track_r )
@ -95,10 +95,10 @@ static READ16_HANDLER( track_r )
switch (offset) switch (offset)
{ {
default: default:
case 0: return (( readinputport(3) - last[0]) & 0x00ff) | (((readinputport(5) - last[2]) & 0x00ff) << 8); /* X lo */ case 0: return (( input_port_read_indexed(machine, 3) - last[0]) & 0x00ff) | (((input_port_read_indexed(machine, 5) - last[2]) & 0x00ff) << 8); /* X lo */
case 1: return (((readinputport(3) - last[0]) & 0xff00) >> 8) | (( readinputport(5) - last[2]) & 0xff00); /* X hi */ case 1: return (((input_port_read_indexed(machine, 3) - last[0]) & 0xff00) >> 8) | (( input_port_read_indexed(machine, 5) - last[2]) & 0xff00); /* X hi */
case 2: return (( readinputport(4) - last[1]) & 0x00ff) | (((readinputport(6) - last[3]) & 0x00ff) << 8); /* Y lo */ case 2: return (( input_port_read_indexed(machine, 4) - last[1]) & 0x00ff) | (((input_port_read_indexed(machine, 6) - last[3]) & 0x00ff) << 8); /* Y lo */
case 3: return (((readinputport(4) - last[1]) & 0xff00) >> 8) | (( readinputport(6) - last[3]) & 0xff00); /* Y hi */ case 3: return (((input_port_read_indexed(machine, 4) - last[1]) & 0xff00) >> 8) | (( input_port_read_indexed(machine, 6) - last[3]) & 0xff00); /* Y hi */
} }
} }

View File

@ -64,11 +64,11 @@ static READ8_HANDLER( canyon_switches_r )
{ {
UINT8 val = 0; UINT8 val = 0;
if ((readinputport(2) >> (offset & 7)) & 1) if ((input_port_read_indexed(machine, 2) >> (offset & 7)) & 1)
{ {
val |= 0x80; val |= 0x80;
} }
if ((readinputport(1) >> (offset & 3)) & 1) if ((input_port_read_indexed(machine, 1) >> (offset & 3)) & 1)
{ {
val |= 0x01; val |= 0x01;
} }
@ -79,7 +79,7 @@ static READ8_HANDLER( canyon_switches_r )
static READ8_HANDLER( canyon_options_r ) static READ8_HANDLER( canyon_options_r )
{ {
return (readinputport(0) >> (2 * (~offset & 3))) & 3; return (input_port_read_indexed(machine, 0) >> (2 * (~offset & 3))) & 3;
} }

View File

@ -111,7 +111,7 @@ static UINT8 last_trackball_val[2];
static INTERRUPT_GEN( capbowl_interrupt ) static INTERRUPT_GEN( capbowl_interrupt )
{ {
if (readinputport(4) & 1) /* get status of the F2 key */ if (input_port_read_indexed(machine, 4) & 1) /* get status of the F2 key */
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); /* trigger self test */ cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); /* trigger self test */
} }

View File

@ -311,17 +311,17 @@ static int cave_region_byte;
static READ16_HANDLER( cave_input1_r ) static READ16_HANDLER( cave_input1_r )
{ {
return readinputport(1) | ((EEPROM_read_bit() & 0x01) << 11); return input_port_read_indexed(machine, 1) | ((EEPROM_read_bit() & 0x01) << 11);
} }
static READ16_HANDLER( guwange_input1_r ) static READ16_HANDLER( guwange_input1_r )
{ {
return readinputport(1) | ((EEPROM_read_bit() & 0x01) << 7); return input_port_read_indexed(machine, 1) | ((EEPROM_read_bit() & 0x01) << 7);
} }
static READ16_HANDLER( gaia_dsw_r ) static READ16_HANDLER( gaia_dsw_r )
{ {
return readinputport(2) | (readinputport(3) << 8); return input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 3) << 8);
} }
static WRITE16_HANDLER( cave_eeprom_msb_w ) static WRITE16_HANDLER( cave_eeprom_msb_w )
@ -870,12 +870,12 @@ static WRITE16_HANDLER( korokoro_eeprom_msb_w )
static READ16_HANDLER( korokoro_input0_r ) static READ16_HANDLER( korokoro_input0_r )
{ {
return readinputport(0) | (hopper ? 0 : 0x8000); return input_port_read_indexed(machine, 0) | (hopper ? 0 : 0x8000);
} }
static READ16_HANDLER( korokoro_input1_r ) static READ16_HANDLER( korokoro_input1_r )
{ {
return readinputport(1) | ((EEPROM_read_bit() & 0x01) << 12); return input_port_read_indexed(machine, 1) | ((EEPROM_read_bit() & 0x01) << 12);
} }
static ADDRESS_MAP_START( korokoro_readmem, ADDRESS_SPACE_PROGRAM, 16 ) static ADDRESS_MAP_START( korokoro_readmem, ADDRESS_SPACE_PROGRAM, 16 )
@ -1077,7 +1077,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( sailormn_input0_r ) static READ16_HANDLER( sailormn_input0_r )
{ {
// watchdog_reset16_r(0,0); // written too rarely for mame. // watchdog_reset16_r(0,0); // written too rarely for mame.
return readinputport(0); return input_port_read_indexed(machine, 0);
} }
static READ16_HANDLER( agallet_irq_cause_r ) static READ16_HANDLER( agallet_irq_cause_r )
@ -1984,7 +1984,7 @@ static MACHINE_RESET( cave )
/* modify the eeprom on a reset with the desired region for the games that have the /* modify the eeprom on a reset with the desired region for the games that have the
region factory set in eeprom */ region factory set in eeprom */
if (cave_region_byte >= 0) if (cave_region_byte >= 0)
EEPROM_get_data_pointer(0)[cave_region_byte] = readinputport(2); EEPROM_get_data_pointer(0)[cave_region_byte] = input_port_read_indexed(machine, 2);
} }
static const struct YMZ280Binterface ymz280b_intf = static const struct YMZ280Binterface ymz280b_intf =

View File

@ -89,17 +89,17 @@ static READ16_HANDLER( twocrude_control_r )
switch (offset<<1) switch (offset<<1)
{ {
case 0: /* Player 1 & Player 2 joysticks & fire buttons */ case 0: /* Player 1 & Player 2 joysticks & fire buttons */
return (readinputport(0) + (readinputport(1) << 8)); return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 2: /* Dip Switches */ case 2: /* Dip Switches */
return (readinputport(3) + (readinputport(4) << 8)); return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
case 4: /* Protection */ case 4: /* Protection */
logerror("%04x : protection control read at 30c000 %d\n",activecpu_get_pc(),offset); logerror("%04x : protection control read at 30c000 %d\n",activecpu_get_pc(),offset);
return prot; return prot;
case 6: /* Credits, VBL in byte 7 */ case 6: /* Credits, VBL in byte 7 */
return readinputport(2); return input_port_read_indexed(machine, 2);
} }
return ~0; return ~0;

View File

@ -291,7 +291,7 @@ static WRITE8_HANDLER( bankswitch_w )
static READ8_HANDLER( leta_r ) static READ8_HANDLER( leta_r )
{ {
return readinputport(2 + offset); return input_port_read_indexed(machine, 2 + offset);
} }

View File

@ -507,7 +507,7 @@ static WRITE8_HANDLER( irq_ack_w )
* to prevent the counter from wrapping around between reads. * to prevent the counter from wrapping around between reads.
*/ */
INLINE int read_trackball(int idx, int switch_port) INLINE int read_trackball(running_machine *machine, int idx, int switch_port)
{ {
UINT8 newpos; UINT8 newpos;
@ -517,10 +517,10 @@ INLINE int read_trackball(int idx, int switch_port)
/* if we're to read the dipswitches behind the trackball data, do it now */ /* if we're to read the dipswitches behind the trackball data, do it now */
if (dsw_select) if (dsw_select)
return (readinputport(switch_port) & 0x7f) | sign[idx]; return (input_port_read_indexed(machine, switch_port) & 0x7f) | sign[idx];
/* get the new position and adjust the result */ /* get the new position and adjust the result */
newpos = readinputport(6 + idx); newpos = input_port_read_indexed(machine, 6 + idx);
if (newpos != oldpos[idx]) if (newpos != oldpos[idx])
{ {
sign[idx] = (newpos - oldpos[idx]) & 0x80; sign[idx] = (newpos - oldpos[idx]) & 0x80;
@ -528,30 +528,30 @@ INLINE int read_trackball(int idx, int switch_port)
} }
/* blend with the bits from the switch port */ /* blend with the bits from the switch port */
return (readinputport(switch_port) & 0x70) | (oldpos[idx] & 0x0f) | sign[idx]; return (input_port_read_indexed(machine, switch_port) & 0x70) | (oldpos[idx] & 0x0f) | sign[idx];
} }
static READ8_HANDLER( centiped_IN0_r ) static READ8_HANDLER( centiped_IN0_r )
{ {
return read_trackball(0, 0); return read_trackball(machine, 0, 0);
} }
static READ8_HANDLER( centiped_IN2_r ) static READ8_HANDLER( centiped_IN2_r )
{ {
return read_trackball(1, 2); return read_trackball(machine, 1, 2);
} }
static READ8_HANDLER( milliped_IN1_r ) static READ8_HANDLER( milliped_IN1_r )
{ {
return read_trackball(1, 1); return read_trackball(machine, 1, 1);
} }
static READ8_HANDLER( milliped_IN2_r ) static READ8_HANDLER( milliped_IN2_r )
{ {
UINT8 data = readinputport(2); UINT8 data = input_port_read_indexed(machine, 2);
/* MSH - 15 Feb, 2007 /* MSH - 15 Feb, 2007
* The P2 X Joystick inputs are not properly handled in * The P2 X Joystick inputs are not properly handled in
@ -562,7 +562,7 @@ static READ8_HANDLER( milliped_IN2_r )
*/ */
if (0 != control_select) { if (0 != control_select) {
/* Bottom 4 bits is our joystick inputs */ /* Bottom 4 bits is our joystick inputs */
UINT8 joy2data = readinputport(3) & 0x0f; UINT8 joy2data = input_port_read_indexed(machine, 3) & 0x0f;
data = data & 0xf0; /* Keep the top 4 bits */ data = data & 0xf0; /* Keep the top 4 bits */
data |= (joy2data & 0x0a) >> 1; /* flip left and up */ data |= (joy2data & 0x0a) >> 1; /* flip left and up */
data |= (joy2data & 0x05) << 1; /* flip right and down */ data |= (joy2data & 0x05) << 1; /* flip right and down */
@ -584,7 +584,7 @@ static WRITE8_HANDLER( control_select_w )
static READ8_HANDLER( mazeinv_input_r ) static READ8_HANDLER( mazeinv_input_r )
{ {
return readinputport(6 + control_select); return input_port_read_indexed(machine, 6 + control_select);
} }

View File

@ -106,8 +106,8 @@ static WRITE8_HANDLER( cham24_IN0_w )
in_0_shift = 0; in_0_shift = 0;
in_1_shift = 0; in_1_shift = 0;
in_0 = readinputport(0); in_0 = input_port_read_indexed(machine, 0);
in_1 = readinputport(1); in_1 = input_port_read_indexed(machine, 1);
} }

View File

@ -159,8 +159,8 @@ static UINT8 last_trackball_val[2] = {0,0};
static READ8_HANDLER( trackball_r ) static READ8_HANDLER( trackball_r )
{ {
UINT8 ret; UINT8 ret;
UINT8 port4 = readinputport(4); UINT8 port4 = input_port_read_indexed(machine, 4);
UINT8 port5 = readinputport(5); UINT8 port5 = input_port_read_indexed(machine, 5);
ret = (((port4 - last_trackball_val[0]) & 0x0f)<<4) | ((port5 - last_trackball_val[1]) & 0x0f); ret = (((port4 - last_trackball_val[0]) & 0x0f)<<4) | ((port5 - last_trackball_val[1]) & 0x0f);

View File

@ -95,7 +95,7 @@ static WRITE8_HANDLER( changela_68705_ddrA_w )
static READ8_HANDLER( changela_68705_portB_r ) static READ8_HANDLER( changela_68705_portB_r )
{ {
return (portB_out & ddrB) | (readinputport(4) & ~ddrB); return (portB_out & ddrB) | (input_port_read_indexed(machine, 4) & ~ddrB);
} }
static WRITE8_HANDLER( changela_68705_portB_w ) static WRITE8_HANDLER( changela_68705_portB_w )
@ -177,7 +177,7 @@ static READ8_HANDLER( changela_25_r )
static READ8_HANDLER( changela_30_r ) static READ8_HANDLER( changela_30_r )
{ {
return readinputport(7) & 0x0f; //wheel control (clocked input) signal on bits 3,2,1,0 return input_port_read_indexed(machine, 7) & 0x0f; //wheel control (clocked input) signal on bits 3,2,1,0
} }
static READ8_HANDLER( changela_31_r ) static READ8_HANDLER( changela_31_r )
@ -186,7 +186,7 @@ static READ8_HANDLER( changela_31_r )
or if the new value is greater than the old value, and it did wrap around, or if the new value is greater than the old value, and it did wrap around,
then we are moving LEFT. */ then we are moving LEFT. */
static UINT8 prev_value = 0; static UINT8 prev_value = 0;
UINT8 curr_value = readinputport(7); UINT8 curr_value = input_port_read_indexed(machine, 7);
static int dir = 0; static int dir = 0;
if( (curr_value < prev_value && (prev_value - curr_value) < 0x80) if( (curr_value < prev_value && (prev_value - curr_value) < 0x80)
@ -204,7 +204,7 @@ static READ8_HANDLER( changela_31_r )
static READ8_HANDLER( changela_2c_r ) static READ8_HANDLER( changela_2c_r )
{ {
int val = readinputport(5); int val = input_port_read_indexed(machine, 5);
val = (val&0x30) | ((val&1)<<7) | (((val&1)^1)<<6); val = (val&0x30) | ((val&1)<<7) | (((val&1)^1)<<6);
@ -221,7 +221,7 @@ static READ8_HANDLER( changela_2d_r )
v8 = 1; v8 = 1;
/* Gas pedal is made up of 2 switches, 1 active low, 1 active high */ /* Gas pedal is made up of 2 switches, 1 active low, 1 active high */
switch(readinputport(6) & 0x03) switch(input_port_read_indexed(machine, 6) & 0x03)
{ {
case 0x02: case 0x02:
gas = 0x80; gas = 0x80;
@ -234,7 +234,7 @@ static READ8_HANDLER( changela_2d_r )
break; break;
} }
return (readinputport(6) & 0x20) | gas | (v8<<4); return (input_port_read_indexed(machine, 6) & 0x20) | gas | (v8<<4);
} }
static WRITE8_HANDLER( mcu_PC0_w ) static WRITE8_HANDLER( mcu_PC0_w )

View File

@ -130,22 +130,22 @@ static READ8_HANDLER( chinsan_input_port_0_r )
/* i doubt these are both really the same.. */ /* i doubt these are both really the same.. */
case 0x40: case 0x40:
case 0x4f: case 0x4f:
return readinputportbytag("MAHJONG_P2_1"); return input_port_read(machine, "MAHJONG_P2_1");
case 0x53: case 0x53:
return readinputportbytag("MAHJONG_P2_2"); return input_port_read(machine, "MAHJONG_P2_2");
case 0x57: case 0x57:
return readinputportbytag("MAHJONG_P2_3"); return input_port_read(machine, "MAHJONG_P2_3");
case 0x5b: case 0x5b:
return readinputportbytag("MAHJONG_P2_4"); return input_port_read(machine, "MAHJONG_P2_4");
case 0x5d: case 0x5d:
return readinputportbytag("MAHJONG_P2_5"); return input_port_read(machine, "MAHJONG_P2_5");
case 0x5e: case 0x5e:
return readinputportbytag("MAHJONG_P2_6"); return input_port_read(machine, "MAHJONG_P2_6");
} }
printf("chinsan_input_port_0_r unk_r %02x\n", chinsan_port_select); printf("chinsan_input_port_0_r unk_r %02x\n", chinsan_port_select);
@ -159,22 +159,22 @@ static READ8_HANDLER( chinsan_input_port_1_r )
/* i doubt these are both really the same.. */ /* i doubt these are both really the same.. */
case 0x40: case 0x40:
case 0x4f: case 0x4f:
return readinputportbytag("MAHJONG_P1_1"); return input_port_read(machine, "MAHJONG_P1_1");
case 0x53: case 0x53:
return readinputportbytag("MAHJONG_P1_2"); return input_port_read(machine, "MAHJONG_P1_2");
case 0x57: case 0x57:
return readinputportbytag("MAHJONG_P1_3"); return input_port_read(machine, "MAHJONG_P1_3");
case 0x5b: case 0x5b:
return readinputportbytag("MAHJONG_P1_4"); return input_port_read(machine, "MAHJONG_P1_4");
case 0x5d: case 0x5d:
return readinputportbytag("MAHJONG_P1_5"); return input_port_read(machine, "MAHJONG_P1_5");
case 0x5e: case 0x5e:
return readinputportbytag("MAHJONG_P1_6"); return input_port_read(machine, "MAHJONG_P1_6");
} }
printf("chinsan_input_port_1_r unk_r %02x\n", chinsan_port_select); printf("chinsan_input_port_1_r unk_r %02x\n", chinsan_port_select);

View File

@ -125,8 +125,8 @@ static READ8_HANDLER( analog_read_r )
static int accel, wheel; static int accel, wheel;
switch (analog_ctrl & 0x03){ switch (analog_ctrl & 0x03){
case 0x00: return (accel = readinputport(5)); /* accelerator */ case 0x00: return (accel = input_port_read_indexed(machine, 5)); /* accelerator */
case 0x01: return (wheel = readinputport(6)); /* steering */ case 0x01: return (wheel = input_port_read_indexed(machine, 6)); /* steering */
case 0x02: return accel; /* accelerator (previous?) */ case 0x02: return accel; /* accelerator (previous?) */
case 0x03: return wheel; /* steering (previous?) */ case 0x03: return wheel; /* steering (previous?) */
} }

View File

@ -36,7 +36,7 @@ static UINT8 cidelsa_ef_r(void)
EF4 Coin 1 EF4 Coin 1
*/ */
return readinputportbytag("EF"); return input_port_read(Machine, "EF");
} }
static void cidelsa_q_w(int q) static void cidelsa_q_w(int q)

View File

@ -87,14 +87,14 @@ MACHINE_RESET( cinemat )
static READ8_HANDLER( inputs_r ) static READ8_HANDLER( inputs_r )
{ {
return (readinputportbytag("INPUTS") >> offset) & 1; return (input_port_read(machine, "INPUTS") >> offset) & 1;
} }
static READ8_HANDLER( switches_r ) static READ8_HANDLER( switches_r )
{ {
static const UINT8 switch_shuffle[8] = { 2,5,4,3,0,1,6,7 }; static const UINT8 switch_shuffle[8] = { 2,5,4,3,0,1,6,7 };
return (readinputportbytag("SWITCHES") >> switch_shuffle[offset]) & 1; return (input_port_read(machine, "SWITCHES") >> switch_shuffle[offset]) & 1;
} }
@ -154,7 +154,7 @@ static UINT8 joystick_read(void)
if (port_tag_to_index("ANALOGX") != -1) if (port_tag_to_index("ANALOGX") != -1)
{ {
int xval = (INT16)(cpunum_get_reg(0, CCPU_X) << 4) >> 4; int xval = (INT16)(cpunum_get_reg(0, CCPU_X) << 4) >> 4;
return (readinputportbytag(mux_select ? "ANALOGX" : "ANALOGY") - xval) < 0x800; return (input_port_read(Machine, mux_select ? "ANALOGX" : "ANALOGY") - xval) < 0x800;
} }
return 0; return 0;
} }
@ -173,7 +173,7 @@ static READ8_HANDLER( speedfrk_wheel_r )
int delta_wheel; int delta_wheel;
/* the shift register is cleared once per 'frame' */ /* the shift register is cleared once per 'frame' */
delta_wheel = (INT8)readinputportbytag("WHEEL") / 8; delta_wheel = (INT8)input_port_read(machine, "WHEEL") / 8;
if (delta_wheel > 3) if (delta_wheel > 3)
delta_wheel = 3; delta_wheel = 3;
else if (delta_wheel < -3) else if (delta_wheel < -3)
@ -186,14 +186,14 @@ static READ8_HANDLER( speedfrk_wheel_r )
static READ8_HANDLER( speedfrk_gear_r ) static READ8_HANDLER( speedfrk_gear_r )
{ {
static int gear = 0x0e; static int gear = 0x0e;
int gearval = readinputportbytag("GEAR"); int gearval = input_port_read(machine, "GEAR");
/* check the fake gear input port and determine the bit settings for the gear */ /* check the fake gear input port and determine the bit settings for the gear */
if ((gearval & 0x0f) != 0x0f) if ((gearval & 0x0f) != 0x0f)
gear = gearval & 0x0f; gear = gearval & 0x0f;
/* add the start key into the mix -- note that it overlaps 4th gear */ /* add the start key into the mix -- note that it overlaps 4th gear */
if (!(readinputportbytag("INPUTS") & 0x80)) if (!(input_port_read(machine, "INPUTS") & 0x80))
gear &= ~0x08; gear &= ~0x08;
return (gear >> offset) & 1; return (gear >> offset) & 1;
@ -239,9 +239,9 @@ static READ8_HANDLER( sundance_inputs_r )
{ {
/* handle special keys first */ /* handle special keys first */
if (sundance_port_map[offset].portname) if (sundance_port_map[offset].portname)
return (readinputportbytag(sundance_port_map[offset].portname) & sundance_port_map[offset].bitmask) ? 0 : 1; return (input_port_read(machine, sundance_port_map[offset].portname) & sundance_port_map[offset].bitmask) ? 0 : 1;
else else
return (readinputportbytag("INPUTS") >> offset) & 1; return (input_port_read(machine, "INPUTS") >> offset) & 1;
} }
@ -254,7 +254,7 @@ static READ8_HANDLER( sundance_inputs_r )
static READ8_HANDLER( boxingb_dial_r ) static READ8_HANDLER( boxingb_dial_r )
{ {
int value = readinputportbytag("DIAL"); int value = input_port_read(machine, "DIAL");
if (!mux_select) offset += 4; if (!mux_select) offset += 4;
return (value >> offset) & 1; return (value >> offset) & 1;
} }

View File

@ -532,7 +532,7 @@ static WRITE16_HANDLER( scudhamm_motor_command_w )
READ16_HANDLER( scudhamm_analog_r ) READ16_HANDLER( scudhamm_analog_r )
{ {
return readinputport(1); return input_port_read_indexed(machine, 1);
} }
/* /*
@ -627,17 +627,17 @@ static READ16_HANDLER( armchmp2_analog_r )
int armdelta; int armdelta;
static int armold = 0; static int armold = 0;
armdelta = readinputport(1) - armold; armdelta = input_port_read_indexed(machine, 1) - armold;
armold = readinputport(1); armold = input_port_read_indexed(machine, 1);
return ~( scudhamm_motor_command + armdelta ); // + x : x<=0 and player loses, x>0 and player wins return ~( scudhamm_motor_command + armdelta ); // + x : x<=0 and player loses, x>0 and player wins
} }
static READ16_HANDLER( armchmp2_buttons_r ) static READ16_HANDLER( armchmp2_buttons_r )
{ {
int arm_x = readinputport(1); int arm_x = input_port_read_indexed(machine, 1);
UINT16 ret = readinputport(0); UINT16 ret = input_port_read_indexed(machine, 0);
if (arm_x < 0x40) ret &= ~1; if (arm_x < 0x40) ret &= ~1;
else if (arm_x > 0xc0) ret &= ~2; else if (arm_x > 0xc0) ret &= ~2;

View File

@ -21,7 +21,7 @@ VIDEO_START( citycon );
static READ8_HANDLER( citycon_in_r ) static READ8_HANDLER( citycon_in_r )
{ {
return readinputport(flip_screen_get() ? 1 : 0); return input_port_read_indexed(machine, flip_screen_get() ? 1 : 0);
} }

View File

@ -39,12 +39,12 @@ static WRITE8_HANDLER( input_port_select_w )
} }
static UINT8 difficulty_input_port_r(int bit) static UINT8 difficulty_input_port_r(running_machine *machine, int bit)
{ {
UINT8 ret = 0; UINT8 ret = 0;
/* read fake port and remap the buttons to 2 bits */ /* read fake port and remap the buttons to 2 bits */
UINT8 raw = readinputportbytag("FAKE"); UINT8 raw = input_port_read(machine, "FAKE");
if (raw & (1 << (bit + 1))) if (raw & (1 << (bit + 1)))
ret = 0x03; /* expert */ ret = 0x03; /* expert */
@ -63,12 +63,12 @@ static READ8_HANDLER( input_port_r )
switch (input_port_select) switch (input_port_select)
{ {
case 0x01: ret = readinputportbytag("IN0"); break; case 0x01: ret = input_port_read(machine, "IN0"); break;
case 0x02: ret = readinputportbytag("IN1"); break; case 0x02: ret = input_port_read(machine, "IN1"); break;
case 0x04: ret = (readinputportbytag("IN2") & 0xf0) | case 0x04: ret = (input_port_read(machine, "IN2") & 0xf0) |
difficulty_input_port_r(0) | difficulty_input_port_r(machine, 0) |
(difficulty_input_port_r(3) << 2); break; (difficulty_input_port_r(machine, 3) << 2); break;
case 0x08: ret = readinputportbytag("IN3"); break; case 0x08: ret = input_port_read(machine, "IN3"); break;
case 0x10: case 0x10:
case 0x20: break; /* these two are not really used */ case 0x20: break; /* these two are not really used */
default: logerror("Unexpected port read: %02X\n", input_port_select); default: logerror("Unexpected port read: %02X\n", input_port_select);
@ -107,8 +107,8 @@ static WRITE8_HANDLER( analog_reset_w )
analog_port_val = 0xff; analog_port_val = 0xff;
timer_adjust_oneshot(analog_timer_1, compute_duration(readinputportbytag("AN1")), 0x02); timer_adjust_oneshot(analog_timer_1, compute_duration(input_port_read(machine, "AN1")), 0x02);
timer_adjust_oneshot(analog_timer_2, compute_duration(readinputportbytag("AN2")), 0x01); timer_adjust_oneshot(analog_timer_2, compute_duration(input_port_read(machine, "AN2")), 0x01);
} }

View File

@ -165,7 +165,7 @@ static READ8_HANDLER( cliff_port_r )
{ {
if ( port_bank < 7 ) if ( port_bank < 7 )
{ {
return readinputport( port_bank ); return input_port_read_indexed(machine, port_bank );
} }
/* output is pulled up for non-mapped ports */ /* output is pulled up for non-mapped ports */

View File

@ -248,7 +248,7 @@ static WRITE8_HANDLER( cloud9_coin_counter_w )
static READ8_HANDLER( leta_r ) static READ8_HANDLER( leta_r )
{ {
return readinputport(3 + offset); return input_port_read_indexed(machine, 3 + offset);
} }

View File

@ -56,10 +56,10 @@ static WRITE8_HANDLER( clshroad_sharedram_w ) { clshroad_sharedram[offset] = dat
static READ8_HANDLER( clshroad_input_r ) static READ8_HANDLER( clshroad_input_r )
{ {
return ((~readinputportbytag("IN0") & (1 << offset)) ? 1 : 0) | return ((~input_port_read(machine, "IN0") & (1 << offset)) ? 1 : 0) |
((~readinputportbytag("IN1") & (1 << offset)) ? 2 : 0) | ((~input_port_read(machine, "IN1") & (1 << offset)) ? 2 : 0) |
((~readinputportbytag("DSW1") & (1 << offset)) ? 4 : 0) | ((~input_port_read(machine, "DSW1") & (1 << offset)) ? 4 : 0) |
((~readinputportbytag("DSW2") & (1 << offset)) ? 8 : 0) ; ((~input_port_read(machine, "DSW2") & (1 << offset)) ? 8 : 0) ;
} }

View File

@ -133,17 +133,17 @@ static WRITE16_HANDLER( cninja_irq_w )
logerror("%08x: Unmapped IRQ write %d %04x\n",activecpu_get_pc(),offset,data); logerror("%08x: Unmapped IRQ write %d %04x\n",activecpu_get_pc(),offset,data);
} }
static READ16_HANDLER( robocop2_dip3_r ) { return readinputport(3); } static READ16_HANDLER( robocop2_dip3_r ) { return input_port_read_indexed(machine, 3); }
static READ16_HANDLER( robocop2_prot_r ) static READ16_HANDLER( robocop2_prot_r )
{ {
switch (offset<<1) { switch (offset<<1) {
case 0x41a: /* Player 1 & 2 input ports */ case 0x41a: /* Player 1 & 2 input ports */
return readinputport(0); return input_port_read_indexed(machine, 0);
case 0x320: /* Coins */ case 0x320: /* Coins */
return readinputport(1); return input_port_read_indexed(machine, 1);
case 0x4e6: /* Dip switches */ case 0x4e6: /* Dip switches */
return readinputport(2); return input_port_read_indexed(machine, 2);
case 0x504: /* PC: 6b6. b4, 2c, 36 written before read */ case 0x504: /* PC: 6b6. b4, 2c, 36 written before read */
logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset); logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset);
return 0x84; return 0x84;

View File

@ -368,7 +368,7 @@ static READ32_HANDLER( jaguar_wave_rom_r )
static READ32_HANDLER( jamma_r ) static READ32_HANDLER( jamma_r )
{ {
return readinputport(0) | (readinputport(1) << 16); return input_port_read_indexed(machine, 0) | (input_port_read_indexed(machine, 1) << 16);
} }
@ -381,7 +381,7 @@ static READ32_HANDLER( status_r )
// D5 = /VOLUMEUP // D5 = /VOLUMEUP
// D4 = /VOLUMEDOWN // D4 = /VOLUMEDOWN
// D3-D0 = ACTC4-1 // D3-D0 = ACTC4-1
return readinputport(2) | (readinputport(2) << 16); return input_port_read_indexed(machine, 2) | (input_port_read_indexed(machine, 2) << 16);
} }

View File

@ -169,7 +169,7 @@ static READ8_HANDLER( trackball_r )
{ {
UINT8 curr; UINT8 curr;
curr = readinputport(4 + i); curr = input_port_read_indexed(machine, 4 + i);
dir[i] = curr - pos[i]; dir[i] = curr - pos[i];
sign[i] = dir[i] & 0x80; sign[i] = dir[i] & 0x80;

View File

@ -255,20 +255,20 @@ static TIMER_CALLBACK( amerdart_iop_response )
break; break;
case 0x100: case 0x100:
iop_answer = (INT8)(-readinputportbytag("YAXIS2") - readinputportbytag("XAXIS2")) << 6; iop_answer = (INT8)(-input_port_read(machine, "YAXIS2") - input_port_read(machine, "XAXIS2")) << 6;
break; break;
case 0x101: case 0x101:
iop_answer = (INT8)(-readinputportbytag("YAXIS2") + readinputportbytag("XAXIS2")) << 6; iop_answer = (INT8)(-input_port_read(machine, "YAXIS2") + input_port_read(machine, "XAXIS2")) << 6;
break; break;
case 0x102: case 0x102:
iop_answer = (INT8)(-readinputportbytag("YAXIS1") - readinputportbytag("XAXIS1")) << 6; iop_answer = (INT8)(-input_port_read(machine, "YAXIS1") - input_port_read(machine, "XAXIS1")) << 6;
break; break;
case 0x103: case 0x103:
iop_answer = (INT8)(-readinputportbytag("YAXIS1") + readinputportbytag("XAXIS1")) << 6; iop_answer = (INT8)(-input_port_read(machine, "YAXIS1") + input_port_read(machine, "XAXIS1")) << 6;
break; break;
case 0x500: case 0x500:
iop_answer = readinputport(0); iop_answer = input_port_read_indexed(machine, 0);
break; break;
} }
@ -420,9 +420,9 @@ static READ16_HANDLER( coolpool_input_r )
static UINT8 oldx, oldy; static UINT8 oldx, oldy;
static UINT16 lastresult; static UINT16 lastresult;
int result = (readinputportbytag("IN1") & 0x00ff) | (lastresult & 0xff00); int result = (input_port_read(machine, "IN1") & 0x00ff) | (lastresult & 0xff00);
UINT8 newx = readinputportbytag("XAXIS"); UINT8 newx = input_port_read(machine, "XAXIS");
UINT8 newy = readinputportbytag("YAXIS"); UINT8 newy = input_port_read(machine, "YAXIS");
int dx = (INT8)(newx - oldx); int dx = (INT8)(newx - oldx);
int dy = (INT8)(newy - oldy); int dy = (INT8)(newy - oldy);

View File

@ -101,10 +101,10 @@ static READ8_HANDLER( mightguy_dsw_r )
switch (offset) switch (offset)
{ {
case 0 : case 0 :
data = (readinputportbytag("DSW1") & 0x7f) | ((readinputportbytag("FAKE") & 0x04) << 5); data = (input_port_read(machine, "DSW1") & 0x7f) | ((input_port_read(machine, "FAKE") & 0x04) << 5);
break; break;
case 1 : case 1 :
data = (readinputportbytag("DSW2") & 0x3f) | ((readinputportbytag("FAKE") & 0x03) << 6); data = (input_port_read(machine, "DSW2") & 0x3f) | ((input_port_read(machine, "FAKE") & 0x03) << 6);
break; break;
} }

View File

@ -82,7 +82,7 @@ static UINT8 misc = 0;
static READ8_HANDLER( copsnrob_misc_r ) static READ8_HANDLER( copsnrob_misc_r )
{ {
return misc | (readinputport(0) & 0x80); return misc | (input_port_read_indexed(machine, 0) & 0x80);
} }
static WRITE8_HANDLER( copsnrob_misc_w ) static WRITE8_HANDLER( copsnrob_misc_w )

View File

@ -204,7 +204,7 @@ static INTERRUPT_GEN( cosmica_interrupt )
if (pixel_clock == 0) if (pixel_clock == 0)
{ {
if (readinputport(3) & 1) /* Left Coin */ if (input_port_read_indexed(machine, 3) & 1) /* Left Coin */
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
} }
} }
@ -218,7 +218,7 @@ static INTERRUPT_GEN( cosmicg_interrupt )
It makes sense and works fine, but I cannot be 100% sure this is correct, It makes sense and works fine, but I cannot be 100% sure this is correct,
as I have no Cosmic Guerilla console :-) . */ as I have no Cosmic Guerilla console :-) . */
if ((readinputport(2) & 1)) /* Coin */ if ((input_port_read_indexed(machine, 2) & 1)) /* Coin */
/* on tms9980, a 6 on the interrupt bus means level 4 interrupt */ /* on tms9980, a 6 on the interrupt bus means level 4 interrupt */
cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, 6); cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, 6);
else else

View File

@ -164,31 +164,31 @@ Stephh's log (2006.09.20) :
READ16_HANDLER( cps1_dsw_r ) READ16_HANDLER( cps1_dsw_r )
{ {
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" }; static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
int control = readinputportbytag(dswname[offset]); int control = input_port_read(machine, dswname[offset]);
return control << 8 | control; return control << 8 | control;
} }
READ16_HANDLER( cps1_in0_r ) READ16_HANDLER( cps1_in0_r )
{ {
int buttons = readinputportbytag("IN0"); int buttons = input_port_read(machine, "IN0");
return buttons << 8 | buttons; return buttons << 8 | buttons;
} }
READ16_HANDLER( cps1_in1_r ) READ16_HANDLER( cps1_in1_r )
{ {
int buttons = readinputportbytag("IN1"); int buttons = input_port_read(machine, "IN1");
return buttons; return buttons;
} }
READ16_HANDLER( cps1_in2_r ) READ16_HANDLER( cps1_in2_r )
{ {
int buttons = readinputportbytag("IN2"); int buttons = input_port_read(machine, "IN2");
return buttons << 8 | buttons; return buttons << 8 | buttons;
} }
READ16_HANDLER( cps1_in3_r ) READ16_HANDLER( cps1_in3_r )
{ {
int buttons = readinputportbytag("IN3"); int buttons = input_port_read(machine, "IN3");
return buttons << 8 | buttons; return buttons << 8 | buttons;
} }
@ -197,22 +197,22 @@ static int dial[2];
static READ16_HANDLER( forgottn_dial_0_r ) static READ16_HANDLER( forgottn_dial_0_r )
{ {
return ((readinputportbytag("DIAL0") - dial[0]) >> (8*offset)) & 0xff; return ((input_port_read(machine, "DIAL0") - dial[0]) >> (8*offset)) & 0xff;
} }
static READ16_HANDLER( forgottn_dial_1_r ) static READ16_HANDLER( forgottn_dial_1_r )
{ {
return ((readinputportbytag("DIAL1") - dial[1]) >> (8*offset)) & 0xff; return ((input_port_read(machine, "DIAL1") - dial[1]) >> (8*offset)) & 0xff;
} }
static WRITE16_HANDLER( forgottn_dial_0_reset_w ) static WRITE16_HANDLER( forgottn_dial_0_reset_w )
{ {
dial[0] = readinputportbytag("DIAL0"); dial[0] = input_port_read(machine, "DIAL0");
} }
static WRITE16_HANDLER( forgottn_dial_1_reset_w ) static WRITE16_HANDLER( forgottn_dial_1_reset_w )
{ {
dial[1] = readinputportbytag("DIAL1"); dial[1] = input_port_read(machine, "DIAL1");
} }

View File

@ -848,9 +848,9 @@ static READ16_HANDLER( kludge_r )
static READ16_HANDLER( joy_or_paddle_r ) static READ16_HANDLER( joy_or_paddle_r )
{ {
if (readpaddle != 0) if (readpaddle != 0)
return (readinputportbytag("IN0")); return (input_port_read(machine, "IN0"));
else else
return (readinputportbytag("PADDLE1") & 0xff) | (readinputportbytag("PADDLE2") << 8); return (input_port_read(machine, "PADDLE1") & 0xff) | (input_port_read(machine, "PADDLE2") << 8);
} }

View File

@ -1782,12 +1782,12 @@ static WRITE32_HANDLER( cram_gfxflash_bank_w )
static READ32_HANDLER( cps3_io1_r ) static READ32_HANDLER( cps3_io1_r )
{ {
return readinputport(0); return input_port_read_indexed(machine, 0);
} }
static READ32_HANDLER( cps3_io2_r ) static READ32_HANDLER( cps3_io2_r )
{ {
return readinputport(1); return input_port_read_indexed(machine, 1);
} }
// this seems to be dma active flags, and maybe vblank... not if it is anything else // this seems to be dma active flags, and maybe vblank... not if it is anything else

View File

@ -75,7 +75,7 @@ static CUSTOM_INPUT( pc3092_r )
/* enable coin & start input? Wild guess!!! */ /* enable coin & start input? Wild guess!!! */
if (pc3092_data[1] & 0x02) if (pc3092_data[1] & 0x02)
ret = readinputportbytag("PC3092"); ret = input_port_read(machine, "PC3092");
else else
ret = 0x00; ret = 0x00;
@ -145,7 +145,7 @@ static READ8_HANDLER( pc3259_r )
if (LOG_PC3259) logerror("%04X: read PC3259 #%d = 0x%02x\n", safe_activecpu_get_pc(), reg, ret); if (LOG_PC3259) logerror("%04X: read PC3259 #%d = 0x%02x\n", safe_activecpu_get_pc(), reg, ret);
return ret | (readinputportbytag("DSW1") & 0xf0); return ret | (input_port_read(machine, "DSW1") & 0xf0);
} }

View File

@ -81,13 +81,13 @@ static MACHINE_START( crgolf )
static READ8_HANDLER( switch_input_r ) static READ8_HANDLER( switch_input_r )
{ {
return readinputport(port_select); return input_port_read_indexed(machine, port_select);
} }
static READ8_HANDLER( analog_input_r ) static READ8_HANDLER( analog_input_r )
{ {
return ((readinputport(7) >> 4) | (readinputport(8) & 0xf0)) ^ 0x88; return ((input_port_read_indexed(machine, 7) >> 4) | (input_port_read_indexed(machine, 8) & 0xf0)) ^ 0x88;
} }

View File

@ -173,7 +173,7 @@ static WRITE16_HANDLER( sound_command_w )
static READ16_HANDLER( country_sndpending_r ) static READ16_HANDLER( country_sndpending_r )
{ {
return readinputport(5) | (pending_command ? 0x8000 : 0); return input_port_read_indexed(machine, 5) | (pending_command ? 0x8000 : 0);
} }
static WRITE8_HANDLER( pending_command_clear_w ) static WRITE8_HANDLER( pending_command_clear_w )

View File

@ -181,18 +181,18 @@ static WRITE32_HANDLER(FlipCount_w)
static READ32_HANDLER(Input_r) static READ32_HANDLER(Input_r)
{ {
if(offset==0) if(offset==0)
return readinputport(0)|(readinputport(1)<<16); return input_port_read_indexed(machine, 0)|(input_port_read_indexed(machine, 1)<<16);
else if(offset==1) else if(offset==1)
return readinputport(2)|(readinputport(3)<<16); return input_port_read_indexed(machine, 2)|(input_port_read_indexed(machine, 3)<<16);
else if(offset==2) else if(offset==2)
{ {
UINT8 Port4=readinputport(4); UINT8 Port4=input_port_read_indexed(machine, 4);
if(!(Port4&0x10) && ((OldPort4^Port4)&0x10)) //coin buttons trigger IRQs if(!(Port4&0x10) && ((OldPort4^Port4)&0x10)) //coin buttons trigger IRQs
IntReq(machine, 12); IntReq(machine, 12);
if(!(Port4&0x20) && ((OldPort4^Port4)&0x20)) if(!(Port4&0x20) && ((OldPort4^Port4)&0x20))
IntReq(machine, 19); IntReq(machine, 19);
OldPort4=Port4; OldPort4=Port4;
return /*dips*/readinputport(5)|(Port4<<16); return /*dips*/input_port_read_indexed(machine, 5)|(Port4<<16);
} }
return 0; return 0;
} }

View File

@ -161,7 +161,7 @@ static WRITE8_HANDLER( custom_io_w )
{ {
switch (data) switch (data)
{ {
case 0x00: protection_res = readinputport(7); break; case 0x00: protection_res = input_port_read_indexed(machine, 7); break;
case 0x20: protection_res = 0x49; break; case 0x20: protection_res = 0x49; break;
case 0x21: protection_res = 0x47; break; case 0x21: protection_res = 0x47; break;
case 0x22: protection_res = 0x53; break; case 0x22: protection_res = 0x53; break;

View File

@ -45,6 +45,7 @@
*/ */
#include "driver.h" #include "driver.h"
#include "deprecat.h"
#include "memconv.h" #include "memconv.h"
#include "sound/custom.h" #include "sound/custom.h"
#include "includes/amiga.h" #include "includes/amiga.h"
@ -106,7 +107,7 @@ static WRITE32_HANDLER( aga_overlay_w )
static UINT8 cd32_cia_0_porta_r(void) static UINT8 cd32_cia_0_porta_r(void)
{ {
return readinputportbytag("CIA0PORTA"); return input_port_read(Machine, "CIA0PORTA");
} }
static void cd32_cia_0_porta_w(UINT8 data) static void cd32_cia_0_porta_w(UINT8 data)
@ -148,7 +149,7 @@ static void cd32_cia_0_portb_w(UINT8 data)
static READ32_HANDLER( dipswitch_r ) static READ32_HANDLER( dipswitch_r )
{ {
return readinputportbytag("DIPSW1"); return input_port_read(machine, "DIPSW1");
} }
static ADDRESS_MAP_START( cd32_map, ADDRESS_SPACE_PROGRAM, 32 ) static ADDRESS_MAP_START( cd32_map, ADDRESS_SPACE_PROGRAM, 32 )

View File

@ -105,7 +105,7 @@ static MACHINE_RESET( cyberb2p )
static READ16_HANDLER( special_port0_r ) static READ16_HANDLER( special_port0_r )
{ {
int temp = readinputport(0); int temp = input_port_read_indexed(machine, 0);
if (atarigen_cpu_to_sound_ready) temp ^= 0x0080; if (atarigen_cpu_to_sound_ready) temp ^= 0x0080;
return temp; return temp;
} }
@ -113,7 +113,7 @@ static READ16_HANDLER( special_port0_r )
static READ16_HANDLER( special_port2_r ) static READ16_HANDLER( special_port2_r )
{ {
int temp = readinputport(2); int temp = input_port_read_indexed(machine, 2);
if (atarigen_cpu_to_sound_ready) temp ^= 0x2000; if (atarigen_cpu_to_sound_ready) temp ^= 0x2000;
return temp; return temp;
} }

View File

@ -236,7 +236,7 @@ static READ16_HANDLER( io_r )
switch( offset ) switch( offset )
{ {
case 2/2: case 2/2:
return ( (readinputportbytag("DSW1") << 8) | readinputportbytag("DSW2") ); return ( (input_port_read(machine, "DSW1") << 8) | input_port_read(machine, "DSW2") );
// 0x00110007 is controller device select // 0x00110007 is controller device select
// 0x001100D5 is controller data // 0x001100D5 is controller data
@ -245,15 +245,15 @@ static READ16_HANDLER( io_r )
switch( (io_ram[7/2]) & 0xff ) switch( (io_ram[7/2]) & 0xff )
{ {
case 0: case 0:
io_ram[0xd5/2] = readinputportbytag("TRAVERSE"); io_ram[0xd5/2] = input_port_read(machine, "TRAVERSE");
break; break;
case 0x20: case 0x20:
io_ram[0xd5/2] = readinputportbytag("ELEVATE"); io_ram[0xd5/2] = input_port_read(machine, "ELEVATE");
break; break;
case 0x40: case 0x40:
io_ram[0xd5/2] = readinputportbytag("ACCEL"); io_ram[0xd5/2] = input_port_read(machine, "ACCEL");
break; break;
case 0x42: case 0x42:
@ -265,7 +265,7 @@ static READ16_HANDLER( io_r )
break; break;
case 0x60: case 0x60:
io_ram[0xd5/2] = readinputportbytag("HANDLE"); io_ram[0xd5/2] = input_port_read(machine, "HANDLE");
break; break;
default: default:
@ -274,13 +274,13 @@ static READ16_HANDLER( io_r )
return 0; return 0;
case 6/2: case 6/2:
return readinputportbytag("IN0"); // high half return input_port_read(machine, "IN0"); // high half
case 9/2: case 9/2:
return readinputportbytag("IN0"); // low half return input_port_read(machine, "IN0"); // low half
case 0xb/2: case 0xb/2:
return readinputportbytag("DSW3"); return input_port_read(machine, "DSW3");
case 0xd5/2: case 0xd5/2:
return io_ram[offset]; // controller data return io_ram[offset]; // controller data

View File

@ -234,7 +234,7 @@ static NVRAM_HANDLER( darkhors )
static READ32_HANDLER( darkhors_eeprom_r ) static READ32_HANDLER( darkhors_eeprom_r )
{ {
// bit 31? // bit 31?
return readinputport(4) | ((EEPROM_read_bit() & 1) << (7+16)); return input_port_read_indexed(machine, 4) | ((EEPROM_read_bit() & 1) << (7+16));
} }
static WRITE32_HANDLER( darkhors_eeprom_w ) static WRITE32_HANDLER( darkhors_eeprom_w )
@ -302,8 +302,8 @@ static READ32_HANDLER( darkhors_input_sel_r )
int bit_p1 = mask_to_bit((input_sel & 0x00ff0000) >> 16); int bit_p1 = mask_to_bit((input_sel & 0x00ff0000) >> 16);
int bit_p2 = mask_to_bit((input_sel & 0xff000000) >> 24); int bit_p2 = mask_to_bit((input_sel & 0xff000000) >> 24);
return (readinputport(5 + bit_p1) & 0x00ffffff) | return (input_port_read_indexed(machine, 5 + bit_p1) & 0x00ffffff) |
(readinputport(5 + bit_p2) & 0xff000000) ; (input_port_read_indexed(machine, 5 + bit_p2) & 0xff000000) ;
} }
static WRITE32_HANDLER( darkhors_unk1_w ) static WRITE32_HANDLER( darkhors_unk1_w )

View File

@ -54,13 +54,13 @@ static READ16_HANDLER( darkseal_control_r )
switch (offset<<1) switch (offset<<1)
{ {
case 0: /* Dip Switches */ case 0: /* Dip Switches */
return (readinputport(3) + (readinputport(4) << 8)); return (input_port_read_indexed(machine, 3) + (input_port_read_indexed(machine, 4) << 8));
case 2: /* Player 1 & Player 2 joysticks & fire buttons */ case 2: /* Player 1 & Player 2 joysticks & fire buttons */
return (readinputport(0) + (readinputport(1) << 8)); return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 4: /* Credits */ case 4: /* Credits */
return readinputport(2); return input_port_read_indexed(machine, 2);
} }
return ~0; return ~0;

View File

@ -138,19 +138,19 @@ static READ16_HANDLER( dassault_control_r )
switch (offset<<1) switch (offset<<1)
{ {
case 0: /* Player 1 & Player 2 joysticks & fire buttons */ case 0: /* Player 1 & Player 2 joysticks & fire buttons */
return (readinputport(0) + (readinputport(1) << 8)); return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
case 2: /* Player 3 & Player 4 joysticks & fire buttons */ case 2: /* Player 3 & Player 4 joysticks & fire buttons */
return (readinputport(6) + (readinputport(7) << 8)); return (input_port_read_indexed(machine, 6) + (input_port_read_indexed(machine, 7) << 8));
case 4: /* Dip 1 (stored at 0x3f8035) */ case 4: /* Dip 1 (stored at 0x3f8035) */
return readinputport(3); return input_port_read_indexed(machine, 3);
case 6: /* Dip 2 (stored at 0x3f8034) */ case 6: /* Dip 2 (stored at 0x3f8034) */
return readinputport(4); return input_port_read_indexed(machine, 4);
case 8: /* VBL, Credits */ case 8: /* VBL, Credits */
return readinputport(2); return input_port_read_indexed(machine, 2);
} }
return 0xffff; return 0xffff;
@ -165,7 +165,7 @@ static WRITE16_HANDLER( dassault_control_w )
static READ16_HANDLER( dassault_sub_control_r ) static READ16_HANDLER( dassault_sub_control_r )
{ {
return readinputport(5); return input_port_read_indexed(machine, 5);
} }
static WRITE16_HANDLER( dassault_sound_w ) static WRITE16_HANDLER( dassault_sound_w )

View File

@ -115,17 +115,17 @@ static WRITE16_HANDLER( dbzcontrol_w )
static READ16_HANDLER( dbz_inp0_r ) static READ16_HANDLER( dbz_inp0_r )
{ {
return readinputportbytag("IN0") | (readinputportbytag("IN1")<<8); return input_port_read(machine, "IN0") | (input_port_read(machine, "IN1")<<8);
} }
static READ16_HANDLER( dbz_inp1_r ) static READ16_HANDLER( dbz_inp1_r )
{ {
return readinputportbytag("IN3") | (readinputportbytag("DSW1")<<8); return input_port_read(machine, "IN3") | (input_port_read(machine, "DSW1")<<8);
} }
static READ16_HANDLER( dbz_inp2_r ) static READ16_HANDLER( dbz_inp2_r )
{ {
return readinputportbytag("DSW2") | (readinputportbytag("DSW2")<<8); return input_port_read(machine, "DSW2") | (input_port_read(machine, "DSW2")<<8);
} }
static WRITE16_HANDLER( dbz_sound_command_w ) static WRITE16_HANDLER( dbz_sound_command_w )

View File

@ -128,13 +128,13 @@ static MACHINE_START( dcheese )
static READ16_HANDLER( port_0_r ) static READ16_HANDLER( port_0_r )
{ {
return (readinputport(0) & 0xff7f) | (EEPROM_read_bit() << 7); return (input_port_read_indexed(machine, 0) & 0xff7f) | (EEPROM_read_bit() << 7);
} }
static READ16_HANDLER( port_2_r ) static READ16_HANDLER( port_2_r )
{ {
return (readinputport(2) & 0xff1f) | (!soundlatch_full << 7) | (ticket_dispenser_r(machine, 0) >> 2); return (input_port_read_indexed(machine, 2) & 0xff1f) | (!soundlatch_full << 7) | (ticket_dispenser_r(machine, 0) >> 2);
} }

View File

@ -1305,7 +1305,7 @@ VIDEO_UPDATE(ddenlovr)
static READ16_HANDLER( ddenlovr_special_r ) static READ16_HANDLER( ddenlovr_special_r )
{ {
int res = readinputport(2) | (ddenlovr_blitter_irq_flag << 6); int res = input_port_read_indexed(machine, 2) | (ddenlovr_blitter_irq_flag << 6);
return res; return res;
} }
@ -1486,9 +1486,9 @@ static READ8_HANDLER( rongrong_input2_r )
/* 0 and 1 are read from offset 1, 2 from offset 0... */ /* 0 and 1 are read from offset 1, 2 from offset 0... */
switch( ddenlovr_select2 ) switch( ddenlovr_select2 )
{ {
case 0x00: return readinputport(0); case 0x00: return input_port_read_indexed(machine, 0);
case 0x01: return readinputport(1); case 0x01: return input_port_read_indexed(machine, 1);
case 0x02: return readinputport(2); case 0x02: return input_port_read_indexed(machine, 2);
} }
return 0xff; return 0xff;
} }
@ -1496,9 +1496,9 @@ static READ8_HANDLER( rongrong_input2_r )
static READ8_HANDLER( quiz365_input_r ) static READ8_HANDLER( quiz365_input_r )
{ {
if (!(ddenlovr_select & 0x01)) return readinputport(3); if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 3);
if (!(ddenlovr_select & 0x02)) return readinputport(4); if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 4);
if (!(ddenlovr_select & 0x04)) return readinputport(5); if (!(ddenlovr_select & 0x04)) return input_port_read_indexed(machine, 5);
if (!(ddenlovr_select & 0x08)) return 0xff;//mame_rand(machine); if (!(ddenlovr_select & 0x08)) return 0xff;//mame_rand(machine);
if (!(ddenlovr_select & 0x10)) return 0xff;//mame_rand(machine); if (!(ddenlovr_select & 0x10)) return 0xff;//mame_rand(machine);
return 0xff; return 0xff;
@ -1510,9 +1510,9 @@ static READ16_HANDLER( quiz365_input2_r )
/* 0 and 1 are read from offset 1, 2 from offset 0... */ /* 0 and 1 are read from offset 1, 2 from offset 0... */
switch( ddenlovr_select2 ) switch( ddenlovr_select2 )
{ {
case 0x10: return readinputport(0); case 0x10: return input_port_read_indexed(machine, 0);
case 0x11: return readinputport(1); case 0x11: return input_port_read_indexed(machine, 1);
case 0x12: return readinputport(2) | (ddenlovr_blitter_irq_flag << 6); case 0x12: return input_port_read_indexed(machine, 2) | (ddenlovr_blitter_irq_flag << 6);
} }
return 0xff; return 0xff;
} }
@ -1615,9 +1615,9 @@ static UINT16 *ddenlvrj_dsw_sel;
static READ16_HANDLER( ddenlvrj_dsw_r ) static READ16_HANDLER( ddenlvrj_dsw_r )
{ {
UINT16 dsw = 0; UINT16 dsw = 0;
if ((~*ddenlvrj_dsw_sel) & 0x01) dsw |= readinputport(3); // dsw 1 if ((~*ddenlvrj_dsw_sel) & 0x01) dsw |= input_port_read_indexed(machine, 3); // dsw 1
if ((~*ddenlvrj_dsw_sel) & 0x02) dsw |= readinputport(4); // dsw 2 if ((~*ddenlvrj_dsw_sel) & 0x02) dsw |= input_port_read_indexed(machine, 4); // dsw 2
if ((~*ddenlvrj_dsw_sel) & 0x04) dsw |= readinputport(5); // ? if ((~*ddenlvrj_dsw_sel) & 0x04) dsw |= input_port_read_indexed(machine, 5); // ?
return dsw; return dsw;
} }
@ -1633,7 +1633,7 @@ static WRITE16_HANDLER( ddenlvrj_coincounter_w )
static READ16_HANDLER( ddenlvrj_blitter_r ) static READ16_HANDLER( ddenlvrj_blitter_r )
{ {
return readinputport(2) | (ddenlovr_blitter_irq_flag ? 0x60 : 0x00 ); // bit 4 = 1 -> blitter busy return input_port_read_indexed(machine, 2) | (ddenlovr_blitter_irq_flag ? 0x60 : 0x00 ); // bit 4 = 1 -> blitter busy
} }
static ADDRESS_MAP_START( ddenlvrj_readmem, ADDRESS_SPACE_PROGRAM, 16 ) static ADDRESS_MAP_START( ddenlvrj_readmem, ADDRESS_SPACE_PROGRAM, 16 )
@ -1718,14 +1718,14 @@ ADDRESS_MAP_END
static READ16_HANDLER( nettoqc_special_r ) static READ16_HANDLER( nettoqc_special_r )
{ {
return readinputport(2) | (ddenlovr_blitter_irq_flag ? 0x60 : 0x00 ); return input_port_read_indexed(machine, 2) | (ddenlovr_blitter_irq_flag ? 0x60 : 0x00 );
} }
static READ16_HANDLER( nettoqc_input_r ) static READ16_HANDLER( nettoqc_input_r )
{ {
if (!(ddenlovr_select & 0x01)) return readinputport(3); if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 3);
if (!(ddenlovr_select & 0x02)) return readinputport(4); if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 4);
if (!(ddenlovr_select & 0x04)) return readinputport(5); if (!(ddenlovr_select & 0x04)) return input_port_read_indexed(machine, 5);
return 0xffff; return 0xffff;
} }
@ -1810,11 +1810,11 @@ ADDRESS_MAP_END
static READ8_HANDLER( rongrong_input_r ) static READ8_HANDLER( rongrong_input_r )
{ {
if (!(ddenlovr_select & 0x01)) return readinputport(3); if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 3);
if (!(ddenlovr_select & 0x02)) return readinputport(4); if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 4);
if (!(ddenlovr_select & 0x04)) return 0xff;//mame_rand(machine); if (!(ddenlovr_select & 0x04)) return 0xff;//mame_rand(machine);
if (!(ddenlovr_select & 0x08)) return 0xff;//mame_rand(machine); if (!(ddenlovr_select & 0x08)) return 0xff;//mame_rand(machine);
if (!(ddenlovr_select & 0x10)) return readinputport(5); if (!(ddenlovr_select & 0x10)) return input_port_read_indexed(machine, 5);
return 0xff; return 0xff;
} }
@ -2131,9 +2131,9 @@ static WRITE8_HANDLER( funkyfig_rombank_w )
static READ8_HANDLER( funkyfig_dsw_r ) static READ8_HANDLER( funkyfig_dsw_r )
{ {
if (!(ddenlovr_select & 0x01)) return readinputport(3); if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 3);
if (!(ddenlovr_select & 0x02)) return readinputport(4); if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 4);
if (!(ddenlovr_select & 0x04)) return readinputport(5); if (!(ddenlovr_select & 0x04)) return input_port_read_indexed(machine, 5);
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select); logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select);
return 0xff; return 0xff;
} }
@ -2144,7 +2144,7 @@ static READ8_HANDLER( funkyfig_coin_r )
{ {
switch( ddenlovr_select2 ) switch( ddenlovr_select2 )
{ {
case 0x22: return readinputport(2); case 0x22: return input_port_read_indexed(machine, 2);
case 0x23: return funkyfig_lockout; case 0x23: return funkyfig_lockout;
} }
logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", activecpu_get_pc(), ddenlovr_select2); logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", activecpu_get_pc(), ddenlovr_select2);
@ -2155,8 +2155,8 @@ static READ8_HANDLER( funkyfig_key_r )
{ {
switch( ddenlovr_select2 ) switch( ddenlovr_select2 )
{ {
case 0x20: return readinputport(0); case 0x20: return input_port_read_indexed(machine, 0);
case 0x21: return readinputport(1); case 0x21: return input_port_read_indexed(machine, 1);
} }
logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", activecpu_get_pc(), ddenlovr_select2); logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", activecpu_get_pc(), ddenlovr_select2);
return 0xff; return 0xff;
@ -2266,23 +2266,23 @@ static READ8_HANDLER( hanakanz_keyb_r )
{ {
UINT8 val = 0xff; UINT8 val = 0xff;
if (!(keyb & 0x01)) val = readinputport(offset * 5 + 1); if (!(keyb & 0x01)) val = input_port_read_indexed(machine, offset * 5 + 1);
else if (!(keyb & 0x02)) val = readinputport(offset * 5 + 2); else if (!(keyb & 0x02)) val = input_port_read_indexed(machine, offset * 5 + 2);
else if (!(keyb & 0x04)) val = readinputport(offset * 5 + 3); else if (!(keyb & 0x04)) val = input_port_read_indexed(machine, offset * 5 + 3);
else if (!(keyb & 0x08)) val = readinputport(offset * 5 + 4); else if (!(keyb & 0x08)) val = input_port_read_indexed(machine, offset * 5 + 4);
else if (!(keyb & 0x10)) val = readinputport(offset * 5 + 5); else if (!(keyb & 0x10)) val = input_port_read_indexed(machine, offset * 5 + 5);
val |= readinputport(16 + offset); val |= input_port_read_indexed(machine, 16 + offset);
return val; return val;
} }
static READ8_HANDLER( hanakanz_dsw_r ) static READ8_HANDLER( hanakanz_dsw_r )
{ {
if (!(dsw & 0x01)) return readinputport(11); if (!(dsw & 0x01)) return input_port_read_indexed(machine, 11);
if (!(dsw & 0x02)) return readinputport(12); if (!(dsw & 0x02)) return input_port_read_indexed(machine, 12);
if (!(dsw & 0x04)) return readinputport(13); if (!(dsw & 0x04)) return input_port_read_indexed(machine, 13);
if (!(dsw & 0x08)) return readinputport(14); if (!(dsw & 0x08)) return input_port_read_indexed(machine, 14);
if (!(dsw & 0x10)) return readinputport(15); if (!(dsw & 0x10)) return input_port_read_indexed(machine, 15);
return 0xff; return 0xff;
} }
@ -2471,13 +2471,13 @@ static READ8_HANDLER( mjchuuka_keyb_r )
{ {
UINT8 val = 0xff; UINT8 val = 0xff;
if (!(keyb & 0x01)) val = readinputport(offset * 5 + 1); if (!(keyb & 0x01)) val = input_port_read_indexed(machine, offset * 5 + 1);
else if (!(keyb & 0x02)) val = readinputport(offset * 5 + 2); else if (!(keyb & 0x02)) val = input_port_read_indexed(machine, offset * 5 + 2);
else if (!(keyb & 0x04)) val = readinputport(offset * 5 + 3); else if (!(keyb & 0x04)) val = input_port_read_indexed(machine, offset * 5 + 3);
else if (!(keyb & 0x08)) val = readinputport(offset * 5 + 4); else if (!(keyb & 0x08)) val = input_port_read_indexed(machine, offset * 5 + 4);
else if (!(keyb & 0x10)) val = readinputport(offset * 5 + 5); else if (!(keyb & 0x10)) val = input_port_read_indexed(machine, offset * 5 + 5);
val |= readinputport(16 + offset); val |= input_port_read_indexed(machine, 16 + offset);
if (offset) val |= 0x80; // blitter busy if (offset) val |= 0x80; // blitter busy
return val; return val;
} }
@ -2633,7 +2633,7 @@ static READ8_HANDLER( mjmyster_coins_r )
{ {
switch( ddenlovr_select2 ) switch( ddenlovr_select2 )
{ {
case 0x00: return readinputport(0); case 0x00: return input_port_read_indexed(machine, 0);
case 0x01: return 0xff; case 0x01: return 0xff;
case 0x02: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch case 0x02: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch
case 0x03: return 0xff; case 0x03: return 0xff;
@ -2648,11 +2648,11 @@ static READ8_HANDLER( mjmyster_keyb_r )
{ {
UINT8 ret = 0xff; UINT8 ret = 0xff;
if (keyb & 0x01) ret = readinputport(1); if (keyb & 0x01) ret = input_port_read_indexed(machine, 1);
else if (keyb & 0x02) ret = readinputport(2); else if (keyb & 0x02) ret = input_port_read_indexed(machine, 2);
else if (keyb & 0x04) ret = readinputport(3); else if (keyb & 0x04) ret = input_port_read_indexed(machine, 3);
else if (keyb & 0x08) ret = readinputport(4); else if (keyb & 0x08) ret = input_port_read_indexed(machine, 4);
else if (keyb & 0x10) ret = readinputport(5); else if (keyb & 0x10) ret = input_port_read_indexed(machine, 5);
else logerror("%06x: warning, unknown bits read, keyb = %02x\n", activecpu_get_pc(), keyb); else logerror("%06x: warning, unknown bits read, keyb = %02x\n", activecpu_get_pc(), keyb);
keyb <<= 1; keyb <<= 1;
@ -2662,11 +2662,11 @@ static READ8_HANDLER( mjmyster_keyb_r )
static READ8_HANDLER( mjmyster_dsw_r ) static READ8_HANDLER( mjmyster_dsw_r )
{ {
if (!(ddenlovr_select & 0x01)) return readinputport(9); if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 9);
if (!(ddenlovr_select & 0x02)) return readinputport(8); if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 8);
if (!(ddenlovr_select & 0x04)) return readinputport(7); if (!(ddenlovr_select & 0x04)) return input_port_read_indexed(machine, 7);
if (!(ddenlovr_select & 0x08)) return readinputport(6); if (!(ddenlovr_select & 0x08)) return input_port_read_indexed(machine, 6);
if (!(ddenlovr_select & 0x10)) return readinputport(10); if (!(ddenlovr_select & 0x10)) return input_port_read_indexed(machine, 10);
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select); logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select);
return 0xff; return 0xff;
} }
@ -2765,11 +2765,11 @@ ADDRESS_MAP_END
static READ8_HANDLER( hginga_dsw_r ) static READ8_HANDLER( hginga_dsw_r )
{ {
if (!(ddenlovr_select & 0x01)) return readinputport(11); if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 11);
if (!(ddenlovr_select & 0x02)) return readinputport(12); if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 12);
if (!(ddenlovr_select & 0x04)) return readinputport(13); if (!(ddenlovr_select & 0x04)) return input_port_read_indexed(machine, 13);
if (!(ddenlovr_select & 0x08)) return readinputport(14); if (!(ddenlovr_select & 0x08)) return input_port_read_indexed(machine, 14);
if (!(ddenlovr_select & 0x10)) return readinputport(15); if (!(ddenlovr_select & 0x10)) return input_port_read_indexed(machine, 15);
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select); logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select);
return 0xff; return 0xff;
} }
@ -2786,8 +2786,8 @@ static READ8_HANDLER( hginga_coins_r )
{ {
switch( hginga_select ) switch( hginga_select )
{ {
case 0x20: return readinputport(0); case 0x20: return input_port_read_indexed(machine, 0);
case 0x21: return readinputport(16); case 0x21: return input_port_read_indexed(machine, 16);
case 0x22: return 0x7f; // bit 7 = blitter busy, bit 6 = hopper case 0x22: return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
case 0x23: return hginga_coins; case 0x23: return hginga_coins;
} }
@ -2832,11 +2832,11 @@ static READ8_HANDLER( hginga_input_r )
// player 1 // player 1
case 0xa1: case 0xa1:
return readinputport(1 + hginga_ip++); return input_port_read_indexed(machine, 1 + hginga_ip++);
// player 2 // player 2
case 0xa2: case 0xa2:
return readinputport(1 + 5 + hginga_ip++); return input_port_read_indexed(machine, 1 + 5 + hginga_ip++);
} }
logerror("%04x: input_r with select = %02x\n",activecpu_get_pc(),hginga_select); logerror("%04x: input_r with select = %02x\n",activecpu_get_pc(),hginga_select);
return 0xff; return 0xff;
@ -2914,11 +2914,11 @@ static UINT8 hgokou_player_r(running_machine *machine, int player)
{ {
UINT8 hopper_bit = ((hgokou_hopper && !(video_screen_get_frame_number(machine->primary_screen)%10)) ? 0 : (1<<6)); UINT8 hopper_bit = ((hgokou_hopper && !(video_screen_get_frame_number(machine->primary_screen)%10)) ? 0 : (1<<6));
if (!(ddenlovr_select2 & 0x01)) return readinputport(player * 5 + 1) | hopper_bit; if (!(ddenlovr_select2 & 0x01)) return input_port_read_indexed(machine, player * 5 + 1) | hopper_bit;
if (!(ddenlovr_select2 & 0x02)) return readinputport(player * 5 + 2) | hopper_bit; if (!(ddenlovr_select2 & 0x02)) return input_port_read_indexed(machine, player * 5 + 2) | hopper_bit;
if (!(ddenlovr_select2 & 0x04)) return readinputport(player * 5 + 3) | hopper_bit; if (!(ddenlovr_select2 & 0x04)) return input_port_read_indexed(machine, player * 5 + 3) | hopper_bit;
if (!(ddenlovr_select2 & 0x08)) return readinputport(player * 5 + 4) | hopper_bit; if (!(ddenlovr_select2 & 0x08)) return input_port_read_indexed(machine, player * 5 + 4) | hopper_bit;
if (!(ddenlovr_select2 & 0x10)) return readinputport(player * 5 + 5) | hopper_bit; if (!(ddenlovr_select2 & 0x10)) return input_port_read_indexed(machine, player * 5 + 5) | hopper_bit;
return 0x7f; // bit 7 = blitter busy, bit 6 = hopper return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
} }
@ -2927,7 +2927,7 @@ static READ8_HANDLER( hgokou_input_r )
{ {
switch (hginga_select) switch (hginga_select)
{ {
case 0x20: return readinputport(0); case 0x20: return input_port_read_indexed(machine, 0);
case 0x21: return hgokou_player_r(machine, 1); case 0x21: return hgokou_player_r(machine, 1);
case 0x22: return hgokou_player_r(machine, 0); case 0x22: return hgokou_player_r(machine, 0);
case 0x23: return hginga_coins; case 0x23: return hginga_coins;
@ -3037,12 +3037,12 @@ static READ8_HANDLER( hparadis_input_r )
{ {
switch (hginga_select) switch (hginga_select)
{ {
case 0x00: return readinputport(0); // P1 (Joy) case 0x00: return input_port_read_indexed(machine, 0); // P1 (Joy)
case 0x01: return readinputport(1); // P2 (Joy) case 0x01: return input_port_read_indexed(machine, 1); // P2 (Joy)
case 0x02: return readinputport(2); // Coins case 0x02: return input_port_read_indexed(machine, 2); // Coins
case 0x0d: return 0x00; case 0x0d: return 0x00;
case 0x80: return readinputport(3 + hginga_ip++); // P1 (Keys) case 0x80: return input_port_read_indexed(machine, 3 + hginga_ip++); // P1 (Keys)
case 0x81: return readinputport(8 + hginga_ip++); // P2 (Keys) case 0x81: return input_port_read_indexed(machine, 8 + hginga_ip++); // P2 (Keys)
} }
logerror("%06x: warning, unknown bits read, hginga_select = %02x\n", activecpu_get_pc(), hginga_select); logerror("%06x: warning, unknown bits read, hginga_select = %02x\n", activecpu_get_pc(), hginga_select);
return 0xff; return 0xff;
@ -3050,11 +3050,11 @@ static READ8_HANDLER( hparadis_input_r )
static READ8_HANDLER( hparadis_dsw_r ) static READ8_HANDLER( hparadis_dsw_r )
{ {
if (!(ddenlovr_select & 0x01)) return readinputport(13); if (!(ddenlovr_select & 0x01)) return input_port_read_indexed(machine, 13);
if (!(ddenlovr_select & 0x02)) return readinputport(14); if (!(ddenlovr_select & 0x02)) return input_port_read_indexed(machine, 14);
if (!(ddenlovr_select & 0x04)) return 0xff; if (!(ddenlovr_select & 0x04)) return 0xff;
if (!(ddenlovr_select & 0x08)) return 0xff; if (!(ddenlovr_select & 0x08)) return 0xff;
if (!(ddenlovr_select & 0x10)) return readinputport(15); if (!(ddenlovr_select & 0x10)) return input_port_read_indexed(machine, 15);
return 0xff; return 0xff;
} }
@ -3118,7 +3118,7 @@ static READ8_HANDLER( mjmywrld_coins_r )
{ {
switch( ddenlovr_select2 ) switch( ddenlovr_select2 )
{ {
case 0x80: return readinputport(0); case 0x80: return input_port_read_indexed(machine, 0);
case 0x81: return 0x00; case 0x81: return 0x00;
case 0x82: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch case 0x82: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch
case 0x83: return 0x00; case 0x83: return 0x00;
@ -3194,8 +3194,8 @@ static UINT16 *akamaru_dsw_sel;
static READ16_HANDLER( akamaru_dsw_r ) static READ16_HANDLER( akamaru_dsw_r )
{ {
UINT16 dsw = 0; UINT16 dsw = 0;
if (akamaru_dsw_sel[1] == 0xff) dsw |= readinputport(3); if (akamaru_dsw_sel[1] == 0xff) dsw |= input_port_read_indexed(machine, 3);
if (akamaru_dsw_sel[0] == 0xff) dsw |= readinputport(4); if (akamaru_dsw_sel[0] == 0xff) dsw |= input_port_read_indexed(machine, 4);
return dsw; return dsw;
} }
@ -3280,11 +3280,11 @@ static READ8_HANDLER( mjflove_keyb_r )
{ {
UINT8 val = 0xff; UINT8 val = 0xff;
if (!(keyb & 0x01)) val = readinputport(offset * 5 + 1); if (!(keyb & 0x01)) val = input_port_read_indexed(machine, offset * 5 + 1);
else if (!(keyb & 0x02)) val = readinputport(offset * 5 + 2); else if (!(keyb & 0x02)) val = input_port_read_indexed(machine, offset * 5 + 2);
else if (!(keyb & 0x04)) val = readinputport(offset * 5 + 3); else if (!(keyb & 0x04)) val = input_port_read_indexed(machine, offset * 5 + 3);
else if (!(keyb & 0x08)) val = readinputport(offset * 5 + 4); else if (!(keyb & 0x08)) val = input_port_read_indexed(machine, offset * 5 + 4);
else if (!(keyb & 0x10)) val = readinputport(offset * 5 + 5); else if (!(keyb & 0x10)) val = input_port_read_indexed(machine, offset * 5 + 5);
return val; return val;
} }
@ -3296,7 +3296,7 @@ static READ8_HANDLER( mjflove_blitter_r )
// bit 7 = 1 -> blitter busy // bit 7 = 1 -> blitter busy
// bit 6 = 0 -> VBLANK? // bit 6 = 0 -> VBLANK?
// bit 5 = 0 -> RTC? // bit 5 = 0 -> RTC?
return readinputport(0) | mjflove_irq_cause; return input_port_read_indexed(machine, 0) | mjflove_irq_cause;
} }
static WRITE8_HANDLER( mjflove_blitter_w ) static WRITE8_HANDLER( mjflove_blitter_w )

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