diff options
| author | 2009-09-06 22:28:58 +0000 | |
|---|---|---|
| committer | 2009-09-06 22:28:58 +0000 | |
| commit | 191fe9cdc3319261c90ae1991615558ae455d2f4 (patch) | |
| tree | ddcdca10ff9738fa3073591ef3ecf6bcccb53d3f | |
| parent | c15d83d0da8077190f86d7a966c57a101278b1e5 (diff) | |
> From: Atari Ace [mailto:atari_ace@verizon.net]
> Sent: Sunday, September 06, 2009 7:25 AM
> To: submit@mamedev.org
> Cc: atariace@hotmail.com
> Subject: [patch] Deglobalize input.c
>
> Hi mamedev,
>
> These patches deglobalize input.c. The first adds running_machine to
> some driver apis. The (large) second patch adds the machine parameter
> to the most input_code_pressed apis (generated by script, not
> compilable). The last patch then actually changes those apis and
> others to take running_machine, and adds struct _input_private to hold
> the input state variables.
>
> ~aa
131 files changed, 1003 insertions, 999 deletions
diff --git a/src/emu/cpu/tms34010/34010gfx.c b/src/emu/cpu/tms34010/34010gfx.c index 0e467230d87..66c5d0606d8 100644 --- a/src/emu/cpu/tms34010/34010gfx.c +++ b/src/emu/cpu/tms34010/34010gfx.c @@ -11,7 +11,7 @@ #define LOG_GFX_OPS 0 -#define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(KEYCODE_L)) logerror x; } while (0) +#define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(tms->device->machine, KEYCODE_L)) logerror x; } while (0) /* Graphics Instructions */ diff --git a/src/emu/inptport.c b/src/emu/inptport.c index c2c16e95db9..36902c7938b 100644 --- a/src/emu/inptport.c +++ b/src/emu/inptport.c @@ -449,7 +449,7 @@ static analog_field_state *init_field_analog_state(const input_field_config *fie static void frame_update_callback(running_machine *machine); static void frame_update(running_machine *machine); static void frame_update_digital_joysticks(running_machine *machine); -static void frame_update_analog_field(analog_field_state *analog); +static void frame_update_analog_field(running_machine *machine, analog_field_state *analog); static int frame_get_digital_field_state(const input_field_config *field, int mouse_down); /* port configuration helpers */ @@ -478,7 +478,7 @@ static int load_game_config(running_machine *machine, xml_data_node *portnode, i /* settings save */ static void save_config_callback(running_machine *machine, int config_type, xml_data_node *parentnode); -static void save_sequence(xml_data_node *parentnode, int type, int porttype, const input_seq *seq); +static void save_sequence(running_machine *machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq); static int save_this_input_field_type(int type); static void save_default_inputs(running_machine *machine, xml_data_node *parentnode); static void save_game_inputs(running_machine *machine, xml_data_node *parentnode); @@ -1174,7 +1174,7 @@ void input_type_set_seq(running_machine *machine, int type, int player, input_se int input_type_pressed(running_machine *machine, int type, int player) { - return input_seq_pressed(input_type_seq(machine, type, player, SEQ_TYPE_STANDARD)); + return input_seq_pressed(machine, input_type_seq(machine, type, player, SEQ_TYPE_STANDARD)); } @@ -1646,7 +1646,7 @@ static void init_port_state(running_machine *machine) for (field = port->fieldlist; field != NULL; field = field->next) if (field->state->joystick != NULL && field->way == 4) { - input_device_set_joystick_map(-1, (field->flags & FIELD_FLAG_ROTATED) ? joystick_map_4way_diagonal : joystick_map_4way_sticky); + input_device_set_joystick_map(machine, -1, (field->flags & FIELD_FLAG_ROTATED) ? joystick_map_4way_diagonal : joystick_map_4way_sticky); break; } } @@ -1695,7 +1695,7 @@ static void init_autoselect_devices(const input_port_config *portlist, int type1 mame_printf_error("Invalid %s value %s; reverting to keyboard\n", option, stemp); /* only scan the list if we haven't already enabled this class of control */ - if (!input_device_class_enabled(autoenable)) + if (!input_device_class_enabled(portlist->machine, autoenable)) for (port = portlist; port != NULL; port = port->next) for (field = port->fieldlist; field != NULL; field = field->next) @@ -1705,7 +1705,7 @@ static void init_autoselect_devices(const input_port_config *portlist, int type1 (type3 != 0 && field->type == type3)) { mame_printf_verbose("Input: Autoenabling %s due to presence of a %s\n", autostring, ananame); - input_device_class_enable(autoenable, TRUE); + input_device_class_enable(portlist->machine, autoenable, TRUE); break; } } @@ -1988,7 +1988,7 @@ profiler_mark_start(PROFILER_INPUT); /* handle analog inputs */ else if (field->state->analog != NULL) - frame_update_analog_field(field->state->analog); + frame_update_analog_field(machine, field->state->analog); /* handle non-analog types, but only when the UI isn't visible */ else if (!ui_visible && frame_get_digital_field_state(field, field == mouse_field)) @@ -2050,13 +2050,13 @@ static void frame_update_digital_joysticks(running_machine *machine) joystick->current = 0; /* read all the associated ports */ - if (joystick->field[JOYDIR_UP] != NULL && input_seq_pressed(input_field_seq(joystick->field[JOYDIR_UP], SEQ_TYPE_STANDARD))) + if (joystick->field[JOYDIR_UP] != NULL && input_seq_pressed(machine, input_field_seq(joystick->field[JOYDIR_UP], SEQ_TYPE_STANDARD))) joystick->current |= JOYDIR_UP_BIT; - if (joystick->field[JOYDIR_DOWN] != NULL && input_seq_pressed(input_field_seq(joystick->field[JOYDIR_DOWN], SEQ_TYPE_STANDARD))) + if (joystick->field[JOYDIR_DOWN] != NULL && input_seq_pressed(machine, input_field_seq(joystick->field[JOYDIR_DOWN], SEQ_TYPE_STANDARD))) joystick->current |= JOYDIR_DOWN_BIT; - if (joystick->field[JOYDIR_LEFT] != NULL && input_seq_pressed(input_field_seq(joystick->field[JOYDIR_LEFT], SEQ_TYPE_STANDARD))) + if (joystick->field[JOYDIR_LEFT] != NULL && input_seq_pressed(machine, input_field_seq(joystick->field[JOYDIR_LEFT], SEQ_TYPE_STANDARD))) joystick->current |= JOYDIR_LEFT_BIT; - if (joystick->field[JOYDIR_RIGHT] != NULL && input_seq_pressed(input_field_seq(joystick->field[JOYDIR_RIGHT], SEQ_TYPE_STANDARD))) + if (joystick->field[JOYDIR_RIGHT] != NULL && input_seq_pressed(machine, input_field_seq(joystick->field[JOYDIR_RIGHT], SEQ_TYPE_STANDARD))) joystick->current |= JOYDIR_RIGHT_BIT; /* lock out opposing directions (left + right or up + down) */ @@ -2117,7 +2117,7 @@ static void frame_update_digital_joysticks(running_machine *machine) internals of a single analog field -------------------------------------------------*/ -static void frame_update_analog_field(analog_field_state *analog) +static void frame_update_analog_field(running_machine *machine, analog_field_state *analog) { input_item_class itemclass; int keypressed = FALSE; @@ -2129,7 +2129,7 @@ static void frame_update_analog_field(analog_field_state *analog) analog->previous = analog->accum = apply_analog_min_max(analog, analog->accum); /* get the new raw analog value and its type */ - rawvalue = input_seq_axis_value(input_field_seq(analog->field, SEQ_TYPE_STANDARD), &itemclass); + rawvalue = input_seq_axis_value(machine, input_field_seq(analog->field, SEQ_TYPE_STANDARD), &itemclass); /* if we got an absolute input, it overrides everything else */ if (itemclass == ITEM_CLASS_ABSOLUTE) @@ -2187,7 +2187,7 @@ static void frame_update_analog_field(analog_field_state *analog) /* if the decrement code sequence is pressed, add the key delta to */ /* the accumulated delta; also note that the last input was a digital one */ - if (input_seq_pressed(input_field_seq(analog->field, SEQ_TYPE_DECREMENT))) + if (input_seq_pressed(machine, input_field_seq(analog->field, SEQ_TYPE_DECREMENT))) { keypressed = TRUE; if (analog->delta != 0) @@ -2199,7 +2199,7 @@ static void frame_update_analog_field(analog_field_state *analog) } /* same for the increment code sequence */ - if (input_seq_pressed(input_field_seq(analog->field, SEQ_TYPE_INCREMENT))) + if (input_seq_pressed(machine, input_field_seq(analog->field, SEQ_TYPE_INCREMENT))) { keypressed = TRUE; if (analog->delta) @@ -2263,7 +2263,7 @@ static void frame_update_analog_field(analog_field_state *analog) static int frame_get_digital_field_state(const input_field_config *field, int mouse_down) { - int curstate = mouse_down || input_seq_pressed(input_field_seq(field, SEQ_TYPE_STANDARD)); + int curstate = mouse_down || input_seq_pressed(field->port->machine, input_field_seq(field, SEQ_TYPE_STANDARD)); int changed = FALSE; /* if the state changed, look for switch down/switch up */ @@ -3403,7 +3403,7 @@ static void load_config_callback(running_machine *machine, int config_type, xml_ { if (strcmp(seqnode->value, "NONE") == 0) input_seq_set_0(&newseq[seqtype]); - else if (input_seq_from_tokens(seqnode->value, &tempseq) != 0) + else if (input_seq_from_tokens(machine, seqnode->value, &tempseq) != 0) newseq[seqtype] = tempseq; } } @@ -3459,8 +3459,8 @@ static void load_remap_table(running_machine *machine, xml_data_node *parentnode count = 0; for (remapnode = xml_get_sibling(parentnode->child, "remap"); remapnode != NULL; remapnode = xml_get_sibling(remapnode->next, "remap")) { - input_code origcode = input_code_from_token(xml_get_attribute_string(remapnode, "origcode", "")); - input_code newcode = input_code_from_token(xml_get_attribute_string(remapnode, "newcode", "")); + input_code origcode = input_code_from_token(machine, xml_get_attribute_string(remapnode, "origcode", "")); + input_code newcode = input_code_from_token(machine, xml_get_attribute_string(remapnode, "newcode", "")); if (origcode != INPUT_CODE_INVALID && newcode != INPUT_CODE_INVALID) { oldtable[count] = origcode; @@ -3609,7 +3609,7 @@ static void save_config_callback(running_machine *machine, int config_type, xml_ sequence -------------------------------------------------*/ -static void save_sequence(xml_data_node *parentnode, int type, int porttype, const input_seq *seq) +static void save_sequence(running_machine *machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq) { astring *seqstring = astring_alloc(); xml_data_node *seqnode; @@ -3618,7 +3618,7 @@ static void save_sequence(xml_data_node *parentnode, int type, int porttype, con if (input_seq_get_1(seq) == SEQCODE_END) astring_cpyc(seqstring, "NONE"); else - input_seq_to_tokens(seqstring, seq); + input_seq_to_tokens(machine, seqstring, seq); /* add the new node */ seqnode = xml_add_child(parentnode, "newseq", astring_c(seqstring)); @@ -3684,7 +3684,7 @@ static void save_default_inputs(running_machine *machine, xml_data_node *parentn /* add only the sequences that have changed from the defaults */ for (seqtype = 0; seqtype < ARRAY_LENGTH(typestate->seq); seqtype++) if (input_seq_cmp(&typestate->seq[seqtype], &typestate->typedesc.seq[seqtype]) != 0) - save_sequence(portnode, seqtype, typestate->typedesc.type, &typestate->seq[seqtype]); + save_sequence(machine, portnode, seqtype, typestate->typedesc.type, &typestate->seq[seqtype]); } } } @@ -3745,7 +3745,7 @@ static void save_game_inputs(running_machine *machine, xml_data_node *parentnode /* add sequences if changed */ for (seqtype = 0; seqtype < ARRAY_LENGTH(field->state->seq); seqtype++) if (input_seq_cmp(&field->state->seq[seqtype], &field->seq[seqtype]) != 0) - save_sequence(portnode, seqtype, field->type, &field->state->seq[seqtype]); + save_sequence(machine, portnode, seqtype, field->type, &field->state->seq[seqtype]); /* write out non-analog changes */ if (field->state->analog == NULL) diff --git a/src/emu/input.c b/src/emu/input.c index 8e329d56d98..9b770839621 100644 --- a/src/emu/input.c +++ b/src/emu/input.c @@ -115,6 +115,20 @@ struct _code_string_table }; +struct _input_private +{ + /* array of devices for each class */ + input_device_list device_list[DEVICE_CLASS_MAXIMUM]; + input_code code_pressed_memory[MAX_PRESSED_SWITCHES]; + + /* device configuration */ + UINT8 steadykey_enabled; + UINT8 lightgun_reload_button; + const char * joystick_map_default; + INT32 joystick_deadzone; + INT32 joystick_saturation; +}; + /*************************************************************************** TOKEN/STRING TABLES @@ -392,17 +406,6 @@ static const code_string_table itemid_token_table[] = GLOBAL VARIABLES ***************************************************************************/ -/* array of devices for each class */ -static input_device_list device_list[DEVICE_CLASS_MAXIMUM]; -static input_code code_pressed_memory[MAX_PRESSED_SWITCHES]; - -/* device configuration */ -static UINT8 steadykey_enabled; -static UINT8 lightgun_reload_button; -static const char * joystick_map_default; -static INT32 joystick_deadzone; -static INT32 joystick_saturation; - /* standard joystick mappings */ const char joystick_map_8way[] = "7778...4445"; const char joystick_map_4way_sticky[] = "s8.4s8.44s8.4445"; @@ -415,15 +418,15 @@ const char joystick_map_4way_diagonal[] = "4444s8888..444458888.444555888.ss5. ***************************************************************************/ static void input_frame(running_machine *machine); -static input_device_item *input_code_item(input_code code); -static INT32 convert_absolute_value(input_code code, input_device_item *item); +static input_device_item *input_code_item(running_machine *machine, input_code code); +static INT32 convert_absolute_value(running_machine *machine, input_code code, input_device_item *item); static INT32 convert_relative_value(input_code code, input_device_item *item); -static INT32 convert_switch_value(input_code code, input_device_item *item); -static INT32 apply_deadzone_and_saturation(input_code code, INT32 result); +static INT32 convert_switch_value(running_machine *machine, input_code code, input_device_item *item); +static INT32 apply_deadzone_and_saturation(running_machine *machine, input_code code, INT32 result); static int joystick_map_parse(const char *mapstring, joystick_map *map); static void joystick_map_print(const char *header, const char *origstring, const joystick_map *map); -static void input_code_reset_axes(void); -static int input_code_check_axis(input_device_item *item, input_code code); +static void input_code_reset_axes(running_machine *machine); +static int input_code_check_axis(running_machine *machine, input_device_item *item, input_code code); @@ -436,12 +439,14 @@ static int input_code_check_axis(input_device_item *item, input_code code); a pointer to the associated device -------------------------------------------------*/ -INLINE input_device *input_code_device(input_code code) +INLINE input_device *input_code_device(running_machine *machine, input_code code) { /* if the class is valid... */ input_device_class devclass = INPUT_CODE_DEVCLASS(code); if (devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM) { + input_device_list *device_list = machine->input_data->device_list; + /* ...and the index is valid for that class, return a pointer to the device */ int devindex = INPUT_CODE_DEVINDEX(code); if (devindex < device_list[devclass].count) @@ -462,7 +467,7 @@ INLINE input_code device_item_to_code(input_device *device, input_item_id itemid { int devindex = device->devindex; - assert(devindex < device_list[device->devclass].count); + assert(devindex < device->machine->input_data->device_list[device->devclass].count); assert(itemid < ITEM_ID_ABSOLUTE_MAXIMUM); assert(device->item[itemid] != NULL); @@ -496,8 +501,10 @@ INLINE input_item_class input_item_standard_class(input_device_class devclass, i of an input item -------------------------------------------------*/ -INLINE void input_item_update_value(input_device_item *item) +INLINE void input_item_update_value(running_machine *machine, input_device_item *item) { + input_device_list *device_list = machine->input_data->device_list; + item->current = (*item->getstate)(device_list[item->devclass].list[item->devindex].internal, item->internal); } @@ -507,9 +514,11 @@ INLINE void input_item_update_value(input_device_item *item) of memory for pressed switches -------------------------------------------------*/ -INLINE void code_pressed_memory_reset(void) +INLINE void code_pressed_memory_reset(running_machine *machine) { + input_code *code_pressed_memory = machine->input_data->code_pressed_memory; int memnum; + for (memnum = 0; memnum < MAX_PRESSED_SWITCHES; memnum++) code_pressed_memory[memnum] = INPUT_CODE_INVALID; } @@ -561,12 +570,18 @@ INLINE const char *code_to_string(const code_string_table *table, UINT32 code) void input_init(running_machine *machine) { joystick_map map; + input_private *state; + input_device_list *device_list; + + /* allocate private memory */ + machine->input_data = state = auto_alloc_clear(machine, input_private); + device_list = state->device_list; /* reset the device lists */ memset(device_list, 0, sizeof(device_list)); /* reset code memory */ - code_pressed_memory_reset(); + code_pressed_memory_reset(machine); /* request a per-frame callback for bookkeeping */ add_frame_callback(machine, input_frame); @@ -584,19 +599,19 @@ void input_init(running_machine *machine) device_list[DEVICE_CLASS_JOYSTICK].multi = TRUE; /* read other input options */ - steadykey_enabled = options_get_bool(mame_options(), OPTION_STEADYKEY); - lightgun_reload_button = options_get_bool(mame_options(), OPTION_OFFSCREEN_RELOAD); - joystick_deadzone = (INT32)(options_get_float(mame_options(), OPTION_JOYSTICK_DEADZONE) * INPUT_ABSOLUTE_MAX); - joystick_saturation = (INT32)(options_get_float(mame_options(), OPTION_JOYSTICK_SATURATION) * INPUT_ABSOLUTE_MAX); + state->steadykey_enabled = options_get_bool(mame_options(), OPTION_STEADYKEY); + state->lightgun_reload_button = options_get_bool(mame_options(), OPTION_OFFSCREEN_RELOAD); + state->joystick_deadzone = (INT32)(options_get_float(mame_options(), OPTION_JOYSTICK_DEADZONE) * INPUT_ABSOLUTE_MAX); + state->joystick_saturation = (INT32)(options_get_float(mame_options(), OPTION_JOYSTICK_SATURATION) * INPUT_ABSOLUTE_MAX); /* get the default joystick map */ - joystick_map_default = options_get_string(mame_options(), OPTION_JOYSTICK_MAP); - if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0) - joystick_map_default = joystick_map_8way; - if (!joystick_map_parse(joystick_map_default, &map)) - mame_printf_error("Invalid joystick map: %s\n", joystick_map_default); - else if (joystick_map_default != joystick_map_8way) - joystick_map_print("Input: Default joystick map", joystick_map_default, &map); + state->joystick_map_default = options_get_string(mame_options(), OPTION_JOYSTICK_MAP); + if (state->joystick_map_default[0] == 0 || strcmp(state->joystick_map_default, "auto") == 0) + state->joystick_map_default = joystick_map_8way; + if (!joystick_map_parse(state->joystick_map_default, &map)) + mame_printf_error("Invalid joystick map: %s\n", state->joystick_map_default); + else if (state->joystick_map_default != joystick_map_8way) + joystick_map_print("Input: Default joystick map", state->joystick_map_default, &map); } @@ -605,8 +620,10 @@ void input_init(running_machine *machine) a device class -------------------------------------------------*/ -void input_device_class_enable(input_device_class devclass, UINT8 enable) +void input_device_class_enable(running_machine *machine, input_device_class devclass, UINT8 enable) { + input_device_list *device_list = machine->input_data->device_list; + assert(devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM); device_list[devclass].enabled = enable; } @@ -617,8 +634,10 @@ void input_device_class_enable(input_device_class devclass, UINT8 enable) enabled? -------------------------------------------------*/ -UINT8 input_device_class_enabled(input_device_class devclass) +UINT8 input_device_class_enabled(running_machine *machine, input_device_class devclass) { + input_device_list *device_list = machine->input_data->device_list; + assert(devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM); return device_list[devclass].enabled; } @@ -629,8 +648,9 @@ UINT8 input_device_class_enabled(input_device_class devclass) joystick map for a device -------------------------------------------------*/ -int input_device_set_joystick_map(int devindex, const char *mapstring) +int input_device_set_joystick_map(running_machine *machine, int devindex, const char *mapstring) { + input_device_list *device_list = machine->input_data->device_list; int startindex = devindex; int stopindex = devindex; joystick_map map; @@ -666,9 +686,12 @@ int input_device_set_joystick_map(int devindex, const char *mapstring) static void input_frame(running_machine *machine) { + input_private *state = machine->input_data; + /* if steadykey is enabled, do processing here */ - if (steadykey_enabled) + if (state->steadykey_enabled) { + input_device_list *device_list = state->device_list; int devnum; /* iterate over keyboards */ @@ -684,7 +707,7 @@ static void input_frame(running_machine *machine) input_device_item *item = device->item[itemid]; if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH) { - input_item_update_value(item); + input_item_update_value(machine, item); if ((item->current ^ item->oldkey) & 1) { changed = TRUE; @@ -723,7 +746,8 @@ static void input_frame(running_machine *machine) input_device *input_device_add(running_machine *machine, input_device_class devclass, const char *name, void *internal) { - input_device_list *devlist = &device_list[devclass]; + input_private *state = machine->input_data; + input_device_list *devlist = &state->device_list[devclass]; input_device *device; assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call input_device_add at init time!"); @@ -745,7 +769,7 @@ input_device *input_device_add(running_machine *machine, input_device_class devc /* default to 8-way map for joysticks */ if (devclass == DEVICE_CLASS_JOYSTICK) { - joystick_map_parse(joystick_map_default, &device->joymap); + joystick_map_parse(state->joystick_map_default, &device->joymap); device->lastmap = JOYSTICK_MAP_NEUTRAL; } @@ -821,8 +845,9 @@ void input_device_item_add(input_device *device, const char *name, void *interna given input code -------------------------------------------------*/ -INT32 input_code_value(input_code code) +INT32 input_code_value(running_machine *machine, input_code code) { + input_device_list *device_list = machine->input_data->device_list; input_device_class devclass = INPUT_CODE_DEVCLASS(code); int startindex = INPUT_CODE_DEVINDEX(code); int stopindex = startindex; @@ -852,18 +877,18 @@ INT32 input_code_value(input_code code) for (curindex = startindex; curindex <= stopindex; curindex++) { /* lookup the item for the appropriate index */ - input_device_item *item = input_code_item(INPUT_CODE_SET_DEVINDEX(code, curindex)); + input_device_item *item = input_code_item(machine, INPUT_CODE_SET_DEVINDEX(code, curindex)); if (item == NULL) continue; /* update the value of this item */ - input_item_update_value(item); + input_item_update_value(machine, item); /* process items according to their native type */ switch (item->itemclass) { case ITEM_CLASS_ABSOLUTE: - result = convert_absolute_value(code, item); + result = convert_absolute_value(machine, code, item); break; case ITEM_CLASS_RELATIVE: @@ -871,7 +896,7 @@ INT32 input_code_value(input_code code) break; case ITEM_CLASS_SWITCH: - result |= convert_switch_value(code, item); + result |= convert_switch_value(machine, code, item); break; default: @@ -890,9 +915,9 @@ exit: given input code has been pressed -------------------------------------------------*/ -int input_code_pressed(input_code code) +int input_code_pressed(running_machine *machine, input_code code) { - return (input_code_value(code) != 0); + return (input_code_value(machine, code) != 0); } @@ -902,9 +927,10 @@ int input_code_pressed(input_code code) on since the last call -------------------------------------------------*/ -int input_code_pressed_once(input_code code) +int input_code_pressed_once(running_machine *machine, input_code code) { - int curvalue = input_code_pressed(code); + input_code *code_pressed_memory = machine->input_data->code_pressed_memory; + int curvalue = input_code_pressed(machine, code); int memnum, empty = -1; /* look for the code in the memory */ @@ -943,8 +969,9 @@ int input_code_pressed_once(input_code code) an input_item_id to an input_code -------------------------------------------------*/ -input_code input_code_from_input_item_id(input_item_id itemid) +input_code input_code_from_input_item_id(running_machine *machine, input_item_id itemid) { + input_device_list *device_list = machine->input_data->device_list; input_device_class devclass; /* iterate over device classes and devices */ @@ -969,15 +996,16 @@ input_code input_code_from_input_item_id(input_item_id itemid) input_code_poll_switches - poll for any input -------------------------------------------------*/ -input_code input_code_poll_switches(int reset) +input_code input_code_poll_switches(running_machine *machine, int reset) { + input_device_list *device_list = machine->input_data->device_list; input_device_class devclass; /* if resetting memory, do it now */ if (reset) { - code_pressed_memory_reset(); - input_code_reset_axes(); + code_pressed_memory_reset(machine); + input_code_reset_axes(machine); } /* iterate over device classes and devices */ @@ -1003,14 +1031,14 @@ input_code input_code_poll_switches(int reset) /* if the item is natively a switch, poll it */ if (item->itemclass == ITEM_CLASS_SWITCH) { - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) return code; else continue; } /* skip if there is not enough axis movement */ - if (!input_code_check_axis(item, code)) + if (!input_code_check_axis(machine, item, code)) continue; /* otherwise, poll axes digitally */ @@ -1020,10 +1048,10 @@ input_code input_code_poll_switches(int reset) if (devclass == DEVICE_CLASS_JOYSTICK && INPUT_CODE_ITEMID(code) == ITEM_ID_XAXIS) { code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_LEFT); - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) return code; code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_RIGHT); - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) return code; } @@ -1031,10 +1059,10 @@ input_code input_code_poll_switches(int reset) else if (devclass == DEVICE_CLASS_JOYSTICK && INPUT_CODE_ITEMID(code) == ITEM_ID_YAXIS) { code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_UP); - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) return code; code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_DOWN); - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) return code; } @@ -1042,10 +1070,10 @@ input_code input_code_poll_switches(int reset) else { code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_POS); - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) return code; code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_NEG); - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) return code; } } @@ -1063,14 +1091,14 @@ input_code input_code_poll_switches(int reset) any keyboard-specific input -------------------------------------------------*/ -input_code input_code_poll_keyboard_switches(int reset) +input_code input_code_poll_keyboard_switches(running_machine *machine, int reset) { - input_device_list *devlist = &device_list[DEVICE_CLASS_KEYBOARD]; + input_device_list *devlist = &machine->input_data->device_list[DEVICE_CLASS_KEYBOARD]; int devnum; /* if resetting memory, do it now */ if (reset) - code_pressed_memory_reset(); + code_pressed_memory_reset(machine); /* iterate over devices within each class */ for (devnum = 0; devnum < devlist->count; devnum++) @@ -1085,7 +1113,7 @@ input_code input_code_poll_keyboard_switches(int reset) if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH) { input_code code = device_item_to_code(device, itemid); - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) return code; } } @@ -1101,12 +1129,12 @@ input_code input_code_poll_keyboard_switches(int reset) move far enough -------------------------------------------------*/ -static int input_code_check_axis(input_device_item *item, input_code code) +static int input_code_check_axis(running_machine *machine, input_device_item *item, input_code code) { INT32 curval, diff; /* poll the current value */ - curval = input_code_value(code); + curval = input_code_value(machine, code); /* if we've already reported this one, don't bother */ if (item->memory == INVALID_AXIS_VALUE) @@ -1146,8 +1174,9 @@ static int input_code_check_axis(input_device_item *item, input_code code) input_code_reset_axes - reset axes memory -------------------------------------------------*/ -static void input_code_reset_axes(void) +static void input_code_reset_axes(running_machine *machine) { + input_device_list *device_list = machine->input_data->device_list; input_device_class devclass; /* iterate over device classes and devices */ @@ -1175,7 +1204,7 @@ static void input_code_reset_axes(void) continue; /* poll the current value and reset the memory */ - item->memory = input_code_value(code); + item->memory = input_code_value(machine, code); } } } @@ -1187,13 +1216,14 @@ static void input_code_reset_axes(void) input_code_poll_axes - poll for any input -------------------------------------------------*/ -input_code input_code_poll_axes(int reset) +input_code input_code_poll_axes(running_machine *machine, int reset) { + input_device_list *device_list = machine->input_data->device_list; input_device_class devclass; /* if resetting memory, do it now */ if (reset) - input_code_reset_axes(); + input_code_reset_axes(machine); /* iterate over device classes and devices */ for (devclass = DEVICE_CLASS_FIRST_VALID; devclass < DEVICE_CLASS_MAXIMUM; devclass++) @@ -1220,7 +1250,7 @@ input_code input_code_poll_axes(int reset) continue; /* check if there is enough axis movement */ - if (input_code_check_axis(item, code)) + if (input_code_check_axis(machine, item, code)) return code; } } @@ -1242,9 +1272,10 @@ input_code input_code_poll_axes(int reset) a friendly name -------------------------------------------------*/ -astring *input_code_name(astring *string, input_code code) +astring *input_code_name(running_machine *machine, astring *string, input_code code) { - input_device_item *item = input_code_item(code); + input_device_list *device_list = machine->input_data->device_list; + input_device_item *item = input_code_item(machine, code); const char *devclass; const char *devcode; const char *modifier; @@ -1301,9 +1332,9 @@ astring *input_code_name(astring *string, input_code code) a given code -------------------------------------------------*/ -astring *input_code_to_token(astring *string, input_code code) +astring *input_code_to_token(running_machine *machine, astring *string, input_code code) { - input_device_item *item = input_code_item(code); + input_device_item *item = input_code_item(machine, code); const char *devclass; const char *devcode; const char *itemclass; @@ -1353,7 +1384,7 @@ astring *input_code_to_token(astring *string, input_code code) code from a token -------------------------------------------------*/ -input_code input_code_from_token(const char *_token) +input_code input_code_from_token(running_machine *machine, const char *_token) { UINT32 devclass, itemid, devindex, modifier, standard; UINT32 itemclass = ITEM_CLASS_INVALID; @@ -1402,6 +1433,7 @@ input_code input_code_from_token(const char *_token) else { input_device *device; + input_device_list *device_list = machine->input_data->device_list; /* if this is an invalid device, we have nothing to look up */ if (devindex >= device_list[devclass].count) @@ -1473,9 +1505,9 @@ exit: from the code -------------------------------------------------*/ -static input_device_item *input_code_item(input_code code) +static input_device_item *input_code_item(running_machine *machine, input_code code) { - input_device *device = input_code_device(code); + input_device *device = input_code_device(machine, code); input_item_id itemid; /* if no device, we fail */ @@ -1497,8 +1529,10 @@ static input_device_item *input_code_item(input_code code) value into the class specified by code -------------------------------------------------*/ -static INT32 convert_absolute_value(input_code code, input_device_item *item) +static INT32 convert_absolute_value(running_machine *machine, input_code code, input_device_item *item) { + input_private *state = machine->input_data; + /* make sure values are valid */ assert(item->current >= INPUT_ABSOLUTE_MIN && item->current <= INPUT_ABSOLUTE_MAX); @@ -1510,16 +1544,16 @@ static INT32 convert_absolute_value(input_code code, input_device_item *item) else if (INPUT_CODE_ITEMCLASS(code) == ITEM_CLASS_ABSOLUTE) { input_item_modifier modifier = INPUT_CODE_MODIFIER(code); - INT32 result = apply_deadzone_and_saturation(code, item->current); + INT32 result = apply_deadzone_and_saturation(machine, code, item->current); /* if we're doing a lightgun reload hack, override the value */ - if (lightgun_reload_button && item->devclass == DEVICE_CLASS_LIGHTGUN) + if (state->lightgun_reload_button && item->devclass == DEVICE_CLASS_LIGHTGUN) { - input_device_item *button2_item = device_list[item->devclass].list[item->devindex].item[ITEM_ID_BUTTON2]; + input_device_item *button2_item = state->device_list[item->devclass].list[item->devindex].item[ITEM_ID_BUTTON2]; if (button2_item != NULL) { /* if it is pressed, return (min,max) */ - input_item_update_value(button2_item); + input_item_update_value(machine, button2_item); if (button2_item->current) result = (INPUT_CODE_ITEMID(code) == ITEM_ID_XAXIS) ? INPUT_ABSOLUTE_MIN : INPUT_ABSOLUTE_MAX; } @@ -1544,7 +1578,7 @@ static INT32 convert_absolute_value(input_code code, input_device_item *item) /* left/right/up/down: if this is a joystick, fetch the paired X/Y axis values and convert */ if (modifier >= ITEM_MODIFIER_LEFT && modifier <= ITEM_MODIFIER_DOWN && item->devclass == DEVICE_CLASS_JOYSTICK) { - input_device *device = &device_list[item->devclass].list[item->devindex]; + input_device *device = &state->device_list[item->devclass].list[item->devindex]; input_device_item *xaxis_item = device->item[ITEM_ID_XAXIS]; input_device_item *yaxis_item = device->item[ITEM_ID_YAXIS]; if (xaxis_item != NULL && yaxis_item != NULL) @@ -1554,7 +1588,7 @@ static INT32 convert_absolute_value(input_code code, input_device_item *item) /* determine which item we didn't update, and update it */ assert(item == xaxis_item || item == yaxis_item); - input_item_update_value((item == xaxis_item) ? yaxis_item : xaxis_item); + input_item_update_value(machine, (item == xaxis_item) ? yaxis_item : xaxis_item); /* now map the X and Y axes to a 9x9 grid */ xaxisval = ((xaxis_item->current - INPUT_ABSOLUTE_MIN) * 9) / (INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN + 1); @@ -1574,9 +1608,9 @@ static INT32 convert_absolute_value(input_code code, input_device_item *item) /* positive/negative: TRUE if past the deadzone in either direction */ if (modifier == ITEM_MODIFIER_POS || modifier == ITEM_MODIFIER_RIGHT || modifier == ITEM_MODIFIER_DOWN) - return (apply_deadzone_and_saturation(code, item->current) > 0); + return (apply_deadzone_and_saturation(machine, code, item->current) > 0); else if (modifier == ITEM_MODIFIER_NEG || modifier == ITEM_MODIFIER_LEFT || modifier == ITEM_MODIFIER_UP) - return (apply_deadzone_and_saturation(code, item->current) < 0); + return (apply_deadzone_and_saturation(machine, code, item->current) < 0); } return 0; @@ -1619,21 +1653,23 @@ static INT32 convert_relative_value(input_code code, input_device_item *item) value into the class specified by code -------------------------------------------------*/ -static INT32 convert_switch_value(input_code code, input_device_item *item) +static INT32 convert_switch_value(running_machine *machine, input_code code, input_device_item *item) { + input_private *state = machine->input_data; + /* only a switch is supported */ if (INPUT_CODE_ITEMCLASS(code) == ITEM_CLASS_SWITCH) { /* if we're doing a lightgun reload hack, button 1 and 2 operate differently */ - if (lightgun_reload_button && item->devclass == DEVICE_CLASS_LIGHTGUN) + if (state->lightgun_reload_button && item->devclass == DEVICE_CLASS_LIGHTGUN) { /* button 1 is pressed if either button 1 or 2 are active */ if (INPUT_CODE_ITEMID(code) == ITEM_ID_BUTTON1) { - input_device_item *button2_item = device_list[item->devclass].list[item->devindex].item[ITEM_ID_BUTTON2]; + input_device_item *button2_item = state->device_list[item->devclass].list[item->devindex].item[ITEM_ID_BUTTON2]; if (button2_item != NULL) { - input_item_update_value(button2_item); + input_item_update_value(machine, button2_item); return item->current | button2_item->current; } } @@ -1644,7 +1680,7 @@ static INT32 convert_switch_value(input_code code, input_device_item *item) } /* steadykey for keyboards */ - if (steadykey_enabled && item->devclass == DEVICE_CLASS_KEYBOARD) + if (state->steadykey_enabled && item->devclass == DEVICE_CLASS_KEYBOARD) return item->steadykey; /* everything else is just the current value as-is */ @@ -1661,8 +1697,9 @@ static INT32 convert_switch_value(input_code code, input_device_item *item) absolute value -------------------------------------------------*/ -static INT32 apply_deadzone_and_saturation(input_code code, INT32 result) +static INT32 apply_deadzone_and_saturation(running_machine *machine, input_code code, INT32 result) { + input_private *state = machine->input_data; int negative = FALSE; /* ignore if not a joystick */ @@ -1677,16 +1714,16 @@ static INT32 apply_deadzone_and_saturation(input_code code, INT32 result) } /* if in the deadzone, return 0 */ - if (result < joystick_deadzone) + if (result < state->joystick_deadzone) result = 0; /* if saturated, return the max */ - else if (result > joystick_saturation) + else if (result > state->joystick_saturation) result = INPUT_ABSOLUTE_MAX; /* otherwise, scale */ else - result = (INT64)(result - joystick_deadzone) * (INT64)INPUT_ABSOLUTE_MAX / (INT64)(joystick_saturation - joystick_deadzone); + result = (INT64)(result - state->joystick_deadzone) * (INT64)INPUT_ABSOLUTE_MAX / (INT64)(state->joystick_saturation - state->joystick_deadzone); /* apply sign and return */ return negative ? -result : result; diff --git a/src/emu/input.h b/src/emu/input.h index 04d0c2e7452..0ff872032ca 100644 --- a/src/emu/input.h +++ b/src/emu/input.h @@ -584,13 +584,13 @@ extern const char joystick_map_4way_diagonal[]; void input_init(running_machine *machine); /* enable or disable a device class */ -void input_device_class_enable(input_device_class devclass, UINT8 enable); +void input_device_class_enable(running_machine *machine, input_device_class devclass, UINT8 enable); /* is a device class enabled? */ -UINT8 input_device_class_enabled(input_device_class devclass); +UINT8 input_device_class_enabled(running_machine *machine, input_device_class devclass); /* configure default joystick maps */ -int input_device_set_joystick_map(int devindex, const char *mapstring); +int input_device_set_joystick_map(running_machine *machine, int devindex, const char *mapstring); /* ----- OSD configuration and access ----- */ @@ -606,38 +606,38 @@ void input_device_item_add(input_device *device, const char *name, void *interna /* ----- state queries ----- */ /* return the value of a particular input code */ -INT32 input_code_value(input_code code); +INT32 input_code_value(running_machine *machine, input_code code); /* return TRUE if the given input code has been pressed */ -INT32 input_code_pressed(input_code code); +INT32 input_code_pressed(running_machine *machine, input_code code); /* same as above, but returns TRUE only on the first call after an off->on transition */ -INT32 input_code_pressed_once(input_code code); +INT32 input_code_pressed_once(running_machine *machine, input_code code); /* translates an input_item_id to an input_code */ -input_code input_code_from_input_item_id(input_item_id itemid); +input_code input_code_from_input_item_id(running_machine *machine, input_item_id itemid); /* poll for any switch input, optionally resetting internal memory */ -input_code input_code_poll_switches(int reset); +input_code input_code_poll_switches(running_machine *machine, int reset); /* poll for any keyboard switch input, optionally resetting internal memory */ -input_code input_code_poll_keyboard_switches(int reset); +input_code input_code_poll_keyboard_switches(running_machine *machine, int reset); /* poll for any axis input, optionally resetting internal memory */ -input_code input_code_poll_axes(int reset); +input_code input_code_poll_axes(running_machine *machine, int reset); /* ----- strings and tokenization ----- */ /* generate the friendly name of an input code, returning the length (buffer can be NULL) */ -astring *input_code_name(astring *buffer, input_code code); +astring *input_code_name(running_machine *machine, astring *buffer, input_code code); /* convert an input code to a token, returning the length (buffer can be NULL) */ -astring *input_code_to_token(astring *buffer, input_code code); +astring *input_code_to_token(running_machine *machine, astring *buffer, input_code code); /* convert a token back to an input code */ -input_code input_code_from_token(const char *_token); +input_code input_code_from_token(running_machine *machine, const char *_token); #endif /* __INPUT_H__ */ diff --git a/src/emu/inputseq.c b/src/emu/inputseq.c index ea3a3b5829c..6f4afc2640a 100644 --- a/src/emu/inputseq.c +++ b/src/emu/inputseq.c @@ -133,7 +133,7 @@ INLINE void input_seq_backspace(input_seq *seq) sequence of switch inputs is "pressed" -------------------------------------------------*/ -int input_seq_pressed(const input_seq *seq) +int input_seq_pressed(running_machine *machine, const input_seq *seq) { int result = FALSE; int invert = FALSE; @@ -167,11 +167,11 @@ int input_seq_pressed(const input_seq *seq) { /* if this is the first in the sequence, result is set equal */ if (first) - result = input_code_pressed(code) ^ invert; + result = input_code_pressed(machine, code) ^ invert; /* further values are ANDed */ else if (result) - result &= input_code_pressed(code) ^ invert; + result &= input_code_pressed(machine, code) ^ invert; /* no longer first, and clear the invert flag */ first = invert = FALSE; @@ -188,7 +188,7 @@ int input_seq_pressed(const input_seq *seq) axis defined in an input sequence -------------------------------------------------*/ -INT32 input_seq_axis_value(const input_seq *seq, input_item_class *itemclass_ptr) +INT32 input_seq_axis_value(running_machine *machine, const input_seq *seq, input_item_class *itemclass_ptr) { input_item_class itemclasszero = ITEM_CLASS_ABSOLUTE; input_item_class itemclass = ITEM_CLASS_INVALID; @@ -227,13 +227,13 @@ INT32 input_seq_axis_value(const input_seq *seq, input_item_class *itemclass_ptr { /* AND against previous digital codes */ if (enable) - enable &= input_code_pressed(code) ^ invert; + enable &= input_code_pressed(machine, code) ^ invert; } /* non-switch codes are analog values */ else { - INT32 value = input_code_value(code); + INT32 value = input_code_value(machine, code); /* if we got a 0 value, don't do anything except remember the first type */ if (value == 0) @@ -279,7 +279,7 @@ INT32 input_seq_axis_value(const input_seq *seq, input_item_class *itemclass_ptr new sequence of the given itemclass -------------------------------------------------*/ -void input_seq_poll_start(input_item_class itemclass, const input_seq *startseq) +void input_seq_poll_start(running_machine *machine, input_item_class itemclass, const input_seq *startseq) { input_code dummycode; @@ -300,9 +300,9 @@ void input_seq_poll_start(input_item_class itemclass, const input_seq *startseq) input_seq_append(&record_seq, SEQCODE_OR); /* flush out any goobers */ - dummycode = (record_class == ITEM_CLASS_SWITCH) ? input_code_poll_switches(TRUE) : input_code_poll_axes(TRUE); + dummycode = (record_class == ITEM_CLASS_SWITCH) ? input_code_poll_switches(machine, TRUE) : input_code_poll_axes(machine, TRUE); while (dummycode != INPUT_CODE_INVALID) - dummycode = (record_class == ITEM_CLASS_SWITCH) ? input_code_poll_switches(FALSE) : input_code_poll_axes(FALSE); + dummycode = (record_class == ITEM_CLASS_SWITCH) ? input_code_poll_switches(machine, FALSE) : input_code_poll_axes(machine, FALSE); } @@ -310,7 +310,7 @@ void input_seq_poll_start(input_item_class itemclass, const input_seq *startseq) input_seq_poll - continue polling -------------------------------------------------*/ -int input_seq_poll(input_seq *finalseq) +int input_seq_poll(running_machine *machine, input_seq *finalseq) { input_code lastcode = input_seq_get_last(&record_seq); int has_or = FALSE; @@ -319,7 +319,7 @@ int input_seq_poll(input_seq *finalseq) /* switch case: see if we have a new code to process */ if (record_class == ITEM_CLASS_SWITCH) { - newcode = input_code_poll_switches(FALSE); + newcode = input_code_poll_switches(machine, FALSE); if (newcode != INPUT_CODE_INVALID) { /* if code is duplicate, toggle the NOT state on the code */ @@ -345,7 +345,7 @@ int input_seq_poll(input_seq *finalseq) lastcode = input_seq_get_last_but_one(&record_seq); has_or = TRUE; } - newcode = input_code_poll_axes(FALSE); + newcode = input_code_poll_axes(machine, FALSE); /* if the last code doesn't match absolute/relative of this code, ignore the new one */ if ((INPUT_CODE_ITEMCLASS(lastcode) == ITEM_CLASS_ABSOLUTE && INPUT_CODE_ITEMCLASS(newcode) != ITEM_CLASS_ABSOLUTE) || @@ -407,7 +407,7 @@ int input_seq_poll(input_seq *finalseq) of a sequence -------------------------------------------------*/ -astring *input_seq_name(astring *string, const input_seq *seq) +astring *input_seq_name(running_machine *machine, astring *string, const input_seq *seq) { astring *codestr = astring_alloc(); int codenum, copycodenum; @@ -419,7 +419,7 @@ astring *input_seq_name(astring *string, const input_seq *seq) input_code code = seq->code[codenum]; /* if this is a code item which is not valid, don't copy it and remove any preceding ORs/NOTs */ - if (!INPUT_CODE_IS_INTERNAL(code) && astring_len(input_code_name(codestr, code)) == 0) + if (!INPUT_CODE_IS_INTERNAL(code) && astring_len(input_code_name(machine, codestr, code)) == 0) { while (copycodenum > 0 && INPUT_CODE_IS_INTERNAL(seqcopy.code[copycodenum - 1])) copycodenum--; @@ -456,7 +456,7 @@ astring *input_seq_name(astring *string, const input_seq *seq) /* otherwise, assume it is an input code and ask the input system to generate it */ else - astring_cat(string, input_code_name(codestr, code)); + astring_cat(string, input_code_name(machine, codestr, code)); } astring_free(codestr); @@ -469,7 +469,7 @@ astring *input_seq_name(astring *string, const input_seq *seq) form of a sequence -------------------------------------------------*/ -astring *input_seq_to_tokens(astring *string, const input_seq *seq) +astring *input_seq_to_tokens(running_machine *machine, astring *string, const input_seq *seq) { astring *codestr = astring_alloc(); int codenum; @@ -496,7 +496,7 @@ astring *input_seq_to_tokens(astring *string, const input_seq *seq) /* otherwise, assume it is an input code and ask the input system to generate it */ else - astring_cat(string, input_code_to_token(codestr, code)); + astring_cat(string, input_code_to_token(machine, codestr, code)); } astring_free(codestr); @@ -509,7 +509,7 @@ astring *input_seq_to_tokens(astring *string, const input_seq *seq) form of a sequence -------------------------------------------------*/ -int input_seq_from_tokens(const char *string, input_seq *seq) +int input_seq_from_tokens(running_machine *machine, const char *string, input_seq *seq) { char *strcopy = alloc_array_or_die(char, strlen(string) + 1); char *str = strcopy; @@ -551,7 +551,7 @@ int input_seq_from_tokens(const char *string, input_seq *seq) else if (strcmp(str, "DEFAULT") == 0) code = SEQCODE_DEFAULT; else - code = input_code_from_token(str); + code = input_code_from_token(machine, str); /* translate and add to the sequence */ input_seq_append(seq, code); diff --git a/src/emu/inputseq.h b/src/emu/inputseq.h index e91b41cef85..f9de770000e 100644 --- a/src/emu/inputseq.h +++ b/src/emu/inputseq.h @@ -69,33 +69,33 @@ struct _input_seq /* ----- state queries ----- */ /* return TRUE if the given switch sequence has been pressed */ -int input_seq_pressed(const input_seq *seq); +int input_seq_pressed(running_machine *machine, const input_seq *seq); /* return the value of an axis sequence */ -INT32 input_seq_axis_value(const input_seq *seq, input_item_class *itemclass_ptr); +INT32 input_seq_axis_value(running_machine *machine, const input_seq *seq, input_item_class *itemclass_ptr); /* ----- sequence polling ----- */ /* begin polling for a new sequence of the given itemclass */ -void input_seq_poll_start(input_item_class itemclass, const input_seq *startseq); +void input_seq_poll_start(running_machine *machine, input_item_class itemclass, const input_seq *startseq); /* continue polling for a sequence */ -int input_seq_poll(input_seq *finalseq); +int input_seq_poll(running_machine *machine, input_seq *finalseq); /* ----- strings and tokenization ----- */ /* generate the friendly name of an input sequence */ -astring *input_seq_name(astring *string, const input_seq *seq); +astring *input_seq_name(running_machine *machine, astring *string, const input_seq *seq); /* convert an input sequence to tokens, returning the length */ -astring *input_seq_to_tokens(astring *string, const input_seq *seq); +astring *input_seq_to_tokens(running_machine *machine, astring *string, const input_seq *seq); /* convert a set of tokens back to an input sequence */ -int input_seq_from_tokens(const char *string, input_seq *seq); +int input_seq_from_tokens(running_machine *machine, const char *string, input_seq *seq); diff --git a/src/emu/machine/68681.c b/src/emu/machine/68681.c index 6f05c907647..2ff96d1bc1b 100644 --- a/src/emu/machine/68681.c +++ b/src/emu/machine/68681.c @@ -498,16 +498,16 @@ READ8_DEVICE_HANDLER(duart68681_r) else { r = 0xff; - /* - if (input_code_pressed(KEYCODE_1)) r ^= 0x0001; - if (input_code_pressed(KEYCODE_2)) r ^= 0x0002; - if (input_code_pressed(KEYCODE_3)) r ^= 0x0004; - if (input_code_pressed(KEYCODE_4)) r ^= 0x0008; - if (input_code_pressed(KEYCODE_5)) r ^= 0x0010; - if (input_code_pressed(KEYCODE_6)) r ^= 0x0020; - if (input_code_pressed(KEYCODE_7)) r ^= 0x0040; - if (input_code_pressed(KEYCODE_8)) r ^= 0x0080; - */ +#if 0 + if (input_code_pressed(device->machine, KEYCODE_1)) r ^= 0x0001; + if (input_code_pressed(device->machine, KEYCODE_2)) r ^= 0x0002; + if (input_code_pressed(device->machine, KEYCODE_3)) r ^= 0x0004; + if (input_code_pressed(device->machine, KEYCODE_4)) r ^= 0x0008; + if (input_code_pressed(device->machine, KEYCODE_5)) r ^= 0x0010; + if (input_code_pressed(device->machine, KEYCODE_6)) r ^= 0x0020; + if (input_code_pressed(device->machine, KEYCODE_7)) r ^= 0x0040; + if (input_code_pressed(device->machine, KEYCODE_8)) r ^= 0x0080; +#endif } break; case 0x0e: /* Start counter command */ diff --git a/src/emu/mame.h b/src/emu/mame.h index 9a2de49849d..7eee1ef8180 100644 --- a/src/emu/mame.h +++ b/src/emu/mame.h @@ -135,6 +135,7 @@ typedef struct _streams_private streams_private; typedef struct _devices_private devices_private; typedef struct _romload_private romload_private; typedef struct _sound_private sound_private; +typedef struct _input_private input_private; typedef struct _input_port_private input_port_private; typedef struct _ui_input_private ui_input_private; typedef struct _cheat_private cheat_private; @@ -186,6 +187,7 @@ struct _running_machine devices_private * devices_data; /* internal data from devices.c */ romload_private * romload_data; /* internal data from romload.c */ sound_private * sound_data; /* internal data from sound.c */ + input_private * input_data; /* internal data from input.c */ input_port_private * input_port_data; /* internal data from inptport.c */ ui_input_private * ui_input_data; /* internal data from uiinput.c */ cheat_private * cheat_data; /* internal data from cheat.c */ diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c index 6707bfcdfdc..7faac2c8a0b 100644 --- a/src/emu/sound/k054539.c +++ b/src/emu/sound/k054539.c @@ -388,7 +388,7 @@ else double gc_f0; int gc_i, gc_j, gc_k, gc_l; - if (input_code_pressed_once(KEYCODE_DEL_PAD)) + if (input_code_pressed_once(device->machine, KEYCODE_DEL_PAD)) { gc_active ^= 1; if (!gc_active) popmessage(NULL); @@ -396,23 +396,23 @@ else if (gc_active) { - if (input_code_pressed_once(KEYCODE_0_PAD)) gc_chip ^= 1; + if (input_code_pressed_once(device->machine, KEYCODE_0_PAD)) gc_chip ^= 1; gc_i = gc_pos[gc_chip]; gc_j = 0; - if (input_code_pressed_once(KEYCODE_4_PAD)) { gc_i--; gc_j = 1; } - if (input_code_pressed_once(KEYCODE_6_PAD)) { gc_i++; gc_j = 1; } + if (input_code_pressed_once(device->machine, KEYCODE_4_PAD)) { gc_i--; gc_j = 1; } + if (input_code_pressed_once(device->machine, KEYCODE_6_PAD)) { gc_i++; gc_j = 1; } if (gc_j) { gc_i &= 7; gc_pos[gc_chip] = gc_i; } - if (input_code_pressed_once(KEYCODE_5_PAD)) + if (input_code_pressed_once(device->machine, KEYCODE_5_PAD)) info->k054539_gain[gc_i] = 1.0; else { gc_fptr = &info->k054539_gain[gc_i]; gc_f0 = *gc_fptr; gc_j = 0; - if (input_code_pressed_once(KEYCODE_2_PAD)) { gc_f0 -= 0.1; gc_j = 1; } - if (input_code_pressed_once(KEYCODE_8_PAD)) { gc_f0 += 0.1; gc_j = 1; } + if (input_code_pressed_once(device->machine, KEYCODE_2_PAD)) { gc_f0 -= 0.1; gc_j = 1; } + if (input_code_pressed_once(device->machine, KEYCODE_8_PAD)) { gc_f0 += 0.1; gc_j = 1; } if (gc_j) { if (gc_f0 < 0) gc_f0 = 0; *gc_fptr = gc_f0; } } diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c index a92e7b6a1fe..f0b766143fc 100644 --- a/src/emu/sound/sn76477.c +++ b/src/emu/sound/sn76477.c @@ -1995,7 +1995,7 @@ static STREAM_UPDATE( SN76477_update ) #if TEST_MODE static int recursing = 0; /* we need to prevent recursion since enable_w calls stream_update */ - if (input_code_pressed_once(KEYCODE_SPACE) && !recursing) + if (input_code_pressed_once(device->machine, KEYCODE_SPACE) && !recursing) { recursing = 1; diff --git a/src/emu/ui.c b/src/emu/ui.c index 1981264986c..dd3231542fd 100644 --- a/src/emu/ui.c +++ b/src/emu/ui.c @@ -291,8 +291,8 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho } /* clear the input memory */ - input_code_poll_switches(TRUE); - while (input_code_poll_switches(FALSE) != INPUT_CODE_INVALID) ; + input_code_poll_switches(machine, TRUE); + while (input_code_poll_switches(machine, FALSE) != INPUT_CODE_INVALID) ; /* loop while we have a handler */ while (ui_handler_callback != handler_ingame && !mame_is_scheduled_event_pending(machine) && !ui_menu_is_force_game_select()) @@ -1097,11 +1097,11 @@ static UINT32 handler_messagebox_ok(running_machine *machine, UINT32 state) ui_draw_text_box(astring_c(messagebox_text), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); /* an 'O' or left joystick kicks us to the next state */ - if (state == 0 && (input_code_pressed_once(KEYCODE_O) || ui_input_pressed(machine, IPT_UI_LEFT))) + if (state == 0 && (input_code_pressed_once(machine, KEYCODE_O) || ui_input_pressed(machine, IPT_UI_LEFT))) state++; /* a 'K' or right joystick exits the state */ - else if (state == 1 && (input_code_pressed_once(KEYCODE_K) || ui_input_pressed(machine, IPT_UI_RIGHT))) + else if (state == 1 && (input_code_pressed_once(machine, KEYCODE_K) || ui_input_pressed(machine, IPT_UI_RIGHT))) state = UI_HANDLER_CANCEL; /* if the user cancels, exit out completely */ @@ -1134,7 +1134,7 @@ static UINT32 handler_messagebox_anykey(running_machine *machine, UINT32 state) } /* if any key is pressed, just exit */ - else if (input_code_poll_switches(FALSE) != INPUT_CODE_INVALID) + else if (input_code_poll_switches(machine, FALSE) != INPUT_CODE_INVALID) state = UI_HANDLER_CANCEL; return state; @@ -1227,7 +1227,7 @@ static UINT32 handler_ingame(running_machine *machine, UINT32 state) if (ui_input_pressed(machine, IPT_UI_PAUSE)) { /* with a shift key, it is single step */ - if (is_paused && (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT))) + if (is_paused && (input_code_pressed(machine, KEYCODE_LSHIFT) || input_code_pressed(machine, KEYCODE_RSHIFT))) { single_step = TRUE; mame_pause(machine, FALSE); @@ -1339,15 +1339,15 @@ static UINT32 handler_load_save(running_machine *machine, UINT32 state) /* check for A-Z or 0-9 */ for (code = KEYCODE_A; code <= (input_code)KEYCODE_Z; code++) - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) file = code - KEYCODE_A + 'a'; if (file == 0) for (code = KEYCODE_0; code <= (input_code)KEYCODE_9; code++) - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) file = code - KEYCODE_0 + '0'; if (file == 0) for (code = KEYCODE_0_PAD; code <= (input_code)KEYCODE_9_PAD; code++) - if (input_code_pressed_once(code)) + if (input_code_pressed_once(machine, code)) file = code - KEYCODE_0_PAD + '0'; if (file == 0) return state; diff --git a/src/emu/uigfx.c b/src/emu/uigfx.c index 7dc83f658fc..e2daefa3011 100644 --- a/src/emu/uigfx.c +++ b/src/emu/uigfx.c @@ -994,8 +994,8 @@ static void tilemap_handle_keys(running_machine *machine, ui_gfx_state *state, i /* handle navigation (up,down,left,right) */ step = 8; - if (input_code_pressed(KEYCODE_LSHIFT)) step = 1; - if (input_code_pressed(KEYCODE_LCONTROL)) step = 64; + if (input_code_pressed(machine, KEYCODE_LSHIFT)) step = 1; + if (input_code_pressed(machine, KEYCODE_LCONTROL)) step = 64; if (ui_input_pressed_repeat(machine, IPT_UI_UP, 4)) state->tilemap.yoffs -= step; if (ui_input_pressed_repeat(machine, IPT_UI_DOWN, 4)) diff --git a/src/emu/uiinput.c b/src/emu/uiinput.c index f9da653265e..03799ae2916 100644 --- a/src/emu/uiinput.c +++ b/src/emu/uiinput.c @@ -104,7 +104,7 @@ static void ui_input_frame_update(running_machine *machine) /* update the state of all the UI keys */ for (code = __ipt_ui_start; code <= __ipt_ui_end; code++) { - int pressed = input_seq_pressed(input_type_seq(machine, code, 0, SEQ_TYPE_STANDARD)); + int pressed = input_seq_pressed(machine, input_type_seq(machine, code, 0, SEQ_TYPE_STANDARD)); if (!pressed || uidata->seqpressed[code] != SEQ_PRESSED_RESET) uidata->seqpressed[code] = pressed; } diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c index 580b7bbc11f..66e1aec6b42 100644 --- a/src/emu/uimenu.c +++ b/src/emu/uimenu.c @@ -278,7 +278,7 @@ static void menu_input_specific(running_machine *machine, ui_menu *menu, void *p static void menu_input_specific_populate(running_machine *machine, ui_menu *menu, input_menu_state *menustate); static void menu_input_common(running_machine *machine, ui_menu *menu, void *parameter, void *state); static int CLIB_DECL menu_input_compare_items(const void *i1, const void *i2); -static void menu_input_populate_and_sort(ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate); +static void menu_input_populate_and_sort(running_machine *machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate); static void menu_settings_dip_switches(running_machine *machine, ui_menu *menu, void *parameter, void *state); static void menu_settings_driver_config(running_machine *machine, ui_menu *menu, void *parameter, void *state); static void menu_settings_categories(running_machine *machine, ui_menu *menu, void *parameter, void *state); @@ -1629,7 +1629,7 @@ static void menu_input_general_populate(running_machine *machine, ui_menu *menu, } /* sort and populate the menu in a standard fashion */ - menu_input_populate_and_sort(menu, itemlist, menustate); + menu_input_populate_and_sort(machine, menu, itemlist, menustate); astring_free(tempstring); } @@ -1709,7 +1709,7 @@ static void menu_input_specific_populate(running_machine *machine, ui_menu *menu } /* sort and populate the menu in a standard fashion */ - menu_input_populate_and_sort(menu, itemlist, menustate); + menu_input_populate_and_sort(machine, menu, itemlist, menustate); astring_free(tempstring); } @@ -1758,7 +1758,7 @@ static void menu_input_common(running_machine *machine, ui_menu *menu, void *par } /* poll again; if finished, update the sequence */ - if (input_seq_poll(&newseq)) + if (input_seq_poll(machine, &newseq)) { menustate->pollingitem = NULL; menustate->record_next = TRUE; @@ -1778,7 +1778,7 @@ static void menu_input_common(running_machine *machine, ui_menu *menu, void *par menustate->pollingitem = item; menustate->last_sortorder = item->sortorder; menustate->starting_seq = item->seq; - input_seq_poll_start((item->type == INPUT_TYPE_ANALOG) ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, menustate->record_next ? &item->seq : NULL); + input_seq_poll_start(machine, (item->type == INPUT_TYPE_ANALOG) ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, menustate->record_next ? &item->seq : NULL); invalidate = TRUE; break; @@ -1854,7 +1854,7 @@ static int menu_input_compare_items(const void *i1, const void *i2) menu from them -------------------------------------------------*/ -static void menu_input_populate_and_sort(ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate) +static void menu_input_populate_and_sort(running_machine *machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate) { const char *nameformat[INPUT_TYPE_TOTAL] = { 0 }; input_item_data **itemarray, *item; @@ -1900,7 +1900,7 @@ static void menu_input_populate_and_sort(ui_menu *menu, input_item_data *itemlis /* otherwise, generate the sequence name and invert it if different from the default */ else { - input_seq_name(subtext, &item->seq); + input_seq_name(machine, subtext, &item->seq); flags |= input_seq_cmp(&item->seq, item->defseq) ? MENU_FLAG_INVERT : 0; } @@ -2225,12 +2225,12 @@ static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter /* left decrements */ case IPT_UI_LEFT: - newval -= input_code_pressed(KEYCODE_LSHIFT) ? 10 : 1; + newval -= input_code_pressed(machine, KEYCODE_LSHIFT) ? 10 : 1; break; /* right increments */ case IPT_UI_RIGHT: - newval += input_code_pressed(KEYCODE_LSHIFT) ? 10 : 1; + newval += input_code_pressed(machine, KEYCODE_LSHIFT) ? 10 : 1; break; } @@ -2742,11 +2742,11 @@ static void menu_sliders(running_machine *machine, ui_menu *menu, void *paramete /* decrease value */ case IPT_UI_LEFT: - if (input_code_pressed(KEYCODE_LALT) || input_code_pressed(KEYCODE_RALT)) + if (input_code_pressed(machine, KEYCODE_LALT) || input_code_pressed(machine, KEYCODE_RALT)) increment = -1; - else if (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT)) + else if (input_code_pressed(machine, KEYCODE_LSHIFT) || input_code_pressed(machine, KEYCODE_RSHIFT)) increment = (slider->incval > 10) ? -(slider->incval / 10) : -1; - else if (input_code_pressed(KEYCODE_LCONTROL) || input_code_pressed(KEYCODE_RCONTROL)) + else if (input_code_pressed(machine, KEYCODE_LCONTROL) || input_code_pressed(machine, KEYCODE_RCONTROL)) increment = -slider->incval * 10; else increment = -slider->incval; @@ -2754,11 +2754,11 @@ static void menu_sliders(running_machine *machine, ui_menu *menu, void *paramete /* increase value */ case IPT_UI_RIGHT: - if (input_code_pressed(KEYCODE_LALT) || input_code_pressed(KEYCODE_RALT)) + if (input_code_pressed(machine, KEYCODE_LALT) || input_code_pressed(machine, KEYCODE_RALT)) increment = 1; - else if (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT)) + else if (input_code_pressed(machine, KEYCODE_LSHIFT) || input_code_pressed(machine, KEYCODE_RSHIFT)) increment = (slider->incval > 10) ? (slider->incval / 10) : 1; - else if (input_code_pressed(KEYCODE_LCONTROL) || input_code_pressed(KEYCODE_RCONTROL)) + else if (input_code_pressed(machine, KEYCODE_LCONTROL) || input_code_pressed(machine, KEYCODE_RCONTROL)) increment = slider->incval * 10; else increment = slider->incval; @@ -3121,12 +3121,12 @@ static void menu_crosshair(running_machine *machine, ui_menu *menu, void *parame /* left decrements */ case IPT_UI_LEFT: - newval -= input_code_pressed(KEYCODE_LSHIFT) ? 10 : 1; + newval -= input_code_pressed(machine, KEYCODE_LSHIFT) ? 10 : 1; break; /* right increments */ case IPT_UI_RIGHT: - newval += input_code_pressed(KEYCODE_LSHIFT) ? 10 : 1; + newval += input_code_pressed(machine, KEYCODE_LSHIFT) ? 10 : 1; break; } diff --git a/src/emu/video/v9938.c b/src/emu/video/v9938.c index 512564b2331..1d6b6cf50aa 100644 --- a/src/emu/video/v9938.c +++ b/src/emu/video/v9938.c @@ -1394,10 +1394,10 @@ I do not know the behaviour of FV when IE0=0. That is the part that I still have to test. */ -static void v9938_interrupt_start_vblank (void) +static void v9938_interrupt_start_vblank (running_machine *machine) { #if 0 - if (input_code_pressed (KEYCODE_D) ) + if (input_code_pressed (machine, KEYCODE_D) ) { FILE *fp; int i; @@ -1492,7 +1492,7 @@ int v9938_interrupt (running_machine *machine, int which) /* check for start of vblank */ if ((pal && (vdp->scanline == 310)) || (!pal && (vdp->scanline == 259))) - v9938_interrupt_start_vblank (); + v9938_interrupt_start_vblank (machine); /* render the current line */ if ((vdp->scanline >= scanline_start) && (vdp->scanline < (212 + 28 + scanline_start))) diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c index 8d0c2254638..ab9e424e784 100644 --- a/src/emu/video/voodoo.c +++ b/src/emu/video/voodoo.c @@ -379,7 +379,7 @@ int voodoo_update(const device_config *device, bitmap_t *bitmap, const rectangle } /* debugging! */ - if (input_code_pressed(KEYCODE_L)) + if (input_code_pressed(device->machine, KEYCODE_L)) drawbuf = v->fbi.backbuf; /* copy from the current front buffer */ @@ -393,7 +393,7 @@ int voodoo_update(const device_config *device, bitmap_t *bitmap, const rectangle } /* update stats display */ - statskey = (input_code_pressed(KEYCODE_BACKSLASH) != 0); + statskey = (input_code_pressed(device->machine, KEYCODE_BACKSLASH) != 0); if (statskey && statskey != v->stats.lastkey) v->stats.display = !v->stats.display; v->stats.lastkey = statskey; @@ -403,7 +403,7 @@ int voodoo_update(const device_config *device, bitmap_t *bitmap, const rectangle popmessage(v->stats.buffer, 0, 0); /* update render override */ - v->stats.render_override = input_code_pressed(KEYCODE_ENTER); + v->stats.render_override = input_code_pressed(device->machine, KEYCODE_ENTER); if (DEBUG_DEPTH && v->stats.render_override) { for (y = cliprect->min_y; y <= cliprect->max_y; y++) diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c index d3154ea4e7f..567ae3988fb 100644 --- a/src/mame/drivers/adp.c +++ b/src/mame/drivers/adp.c @@ -253,31 +253,31 @@ static VIDEO_UPDATE(adp) int x,y,b; b = ((HD63484_reg[0xcc/2] & 0x000f) << 16) + HD63484_reg[0xce/2]; -/* - if (input_code_pressed(KEYCODE_M)) b = 0; - if (input_code_pressed(KEYCODE_Q)) b += 0x060 * 280 * 1; - if (input_code_pressed(KEYCODE_W)) b += 0x060 * 280 * 2; - if (input_code_pressed(KEYCODE_E)) b += 0x060 * 280 * 3; - if (input_code_pressed(KEYCODE_R)) b += 0x060 * 280 * 4; - if (input_code_pressed(KEYCODE_T)) b += 0x060 * 280 * 5; - if (input_code_pressed(KEYCODE_Y)) b += 0x060 * 280 * 6; - if (input_code_pressed(KEYCODE_U)) b += 0x060 * 280 * 7; - if (input_code_pressed(KEYCODE_I)) b += 0x060 * 280 * 8; - if (input_code_pressed(KEYCODE_A)) b += 0x060 * 280 * 9; - if (input_code_pressed(KEYCODE_S)) b += 0x060 * 280 * 10; - if (input_code_pressed(KEYCODE_D)) b += 0x060 * 280 * 11; - if (input_code_pressed(KEYCODE_F)) b += 0x060 * 280 * 12; - if (input_code_pressed(KEYCODE_G)) b += 0x060 * 280 * 13; - if (input_code_pressed(KEYCODE_H)) b += 0x060 * 280 * 14; - if (input_code_pressed(KEYCODE_J)) b += 0x060 * 280 * 15; - if (input_code_pressed(KEYCODE_K)) b += 0x060 * 280 * 16; - if (input_code_pressed(KEYCODE_Z)) b += 0x060 * 280 * 17; - if (input_code_pressed(KEYCODE_X)) b += 0x060 * 280 * 18; - if (input_code_pressed(KEYCODE_C)) b += 0x060 * 280 * 19; - if (input_code_pressed(KEYCODE_V)) b += 0x060 * 280 * 20; - if (input_code_pressed(KEYCODE_B)) b += 0x060 * 280 * 21; - if (input_code_pressed(KEYCODE_N)) b += 0x060 * 280 * 22; -*/ +#if 0 + if (input_code_pressed(screen->machine, KEYCODE_M)) b = 0; + if (input_code_pressed(screen->machine, KEYCODE_Q)) b += 0x060 * 280 * 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) b += 0x060 * 280 * 2; + if (input_code_pressed(screen->machine, KEYCODE_E)) b += 0x060 * 280 * 3; + if (input_code_pressed(screen->machine, KEYCODE_R)) b += 0x060 * 280 * 4; + if (input_code_pressed(screen->machine, KEYCODE_T)) b += 0x060 * 280 * 5; + if (input_code_pressed(screen->machine, KEYCODE_Y)) b += 0x060 * 280 * 6; + if (input_code_pressed(screen->machine, KEYCODE_U)) b += 0x060 * 280 * 7; + if (input_code_pressed(screen->machine, KEYCODE_I)) b += 0x060 * 280 * 8; + if (input_code_pressed(screen->machine, KEYCODE_A)) b += 0x060 * 280 * 9; + if (input_code_pressed(screen->machine, KEYCODE_S)) b += 0x060 * 280 * 10; + if (input_code_pressed(screen->machine, KEYCODE_D)) b += 0x060 * 280 * 11; + if (input_code_pressed(screen->machine, KEYCODE_F)) b += 0x060 * 280 * 12; + if (input_code_pressed(screen->machine, KEYCODE_G)) b += 0x060 * 280 * 13; + if (input_code_pressed(screen->machine, KEYCODE_H)) b += 0x060 * 280 * 14; + if (input_code_pressed(screen->machine, KEYCODE_J)) b += 0x060 * 280 * 15; + if (input_code_pressed(screen->machine, KEYCODE_K)) b += 0x060 * 280 * 16; + if (input_code_pressed(screen->machine, KEYCODE_Z)) b += 0x060 * 280 * 17; + if (input_code_pressed(screen->machine, KEYCODE_X)) b += 0x060 * 280 * 18; + if (input_code_pressed(screen->machine, KEYCODE_C)) b += 0x060 * 280 * 19; + if (input_code_pressed(screen->machine, KEYCODE_V)) b += 0x060 * 280 * 20; + if (input_code_pressed(screen->machine, KEYCODE_B)) b += 0x060 * 280 * 21; + if (input_code_pressed(screen->machine, KEYCODE_N)) b += 0x060 * 280 * 22; +#endif for (y = 0;y < 280;y++) { for (x = 0 ; x < (HD63484_reg[0xca/2] & 0x0fff) * 4 ; x += 4) @@ -290,7 +290,7 @@ static VIDEO_UPDATE(adp) b++; } } -if (!input_code_pressed(KEYCODE_O)) +if (!input_code_pressed(screen->machine, KEYCODE_O)) if ((HD63484_reg[0x06/2] & 0x0300) == 0x0300) { int sy = (HD63484_reg[0x94/2] & 0x0fff) - (HD63484_reg[0x88/2] >> 8); diff --git a/src/mame/drivers/bingoc.c b/src/mame/drivers/bingoc.c index e7573d46c1d..867e840df36 100644 --- a/src/mame/drivers/bingoc.c +++ b/src/mame/drivers/bingoc.c @@ -61,13 +61,13 @@ static READ8_HANDLER( sound_test_r ) { static UINT8 x; - if(input_code_pressed_once(KEYCODE_Z)) + if(input_code_pressed_once(space->machine, KEYCODE_Z)) x++; - if(input_code_pressed_once(KEYCODE_X)) + if(input_code_pressed_once(space->machine, KEYCODE_X)) x--; - if(input_code_pressed_once(KEYCODE_A)) + if(input_code_pressed_once(space->machine, KEYCODE_A)) return 0xff; popmessage("%02x",x); diff --git a/src/mame/drivers/bishjan.c b/src/mame/drivers/bishjan.c index df52be11769..c2df23e06ee 100644 --- a/src/mame/drivers/bishjan.c +++ b/src/mame/drivers/bishjan.c @@ -236,11 +236,11 @@ static VIDEO_UPDATE( bishjan ) int y; #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z)) + if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/drivers/cmmb.c b/src/mame/drivers/cmmb.c index 22288d5a49c..51c4c4d602e 100644 --- a/src/mame/drivers/cmmb.c +++ b/src/mame/drivers/cmmb.c @@ -262,7 +262,7 @@ GFXDECODE_END static INTERRUPT_GEN( cmmb_irq ) { - //if(input_code_pressed_once(KEYCODE_Z)) + //if(input_code_pressed_once(device->machine, KEYCODE_Z)) // cpu_set_input_line(device, 0, HOLD_LINE); } diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c index 1e14511a462..75acd204711 100644 --- a/src/mame/drivers/darkhors.c +++ b/src/mame/drivers/darkhors.c @@ -160,12 +160,12 @@ static VIDEO_UPDATE( darkhors ) int layers_ctrl = -1; #if DARKHORS_DEBUG - if (input_code_pressed(KEYCODE_Z)) + if (input_code_pressed(screen->machine, KEYCODE_Z)) { int mask = 0; - if (input_code_pressed(KEYCODE_Q)) mask |= 1; - if (input_code_pressed(KEYCODE_W)) mask |= 2; - if (input_code_pressed(KEYCODE_A)) mask |= 4; + if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; + if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4; if (mask != 0) layers_ctrl &= mask; } #endif diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c index 1c493dfcd93..70dc5101e00 100644 --- a/src/mame/drivers/ddenlovr.c +++ b/src/mame/drivers/ddenlovr.c @@ -1235,36 +1235,36 @@ VIDEO_UPDATE(ddenlovr) ddenlovr_clip_ctrl = 0x0f; next = blit_draw(screen->machine,base,0); popmessage("GFX %06x",base); - if (input_code_pressed(KEYCODE_S)) base = next; - if (input_code_pressed_once(KEYCODE_X)) base = next; - if (input_code_pressed(KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } - if (input_code_pressed(KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } - if (input_code_pressed_once(KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } - if (input_code_pressed_once(KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } + if (input_code_pressed(screen->machine, KEYCODE_S)) base = next; + if (input_code_pressed_once(screen->machine, KEYCODE_X)) base = next; + if (input_code_pressed(screen->machine, KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } + if (input_code_pressed(screen->machine, KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } + if (input_code_pressed_once(screen->machine, KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } + if (input_code_pressed_once(screen->machine, KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } #endif bitmap_fill(bitmap,cliprect,ddenlovr_bgcolor); #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z)) + if (input_code_pressed(screen->machine, KEYCODE_Z)) { int mask,mask2; mask = 0; - if (input_code_pressed(KEYCODE_Q)) mask |= 1; - if (input_code_pressed(KEYCODE_W)) mask |= 2; - if (input_code_pressed(KEYCODE_E)) mask |= 4; - if (input_code_pressed(KEYCODE_R)) mask |= 8; + if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; + if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 4; + if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 8; mask2 = 0; if (extra_layers) { - if (input_code_pressed(KEYCODE_A)) mask2 |= 1; - if (input_code_pressed(KEYCODE_S)) mask2 |= 2; - if (input_code_pressed(KEYCODE_D)) mask2 |= 4; - if (input_code_pressed(KEYCODE_F)) mask2 |= 8; + if (input_code_pressed(screen->machine, KEYCODE_A)) mask2 |= 1; + if (input_code_pressed(screen->machine, KEYCODE_S)) mask2 |= 2; + if (input_code_pressed(screen->machine, KEYCODE_D)) mask2 |= 4; + if (input_code_pressed(screen->machine, KEYCODE_F)) mask2 |= 8; } if (mask || mask2) diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c index 241b378fa8e..cf2d4c78462 100644 --- a/src/mame/drivers/dunhuang.c +++ b/src/mame/drivers/dunhuang.c @@ -117,11 +117,11 @@ static VIDEO_UPDATE( dunhuang ) int layers_ctrl = -1; #if DUNHUANG_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c index 0665e07bdb9..3b4659820c6 100644 --- a/src/mame/drivers/firebeat.c +++ b/src/mame/drivers/firebeat.c @@ -508,7 +508,7 @@ static VIDEO_UPDATE(firebeat) if (tick >= 5) { tick = 0; - if (input_code_pressed(KEYCODE_0)) + if (input_code_pressed(screen->machine, KEYCODE_0)) { layer++; if (layer > 2) @@ -518,7 +518,7 @@ static VIDEO_UPDATE(firebeat) } /* - if (input_code_pressed_once(KEYCODE_9)) + if (input_code_pressed_once(screen->machine, KEYCODE_9)) { FILE *file = fopen("vram0.bin", "wb"); int i; diff --git a/src/mame/drivers/galaxi.c b/src/mame/drivers/galaxi.c index 7a45c5cc43a..cc3d1742b97 100644 --- a/src/mame/drivers/galaxi.c +++ b/src/mame/drivers/galaxi.c @@ -131,14 +131,14 @@ static VIDEO_UPDATE(galaxi) int layers_ctrl = -1; #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_R)) // remapped due to inputs changes. + if (input_code_pressed(screen->machine, KEYCODE_R)) // remapped due to inputs changes. { int msk = 0; - if (input_code_pressed(KEYCODE_T)) msk |= 1; - if (input_code_pressed(KEYCODE_Y)) msk |= 2; - if (input_code_pressed(KEYCODE_U)) msk |= 4; - if (input_code_pressed(KEYCODE_I)) msk |= 8; - if (input_code_pressed(KEYCODE_O)) msk |= 16; + if (input_code_pressed(screen->machine, KEYCODE_T)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_Y)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_U)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_I)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_O)) msk |= 16; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c index 9c137fa90e1..dc147975dbf 100644 --- a/src/mame/drivers/ghosteo.c +++ b/src/mame/drivers/ghosteo.c @@ -388,19 +388,19 @@ static VIDEO_START( bballoon ) static int b=0; static VIDEO_UPDATE( bballoon ) { - if(input_code_pressed_once(KEYCODE_Q)) + if(input_code_pressed_once(screen->machine, KEYCODE_Q)) { irq_en ^= 1; printf("en = %d\n",irq_en); } - if(input_code_pressed(KEYCODE_W)) + if(input_code_pressed(screen->machine, KEYCODE_W)) { printf("b = %d\n",++b); } - if(input_code_pressed(KEYCODE_E)) + if(input_code_pressed(screen->machine, KEYCODE_E)) { printf("b = %d\n",--b); diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c index bb76ddfd9f8..03cb03c9c85 100644 --- a/src/mame/drivers/gottlieb.c +++ b/src/mame/drivers/gottlieb.c @@ -614,7 +614,7 @@ static void audio_handle_zero_crossing(attotime zerotime, int logit) static void laserdisc_audio_process(const device_config *device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1) { - int logit = LOG_AUDIO_DECODE && input_code_pressed(KEYCODE_L); + int logit = LOG_AUDIO_DECODE && input_code_pressed(device->machine, KEYCODE_L); attotime time_per_sample = ATTOTIME_IN_HZ(samplerate); attotime curtime = laserdisc_last_time; int cursamp; diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c index 6442975f7f3..d40b0fef774 100644 --- a/src/mame/drivers/hvyunit.c +++ b/src/mame/drivers/hvyunit.c @@ -124,10 +124,10 @@ static READ8_HANDLER( mermaid_data_r ) { static UINT8 res; - if(input_code_pressed_once(KEYCODE_Z)) + if(input_code_pressed_once(space->machine, KEYCODE_Z)) test_mcu++; - if(input_code_pressed_once(KEYCODE_X)) + if(input_code_pressed_once(space->machine, KEYCODE_X)) test_mcu--; if(mcu_ram.access_ram_r) diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c index 9fdb5c9ce2a..17041d3916c 100644 --- a/src/mame/drivers/igs009.c +++ b/src/mame/drivers/igs009.c @@ -228,12 +228,12 @@ static VIDEO_UPDATE(jingbell) int layers_ctrl = video_enable ? -1 : 0; #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z)) + if (input_code_pressed(screen->machine, KEYCODE_Z)) { int mask = 0; - if (input_code_pressed(KEYCODE_Q)) mask |= 1; - if (input_code_pressed(KEYCODE_W)) mask |= 2; - if (input_code_pressed(KEYCODE_A)) mask |= 4; + if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; + if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4; if (mask != 0) layers_ctrl &= mask; } #endif diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c index 7cb8da4a252..5d8e3001ee4 100644 --- a/src/mame/drivers/igs017.c +++ b/src/mame/drivers/igs017.c @@ -221,25 +221,25 @@ static int debug_viewer(running_machine *machine, bitmap_t *bitmap,const rectang { #ifdef MAME_DEBUG static int toggle = 0; - if (input_code_pressed_once(KEYCODE_T)) toggle = 1-toggle; + if (input_code_pressed_once(machine, KEYCODE_T)) toggle = 1-toggle; if (toggle) { static int a = 0, w = 512; int h = 256; - if (input_code_pressed(KEYCODE_O)) w += 1; - if (input_code_pressed(KEYCODE_I)) w -= 1; + if (input_code_pressed(machine, KEYCODE_O)) w += 1; + if (input_code_pressed(machine, KEYCODE_I)) w -= 1; - if (input_code_pressed(KEYCODE_U)) w += 8; - if (input_code_pressed(KEYCODE_Y)) w -= 8; + if (input_code_pressed(machine, KEYCODE_U)) w += 8; + if (input_code_pressed(machine, KEYCODE_Y)) w -= 8; - if (input_code_pressed(KEYCODE_RIGHT)) a += 1; - if (input_code_pressed(KEYCODE_LEFT)) a -= 1; + if (input_code_pressed(machine, KEYCODE_RIGHT)) a += 1; + if (input_code_pressed(machine, KEYCODE_LEFT)) a -= 1; - if (input_code_pressed(KEYCODE_DOWN)) a += w; - if (input_code_pressed(KEYCODE_UP)) a -= w; + if (input_code_pressed(machine, KEYCODE_DOWN)) a += w; + if (input_code_pressed(machine, KEYCODE_UP)) a -= w; - if (input_code_pressed(KEYCODE_PGDN)) a += w * h; - if (input_code_pressed(KEYCODE_PGUP)) a -= w * h; + if (input_code_pressed(machine, KEYCODE_PGDN)) a += w * h; + if (input_code_pressed(machine, KEYCODE_PGUP)) a -= w * h; if (a < 0) a = 0; if (a > sprites_gfx_size) a = sprites_gfx_size; @@ -264,12 +264,12 @@ static VIDEO_UPDATE( igs017 ) int layers_ctrl = -1; #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z)) + if (input_code_pressed(screen->machine, KEYCODE_Z)) { int mask = 0; - if (input_code_pressed(KEYCODE_Q)) mask |= 1; - if (input_code_pressed(KEYCODE_W)) mask |= 2; - if (input_code_pressed(KEYCODE_A)) mask |= 4; + if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; + if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4; if (mask != 0) layers_ctrl &= mask; } #endif diff --git a/src/mame/drivers/igs_blit.c b/src/mame/drivers/igs_blit.c index a6b76b842c9..4e5c6e9b66b 100644 --- a/src/mame/drivers/igs_blit.c +++ b/src/mame/drivers/igs_blit.c @@ -107,17 +107,17 @@ static VIDEO_UPDATE(igs) UINT16 *pri_ram; #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z)) + if (input_code_pressed(screen->machine, KEYCODE_Z)) { int mask = 0; - if (input_code_pressed(KEYCODE_Q)) mask |= 0x01; - if (input_code_pressed(KEYCODE_W)) mask |= 0x02; - if (input_code_pressed(KEYCODE_E)) mask |= 0x04; - if (input_code_pressed(KEYCODE_R)) mask |= 0x08; - if (input_code_pressed(KEYCODE_A)) mask |= 0x10; - if (input_code_pressed(KEYCODE_S)) mask |= 0x20; - if (input_code_pressed(KEYCODE_D)) mask |= 0x40; - if (input_code_pressed(KEYCODE_F)) mask |= 0x80; + if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 0x01; + if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 0x02; + if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 0x04; + if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 0x08; + if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 0x10; + if (input_code_pressed(screen->machine, KEYCODE_S)) mask |= 0x20; + if (input_code_pressed(screen->machine, KEYCODE_D)) mask |= 0x40; + if (input_code_pressed(screen->machine, KEYCODE_F)) mask |= 0x80; if (mask) layer_enable &= mask; } #endif @@ -327,7 +327,7 @@ static WRITE16_HANDLER( igs_blit_flags_w ) #ifdef MAME_DEBUG #if 1 - if (input_code_pressed(KEYCODE_Z)) + if (input_code_pressed(space->machine, KEYCODE_Z)) { char buf[20]; sprintf(buf, "%02X%02X",blitter.depth,blitter.flags&0xff); // ui_draw_text(buf, blitter.x, blitter.y); // crashes mame! diff --git a/src/mame/drivers/igspoker.c b/src/mame/drivers/igspoker.c index 5690af1c32b..497f9a4e731 100644 --- a/src/mame/drivers/igspoker.c +++ b/src/mame/drivers/igspoker.c @@ -284,7 +284,7 @@ static WRITE8_HANDLER( custom_io_w ) static CUSTOM_INPUT( hopper_r ) { if (hopper) return !(video_screen_get_frame_number(field->port->machine->primary_screen)%10); - return input_code_pressed(KEYCODE_H); + return input_code_pressed(field->port->machine, KEYCODE_H); } static READ8_HANDLER( exp_rom_r ) diff --git a/src/mame/drivers/itgambl2.c b/src/mame/drivers/itgambl2.c index a4efe0b229b..ff574b44d1a 100644 --- a/src/mame/drivers/itgambl2.c +++ b/src/mame/drivers/itgambl2.c @@ -72,28 +72,28 @@ static VIDEO_UPDATE( itgambl2 ) const UINT8 *blit_ram = memory_region(screen->machine,"gfx1"); static int test_x = 256,test_y = 256,start_offs; - if(input_code_pressed(KEYCODE_Z)) + if(input_code_pressed(screen->machine, KEYCODE_Z)) test_x++; - if(input_code_pressed(KEYCODE_X)) + if(input_code_pressed(screen->machine, KEYCODE_X)) test_x--; - if(input_code_pressed(KEYCODE_A)) + if(input_code_pressed(screen->machine, KEYCODE_A)) test_y++; - if(input_code_pressed(KEYCODE_S)) + if(input_code_pressed(screen->machine, KEYCODE_S)) test_y--; - if(input_code_pressed(KEYCODE_Q)) + if(input_code_pressed(screen->machine, KEYCODE_Q)) start_offs+=0x200; - if(input_code_pressed(KEYCODE_W)) + if(input_code_pressed(screen->machine, KEYCODE_W)) start_offs-=0x200; - if(input_code_pressed(KEYCODE_E)) + if(input_code_pressed(screen->machine, KEYCODE_E)) start_offs++; - if(input_code_pressed(KEYCODE_R)) + if(input_code_pressed(screen->machine, KEYCODE_R)) start_offs--; popmessage("%d %d %04x",test_x,test_y,start_offs); diff --git a/src/mame/drivers/itgambl3.c b/src/mame/drivers/itgambl3.c index bb69ad32211..733fce68353 100644 --- a/src/mame/drivers/itgambl3.c +++ b/src/mame/drivers/itgambl3.c @@ -60,28 +60,28 @@ static VIDEO_UPDATE( itgambl3 ) const UINT8 *blit_ram = memory_region(screen->machine,"gfx1"); static int test_x = 256,test_y = 256,start_offs; - if(input_code_pressed(KEYCODE_Z)) + if(input_code_pressed(screen->machine, KEYCODE_Z)) test_x++; - if(input_code_pressed(KEYCODE_X)) + if(input_code_pressed(screen->machine, KEYCODE_X)) test_x--; - if(input_code_pressed(KEYCODE_A)) + if(input_code_pressed(screen->machine, KEYCODE_A)) test_y++; - if(input_code_pressed(KEYCODE_S)) + if(input_code_pressed(screen->machine, KEYCODE_S)) test_y--; - if(input_code_pressed(KEYCODE_Q)) + if(input_code_pressed(screen->machine, KEYCODE_Q)) start_offs+=0x200; - if(input_code_pressed(KEYCODE_W)) + if(input_code_pressed(screen->machine, KEYCODE_W)) start_offs-=0x200; - if(input_code_pressed(KEYCODE_E)) + if(input_code_pressed(screen->machine, KEYCODE_E)) start_offs++; - if(input_code_pressed(KEYCODE_R)) + if(input_code_pressed(screen->machine, KEYCODE_R)) start_offs--; popmessage("%d %d %04x",test_x,test_y,start_offs); diff --git a/src/mame/drivers/jackie.c b/src/mame/drivers/jackie.c index 9766c84daaa..c3acf627614 100644 --- a/src/mame/drivers/jackie.c +++ b/src/mame/drivers/jackie.c @@ -311,7 +311,7 @@ ADDRESS_MAP_END static CUSTOM_INPUT( hopper_r ) { if (hopper) return !(video_screen_get_frame_number(field->port->machine->primary_screen)%10); - return input_code_pressed(KEYCODE_H); + return input_code_pressed(field->port->machine, KEYCODE_H); } static INPUT_PORTS_START( jackie ) diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c index 428fcd5d28c..76377b68b81 100644 --- a/src/mame/drivers/kickgoal.c +++ b/src/mame/drivers/kickgoal.c @@ -341,7 +341,7 @@ static INTERRUPT_GEN( kickgoal_interrupt ) okim6295_w(adpcm,0,0x81); } } - if ( input_code_pressed_once(KEYCODE_PGUP) ) + if ( input_code_pressed_once(device->machine, KEYCODE_PGUP) ) { if (m6295_key_delay >= (0x60 * oki_time_base)) { @@ -357,7 +357,7 @@ static INTERRUPT_GEN( kickgoal_interrupt ) else m6295_key_delay += (0x01 * oki_time_base); } - else if ( input_code_pressed_once(KEYCODE_PGDN) ) + else if ( input_code_pressed_once(device->machine, KEYCODE_PGDN) ) { if (m6295_key_delay >= (0x60 * oki_time_base)) { @@ -373,7 +373,7 @@ static INTERRUPT_GEN( kickgoal_interrupt ) else m6295_key_delay += (0x01 * oki_time_base); } - else if ( input_code_pressed_once(KEYCODE_INSERT) ) + else if ( input_code_pressed_once(device->machine, KEYCODE_INSERT) ) { if (m6295_key_delay >= (0x60 * oki_time_base)) { @@ -392,7 +392,7 @@ static INTERRUPT_GEN( kickgoal_interrupt ) else m6295_key_delay += (0x01 * oki_time_base); } - else if ( input_code_pressed_once(KEYCODE_DEL) ) + else if ( input_code_pressed_once(device->machine, KEYCODE_DEL) ) { if (m6295_key_delay >= (0x60 * oki_time_base)) { @@ -411,7 +411,7 @@ static INTERRUPT_GEN( kickgoal_interrupt ) else m6295_key_delay += (0x01 * oki_time_base); } - else if ( input_code_pressed_once(KEYCODE_Z) ) + else if ( input_code_pressed_once(device->machine, KEYCODE_Z) ) { if (m6295_key_delay >= (0x80 * oki_time_base)) { diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c index 27da31035ae..bc10adf02d3 100644 --- a/src/mame/drivers/lastfght.c +++ b/src/mame/drivers/lastfght.c @@ -95,11 +95,11 @@ static VIDEO_UPDATE( lastfght ) UINT8 *gfxdata = memory_region( screen->machine, "gfx1" ); UINT8 data; - if ( input_code_pressed_once(KEYCODE_ENTER) ) view_roms ^= 1; + if ( input_code_pressed_once(screen->machine, KEYCODE_ENTER) ) view_roms ^= 1; if ( view_roms ) { - if ( input_code_pressed_once(KEYCODE_PGDN) ) base += 512 * 256; - if ( input_code_pressed_once(KEYCODE_PGUP) ) base -= 512 * 256; + if ( input_code_pressed_once(screen->machine, KEYCODE_PGDN) ) base += 512 * 256; + if ( input_code_pressed_once(screen->machine, KEYCODE_PGUP) ) base -= 512 * 256; base %= memory_region_length( screen->machine, "gfx1" ); count = base; diff --git a/src/mame/drivers/magicard.c b/src/mame/drivers/magicard.c index f41633b3a61..3edf8530b0c 100644 --- a/src/mame/drivers/magicard.c +++ b/src/mame/drivers/magicard.c @@ -517,9 +517,9 @@ static MACHINE_RESET( magicard ) /*Probably there's a mask somewhere if it REALLY uses irqs at all...irq vectors dynamically changes after some time.*/ static INTERRUPT_GEN( magicard_irq ) { - if(input_code_pressed(KEYCODE_Z)) //vblank? + if(input_code_pressed(device->machine, KEYCODE_Z)) //vblank? cpu_set_input_line_and_vector(device, 1, HOLD_LINE,0xe4/4); - if(input_code_pressed(KEYCODE_X)) //uart irq + if(input_code_pressed(device->machine, KEYCODE_X)) //uart irq cpu_set_input_line_and_vector(device, 1, HOLD_LINE,0xf0/4); } diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c index c237f3c5668..2c6026e231d 100644 --- a/src/mame/drivers/mazerbla.c +++ b/src/mame/drivers/mazerbla.c @@ -166,31 +166,31 @@ VIDEO_UPDATE( test_vcu ) bitmap_fill(tmpbitmaps[0],NULL,color_base); - if (input_code_pressed_once(KEYCODE_1)) /* plane 1 */ + if (input_code_pressed_once(screen->machine, KEYCODE_1)) /* plane 1 */ planes_enabled[0] ^= 1; - if (input_code_pressed_once(KEYCODE_2)) /* plane 2 */ + if (input_code_pressed_once(screen->machine, KEYCODE_2)) /* plane 2 */ planes_enabled[1] ^= 1; - if (input_code_pressed_once(KEYCODE_3)) /* plane 3 */ + if (input_code_pressed_once(screen->machine, KEYCODE_3)) /* plane 3 */ planes_enabled[2] ^= 1; - if (input_code_pressed_once(KEYCODE_4)) /* plane 4 */ + if (input_code_pressed_once(screen->machine, KEYCODE_4)) /* plane 4 */ planes_enabled[3] ^= 1; - if (input_code_pressed_once(KEYCODE_I)) /* show/hide debug info */ + if (input_code_pressed_once(screen->machine, KEYCODE_I)) /* show/hide debug info */ dbg_info = !dbg_info; - if (input_code_pressed_once(KEYCODE_G)) /* enable gfx area handling */ + if (input_code_pressed_once(screen->machine, KEYCODE_G)) /* enable gfx area handling */ dbg_gfx_e = !dbg_gfx_e; - if (input_code_pressed_once(KEYCODE_C)) /* enable color area handling */ + if (input_code_pressed_once(screen->machine, KEYCODE_C)) /* enable color area handling */ dbg_clr_e = !dbg_clr_e; - if (input_code_pressed_once(KEYCODE_V)) /* draw only when vbank==dbg_vbank */ + if (input_code_pressed_once(screen->machine, KEYCODE_V)) /* draw only when vbank==dbg_vbank */ dbg_vbank ^= 1; - if (input_code_pressed_once(KEYCODE_L)) /* showlookup ram */ + if (input_code_pressed_once(screen->machine, KEYCODE_L)) /* showlookup ram */ dbg_lookup = (dbg_lookup+1)%5;//0,1,2,3, 4-off diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c index 8486512a12a..0fb3a0e3bca 100644 --- a/src/mame/drivers/meritm.c +++ b/src/mame/drivers/meritm.c @@ -369,12 +369,12 @@ static VIDEO_START( meritm ) static VIDEO_UPDATE( meritm ) { - if(input_code_pressed_once(KEYCODE_Q)) + if(input_code_pressed_once(screen->machine, KEYCODE_Q)) { layer0_enabled^=1; popmessage("Layer 0 %sabled",layer0_enabled ? "en" : "dis"); } - if(input_code_pressed_once(KEYCODE_W)) + if(input_code_pressed_once(screen->machine, KEYCODE_W)) { layer1_enabled^=1; popmessage("Layer 1 %sabled",layer1_enabled ? "en" : "dis"); diff --git a/src/mame/drivers/midas.c b/src/mame/drivers/midas.c index 2ab2eea935b..5f059a23423 100644 --- a/src/mame/drivers/midas.c +++ b/src/mame/drivers/midas.c @@ -161,11 +161,11 @@ static VIDEO_UPDATE( livequiz ) int layers_ctrl = -1; #if MIDAS_DEBUG - if ( input_code_pressed(KEYCODE_Z) ) + if ( input_code_pressed(screen->machine, KEYCODE_Z) ) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1 << 0; // for tmap - if (input_code_pressed(KEYCODE_A)) msk |= 1 << 1; // for sprites + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1 << 0; // for tmap + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 1 << 1; // for sprites if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c index 9fc80819d83..7b396231108 100644 --- a/src/mame/drivers/pntnpuzl.c +++ b/src/mame/drivers/pntnpuzl.c @@ -196,43 +196,44 @@ static VIDEO_UPDATE( pntnpuzl ) static int xxx=0x18f; static int yyy=512; static int sss=0xa8; -/* - if ( input_code_pressed_once(KEYCODE_Q) ) - { - xxx--; - mame_printf_debug("xxx %04x\n",xxx); - } - - if ( input_code_pressed_once(KEYCODE_W) ) - { - xxx++; - mame_printf_debug("xxx %04x\n",xxx); - } - - if ( input_code_pressed_once(KEYCODE_A) ) - { - yyy--; - mame_printf_debug("yyy %04x\n",yyy); - } - - if ( input_code_pressed_once(KEYCODE_S) ) - { - yyy++; - mame_printf_debug("yyy %04x\n",yyy); - } - - if ( input_code_pressed_once(KEYCODE_Z) ) - { - sss--; - mame_printf_debug("sss %04x\n",sss); - } - - if ( input_code_pressed_once(KEYCODE_X) ) - { - sss++; - mame_printf_debug("sss %04x\n",sss); - } -*/ + +#if 0 + if ( input_code_pressed_once(screen->machine, KEYCODE_Q) ) + { + xxx--; + mame_printf_debug("xxx %04x\n",xxx); + } + + if ( input_code_pressed_once(screen->machine, KEYCODE_W) ) + { + xxx++; + mame_printf_debug("xxx %04x\n",xxx); + } + + if ( input_code_pressed_once(screen->machine, KEYCODE_A) ) + { + yyy--; + mame_printf_debug("yyy %04x\n",yyy); + } + + if ( input_code_pressed_once(screen->machine, KEYCODE_S) ) + { + yyy++; + mame_printf_debug("yyy %04x\n",yyy); + } + + if ( input_code_pressed_once(screen->machine, KEYCODE_Z) ) + { + sss--; + mame_printf_debug("sss %04x\n",sss); + } + + if ( input_code_pressed_once(screen->machine, KEYCODE_X) ) + { + sss++; + mame_printf_debug("sss %04x\n",sss); + } +#endif count=sss; diff --git a/src/mame/drivers/quizpun2.c b/src/mame/drivers/quizpun2.c index 2c8e9232b9f..5d462a00aa8 100644 --- a/src/mame/drivers/quizpun2.c +++ b/src/mame/drivers/quizpun2.c @@ -90,11 +90,11 @@ static VIDEO_UPDATE(quizpun2) int layers_ctrl = -1; #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z)) + if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c index 7d65cffb3e1..e7fa5d889fa 100644 --- a/src/mame/drivers/raiden2.c +++ b/src/mame/drivers/raiden2.c @@ -175,11 +175,11 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta // static int ytlim = 1; // static int xtlim = 1; -// if ( input_code_pressed_once(KEYCODE_Q) ) ytlim--; -// if ( input_code_pressed_once(KEYCODE_W) ) ytlim++; +// if ( input_code_pressed_once(machine, KEYCODE_Q) ) ytlim--; +// if ( input_code_pressed_once(machine, KEYCODE_W) ) ytlim++; -// if ( input_code_pressed_once(KEYCODE_A) ) xtlim--; -// if ( input_code_pressed_once(KEYCODE_S) ) xtlim++; +// if ( input_code_pressed_once(machine, KEYCODE_A) ) xtlim--; +// if ( input_code_pressed_once(machine, KEYCODE_S) ) xtlim++; /*00 ???? ???? (colour / priority?) @@ -454,80 +454,80 @@ static VIDEO_UPDATE ( raiden2 ) int mod = 0; tick = 0; - if(input_code_pressed(KEYCODE_R)) { + if(input_code_pressed(screen->machine, KEYCODE_R)) { mod = 1; bg_bank++; if(bg_bank == 8) bg_bank = 0; } - if(input_code_pressed(KEYCODE_T)) { + if(input_code_pressed(screen->machine, KEYCODE_T)) { mod = 1; if(bg_bank == 0) bg_bank = 8; bg_bank--; } - if(input_code_pressed(KEYCODE_Y)) { + if(input_code_pressed(screen->machine, KEYCODE_Y)) { mod = 1; mid_bank++; if(mid_bank == 8) mid_bank = 0; } - if(input_code_pressed(KEYCODE_U)) { + if(input_code_pressed(screen->machine, KEYCODE_U)) { mod = 1; if(mid_bank == 0) mid_bank = 8; mid_bank--; } - if(input_code_pressed(KEYCODE_O)) { + if(input_code_pressed(screen->machine, KEYCODE_O)) { mod = 1; fg_bank++; if(fg_bank == 8) fg_bank = 0; } - if(input_code_pressed(KEYCODE_I)) { + if(input_code_pressed(screen->machine, KEYCODE_I)) { mod = 1; if(fg_bank == 0) fg_bank = 8; fg_bank--; } - if(input_code_pressed(KEYCODE_D)) { + if(input_code_pressed(screen->machine, KEYCODE_D)) { mod = 1; bg_col++; if(bg_col == 8) bg_col = 0; } - if(input_code_pressed(KEYCODE_F)) { + if(input_code_pressed(screen->machine, KEYCODE_F)) { mod = 1; if(bg_col == 0) bg_col = 8; bg_col--; } - if(input_code_pressed(KEYCODE_G)) { + if(input_code_pressed(screen->machine, KEYCODE_G)) { mod = 1; mid_col++; if(mid_col == 8) mid_col = 0; } - if(input_code_pressed(KEYCODE_H)) { + if(input_code_pressed(screen->machine, KEYCODE_H)) { mod = 1; if(mid_col == 0) mid_col = 8; mid_col--; } - if(input_code_pressed(KEYCODE_J)) { + if(input_code_pressed(screen->machine, KEYCODE_J)) { mod = 1; fg_col++; if(fg_col == 8) fg_col = 0; } - if(input_code_pressed(KEYCODE_K)) { + if(input_code_pressed(screen->machine, KEYCODE_K)) { mod = 1; if(fg_col == 0) fg_col = 8; fg_col--; } - if(mod || input_code_pressed(KEYCODE_L)) { + if(mod || input_code_pressed(screen->machine, KEYCODE_L)) { popmessage("b:%x.%x m:%x.%x f:%x.%x %d%d%d", bg_bank, bg_col, mid_bank, mid_col, fg_bank, fg_col, info_1, info_2, info_3); tilemap_mark_all_tiles_dirty(background_layer); tilemap_mark_all_tiles_dirty(midground_layer); @@ -539,16 +539,16 @@ static VIDEO_UPDATE ( raiden2 ) bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); - if (!input_code_pressed(KEYCODE_Q)) + if (!input_code_pressed(screen->machine, KEYCODE_Q)) tilemap_draw(bitmap, cliprect, background_layer, 0, 0); - if (!input_code_pressed(KEYCODE_W)) + if (!input_code_pressed(screen->machine, KEYCODE_W)) tilemap_draw(bitmap, cliprect, midground_layer, 0, 0); - if (!input_code_pressed(KEYCODE_E)) + if (!input_code_pressed(screen->machine, KEYCODE_E)) tilemap_draw(bitmap, cliprect, foreground_layer, 0, 0); draw_sprites(screen->machine, bitmap, cliprect, 0); - if (!input_code_pressed(KEYCODE_A)) + if (!input_code_pressed(screen->machine, KEYCODE_A)) tilemap_draw(bitmap, cliprect, text_layer, 0, 0); return 0; diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c index d9f4e83ac89..8969634324d 100644 --- a/src/mame/drivers/segaybd.c +++ b/src/mame/drivers/segaybd.c @@ -177,10 +177,10 @@ static TIMER_CALLBACK( scanline_callback ) int old = irq2_scanline; /* Q = -10 scanlines, W = -1 scanline, E = +1 scanline, R = +10 scanlines */ - if (input_code_pressed(KEYCODE_Q)) { while (input_code_pressed(KEYCODE_Q)) ; irq2_scanline -= 10; } - if (input_code_pressed(KEYCODE_W)) { while (input_code_pressed(KEYCODE_W)) ; irq2_scanline -= 1; } - if (input_code_pressed(KEYCODE_E)) { while (input_code_pressed(KEYCODE_E)) ; irq2_scanline += 1; } - if (input_code_pressed(KEYCODE_R)) { while (input_code_pressed(KEYCODE_R)) ; irq2_scanline += 10; } + if (input_code_pressed(machine, KEYCODE_Q)) { while (input_code_pressed(machine, KEYCODE_Q)) ; irq2_scanline -= 10; } + if (input_code_pressed(machine, KEYCODE_W)) { while (input_code_pressed(machine, KEYCODE_W)) ; irq2_scanline -= 1; } + if (input_code_pressed(machine, KEYCODE_E)) { while (input_code_pressed(machine, KEYCODE_E)) ; irq2_scanline += 1; } + if (input_code_pressed(machine, KEYCODE_R)) { while (input_code_pressed(machine, KEYCODE_R)) ; irq2_scanline += 10; } if (old != irq2_scanline) popmessage("scanline = %d", irq2_scanline); } diff --git a/src/mame/drivers/spoker.c b/src/mame/drivers/spoker.c index 1f2c1a7bf24..89c31f65ba5 100644 --- a/src/mame/drivers/spoker.c +++ b/src/mame/drivers/spoker.c @@ -84,7 +84,7 @@ static int nmi_enable, hopper; static CUSTOM_INPUT( hopper_r ) { if (hopper) return !(video_screen_get_frame_number(field->port->machine->primary_screen)%10); - return input_code_pressed(KEYCODE_H); + return input_code_pressed(field->port->machine, KEYCODE_H); } static UINT8 out[3]; diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c index 6ce898a5220..a2327f0b8ef 100644 --- a/src/mame/drivers/srmp6.c +++ b/src/mame/drivers/srmp6.c @@ -162,13 +162,13 @@ static VIDEO_UPDATE(srmp6) #if 0 /* debug */ - if(input_code_pressed_once(KEYCODE_Q)) + if(input_code_pressed_once(screen->machine, KEYCODE_Q)) { ++xixi; printf("%x\n",xixi); } - if(input_code_pressed_once(KEYCODE_W)) + if(input_code_pressed_once(screen->machine, KEYCODE_W)) { --xixi; printf("%x\n",xixi); @@ -259,7 +259,7 @@ static VIDEO_UPDATE(srmp6) memcpy(sprram_old, sprram, 0x80000); - if(input_code_pressed_once(KEYCODE_Q)) + if(input_code_pressed_once(screen->machine, KEYCODE_Q)) { FILE *p=fopen("tileram.bin","wb"); fwrite(tileram,1,0x100000*16,p); diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c index 8aa3eb5011a..35157dc4c48 100644 --- a/src/mame/drivers/tmaster.c +++ b/src/mame/drivers/tmaster.c @@ -298,11 +298,11 @@ static VIDEO_UPDATE( tmaster ) int layers_ctrl = -1; #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z)) + if (input_code_pressed(screen->machine, KEYCODE_Z)) { int mask = 0; - if (input_code_pressed(KEYCODE_Q)) mask |= 1; - if (input_code_pressed(KEYCODE_W)) mask |= 2; + if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; if (mask != 0) layers_ctrl &= mask; } #endif diff --git a/src/mame/drivers/wheelfir.c b/src/mame/drivers/wheelfir.c index fc30791779b..207b731b29b 100644 --- a/src/mame/drivers/wheelfir.c +++ b/src/mame/drivers/wheelfir.c @@ -292,10 +292,10 @@ static VIDEO_UPDATE(wheelfir) int x,y; static int base = 0; - if ( input_code_pressed_once(KEYCODE_E) ) + if ( input_code_pressed_once(screen->machine, KEYCODE_E) ) base += 512*512; - if ( input_code_pressed_once(KEYCODE_Q) ) + if ( input_code_pressed_once(screen->machine, KEYCODE_Q) ) base -= 512*512; if (base<0x000000) base = 0x000000; @@ -306,7 +306,7 @@ static VIDEO_UPDATE(wheelfir) copybitmap_trans(bitmap, wheelfir_tmp_bitmap[0], 0, 0, 0, 0, cliprect, 0); bitmap_fill(wheelfir_tmp_bitmap[0], video_screen_get_visible_area(screen),0); - if ( input_code_pressed(KEYCODE_R) ) + if ( input_code_pressed(screen->machine, KEYCODE_R) ) { const UINT8 *gfx = memory_region(machine, "gfx1"); for (y=0;y<128;y++) diff --git a/src/mame/includes/deco16ic.h b/src/mame/includes/deco16ic.h index 5da962f0c07..58589814d24 100644 --- a/src/mame/includes/deco16ic.h +++ b/src/mame/includes/deco16ic.h @@ -57,4 +57,4 @@ WRITE16_HANDLER( deco16_priority_w ); READ16_HANDLER( deco16_71_r ); -void deco16_print_debug_info(bitmap_t *bitmap); +void deco16_print_debug_info(running_machine *machine, bitmap_t *bitmap); diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c index 315ceff951a..ed70ee7de68 100644 --- a/src/mame/machine/atarigen.c +++ b/src/mame/machine/atarigen.c @@ -1074,7 +1074,7 @@ static TIMER_CALLBACK( atarivc_eof_update ) /* use this for debugging the video controller values */ #if 0 - if (input_code_pressed(KEYCODE_8)) + if (input_code_pressed(machine, KEYCODE_8)) { static FILE *out; if (!out) out = fopen("scroll.log", "w"); diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c index 974fa3afc3d..b148921aca6 100644 --- a/src/mame/machine/harddriv.c +++ b/src/mame/machine/harddriv.c @@ -379,7 +379,7 @@ READ16_HANDLER( hdc68k_wheel_r ) UINT16 new_wheel = input_port_read(space->machine, "12BADC0") << 4; /* hack to display the wheel position */ - if (input_code_pressed(KEYCODE_LSHIFT)) + if (input_code_pressed(space->machine, KEYCODE_LSHIFT)) popmessage("%04X", new_wheel); /* if we crossed the center line, latch the edge bit */ @@ -888,7 +888,7 @@ WRITE16_HANDLER( hd68k_adsp_buffer_w ) static TIMER_CALLBACK( deferred_adsp_bank_switch ) { - if (LOG_COMMANDS && m68k_adsp_buffer_bank != param && input_code_pressed(KEYCODE_L)) + if (LOG_COMMANDS && m68k_adsp_buffer_bank != param && input_code_pressed(machine, KEYCODE_L)) { static FILE *commands; if (!commands) commands = fopen("commands.log", "w"); diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c index f77c6762936..dd447943039 100644 --- a/src/mame/machine/seicop.c +++ b/src/mame/machine/seicop.c @@ -1271,8 +1271,8 @@ READ16_HANDLER( heatbrl_mcu_r ) *********************************************************************/ case (0x180/2): { return xy_check; } /*hit protection*/ - case (0x182/2): { if(input_code_pressed(KEYCODE_X)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ - case (0x184/2): { if(input_code_pressed(KEYCODE_C)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ + case (0x182/2): { if(input_code_pressed(space->machine, KEYCODE_X)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ + case (0x184/2): { if(input_code_pressed(space->machine, KEYCODE_C)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ case (0x1b0/2): return (0xffff); /* bit 15 is branched on a few times in the $1938 area */ case (0x1b4/2): return (0xffff); /* read at $1932 and stored in ram before +0x5b0 bit 15 tested */ diff --git a/src/mame/video/amiga.c b/src/mame/video/amiga.c index 5388ff8b841..498e9929e7d 100644 --- a/src/mame/video/amiga.c +++ b/src/mame/video/amiga.c @@ -962,9 +962,9 @@ void amiga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanl #if GUESS_COPPER_OFFSET if (video_screen_get_frame_number(machine->primary_screen) % 64 == 0 && scanline == 0) { - if (input_code_pressed(KEYCODE_Q)) + if (input_code_pressed(machine, KEYCODE_Q)) popmessage("%d", wait_offset -= 1); - if (input_code_pressed(KEYCODE_W)) + if (input_code_pressed(machine, KEYCODE_W)) popmessage("%d", wait_offset += 1); } #endif diff --git a/src/mame/video/amigaaga.c b/src/mame/video/amigaaga.c index 62e3a1ace4f..be0896e6ce3 100644 --- a/src/mame/video/amigaaga.c +++ b/src/mame/video/amigaaga.c @@ -1161,9 +1161,9 @@ void amiga_aga_render_scanline(running_machine *machine, bitmap_t *bitmap, int s #if GUESS_COPPER_OFFSET if (video_screen_get_frame_number(machine->primary_screen) % 64 == 0 && scanline == 0) { - if (input_code_pressed(KEYCODE_Q)) + if (input_code_pressed(machine, KEYCODE_Q)) popmessage("%d", wait_offset -= 1); - if (input_code_pressed(KEYCODE_W)) + if (input_code_pressed(machine, KEYCODE_W)) popmessage("%d", wait_offset += 1); } #endif diff --git a/src/mame/video/argus.c b/src/mame/video/argus.c index 47cdc65d043..9a4654fcab0 100644 --- a/src/mame/video/argus.c +++ b/src/mame/video/argus.c @@ -1152,12 +1152,12 @@ static void butasan_draw_sprites(running_machine *machine, bitmap_t *bitmap, con } -#ifdef MAME_DEBUG -static void butasan_log_vram(void) +static void butasan_log_vram(running_machine *machine) { +#ifdef MAME_DEBUG int offs; - if (input_code_pressed(KEYCODE_M)) + if (input_code_pressed(machine, KEYCODE_M)) { int i; logerror("\nSprite RAM\n"); @@ -1201,8 +1201,8 @@ static void butasan_log_vram(void) } } } -} #endif +} VIDEO_UPDATE( argus ) { @@ -1245,8 +1245,6 @@ VIDEO_UPDATE( butasan ) butasan_draw_sprites(screen->machine, bitmap, cliprect); tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0); -#ifdef MAME_DEBUG - butasan_log_vram(); -#endif + butasan_log_vram(screen->machine); return 0; } diff --git a/src/mame/video/blmbycar.c b/src/mame/video/blmbycar.c index 230ae809c71..ab34328d732 100644 --- a/src/mame/video/blmbycar.c +++ b/src/mame/video/blmbycar.c @@ -230,14 +230,14 @@ VIDEO_UPDATE( blmbycar ) tilemap_set_scrollx( tilemap_1, 0, blmbycar_scroll_1[ 1 ]+5); #ifdef MAME_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; -// if (input_code_pressed(KEYCODE_E)) msk |= 4; - if (input_code_pressed(KEYCODE_A)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; +// if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/video/btoads.c b/src/mame/video/btoads.c index e53b2e08468..850b906ffd5 100644 --- a/src/mame/video/btoads.c +++ b/src/mame/video/btoads.c @@ -524,14 +524,14 @@ void btoads_scanline_update(const device_config *screen, bitmap_t *bitmap, int s #if BT_DEBUG popmessage("screen_control = %02X", screen_control & 0x7f); - if (input_code_pressed(KEYCODE_X)) + if (input_code_pressed(screen->machine, KEYCODE_X)) { static int count = 0; char name[10]; FILE *f; int i; - while (input_code_pressed(KEYCODE_X)) ; + while (input_code_pressed(screen->machine, KEYCODE_X)) ; sprintf(name, "disp%d.log", count++); f = fopen(name, "w"); diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c index 890fb6d85fb..e121890d12d 100644 --- a/src/mame/video/cave.c +++ b/src/mame/video/cave.c @@ -1491,23 +1491,23 @@ VIDEO_UPDATE( cave ) #ifdef MAME_DEBUG { static int rasflag, old_rasflag; - if ( input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X) || input_code_pressed(KEYCODE_C) || - input_code_pressed(KEYCODE_V) || input_code_pressed(KEYCODE_B) ) + if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) || input_code_pressed(screen->machine, KEYCODE_C) || + input_code_pressed(screen->machine, KEYCODE_V) || input_code_pressed(screen->machine, KEYCODE_B) ) { int msk = 0, val = 0; - if (input_code_pressed(KEYCODE_X)) val = 1; // priority 0 only - if (input_code_pressed(KEYCODE_C)) val = 2; // "" 1 - if (input_code_pressed(KEYCODE_V)) val = 4; // "" 2 - if (input_code_pressed(KEYCODE_B)) val = 8; // "" 3 + if (input_code_pressed(screen->machine, KEYCODE_X)) val = 1; // priority 0 only + if (input_code_pressed(screen->machine, KEYCODE_C)) val = 2; // "" 1 + if (input_code_pressed(screen->machine, KEYCODE_V)) val = 4; // "" 2 + if (input_code_pressed(screen->machine, KEYCODE_B)) val = 8; // "" 3 - if (input_code_pressed(KEYCODE_Z)) val = 1|2|4|8; // All of the above priorities + if (input_code_pressed(screen->machine, KEYCODE_Z)) val = 1|2|4|8; // All of the above priorities - if (input_code_pressed(KEYCODE_Q)) msk |= val << 0; // for layer 0 - if (input_code_pressed(KEYCODE_W)) msk |= val << 4; // for layer 1 - if (input_code_pressed(KEYCODE_E)) msk |= val << 8; // for layer 2 - if (input_code_pressed(KEYCODE_R)) msk |= val << 12; // for layer 3 - if (input_code_pressed(KEYCODE_A)) msk |= val << 16; // for sprites + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= val << 0; // for layer 0 + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= val << 4; // for layer 1 + if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= val << 8; // for layer 2 + if (input_code_pressed(screen->machine, KEYCODE_R)) msk |= val << 12; // for layer 3 + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= val << 16; // for sprites if (msk != 0) layers_ctrl &= msk; #if 1 diff --git a/src/mame/video/cischeat.c b/src/mame/video/cischeat.c index 569428f6705..b0056a631d0 100644 --- a/src/mame/video/cischeat.c +++ b/src/mame/video/cischeat.c @@ -872,7 +872,7 @@ static void cischeat_draw_sprites(running_machine *machine, bitmap_t *bitmap , c /* dimension of a tile after zoom */ #ifdef MAME_DEBUG - if ( input_code_pressed(KEYCODE_Z) && input_code_pressed(KEYCODE_M) ) + if ( input_code_pressed(machine, KEYCODE_Z) && input_code_pressed(machine, KEYCODE_M) ) { xdim = 16 << 16; ydim = 16 << 16; @@ -938,7 +938,7 @@ if ( (debugsprites) && ( ((attr & 0x0300)>>8) != (debugsprites-1) ) ) { continu } #ifdef MAME_DEBUG #if 0 -if (input_code_pressed(KEYCODE_X)) +if (input_code_pressed(machine, KEYCODE_X)) { /* Display some info on each sprite */ sprintf(buf, "%04x",attr); ui_draw_text(buf, sx>>16, sy>>16); @@ -1028,7 +1028,7 @@ static void bigrun_draw_sprites(running_machine *machine, bitmap_t *bitmap , con /* dimension of a tile after zoom */ #ifdef MAME_DEBUG - if ( input_code_pressed(KEYCODE_Z) && input_code_pressed(KEYCODE_M) ) + if ( input_code_pressed(machine, KEYCODE_Z) && input_code_pressed(machine, KEYCODE_M) ) { xdim = 16 << 16; ydim = 16 << 16; @@ -1092,7 +1092,7 @@ if ( (debugsprites) && ( ((attr & 0x0300)>>8) != (debugsprites-1) ) ) { continu } #ifdef MAME_DEBUG #if 0 -if (input_code_pressed(KEYCODE_X)) +if (input_code_pressed(machine, KEYCODE_X)) { /* Display some info on each sprite */ sprintf(buf, "%04x",attr); ui_draw_text(buf, sx>>16, sy>>16); @@ -1113,25 +1113,25 @@ if (input_code_pressed(KEYCODE_X)) #define CISCHEAT_LAYERSCTRL \ debugsprites = 0; \ -if ( input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X) ) \ +if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) ) \ { \ int msk = 0; \ - if (input_code_pressed(KEYCODE_Q)) { msk |= 0x01;} \ - if (input_code_pressed(KEYCODE_W)) { msk |= 0x02;} \ - if (input_code_pressed(KEYCODE_E)) { msk |= 0x04;} \ - if (input_code_pressed(KEYCODE_A)) { msk |= 0x08; debugsprites = 1;} \ - if (input_code_pressed(KEYCODE_S)) { msk |= 0x08; debugsprites = 2;} \ - if (input_code_pressed(KEYCODE_D)) { msk |= 0x08; debugsprites = 3;} \ - if (input_code_pressed(KEYCODE_F)) { msk |= 0x08; debugsprites = 4;} \ - if (input_code_pressed(KEYCODE_R)) { msk |= 0x10;} \ - if (input_code_pressed(KEYCODE_T)) { msk |= 0x20;} \ + if (input_code_pressed(screen->machine, KEYCODE_Q)) { msk |= 0x01;} \ + if (input_code_pressed(screen->machine, KEYCODE_W)) { msk |= 0x02;} \ + if (input_code_pressed(screen->machine, KEYCODE_E)) { msk |= 0x04;} \ + if (input_code_pressed(screen->machine, KEYCODE_A)) { msk |= 0x08; debugsprites = 1;} \ + if (input_code_pressed(screen->machine, KEYCODE_S)) { msk |= 0x08; debugsprites = 2;} \ + if (input_code_pressed(screen->machine, KEYCODE_D)) { msk |= 0x08; debugsprites = 3;} \ + if (input_code_pressed(screen->machine, KEYCODE_F)) { msk |= 0x08; debugsprites = 4;} \ + if (input_code_pressed(screen->machine, KEYCODE_R)) { msk |= 0x10;} \ + if (input_code_pressed(screen->machine, KEYCODE_T)) { msk |= 0x20;} \ \ if (msk != 0) megasys1_active_layers &= msk; \ } \ \ { \ static int show_unknown; \ - if ( input_code_pressed(KEYCODE_Z) && input_code_pressed_once(KEYCODE_U) ) \ + if ( input_code_pressed(screen->machine, KEYCODE_Z) && input_code_pressed_once(screen->machine, KEYCODE_U) ) \ show_unknown ^= 1; \ if (show_unknown) \ popmessage("0:%04X 2:%04X 4:%04X 6:%04X c:%04X", \ @@ -1327,16 +1327,16 @@ VIDEO_UPDATE( scudhamm ) #ifdef MAME_DEBUG debugsprites = 0; -if ( input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X) ) +if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) ) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) { msk |= 0x1;} - if (input_code_pressed(KEYCODE_W)) { msk |= 0x2;} - if (input_code_pressed(KEYCODE_E)) { msk |= 0x4;} - if (input_code_pressed(KEYCODE_A)) { msk |= 0x8; debugsprites = 1;} - if (input_code_pressed(KEYCODE_S)) { msk |= 0x8; debugsprites = 2;} - if (input_code_pressed(KEYCODE_D)) { msk |= 0x8; debugsprites = 3;} - if (input_code_pressed(KEYCODE_F)) { msk |= 0x8; debugsprites = 4;} + if (input_code_pressed(screen->machine, KEYCODE_Q)) { msk |= 0x1;} + if (input_code_pressed(screen->machine, KEYCODE_W)) { msk |= 0x2;} + if (input_code_pressed(screen->machine, KEYCODE_E)) { msk |= 0x4;} + if (input_code_pressed(screen->machine, KEYCODE_A)) { msk |= 0x8; debugsprites = 1;} + if (input_code_pressed(screen->machine, KEYCODE_S)) { msk |= 0x8; debugsprites = 2;} + if (input_code_pressed(screen->machine, KEYCODE_D)) { msk |= 0x8; debugsprites = 3;} + if (input_code_pressed(screen->machine, KEYCODE_F)) { msk |= 0x8; debugsprites = 4;} if (msk != 0) megasys1_active_layers &= msk; #if 1 diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index 21d90b22b42..2041535cd0d 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -2469,7 +2469,7 @@ static void cps2_render_sprites(running_machine *machine, bitmap_t *bitmap,const int yoffs = 16-cps2_port(CPS2_OBJ_YOFFS); #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z) && input_code_pressed(KEYCODE_R)) + if (input_code_pressed(machine, KEYCODE_Z) && input_code_pressed(machine, KEYCODE_R)) { return; } @@ -2795,7 +2795,7 @@ if ( (cps2_port(CPS2_OBJ_BASE) != 0x7080 && cps2_port(CPS2_OBJ_BASE) != 0x7000) cps2_port(CPS2_OBJ_UK1), cps2_port(CPS2_OBJ_UK2)); -if (0 && input_code_pressed(KEYCODE_Z)) +if (0 && input_code_pressed(screen->machine, KEYCODE_Z)) popmessage("order: %d (%d) %d (%d) %d (%d) %d (%d)",l0,l0pri,l1,l1pri,l2,l2pri,l3,l3pri); #endif diff --git a/src/mame/video/deco16ic.c b/src/mame/video/deco16ic.c index 6b73a051bfe..711ec2b507f 100644 --- a/src/mame/video/deco16ic.c +++ b/src/mame/video/deco16ic.c @@ -800,11 +800,11 @@ void deco16_pf34_update(const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2 /*****************************************************************************************/ -void deco16_print_debug_info(bitmap_t *bitmap) +void deco16_print_debug_info(running_machine *machine, bitmap_t *bitmap) { char buf[64*5]; - if (input_code_pressed(KEYCODE_O)) + if (input_code_pressed(machine, KEYCODE_O)) return; if (deco16_pf12_control) { diff --git a/src/mame/video/deco_mlc.c b/src/mame/video/deco_mlc.c index 2399926ff87..0ea88fb7b8a 100644 --- a/src/mame/video/deco_mlc.c +++ b/src/mame/video/deco_mlc.c @@ -32,7 +32,7 @@ VIDEO_START( mlc ) } #ifdef UNUSED_FUNCTION -static void blitRaster(bitmap_t *bitmap, int rasterMode) +static void blitRaster(running_machine *machine, bitmap_t *bitmap, int rasterMode) { int x,y; for (y=0; y<256; y++) //todo @@ -41,7 +41,7 @@ static void blitRaster(bitmap_t *bitmap, int rasterMode) UINT32* dst=BITMAP_ADDR32(bitmap, y, 0); UINT32 xptr=(mlc_raster_table[0][y]<<13); - if (input_code_pressed(KEYCODE_X)) + if (input_code_pressed(machine, KEYCODE_X)) xptr=0; for (x=0; x<320; x++) @@ -49,7 +49,7 @@ static void blitRaster(bitmap_t *bitmap, int rasterMode) if (src[x]) dst[x]=src[(xptr>>16)&0x1ff]; - //if (input_code_pressed(KEYCODE_X)) + //if (input_code_pressed(machine, KEYCODE_X)) // xptr+=0x10000; //else if(rasterHackTest[0][y]<0) xptr+=0x10000 - ((mlc_raster_table[2][y]&0x3ff)<<5); @@ -499,7 +499,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan // if (lastRasterMode!=0 && rasterDirty) // { -// blitRaster(bitmap, rasterMode); +// blitRaster(machine, bitmap, rasterMode); // bitmap_fill(temp_bitmap,cliprect,0); // rasterDirty=0; // } diff --git a/src/mame/video/decocass.c b/src/mame/video/decocass.c index 6f996a50280..ff89b1ab4b0 100644 --- a/src/mame/video/decocass.c +++ b/src/mame/video/decocass.c @@ -537,7 +537,7 @@ VIDEO_UPDATE( decocass ) #ifdef MAME_DEBUG { static int showmsg; - if (input_code_pressed_once(KEYCODE_I)) + if (input_code_pressed_once(screen->machine, KEYCODE_I)) showmsg ^= 1; if (showmsg) popmessage("mode:$%02x cm:$%02x ccb:$%02x h:$%02x vl:$%02x vr:$%02x ph:$%02x pv:$%02x ch:$%02x cv:$%02x", diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c index a4bd480efe0..715986b7c9a 100644 --- a/src/mame/video/dynax.c +++ b/src/mame/video/dynax.c @@ -1053,20 +1053,20 @@ WRITE8_HANDLER( tenkai_priority_w ) hanamai_priority = BITSWAP8(data, 3,2,1,0, 4,7,5,6); } -static int debug_mask(void) +static int debug_mask(running_machine *machine) { #ifdef MAME_DEBUG int msk = 0; - if (input_code_pressed(KEYCODE_Z)) + if (input_code_pressed(machine, KEYCODE_Z)) { - if (input_code_pressed(KEYCODE_Q)) msk |= 0x01; // layer 0 - if (input_code_pressed(KEYCODE_W)) msk |= 0x02; // layer 1 - if (input_code_pressed(KEYCODE_E)) msk |= 0x04; // layer 2 - if (input_code_pressed(KEYCODE_R)) msk |= 0x08; // layer 3 - if (input_code_pressed(KEYCODE_A)) msk |= 0x10; // layer 4 - if (input_code_pressed(KEYCODE_S)) msk |= 0x20; // layer 5 - if (input_code_pressed(KEYCODE_D)) msk |= 0x40; // layer 6 - if (input_code_pressed(KEYCODE_F)) msk |= 0x80; // layer 7 + if (input_code_pressed(machine, KEYCODE_Q)) msk |= 0x01; // layer 0 + if (input_code_pressed(machine, KEYCODE_W)) msk |= 0x02; // layer 1 + if (input_code_pressed(machine, KEYCODE_E)) msk |= 0x04; // layer 2 + if (input_code_pressed(machine, KEYCODE_R)) msk |= 0x08; // layer 3 + if (input_code_pressed(machine, KEYCODE_A)) msk |= 0x10; // layer 4 + if (input_code_pressed(machine, KEYCODE_S)) msk |= 0x20; // layer 5 + if (input_code_pressed(machine, KEYCODE_D)) msk |= 0x40; // layer 6 + if (input_code_pressed(machine, KEYCODE_F)) msk |= 0x80; // layer 7 if (msk != 0) return msk; } #endif @@ -1083,18 +1083,18 @@ static int debug_viewer(running_machine *machine, bitmap_t *bitmap,const rectang { #ifdef MAME_DEBUG static int toggle; - if (input_code_pressed_once(KEYCODE_T)) toggle = 1-toggle; + if (input_code_pressed_once(machine, KEYCODE_T)) toggle = 1-toggle; if (toggle) { UINT8 *RAM = memory_region( machine, "gfx1" ); size_t size = memory_region_length( machine, "gfx1" ); static int i = 0, c = 0, r = 0; - if (input_code_pressed_once(KEYCODE_I)) c = (c-1) & 0x1f; - if (input_code_pressed_once(KEYCODE_O)) c = (c+1) & 0x1f; - if (input_code_pressed_once(KEYCODE_R)) { r = (r+1) & 0x7; i = size/8 * r; } - if (input_code_pressed(KEYCODE_M) | input_code_pressed_once(KEYCODE_K)) { + if (input_code_pressed_once(machine, KEYCODE_I)) c = (c-1) & 0x1f; + if (input_code_pressed_once(machine, KEYCODE_O)) c = (c+1) & 0x1f; + if (input_code_pressed_once(machine, KEYCODE_R)) { r = (r+1) & 0x7; i = size/8 * r; } + if (input_code_pressed(machine, KEYCODE_M) | input_code_pressed_once(machine, KEYCODE_K)) { while( i < size && RAM[i] ) i++; while( i < size && !RAM[i] ) i++; } - if (input_code_pressed(KEYCODE_N) | input_code_pressed_once(KEYCODE_J)) { + if (input_code_pressed(machine, KEYCODE_N) | input_code_pressed_once(machine, KEYCODE_J)) { if (i >= 2) i-=2; while( i > 0 && RAM[i] ) i--; i++; } dynax_blit_palettes = (c & 0xf) * 0x111; @@ -1124,7 +1124,7 @@ VIDEO_UPDATE( hanamai ) int lay[4]; if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; - layers_ctrl &= debug_mask(); + layers_ctrl &= debug_mask(screen->machine); bitmap_fill(bitmap, cliprect, (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256); @@ -1158,7 +1158,7 @@ VIDEO_UPDATE( hnoridur ) int pri; if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; - layers_ctrl &= debug_mask(); + layers_ctrl &= debug_mask(screen->machine); bitmap_fill(bitmap, cliprect, (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 0x0f) * 256); @@ -1191,7 +1191,7 @@ VIDEO_UPDATE( sprtmtch ) int layers_ctrl = ~dynax_layer_enable; if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; - layers_ctrl &= debug_mask(); + layers_ctrl &= debug_mask(screen->machine); bitmap_fill(bitmap, cliprect, (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256); @@ -1210,7 +1210,7 @@ VIDEO_UPDATE( jantouki ) const device_config *bottom_screen = devtag_get_device(screen->machine, "bottom"); if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; - layers_ctrl &= debug_mask(); + layers_ctrl &= debug_mask(screen->machine); bitmap_fill(bitmap, cliprect, (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256); @@ -1239,7 +1239,7 @@ VIDEO_UPDATE( mjdialq2 ) int layers_ctrl = ~dynax_layer_enable; if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; - layers_ctrl &= debug_mask(); + layers_ctrl &= debug_mask(screen->machine); bitmap_fill(bitmap, cliprect, (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256); diff --git a/src/mame/video/esd16.c b/src/mame/video/esd16.c index 174777967c1..ebd9ce86498 100644 --- a/src/mame/video/esd16.c +++ b/src/mame/video/esd16.c @@ -343,11 +343,11 @@ VIDEO_UPDATE( esd16 ) tilemap_set_scrolly(esdtilemap_1, 0, esd16_scroll_1[1]); #ifdef MAME_DEBUG -if ( input_code_pressed(KEYCODE_Z) ) +if ( input_code_pressed(screen->machine, KEYCODE_Z) ) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_A)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 4; if (msk != 0) layers_ctrl &= msk; } #endif @@ -369,11 +369,11 @@ VIDEO_UPDATE( hedpanic ) #ifdef MAME_DEBUG -if ( input_code_pressed(KEYCODE_Z) ) +if ( input_code_pressed(screen->machine, KEYCODE_Z) ) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_A)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 4; if (msk != 0) layers_ctrl &= msk; } #endif @@ -431,11 +431,11 @@ VIDEO_UPDATE( hedpanio ) #ifdef MAME_DEBUG -if ( input_code_pressed(KEYCODE_Z) ) +if ( input_code_pressed(screen->machine, KEYCODE_Z) ) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_A)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 4; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/video/fitfight.c b/src/mame/video/fitfight.c index d0aac8fe704..fbfe41bc69d 100644 --- a/src/mame/video/fitfight.c +++ b/src/mame/video/fitfight.c @@ -116,13 +116,13 @@ VIDEO_UPDATE(fitfight) if (vblank > 0) bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); else { -// if (input_code_pressed(KEYCODE_Q)) +// if (input_code_pressed(screen->machine, KEYCODE_Q)) // scrollbak = ((fof_a00000[0]&0xff00) >> 5) - ((fof_700000[0] & 0x0038) >> 3); -// else if (input_code_pressed(KEYCODE_W)) +// else if (input_code_pressed(screen->machine, KEYCODE_W)) // scrollbak = ((fof_a00000[0]&0xff00) >> 5) + ((fof_700000[0] & 0x01c0) >> 6); -// else if (input_code_pressed(KEYCODE_E)) +// else if (input_code_pressed(screen->machine, KEYCODE_E)) // scrollbak = ((fof_a00000[0]&0xff00) >> 5) - ((fof_700000[0] & 0x01c0) >> 6); -// else if (input_code_pressed(KEYCODE_R)) +// else if (input_code_pressed(screen->machine, KEYCODE_R)) // scrollbak = ((fof_a00000[0]&0xff00) >> 5) + ((fof_700000[0] & 0x0038) >> 3); // else scrollbak = ((fof_a00000[0]&0xff00) >> 5); @@ -132,19 +132,19 @@ VIDEO_UPDATE(fitfight) draw_sprites(screen->machine,bitmap,cliprect,0); -// if (input_code_pressed(KEYCODE_A)) +// if (input_code_pressed(screen->machine, KEYCODE_A)) // scrollmid = ((fof_900000[0]&0xff00) >> 5) - ((fof_700000[0] & 0x01c0) >> 6); -// else if (input_code_pressed(KEYCODE_S)) +// else if (input_code_pressed(screen->machine, KEYCODE_S)) // scrollmid = ((fof_900000[0]&0xff00) >> 5) + ((fof_700000[0] & 0x0038) >> 3); -// else if (input_code_pressed(KEYCODE_D)) +// else if (input_code_pressed(screen->machine, KEYCODE_D)) // scrollmid = ((fof_900000[0]&0xff00) >> 5) - ((fof_700000[0] & 0x0038) >> 3); -// else if (input_code_pressed(KEYCODE_F)) +// else if (input_code_pressed(screen->machine, KEYCODE_F)) // scrollmid = ((fof_900000[0]&0xff00) >> 5) + ((fof_700000[0] & 0x01c0) >> 6); // else scrollmid = ((fof_900000[0]&0xff00) >> 5); tilemap_set_scrollx(fof_mid_tilemap,0, scrollmid ); tilemap_set_scrolly(fof_mid_tilemap,0, fof_900000[0]&0xff); -// if (!input_code_pressed(KEYCODE_F)) +// if (!input_code_pressed(screen->machine, KEYCODE_F)) tilemap_draw(bitmap,cliprect,fof_mid_tilemap,0,0); draw_sprites(screen->machine,bitmap,cliprect,1); diff --git a/src/mame/video/funybubl.c b/src/mame/video/funybubl.c index 57d846a3963..40ff7db281d 100644 --- a/src/mame/video/funybubl.c +++ b/src/mame/video/funybubl.c @@ -99,18 +99,18 @@ VIDEO_UPDATE(funybubl) draw_sprites(screen->machine,bitmap,cliprect); -/* - if ( input_code_pressed_once(KEYCODE_W) ) - { - FILE *fp; - - fp=fopen("funnybubsprites", "w+b"); - if (fp) - { - fwrite(&funybubl_banked_videoram[0x1000], 0x1000, 1, fp); - fclose(fp); - } - } -*/ +#if 0 + if ( input_code_pressed_once(screen->machine, KEYCODE_W) ) + { + FILE *fp; + + fp=fopen("funnybubsprites", "w+b"); + if (fp) + { + fwrite(&funybubl_banked_videoram[0x1000], 0x1000, 1, fp); + fclose(fp); + } + } +#endif return 0; } diff --git a/src/mame/video/fuukifg2.c b/src/mame/video/fuukifg2.c index 0156e92fc91..bcdcb7733c6 100644 --- a/src/mame/video/fuukifg2.c +++ b/src/mame/video/fuukifg2.c @@ -223,7 +223,7 @@ static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const re #ifdef MAME_DEBUG #if 0 -if (input_code_pressed(KEYCODE_X)) +if (input_code_pressed(screen->machine, KEYCODE_X)) { /* Display some info on each sprite */ char buf[40]; sprintf(buf, "%Xx%X %X",xnum,ynum,(attr>>6)&3); diff --git a/src/mame/video/fuukifg3.c b/src/mame/video/fuukifg3.c index ad73dd09216..c8b5e6673ad 100644 --- a/src/mame/video/fuukifg3.c +++ b/src/mame/video/fuukifg3.c @@ -223,10 +223,10 @@ static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const re else { ystart = 0; yend = ynum; yinc = +1; } #if 0 - if(!( (input_code_pressed(KEYCODE_V) && (((attr >> 6)&3) == 0)) - || (input_code_pressed(KEYCODE_B) && (((attr >> 6)&3) == 1)) - || (input_code_pressed(KEYCODE_N) && (((attr >> 6)&3) == 2)) - || (input_code_pressed(KEYCODE_M) && (((attr >> 6)&3) == 3)) + if(!( (input_code_pressed(screen->machine, KEYCODE_V) && (((attr >> 6)&3) == 0)) + || (input_code_pressed(screen->machine, KEYCODE_B) && (((attr >> 6)&3) == 1)) + || (input_code_pressed(screen->machine, KEYCODE_N) && (((attr >> 6)&3) == 2)) + || (input_code_pressed(screen->machine, KEYCODE_M) && (((attr >> 6)&3) == 3)) )) #endif @@ -255,7 +255,7 @@ static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const re #ifdef MAME_DEBUG #if 0 -if (input_code_pressed(KEYCODE_X)) +if (input_code_pressed(screen->machine, KEYCODE_X)) { /* Display some info on each sprite */ char buf[40]; sprintf(buf, "%Xx%X %X",xnum,ynum,(attr>>6)&3); diff --git a/src/mame/video/gaelco3d.c b/src/mame/video/gaelco3d.c index 53df394dbd8..af9710f3357 100644 --- a/src/mame/video/gaelco3d.c +++ b/src/mame/video/gaelco3d.c @@ -456,26 +456,26 @@ VIDEO_UPDATE( gaelco3d ) { int x, y, ret; - if (DISPLAY_TEXTURE && (input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X))) + if (DISPLAY_TEXTURE && (input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X))) { static int xv = 0, yv = 0x1000; UINT8 *base = gaelco3d_texture; int length = gaelco3d_texture_size; - if (input_code_pressed(KEYCODE_X)) + if (input_code_pressed(screen->machine, KEYCODE_X)) { base = gaelco3d_texmask; length = gaelco3d_texmask_size; } - if (input_code_pressed(KEYCODE_LEFT) && xv >= 4) + if (input_code_pressed(screen->machine, KEYCODE_LEFT) && xv >= 4) xv -= 4; - if (input_code_pressed(KEYCODE_RIGHT) && xv < 4096 - 4) + if (input_code_pressed(screen->machine, KEYCODE_RIGHT) && xv < 4096 - 4) xv += 4; - if (input_code_pressed(KEYCODE_UP) && yv >= 4) + if (input_code_pressed(screen->machine, KEYCODE_UP) && yv >= 4) yv -= 4; - if (input_code_pressed(KEYCODE_DOWN) && yv < 0x40000) + if (input_code_pressed(screen->machine, KEYCODE_DOWN) && yv < 0x40000) yv += 4; for (y = cliprect->min_y; y <= cliprect->max_y; y++) diff --git a/src/mame/video/galastrm.c b/src/mame/video/galastrm.c index a90896ca7d8..564e3b6a842 100644 --- a/src/mame/video/galastrm.c +++ b/src/mame/video/galastrm.c @@ -493,17 +493,17 @@ VIDEO_UPDATE( galastrm ) #if 0 if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1) { - if (!input_code_pressed(KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[0],0,1); - if (!input_code_pressed(KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[1],0,4); - if (!input_code_pressed(KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[2],0,4); - if (!input_code_pressed(KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[3],0,4); + if (!input_code_pressed(screen->machine, KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[0],0,1); + if (!input_code_pressed(screen->machine, KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[1],0,4); + if (!input_code_pressed(screen->machine, KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[2],0,4); + if (!input_code_pressed(screen->machine, KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[3],0,4); } else { - if (!input_code_pressed(KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[0],0,1); - if (!input_code_pressed(KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[1],0,2); - if (!input_code_pressed(KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[2],0,4); - if (!input_code_pressed(KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[3],0,8); + if (!input_code_pressed(screen->machine, KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[0],0,1); + if (!input_code_pressed(screen->machine, KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[1],0,2); + if (!input_code_pressed(screen->machine, KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[2],0,4); + if (!input_code_pressed(screen->machine, KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[3],0,8); } if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2) @@ -532,8 +532,8 @@ VIDEO_UPDATE( galastrm ) bitmap_fill(priority_bitmap, cliprect, 0); draw_sprites(screen->machine,bitmap,cliprect,primasks,0); - if (!input_code_pressed(KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,0); - if (!input_code_pressed(KEYCODE_M)) TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[2],0,0); + if (!input_code_pressed(screen->machine, KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,0); + if (!input_code_pressed(screen->machine, KEYCODE_M)) TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[2],0,0); #else diff --git a/src/mame/video/galpani2.c b/src/mame/video/galpani2.c index fece70d1c3a..02d0c9e26a8 100644 --- a/src/mame/video/galpani2.c +++ b/src/mame/video/galpani2.c @@ -152,12 +152,12 @@ VIDEO_UPDATE( galpani2 ) int layers_ctrl = -1; #ifdef MAME_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_E)) msk |= 4; - if (input_code_pressed(KEYCODE_A)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/video/gcpinbal.c b/src/mame/video/gcpinbal.c index aabc040bccf..d81e4166809 100644 --- a/src/mame/video/gcpinbal.c +++ b/src/mame/video/gcpinbal.c @@ -281,19 +281,19 @@ VIDEO_UPDATE( gcpinbal ) #endif #ifdef MAME_DEBUG - if (input_code_pressed_once (KEYCODE_V)) + if (input_code_pressed_once (screen->machine, KEYCODE_V)) { dislayer[0] ^= 1; popmessage("bg0: %01x",dislayer[0]); } - if (input_code_pressed_once (KEYCODE_B)) + if (input_code_pressed_once (screen->machine, KEYCODE_B)) { dislayer[1] ^= 1; popmessage("bg1: %01x",dislayer[1]); } - if (input_code_pressed_once (KEYCODE_N)) + if (input_code_pressed_once (screen->machine, KEYCODE_N)) { dislayer[2] ^= 1; popmessage("fg: %01x",dislayer[2]); diff --git a/src/mame/video/ginganin.c b/src/mame/video/ginganin.c index 10afddd8e9b..b1846e02260 100644 --- a/src/mame/video/ginganin.c +++ b/src/mame/video/ginganin.c @@ -250,15 +250,15 @@ VIDEO_UPDATE( ginganin ) layers_ctrl1 = layers_ctrl; #ifdef MAME_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; static int posx,posy; - if (input_code_pressed(KEYCODE_Q)) { msk |= 0xfff1;} - if (input_code_pressed(KEYCODE_W)) { msk |= 0xfff2;} - if (input_code_pressed(KEYCODE_E)) { msk |= 0xfff4;} - if (input_code_pressed(KEYCODE_A)) { msk |= 0xfff8;} + if (input_code_pressed(screen->machine, KEYCODE_Q)) { msk |= 0xfff1;} + if (input_code_pressed(screen->machine, KEYCODE_W)) { msk |= 0xfff2;} + if (input_code_pressed(screen->machine, KEYCODE_E)) { msk |= 0xfff4;} + if (input_code_pressed(screen->machine, KEYCODE_A)) { msk |= 0xfff8;} if (msk != 0) layers_ctrl1 &= msk; #define SETSCROLL \ @@ -268,11 +268,11 @@ if (input_code_pressed(KEYCODE_Z)) tilemap_set_scrolly(fg_tilemap, 0, posy); \ popmessage("B>%04X:%04X F>%04X:%04X",posx%(BG_NX*16),posy%(BG_NY*16),posx%(FG_NX*16),posy%(FG_NY*16)); - if (input_code_pressed(KEYCODE_L)) { posx +=8; SETSCROLL } - if (input_code_pressed(KEYCODE_J)) { posx -=8; SETSCROLL } - if (input_code_pressed(KEYCODE_K)) { posy +=8; SETSCROLL } - if (input_code_pressed(KEYCODE_I)) { posy -=8; SETSCROLL } - if (input_code_pressed(KEYCODE_H)) { posx = posy = 0; SETSCROLL } + if (input_code_pressed(screen->machine, KEYCODE_L)) { posx +=8; SETSCROLL } + if (input_code_pressed(screen->machine, KEYCODE_J)) { posx -=8; SETSCROLL } + if (input_code_pressed(screen->machine, KEYCODE_K)) { posy +=8; SETSCROLL } + if (input_code_pressed(screen->machine, KEYCODE_I)) { posy -=8; SETSCROLL } + if (input_code_pressed(screen->machine, KEYCODE_H)) { posx = posy = 0; SETSCROLL } } #endif diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c index 62cea53f8b5..70ad8893156 100644 --- a/src/mame/video/gticlub.c +++ b/src/mame/video/gticlub.c @@ -996,15 +996,15 @@ VIDEO_UPDATE( gticlub ) if( tick >= 5 ) { tick = 0; - if( input_code_pressed(KEYCODE_O) ) + if( input_code_pressed(screen->machine, KEYCODE_O) ) debug_tex_page++; - if( input_code_pressed(KEYCODE_I) ) + if( input_code_pressed(screen->machine, KEYCODE_I) ) debug_tex_page--; - if (input_code_pressed(KEYCODE_U)) + if (input_code_pressed(screen->machine, KEYCODE_U)) debug_tex_palette++; - if (input_code_pressed(KEYCODE_Y)) + if (input_code_pressed(screen->machine, KEYCODE_Y)) debug_tex_palette--; if (debug_tex_page < 0) diff --git a/src/mame/video/gunbustr.c b/src/mame/video/gunbustr.c index 146e82a05a9..6e579ae832b 100644 --- a/src/mame/video/gunbustr.c +++ b/src/mame/video/gunbustr.c @@ -234,12 +234,12 @@ VIDEO_UPDATE( gunbustr ) sprites as pdrawgfx cannot yet cope with more than 4 layers */ #ifdef MAME_DEBUG - if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); - if (!input_code_pressed (KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); - if (!input_code_pressed (KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); - if (!input_code_pressed (KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); - if (!input_code_pressed (KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); - if (!input_code_pressed (KEYCODE_N)) draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); + if (!input_code_pressed (screen->machine, KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); + if (!input_code_pressed (screen->machine, KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); + if (!input_code_pressed (screen->machine, KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); + if (!input_code_pressed (screen->machine, KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); + if (!input_code_pressed (screen->machine, KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); + if (!input_code_pressed (screen->machine, KEYCODE_N)) draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); #else TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); diff --git a/src/mame/video/holeland.c b/src/mame/video/holeland.c index 8566b41a251..defb5981876 100644 --- a/src/mame/video/holeland.c +++ b/src/mame/video/holeland.c @@ -23,10 +23,10 @@ static TILE_GET_INFO( holeland_get_tile_info ) int attr = colorram[tile_index]; int tile_number = videoram[tile_index] | ((attr & 0x03) << 8); -/*if (input_code_pressed(KEYCODE_Q) && (attr & 0x10)) tile_number = rand(); */ -/*if (input_code_pressed(KEYCODE_W) && (attr & 0x20)) tile_number = rand(); */ -/*if (input_code_pressed(KEYCODE_E) && (attr & 0x40)) tile_number = rand(); */ -/*if (input_code_pressed(KEYCODE_R) && (attr & 0x80)) tile_number = rand(); */ +/*if (input_code_pressed(machine, KEYCODE_Q) && (attr & 0x10)) tile_number = rand(); */ +/*if (input_code_pressed(machine, KEYCODE_W) && (attr & 0x20)) tile_number = rand(); */ +/*if (input_code_pressed(machine, KEYCODE_E) && (attr & 0x40)) tile_number = rand(); */ +/*if (input_code_pressed(machine, KEYCODE_R) && (attr & 0x80)) tile_number = rand(); */ SET_TILE_INFO( 0, tile_number, diff --git a/src/mame/video/hyprduel.c b/src/mame/video/hyprduel.c index 1bb6f280d81..54810904487 100644 --- a/src/mame/video/hyprduel.c +++ b/src/mame/video/hyprduel.c @@ -688,12 +688,12 @@ VIDEO_UPDATE( hyprduel ) flip_screen_set(screen->machine, screenctrl & 1); #if 0 -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 0x01; - if (input_code_pressed(KEYCODE_W)) msk |= 0x02; - if (input_code_pressed(KEYCODE_E)) msk |= 0x04; - if (input_code_pressed(KEYCODE_A)) msk |= 0x08; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 0x01; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 0x02; + if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 0x04; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 0x08; if (msk != 0) { bitmap_fill(bitmap,cliprect,0); layers_ctrl &= msk; } diff --git a/src/mame/video/itech32.c b/src/mame/video/itech32.c index a267cf88a10..b7887840991 100644 --- a/src/mame/video/itech32.c +++ b/src/mame/video/itech32.c @@ -405,9 +405,9 @@ WRITE32_HANDLER( itech020_paletteram_w ) * *************************************/ -static void logblit(const char *tag) +static void logblit(running_machine *machine, const char *tag) { - if (!input_code_pressed(KEYCODE_L)) + if (!input_code_pressed(machine, KEYCODE_L)) return; if (is_drivedge && VIDEO_TRANSFER_FLAGS == 0x5490) { @@ -1203,7 +1203,7 @@ static void handle_video_command(running_machine *machine) /* command 1: blit raw data */ case 1: profiler_mark_start(PROFILER_USER1); - if (BLIT_LOGGING) logblit("Blit Raw"); + if (BLIT_LOGGING) logblit(machine, "Blit Raw"); if (is_drivedge) { @@ -1221,7 +1221,7 @@ static void handle_video_command(running_machine *machine) /* command 2: blit RLE-compressed data */ case 2: profiler_mark_start(PROFILER_USER2); - if (BLIT_LOGGING) logblit("Blit RLE"); + if (BLIT_LOGGING) logblit(machine, "Blit RLE"); if (enable_latch[0]) draw_rle(videoplane[0], color_latch[0]); if (enable_latch[1]) draw_rle(videoplane[1], color_latch[1]); @@ -1231,7 +1231,7 @@ static void handle_video_command(running_machine *machine) /* command 3: set up raw data transfer */ case 3: - if (BLIT_LOGGING) logblit("Raw Xfer"); + if (BLIT_LOGGING) logblit(machine, "Raw Xfer"); xfer_xcount = VIDEO_TRANSFER_WIDTH; xfer_ycount = ADJUSTED_HEIGHT(VIDEO_TRANSFER_HEIGHT); xfer_xcur = VIDEO_TRANSFER_X & 0xfff; @@ -1249,7 +1249,7 @@ static void handle_video_command(running_machine *machine) /* command 6: perform shift register copy */ case 6: profiler_mark_start(PROFILER_USER3); - if (BLIT_LOGGING) logblit("ShiftReg"); + if (BLIT_LOGGING) logblit(machine, "ShiftReg"); if (is_drivedge) { diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c index a4a09ed4655..8db42e2ea1f 100644 --- a/src/mame/video/konamigx.c +++ b/src/mame/video/konamigx.c @@ -493,7 +493,7 @@ VIDEO_UPDATE(konamigx) { const pen_t *paldata = screen->machine->pens; - if ( input_code_pressed(KEYCODE_W) ) + if ( input_code_pressed(screen->machine, KEYCODE_W) ) { int y,x; diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c index 181959a5f82..f4e38fdad2f 100644 --- a/src/mame/video/konamiic.c +++ b/src/mame/video/konamiic.c @@ -1307,7 +1307,7 @@ popmessage("%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %02x-%02x-%02x-%02x-%02x-%0 K007121_ctrlram[0][0x00],K007121_ctrlram[0][0x01],K007121_ctrlram[0][0x02],K007121_ctrlram[0][0x03],K007121_ctrlram[0][0x04],K007121_ctrlram[0][0x05],K007121_ctrlram[0][0x06],K007121_ctrlram[0][0x07], K007121_ctrlram[1][0x00],K007121_ctrlram[1][0x01],K007121_ctrlram[1][0x02],K007121_ctrlram[1][0x03],K007121_ctrlram[1][0x04],K007121_ctrlram[1][0x05],K007121_ctrlram[1][0x06],K007121_ctrlram[1][0x07]); -if (input_code_pressed(KEYCODE_D)) +if (input_code_pressed(gfx->machine, KEYCODE_D)) { FILE *fp; fp=fopen(chip?"SPRITE1.DMP":"SPRITE0.DMP", "w+b"); @@ -1646,7 +1646,7 @@ void K007342_tilemap_update(void) { static int current_layer = 0; - if (input_code_pressed_once(KEYCODE_Z)) current_layer = !current_layer; + if (input_code_pressed_once(machine, KEYCODE_Z)) current_layer = !current_layer; tilemap_set_enable(K007342_tilemap[current_layer], 1); tilemap_set_enable(K007342_tilemap[!current_layer], 0); @@ -1855,8 +1855,8 @@ void K007420_sprites_draw(bitmap_t *bitmap,const rectangle *cliprect) { static int current_sprite = 0; - if (input_code_pressed_once(KEYCODE_Z)) current_sprite = (current_sprite+1) & ((K007420_SPRITERAM_SIZE/8)-1); - if (input_code_pressed_once(KEYCODE_X)) current_sprite = (current_sprite-1) & ((K007420_SPRITERAM_SIZE/8)-1); + if (input_code_pressed_once(machine, KEYCODE_Z)) current_sprite = (current_sprite+1) & ((K007420_SPRITERAM_SIZE/8)-1); + if (input_code_pressed_once(machine, KEYCODE_X)) current_sprite = (current_sprite-1) & ((K007420_SPRITERAM_SIZE/8)-1); popmessage("%02x:%02x %02x %02x %02x %02x %02x %02x %02x", current_sprite, K007420_ram[(current_sprite*8)+0], K007420_ram[(current_sprite*8)+1], @@ -2414,7 +2414,7 @@ if ((K052109_scrollctrl & 0x03) == 0x01 || (K052109_scrollctrl & 0xc0) != 0) popmessage("scrollcontrol = %02x",K052109_scrollctrl); -if (input_code_pressed(KEYCODE_F)) +if (input_code_pressed(machine, KEYCODE_F)) { FILE *fp; fp=fopen("TILE.DMP", "w+b"); @@ -2872,7 +2872,7 @@ void K051960_sprites_draw(running_machine *machine,bitmap_t *bitmap,const rectan } } #if 0 -if (input_code_pressed(KEYCODE_D)) +if (input_code_pressed(machine, KEYCODE_D)) { FILE *fp; fp=fopen("SPRITE.DMP", "w+b"); @@ -3440,7 +3440,7 @@ void K053245_sprites_draw(running_machine *machine, int chip, bitmap_t *bitmap,c } } #if 0 -if (input_code_pressed(KEYCODE_D)) +if (input_code_pressed(machine, KEYCODE_D)) { FILE *fp; fp=fopen("SPRITE.DMP", "w+b"); @@ -3677,7 +3677,7 @@ void K053245_sprites_draw_lethal(running_machine *machine,int chip, bitmap_t *bi } } #if 0 -if (input_code_pressed(KEYCODE_D)) +if (input_code_pressed(machine, KEYCODE_D)) { FILE *fp; fp=fopen("SPRITE.DMP", "w+b"); @@ -5013,7 +5013,7 @@ static void K053936_zoom_draw(int chip,UINT16 *ctrl,UINT16 *linectrl, bitmap_t * } #if 0 -if (input_code_pressed(KEYCODE_D)) +if (input_code_pressed(machine, KEYCODE_D)) popmessage("%04x %04x %04x %04x\n%04x %04x %04x %04x\n%04x %04x %04x %04x\n%04x %04x %04x %04x", ctrl[0x00], ctrl[0x01], @@ -7844,32 +7844,32 @@ void K053250_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *c if(chip && ++kk == 3) { int kx=0, kkc = 0; kk = 0; - if(input_code_pressed(KEYCODE_Y)) { + if(input_code_pressed(machine, KEYCODE_Y)) { kx = 1; kc--; if(kc<-1) kc = 511; } - if(input_code_pressed(KEYCODE_U)) { + if(input_code_pressed(machine, KEYCODE_U)) { kx = 1; kc++; if(kc==512) kc = -1; } - if(input_code_pressed(KEYCODE_T)) { + if(input_code_pressed(machine, KEYCODE_T)) { kkc = 1; kyy--; } - if(input_code_pressed(KEYCODE_V)) { + if(input_code_pressed(machine, KEYCODE_V)) { kkc = 1; kyy++; } - if(input_code_pressed(KEYCODE_F)) { + if(input_code_pressed(machine, KEYCODE_F)) { kkc = 1; kxx--; } - if(input_code_pressed(KEYCODE_G)) { + if(input_code_pressed(machine, KEYCODE_G)) { kkc = 1; kxx++; } diff --git a/src/mame/video/lordgun.c b/src/mame/video/lordgun.c index fce84d66b04..c795c26e7aa 100644 --- a/src/mame/video/lordgun.c +++ b/src/mame/video/lordgun.c @@ -263,15 +263,15 @@ VIDEO_UPDATE( lordgun ) int y; #ifdef MAME_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_E)) msk |= 4; - if (input_code_pressed(KEYCODE_R)) msk |= 8; - if (input_code_pressed(KEYCODE_A)) msk |= 16; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_R)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 16; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/video/mcatadv.c b/src/mame/video/mcatadv.c index 2fb6bc40725..9c646449336 100644 --- a/src/mame/video/mcatadv.c +++ b/src/mame/video/mcatadv.c @@ -225,19 +225,19 @@ VIDEO_UPDATE( mcatadv ) for (i=0; i<=3; i++) { #ifdef MAME_DEBUG - if (!input_code_pressed(KEYCODE_Q)) + if (!input_code_pressed(screen->machine, KEYCODE_Q)) #endif mcatadv_draw_tilemap_part(mcatadv_scroll, mcatadv_videoram1, i, mcatadv_tilemap1, bitmap, cliprect); #ifdef MAME_DEBUG - if (!input_code_pressed(KEYCODE_W)) + if (!input_code_pressed(screen->machine, KEYCODE_W)) #endif mcatadv_draw_tilemap_part(mcatadv_scroll2, mcatadv_videoram2, i, mcatadv_tilemap2, bitmap, cliprect); } profiler_mark_start(PROFILER_USER1); #ifdef MAME_DEBUG - if (!input_code_pressed(KEYCODE_E)) + if (!input_code_pressed(screen->machine, KEYCODE_E)) #endif draw_sprites (screen->machine, bitmap, cliprect); profiler_mark_end(); diff --git a/src/mame/video/metro.c b/src/mame/video/metro.c index e974f4a0749..3bc7f26268b 100644 --- a/src/mame/video/metro.c +++ b/src/mame/video/metro.c @@ -923,13 +923,13 @@ VIDEO_UPDATE( metro ) #ifdef MAME_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_E)) msk |= 4; - if (input_code_pressed(KEYCODE_A)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; if (msk != 0) { bitmap_fill(bitmap,cliprect,0); layers_ctrl &= msk; } diff --git a/src/mame/video/midtunit.c b/src/mame/video/midtunit.c index 086e80e7e74..e7f2dcadc06 100644 --- a/src/mame/video/midtunit.c +++ b/src/mame/video/midtunit.c @@ -719,7 +719,7 @@ WRITE16_HANDLER( midtunit_dma_w ) if (LOG_DMA) { - if (input_code_pressed(KEYCODE_L)) + if (input_code_pressed(space->machine, KEYCODE_L)) { logerror("DMA command %04X: (bpp=%d skip=%d xflip=%d yflip=%d preskip=%d postskip=%d)\n", command, (command >> 12) & 7, (command >> 7) & 1, (command >> 4) & 1, (command >> 5) & 1, (command >> 8) & 3, (command >> 10) & 3); diff --git a/src/mame/video/midvunit.c b/src/mame/video/midvunit.c index b0252642f9d..9e3e7c6fd8d 100644 --- a/src/mame/video/midvunit.c +++ b/src/mame/video/midvunit.c @@ -378,7 +378,7 @@ static void process_dma_queue(running_machine *machine) WRITE32_HANDLER( midvunit_dma_queue_w ) { - if (LOG_DMA && input_code_pressed(KEYCODE_L)) + if (LOG_DMA && input_code_pressed(space->machine, KEYCODE_L)) logerror("%06X:queue(%X) = %08X\n", cpu_get_pc(space->cpu), dma_data_index, data); if (dma_data_index < 16) dma_data[dma_data_index++] = data; @@ -396,7 +396,7 @@ READ32_HANDLER( midvunit_dma_trigger_r ) { if (offset) { - if (LOG_DMA && input_code_pressed(KEYCODE_L)) + if (LOG_DMA && input_code_pressed(space->machine, KEYCODE_L)) logerror("%06X:trigger\n", cpu_get_pc(space->cpu)); process_dma_queue(space->machine); dma_data_index = 0; @@ -418,7 +418,7 @@ WRITE32_HANDLER( midvunit_page_control_w ) if ((page_control ^ data) & 1) { video_changed = TRUE; - if (LOG_DMA && input_code_pressed(KEYCODE_L)) + if (LOG_DMA && input_code_pressed(space->machine, KEYCODE_L)) logerror("##########################################################\n"); video_screen_update_partial(space->machine->primary_screen, video_screen_get_vpos(space->machine->primary_screen) - 1); } diff --git a/src/mame/video/midyunit.c b/src/mame/video/midyunit.c index d041f0bfdb0..837d4be7ef8 100644 --- a/src/mame/video/midyunit.c +++ b/src/mame/video/midyunit.c @@ -455,7 +455,7 @@ WRITE16_HANDLER( midyunit_dma_w ) if (LOG_DMA) { - if (input_code_pressed(KEYCODE_L)) + if (input_code_pressed(space->machine, KEYCODE_L)) { logerror("----\n"); logerror("DMA command %04X: (xflip=%d yflip=%d)\n", diff --git a/src/mame/video/midzeus.c b/src/mame/video/midzeus.c index c46864cc020..4fb411f10a3 100644 --- a/src/mame/video/midzeus.c +++ b/src/mame/video/midzeus.c @@ -89,7 +89,7 @@ static void zeus_register32_w(running_machine *machine, offs_t offset, UINT32 da static void zeus_register_update(running_machine *machine, offs_t offset); static int zeus_fifo_process(running_machine *machine, const UINT32 *data, int numwords); static void zeus_draw_model(running_machine *machine, UINT32 texdata, int logit); -static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texdata, int logit); +static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texdata, int logit); static void render_poly_4bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); static void render_poly_8bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); @@ -314,7 +314,7 @@ VIDEO_UPDATE( midzeus ) poly_wait(poly, "VIDEO_UPDATE"); /* normal update case */ - if (!input_code_pressed(KEYCODE_W)) + if (!input_code_pressed(screen->machine, KEYCODE_W)) { const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0xcc]); int xoffs = video_screen_get_visible_area(screen)->min_x; @@ -333,10 +333,10 @@ VIDEO_UPDATE( midzeus ) static int width = 256; const void *base; - if (input_code_pressed(KEYCODE_DOWN)) yoffs += input_code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; - if (input_code_pressed(KEYCODE_UP)) yoffs -= input_code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; - if (input_code_pressed(KEYCODE_LEFT) && width > 4) { width >>= 1; while (input_code_pressed(KEYCODE_LEFT)) ; } - if (input_code_pressed(KEYCODE_RIGHT) && width < 512) { width <<= 1; while (input_code_pressed(KEYCODE_RIGHT)) ; } + if (input_code_pressed(screen->machine, KEYCODE_DOWN)) yoffs += input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1; + if (input_code_pressed(screen->machine, KEYCODE_UP)) yoffs -= input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1; + if (input_code_pressed(screen->machine, KEYCODE_LEFT) && width > 4) { width >>= 1; while (input_code_pressed(screen->machine, KEYCODE_LEFT)) ; } + if (input_code_pressed(screen->machine, KEYCODE_RIGHT) && width < 512) { width <<= 1; while (input_code_pressed(screen->machine, KEYCODE_RIGHT)) ; } if (yoffs < 0) yoffs = 0; base = waveram0_ptr_from_block_addr(yoffs << 12); @@ -738,7 +738,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset) case 0xcc: video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen)); - log_fifo = input_code_pressed(KEYCODE_L); + log_fifo = input_code_pressed(machine, KEYCODE_L); break; case 0xe0: @@ -1032,7 +1032,7 @@ static void zeus_draw_model(running_machine *machine, UINT32 texdata, int logit) case 0x25: /* mk4 */ case 0x30: /* invasn */ - zeus_draw_quad(databuffer, texdata, logit); + zeus_draw_quad(machine, databuffer, texdata, logit); break; default: @@ -1056,7 +1056,7 @@ static void zeus_draw_model(running_machine *machine, UINT32 texdata, int logit) * *************************************/ -static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texdata, int logit) +static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texdata, int logit) { poly_draw_scanline_func callback; poly_extra_data *extra; @@ -1098,7 +1098,7 @@ if ( { if (logit) logerror("quad (culled %08X)\n", rotnormal[2]); -// if (input_code_pressed(KEYCODE_COMMA)) +// if (input_code_pressed(machine, KEYCODE_COMMA)) // return; } @@ -1111,13 +1111,13 @@ if ( val2 = (texdata >> 16) & 0x3ff; texwshift = (val2 >> 6) & 7; -//if (input_code_pressed(KEYCODE_Z) && (val2 & 0x01)) return; -//if (input_code_pressed(KEYCODE_X) && (val2 & 0x02)) return; -//if (input_code_pressed(KEYCODE_C) && (val2 & 0x04)) return; -//if (input_code_pressed(KEYCODE_V) && (val2 & 0x08)) return; -//if (input_code_pressed(KEYCODE_B) && (val2 & 0x10)) return; -//if (input_code_pressed(KEYCODE_N) && (val2 & 0x20)) return; -//if (input_code_pressed(KEYCODE_M) && (val2 & 0x200)) return; +//if (input_code_pressed(machine, KEYCODE_Z) && (val2 & 0x01)) return; +//if (input_code_pressed(machine, KEYCODE_X) && (val2 & 0x02)) return; +//if (input_code_pressed(machine, KEYCODE_C) && (val2 & 0x04)) return; +//if (input_code_pressed(machine, KEYCODE_V) && (val2 & 0x08)) return; +//if (input_code_pressed(machine, KEYCODE_B) && (val2 & 0x10)) return; +//if (input_code_pressed(machine, KEYCODE_N) && (val2 & 0x20)) return; +//if (input_code_pressed(machine, KEYCODE_M) && (val2 & 0x200)) return; uscale = (8 >> ((zeusbase[0x04] >> 4) & 3)) * 0.125f * 256.0f; vscale = (8 >> ((zeusbase[0x04] >> 6) & 3)) * 0.125f * 256.0f; diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c index 92c66063403..4881f57e7ae 100644 --- a/src/mame/video/midzeus2.c +++ b/src/mame/video/midzeus2.c @@ -107,7 +107,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset, UINT32 static void zeus_pointer_write(UINT8 which, UINT32 value); static int zeus_fifo_process(running_machine *machine, const UINT32 *data, int numwords); static void zeus_draw_model(running_machine *machine, UINT32 baseaddr, UINT16 count, int logit); -static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texoffs, int logit); +static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texoffs, int logit); static void render_poly_8bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); static void log_fifo_command(const UINT32 *data, int numwords, const char *suffix); @@ -361,11 +361,11 @@ VIDEO_UPDATE( midzeus2 ) poly_wait(poly, "VIDEO_UPDATE"); -if (input_code_pressed(KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); } -if (input_code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); } +if (input_code_pressed(screen->machine, KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); } +if (input_code_pressed(screen->machine, KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); } /* normal update case */ - if (!input_code_pressed(KEYCODE_W)) + if (!input_code_pressed(screen->machine, KEYCODE_W)) { const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0x38]); int xoffs = video_screen_get_visible_area(screen)->min_x; @@ -384,10 +384,10 @@ if (input_code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", static int width = 256; const UINT64 *base; - if (input_code_pressed(KEYCODE_DOWN)) yoffs += input_code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; - if (input_code_pressed(KEYCODE_UP)) yoffs -= input_code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; - if (input_code_pressed(KEYCODE_LEFT) && width > 4) { width >>= 1; while (input_code_pressed(KEYCODE_LEFT)) ; } - if (input_code_pressed(KEYCODE_RIGHT) && width < 512) { width <<= 1; while (input_code_pressed(KEYCODE_RIGHT)) ; } + if (input_code_pressed(screen->machine, KEYCODE_DOWN)) yoffs += input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1; + if (input_code_pressed(screen->machine, KEYCODE_UP)) yoffs -= input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1; + if (input_code_pressed(screen->machine, KEYCODE_LEFT) && width > 4) { width >>= 1; while (input_code_pressed(screen->machine, KEYCODE_LEFT)) ; } + if (input_code_pressed(screen->machine, KEYCODE_RIGHT) && width < 512) { width <<= 1; while (input_code_pressed(screen->machine, KEYCODE_RIGHT)) ; } if (yoffs < 0) yoffs = 0; base = (const UINT64 *)waveram0_ptr_from_expanded_addr(yoffs << 16); @@ -584,7 +584,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset, UINT32 UINT32 temp = zeusbase[0x38]; zeusbase[0x38] = oldval; video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen)); - log_fifo = input_code_pressed(KEYCODE_L); + log_fifo = input_code_pressed(machine, KEYCODE_L); zeusbase[0x38] = temp; } break; @@ -1010,7 +1010,7 @@ static void zeus_draw_model(running_machine *machine, UINT32 baseaddr, UINT16 co break; case 0x38: /* crusnexo/thegrid */ - zeus_draw_quad(databuffer, texoffs, logit); + zeus_draw_quad(machine, databuffer, texoffs, logit); break; default: @@ -1039,7 +1039,7 @@ static void zeus_draw_model(running_machine *machine, UINT32 baseaddr, UINT16 co * *************************************/ -static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texoffs, int logit) +static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texoffs, int logit) { poly_draw_scanline_func callback; poly_extra_data *extra; @@ -1057,15 +1057,15 @@ static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texoffs, int logit) if (logit) logerror("quad\n"); -if (input_code_pressed(KEYCODE_Q) && (texoffs & 0xffff) == 0x119) return; -if (input_code_pressed(KEYCODE_E) && (texoffs & 0xffff) == 0x01d) return; -if (input_code_pressed(KEYCODE_R) && (texoffs & 0xffff) == 0x11d) return; -if (input_code_pressed(KEYCODE_T) && (texoffs & 0xffff) == 0x05d) return; -if (input_code_pressed(KEYCODE_Y) && (texoffs & 0xffff) == 0x0dd) return; -//if (input_code_pressed(KEYCODE_U) && (texoffs & 0xffff) == 0x119) return; -//if (input_code_pressed(KEYCODE_I) && (texoffs & 0xffff) == 0x119) return; -//if (input_code_pressed(KEYCODE_O) && (texoffs & 0xffff) == 0x119) return; -//if (input_code_pressed(KEYCODE_L) && (texoffs & 0x100)) return; +if (input_code_pressed(machine, KEYCODE_Q) && (texoffs & 0xffff) == 0x119) return; +if (input_code_pressed(machine, KEYCODE_E) && (texoffs & 0xffff) == 0x01d) return; +if (input_code_pressed(machine, KEYCODE_R) && (texoffs & 0xffff) == 0x11d) return; +if (input_code_pressed(machine, KEYCODE_T) && (texoffs & 0xffff) == 0x05d) return; +if (input_code_pressed(machine, KEYCODE_Y) && (texoffs & 0xffff) == 0x0dd) return; +//if (input_code_pressed(machine, KEYCODE_U) && (texoffs & 0xffff) == 0x119) return; +//if (input_code_pressed(machine, KEYCODE_I) && (texoffs & 0xffff) == 0x119) return; +//if (input_code_pressed(machine, KEYCODE_O) && (texoffs & 0xffff) == 0x119) return; +//if (input_code_pressed(machine, KEYCODE_L) && (texoffs & 0x100)) return; callback = render_poly_8bit; diff --git a/src/mame/video/model1.c b/src/mame/video/model1.c index a5a9fb3f898..421761b3f21 100644 --- a/src/mame/video/model1.c +++ b/src/mame/video/model1.c @@ -1332,7 +1332,7 @@ static void tgp_render(running_machine *machine, bitmap_t *bitmap, const rectang static void tgp_scan(void) { #if 0 - if (input_code_pressed_once(KEYCODE_F)) + if (input_code_pressed_once(machine, KEYCODE_F)) { FILE *fp; fp=fopen("tgp-ram.bin", "w+b"); @@ -1465,35 +1465,35 @@ VIDEO_UPDATE(model1) double delta; delta = 1; - if(input_code_pressed(KEYCODE_F)) { + if(input_code_pressed(screen->machine, KEYCODE_F)) { mod = 1; vxx -= delta; } - if(input_code_pressed(KEYCODE_G)) { + if(input_code_pressed(screen->machine, KEYCODE_G)) { mod = 1; vxx += delta; } - if(input_code_pressed(KEYCODE_H)) { + if(input_code_pressed(screen->machine, KEYCODE_H)) { mod = 1; vyy -= delta; } - if(input_code_pressed(KEYCODE_J)) { + if(input_code_pressed(screen->machine, KEYCODE_J)) { mod = 1; vyy += delta; } - if(input_code_pressed(KEYCODE_K)) { + if(input_code_pressed(screen->machine, KEYCODE_K)) { mod = 1; vzz -= delta; } - if(input_code_pressed(KEYCODE_L)) { + if(input_code_pressed(screen->machine, KEYCODE_L)) { mod = 1; vzz += delta; } - if(input_code_pressed(KEYCODE_U)) { + if(input_code_pressed(screen->machine, KEYCODE_U)) { mod = 1; ayy -= 0.05; } - if(input_code_pressed(KEYCODE_I)) { + if(input_code_pressed(screen->machine, KEYCODE_I)) { mod = 1; ayy += 0.05; } diff --git a/src/mame/video/model2.c b/src/mame/video/model2.c index 382df2f63c6..4924951d72a 100644 --- a/src/mame/video/model2.c +++ b/src/mame/video/model2.c @@ -1031,7 +1031,7 @@ static void model2_3d_frame_end( bitmap_t *bitmap, const rectangle *cliprect ) return; #if DEBUG - if (input_code_pressed(KEYCODE_Q)) + if (input_code_pressed(machine, KEYCODE_Q)) { UINT32 i; diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c index 62476813c18..25f674429f9 100644 --- a/src/mame/video/model3.c +++ b/src/mame/video/model3.c @@ -410,15 +410,15 @@ VIDEO_UPDATE( model3 ) if( tick >= 5 ) { tick = 0; - if( input_code_pressed(KEYCODE_Y) ) + if( input_code_pressed(screen->machine, KEYCODE_Y) ) debug_layer_disable ^= 0x1; - if( input_code_pressed(KEYCODE_U) ) + if( input_code_pressed(screen->machine, KEYCODE_U) ) debug_layer_disable ^= 0x2; - if( input_code_pressed(KEYCODE_I) ) + if( input_code_pressed(screen->machine, KEYCODE_I) ) debug_layer_disable ^= 0x4; - if( input_code_pressed(KEYCODE_O) ) + if( input_code_pressed(screen->machine, KEYCODE_O) ) debug_layer_disable ^= 0x8; - if( input_code_pressed(KEYCODE_T) ) + if( input_code_pressed(screen->machine, KEYCODE_T) ) debug_layer_disable ^= 0x10; } diff --git a/src/mame/video/ms32.c b/src/mame/video/ms32.c index bf3d1f84e98..41106492bd6 100644 --- a/src/mame/video/ms32.c +++ b/src/mame/video/ms32.c @@ -346,10 +346,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta } #if 0 -if (input_code_pressed(KEYCODE_A) && (pri & 8)) color = rand(); -if (input_code_pressed(KEYCODE_S) && (pri & 4)) color = rand(); -if (input_code_pressed(KEYCODE_D) && (pri & 2)) color = rand(); -if (input_code_pressed(KEYCODE_F) && (pri & 1)) color = rand(); +if (input_code_pressed(machine, KEYCODE_A) && (pri & 8)) color = rand(); +if (input_code_pressed(machine, KEYCODE_S) && (pri & 4)) color = rand(); +if (input_code_pressed(machine, KEYCODE_D) && (pri & 2)) color = rand(); +if (input_code_pressed(machine, KEYCODE_F) && (pri & 1)) color = rand(); #endif /* TODO: priority handling is completely wrong, but better than nothing */ diff --git a/src/mame/video/namcos2.c b/src/mame/video/namcos2.c index 42c6c8ed25f..5385b2e8fc8 100644 --- a/src/mame/video/namcos2.c +++ b/src/mame/video/namcos2.c @@ -207,7 +207,7 @@ WRITE16_HANDLER( namcos2_68k_roz_ram_w ) { COMBINE_DATA(&namcos2_68k_roz_ram[offset]); tilemap_mark_tile_dirty(tilemap_roz,offset); -// if( input_code_pressed(KEYCODE_Q) ) +// if( input_code_pressed(space->machine, KEYCODE_Q) ) // { // debugger_break(space->machine); // } diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c index 0c085762d28..716167673d9 100644 --- a/src/mame/video/namcos22.c +++ b/src/mame/video/namcos22.c @@ -2277,7 +2277,7 @@ VIDEO_UPDATE( namcos22s ) ApplyGamma( screen->machine, bitmap ); #ifdef MAME_DEBUG - if( input_code_pressed(KEYCODE_D) ) + if( input_code_pressed(screen->machine, KEYCODE_D) ) { FILE *f = fopen( "dump.txt", "wb" ); if( f ) @@ -2309,7 +2309,7 @@ VIDEO_UPDATE( namcos22s ) Dump(space, f,0xc00000, 0xc1ffff, "polygonram"); fclose( f ); } - while( input_code_pressed(KEYCODE_D) ){} + while( input_code_pressed(screen->machine, KEYCODE_D) ){} } #endif return 0; @@ -2327,7 +2327,7 @@ VIDEO_UPDATE( namcos22 ) ApplyGamma( screen->machine, bitmap ); #ifdef MAME_DEBUG - if( input_code_pressed(KEYCODE_D) ) + if( input_code_pressed(screen->machine, KEYCODE_D) ) { FILE *f = fopen( "dump.txt", "wb" ); if( f ) @@ -2341,7 +2341,7 @@ VIDEO_UPDATE( namcos22 ) // Dump(space, f,0x70000000, 0x7001ffff, "polygonram"); fclose( f ); } - while( input_code_pressed(KEYCODE_D) ){} + while( input_code_pressed(screen->machine, KEYCODE_D) ){} } #endif return 0; diff --git a/src/mame/video/nycaptor.c b/src/mame/video/nycaptor.c index 0ff48e2bd35..938905276cd 100644 --- a/src/mame/video/nycaptor.c +++ b/src/mame/video/nycaptor.c @@ -199,9 +199,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta x - no bg/sprite pri. */ -#define mKEY_MASK(x,y) if (input_code_pressed_once(x)){nycaptor_mask|=y;tilemap_mark_all_tiles_dirty( bg_tilemap );} +#define mKEY_MASK(x,y) if (input_code_pressed_once(machine, x)){nycaptor_mask|=y;tilemap_mark_all_tiles_dirty( bg_tilemap );} -static void nycaptor_setmask(void) +static void nycaptor_setmask(running_machine *machine) { mKEY_MASK(KEYCODE_Q,1); /* bg */ mKEY_MASK(KEYCODE_W,2); @@ -217,15 +217,15 @@ static void nycaptor_setmask(void) mKEY_MASK(KEYCODE_J,0x400); mKEY_MASK(KEYCODE_K,0x800); - if (input_code_pressed_once(KEYCODE_Z)){nycaptor_mask=0;tilemap_mark_all_tiles_dirty( bg_tilemap );} /* disable */ - if (input_code_pressed_once(KEYCODE_X)){nycaptor_mask|=0x1000;tilemap_mark_all_tiles_dirty( bg_tilemap );} /* no layers */ + if (input_code_pressed_once(machine, KEYCODE_Z)){nycaptor_mask=0;tilemap_mark_all_tiles_dirty( bg_tilemap );} /* disable */ + if (input_code_pressed_once(machine, KEYCODE_X)){nycaptor_mask|=0x1000;tilemap_mark_all_tiles_dirty( bg_tilemap );} /* no layers */ } #endif VIDEO_UPDATE( nycaptor ) { #if NYCAPTOR_DEBUG - nycaptor_setmask(); + nycaptor_setmask(screen->machine); if(nycaptor_mask&0x1000) { tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0); diff --git a/src/mame/video/paradise.c b/src/mame/video/paradise.c index 95a345eb4d9..c7f0f82a4f9 100644 --- a/src/mame/video/paradise.c +++ b/src/mame/video/paradise.c @@ -228,14 +228,14 @@ VIDEO_UPDATE( paradise ) int layers_ctrl = -1; #ifdef MAME_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int mask = 0; - if (input_code_pressed(KEYCODE_Q)) mask |= 1; - if (input_code_pressed(KEYCODE_W)) mask |= 2; - if (input_code_pressed(KEYCODE_E)) mask |= 4; - if (input_code_pressed(KEYCODE_R)) mask |= 8; - if (input_code_pressed(KEYCODE_A)) mask |= 16; + if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; + if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 4; + if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 8; + if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 16; if (mask != 0) layers_ctrl &= mask; } #endif diff --git a/src/mame/video/pitnrun.c b/src/mame/video/pitnrun.c index 581d64e1b35..dbd6fabd0b9 100644 --- a/src/mame/video/pitnrun.c +++ b/src/mame/video/pitnrun.c @@ -216,19 +216,19 @@ VIDEO_UPDATE( pitnrun ) rectangle myclip=*cliprect; #ifdef MAME_DEBUG - if (input_code_pressed_once(KEYCODE_Q)) + if (input_code_pressed_once(screen->machine, KEYCODE_Q)) { UINT8 *ROM = memory_region(screen->machine, "maincpu"); ROM[0x84f6]=0; /* lap 0 - normal */ } - if (input_code_pressed_once(KEYCODE_W)) + if (input_code_pressed_once(screen->machine, KEYCODE_W)) { UINT8 *ROM = memory_region(screen->machine, "maincpu"); ROM[0x84f6]=6; /* lap 6 = spotlight */ } - if (input_code_pressed_once(KEYCODE_E)) + if (input_code_pressed_once(screen->machine, KEYCODE_E)) { UINT8 *ROM = memory_region(screen->machine, "maincpu"); ROM[0x84f6]=2; /* lap 3 (trial 2)= lightnings */ diff --git a/src/mame/video/powerins.c b/src/mame/video/powerins.c index 3a1391effaa..020a8eba192 100644 --- a/src/mame/video/powerins.c +++ b/src/mame/video/powerins.c @@ -352,14 +352,14 @@ VIDEO_UPDATE( powerins ) tilemap_set_scrolly( tilemap_1, 0, 0x00); #ifdef MAME_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; -// if (input_code_pressed(KEYCODE_E)) msk |= 4; - if (input_code_pressed(KEYCODE_A)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; +// if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/video/psikyosh.c b/src/mame/video/psikyosh.c index 4a7341534d7..e5713b33f06 100644 --- a/src/mame/video/psikyosh.c +++ b/src/mame/video/psikyosh.c @@ -1051,7 +1051,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta #if 0 #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z)) /* Display some info on each sprite */ + if (input_code_pressed(machine, KEYCODE_Z)) /* Display some info on each sprite */ { char buf[10]; int x, y; diff --git a/src/mame/video/psx.c b/src/mame/video/psx.c index ed415b0f054..e6efd24d7dd 100644 --- a/src/mame/video/psx.c +++ b/src/mame/video/psx.c @@ -420,10 +420,10 @@ static void DebugMeshEnd( void ) static void DebugCheckKeys( running_machine *machine ) { - if( input_code_pressed_once( KEYCODE_M ) ) + if( input_code_pressed_once( machine, KEYCODE_M ) ) m_debug.b_mesh = !m_debug.b_mesh; - if( input_code_pressed_once( KEYCODE_V ) ) + if( input_code_pressed_once( machine, KEYCODE_V ) ) m_debug.b_texture = !m_debug.b_texture; if( m_debug.b_mesh || m_debug.b_texture ) @@ -435,7 +435,7 @@ static void DebugCheckKeys( running_machine *machine ) else video_screen_set_visarea(machine->primary_screen, 0, m_n_screenwidth - 1, 0, m_n_screenheight - 1 ); - if( input_code_pressed_once( KEYCODE_I ) ) + if( input_code_pressed_once( machine, KEYCODE_I ) ) { if( m_debug.b_texture ) { @@ -463,7 +463,7 @@ static void DebugCheckKeys( running_machine *machine ) } #if 0 - if( input_code_pressed_once( KEYCODE_D ) ) + if( input_code_pressed_once( machine, KEYCODE_D ) ) { FILE *f; int n_x; @@ -473,7 +473,7 @@ static void DebugCheckKeys( running_machine *machine ) fprintf( f, "%04u,%04u = %04x\n", n_y, n_x, m_p_p_vram[ n_y ][ n_x ] ); fclose( f ); } - if( input_code_pressed_once( KEYCODE_S ) ) + if( input_code_pressed_once( machine, KEYCODE_S ) ) { FILE *f; popmessage( "saving..." ); @@ -482,7 +482,7 @@ static void DebugCheckKeys( running_machine *machine ) fwrite( m_p_p_vram[ n_y ], 1024 * 2, 1, f ); fclose( f ); } - if( input_code_pressed_once( KEYCODE_L ) ) + if( input_code_pressed_once( machine, KEYCODE_L ) ) { FILE *f; popmessage( "loading..." ); diff --git a/src/mame/video/realbrk.c b/src/mame/video/realbrk.c index 378e64154f3..00cdd3b95da 100644 --- a/src/mame/video/realbrk.c +++ b/src/mame/video/realbrk.c @@ -502,12 +502,12 @@ VIDEO_UPDATE(realbrk) tilemap_set_scrollx(tilemap_1, 0, realbrk_vregs[0x6/2]); #ifdef MAME_DEBUG -if ( input_code_pressed(KEYCODE_Z) ) +if ( input_code_pressed(screen->machine, KEYCODE_Z) ) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_E)) msk |= 4; - if (input_code_pressed(KEYCODE_A)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif @@ -570,12 +570,12 @@ VIDEO_UPDATE(dai2kaku) tilemap_set_scrolly( tilemap_1, 0, bgy1 ); #ifdef MAME_DEBUG -if ( input_code_pressed(KEYCODE_Z) ) +if ( input_code_pressed(screen->machine, KEYCODE_Z) ) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_E)) msk |= 4; - if (input_code_pressed(KEYCODE_A)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/video/rollerg.c b/src/mame/video/rollerg.c index 671831aca88..3020184bc0a 100644 --- a/src/mame/video/rollerg.c +++ b/src/mame/video/rollerg.c @@ -15,10 +15,10 @@ static int bg_colorbase,sprite_colorbase,zoom_colorbase; static void sprite_callback(int *code,int *color,int *priority_mask) { #if 0 -if (input_code_pressed(KEYCODE_Q) && (*color & 0x80)) *color = rand(); -if (input_code_pressed(KEYCODE_W) && (*color & 0x40)) *color = rand(); -if (input_code_pressed(KEYCODE_E) && (*color & 0x20)) *color = rand(); -if (input_code_pressed(KEYCODE_R) && (*color & 0x10)) *color = rand(); +if (input_code_pressed(machine, KEYCODE_Q) && (*color & 0x80)) *color = rand(); +if (input_code_pressed(machine, KEYCODE_W) && (*color & 0x40)) *color = rand(); +if (input_code_pressed(machine, KEYCODE_E) && (*color & 0x20)) *color = rand(); +if (input_code_pressed(machine, KEYCODE_R) && (*color & 0x10)) *color = rand(); #endif *priority_mask = (*color & 0x10) ? 0 : 0x02; *color = sprite_colorbase + (*color & 0x0f); diff --git a/src/mame/video/segas18.c b/src/mame/video/segas18.c index a74d993ee9a..7e2445f0d36 100644 --- a/src/mame/video/segas18.c +++ b/src/mame/video/segas18.c @@ -192,15 +192,15 @@ VIDEO_UPDATE( system18 ) vdppri = (vdp_mixing & 1) ? (1 << vdplayer) : 0; #if DEBUG_VDP - if (input_code_pressed(KEYCODE_Q)) vdplayer = 0; - if (input_code_pressed(KEYCODE_W)) vdplayer = 1; - if (input_code_pressed(KEYCODE_E)) vdplayer = 2; - if (input_code_pressed(KEYCODE_R)) vdplayer = 3; - if (input_code_pressed(KEYCODE_A)) vdppri = 0x00; - if (input_code_pressed(KEYCODE_S)) vdppri = 0x01; - if (input_code_pressed(KEYCODE_D)) vdppri = 0x02; - if (input_code_pressed(KEYCODE_F)) vdppri = 0x04; - if (input_code_pressed(KEYCODE_G)) vdppri = 0x08; + if (input_code_pressed(screen->machine, KEYCODE_Q)) vdplayer = 0; + if (input_code_pressed(screen->machine, KEYCODE_W)) vdplayer = 1; + if (input_code_pressed(screen->machine, KEYCODE_E)) vdplayer = 2; + if (input_code_pressed(screen->machine, KEYCODE_R)) vdplayer = 3; + if (input_code_pressed(screen->machine, KEYCODE_A)) vdppri = 0x00; + if (input_code_pressed(screen->machine, KEYCODE_S)) vdppri = 0x01; + if (input_code_pressed(screen->machine, KEYCODE_D)) vdppri = 0x02; + if (input_code_pressed(screen->machine, KEYCODE_F)) vdppri = 0x04; + if (input_code_pressed(screen->machine, KEYCODE_G)) vdppri = 0x08; #endif /* if no drawing is happening, fill with black and get out */ @@ -241,12 +241,12 @@ VIDEO_UPDATE( system18 ) segaic16_sprites_draw(screen, bitmap, cliprect, 0); #if DEBUG_VDP - if (vdp_enable && input_code_pressed(KEYCODE_V)) + if (vdp_enable && input_code_pressed(screen->machine, KEYCODE_V)) { bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); update_system18_vdp(bitmap, cliprect); } - if (vdp_enable && input_code_pressed(KEYCODE_B)) + if (vdp_enable && input_code_pressed(screen->machine, KEYCODE_B)) { FILE *f = fopen("vdp.bin", "w"); fwrite(tempbitmap->base, 1, tempbitmap->rowpixels * (tempbitmap->bpp / 8) * tempbitmap->height, f); diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c index eadab80c75c..e23fdee52b5 100644 --- a/src/mame/video/segas32.c +++ b/src/mame/video/segas32.c @@ -954,8 +954,8 @@ static void update_tilemap_zoom(const device_config *screen, struct layer_info * /* configure the layer */ opaque = 0; //opaque = (system32_videoram[0x1ff8e/2] >> (8 + bgnum)) & 1; -//if (input_code_pressed(KEYCODE_Z) && bgnum == 0) opaque = 1; -//if (input_code_pressed(KEYCODE_X) && bgnum == 1) opaque = 1; +//if (input_code_pressed(screen->machine, KEYCODE_Z) && bgnum == 0) opaque = 1; +//if (input_code_pressed(screen->machine, KEYCODE_X) && bgnum == 1) opaque = 1; /* determine if we're flipped */ flip = ((system32_videoram[0x1ff00/2] >> 9) ^ (system32_videoram[0x1ff00/2] >> bgnum)) & 1; @@ -1108,8 +1108,8 @@ static void update_tilemap_rowscroll(const device_config *screen, struct layer_i /* configure the layer */ opaque = 0; //opaque = (system32_videoram[0x1ff8e/2] >> (8 + bgnum)) & 1; -//if (input_code_pressed(KEYCODE_C) && bgnum == 2) opaque = 1; -//if (input_code_pressed(KEYCODE_V) && bgnum == 3) opaque = 1; +//if (input_code_pressed(screen->machine, KEYCODE_C) && bgnum == 2) opaque = 1; +//if (input_code_pressed(screen->machine, KEYCODE_V) && bgnum == 3) opaque = 1; /* determine if we're flipped */ flip = ((system32_videoram[0x1ff00/2] >> 9) ^ (system32_videoram[0x1ff00/2] >> bgnum)) & 1; @@ -2466,12 +2466,12 @@ VIDEO_UPDATE( system32 ) /* debugging */ #if QWERTY_LAYER_ENABLE - if (input_code_pressed(KEYCODE_Q)) enablemask = 0x01; - if (input_code_pressed(KEYCODE_W)) enablemask = 0x02; - if (input_code_pressed(KEYCODE_E)) enablemask = 0x04; - if (input_code_pressed(KEYCODE_R)) enablemask = 0x08; - if (input_code_pressed(KEYCODE_T)) enablemask = 0x10; - if (input_code_pressed(KEYCODE_Y)) enablemask = 0x20; + if (input_code_pressed(screen->machine, KEYCODE_Q)) enablemask = 0x01; + if (input_code_pressed(screen->machine, KEYCODE_W)) enablemask = 0x02; + if (input_code_pressed(screen->machine, KEYCODE_E)) enablemask = 0x04; + if (input_code_pressed(screen->machine, KEYCODE_R)) enablemask = 0x08; + if (input_code_pressed(screen->machine, KEYCODE_T)) enablemask = 0x10; + if (input_code_pressed(screen->machine, KEYCODE_Y)) enablemask = 0x20; #endif /* do the mixing */ @@ -2479,7 +2479,7 @@ VIDEO_UPDATE( system32 ) mix_all_layers(0, 0, bitmap, cliprect, enablemask); profiler_mark_end(); - if (LOG_SPRITES && input_code_pressed(KEYCODE_L)) + if (LOG_SPRITES && input_code_pressed(screen->machine, KEYCODE_L)) { const rectangle *visarea = video_screen_get_visible_area(screen); FILE *f = fopen("sprite.txt", "w"); @@ -2557,13 +2557,13 @@ VIDEO_UPDATE( system32 ) { int showclip = -1; -// if (input_code_pressed(KEYCODE_V)) +// if (input_code_pressed(screen->machine, KEYCODE_V)) // showclip = 0; -// if (input_code_pressed(KEYCODE_B)) +// if (input_code_pressed(screen->machine, KEYCODE_B)) // showclip = 1; -// if (input_code_pressed(KEYCODE_N)) +// if (input_code_pressed(screen->machine, KEYCODE_N)) // showclip = 2; -// if (input_code_pressed(KEYCODE_M)) +// if (input_code_pressed(screen->machine, KEYCODE_M)) // showclip = 3; // if (showclip != -1) for (showclip = 0; showclip < 4; showclip++) @@ -2646,12 +2646,12 @@ VIDEO_UPDATE( multi32 ) /* debugging */ #if QWERTY_LAYER_ENABLE - if (input_code_pressed(KEYCODE_Q)) enablemask = 0x01; - if (input_code_pressed(KEYCODE_W)) enablemask = 0x02; - if (input_code_pressed(KEYCODE_E)) enablemask = 0x04; - if (input_code_pressed(KEYCODE_R)) enablemask = 0x08; - if (input_code_pressed(KEYCODE_T)) enablemask = 0x10; - if (input_code_pressed(KEYCODE_Y)) enablemask = 0x20; + if (input_code_pressed(screen->machine, KEYCODE_Q)) enablemask = 0x01; + if (input_code_pressed(screen->machine, KEYCODE_W)) enablemask = 0x02; + if (input_code_pressed(screen->machine, KEYCODE_E)) enablemask = 0x04; + if (input_code_pressed(screen->machine, KEYCODE_R)) enablemask = 0x08; + if (input_code_pressed(screen->machine, KEYCODE_T)) enablemask = 0x10; + if (input_code_pressed(screen->machine, KEYCODE_Y)) enablemask = 0x20; #endif /* do the mixing */ @@ -2661,10 +2661,10 @@ VIDEO_UPDATE( multi32 ) if (PRINTF_MIXER_DATA) { - if (!input_code_pressed(KEYCODE_M)) print_mixer_data(0); + if (!input_code_pressed(screen->machine, KEYCODE_M)) print_mixer_data(0); else print_mixer_data(1); } - if (LOG_SPRITES && input_code_pressed(KEYCODE_L)) + if (LOG_SPRITES && input_code_pressed(screen->machine, KEYCODE_L)) { const rectangle *visarea = video_screen_get_visible_area(screen); FILE *f = fopen("sprite.txt", "w"); diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c index a97b1da6e8b..004645fe1ff 100644 --- a/src/mame/video/seta.c +++ b/src/mame/video/seta.c @@ -965,11 +965,11 @@ static VIDEO_UPDATE( seta_layers ) #ifdef MAME_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_A)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; if (tilemap_2) popmessage("VR:%04X-%04X-%04X L0:%04X L1:%04X",seta_vregs[0],seta_vregs[1],seta_vregs[2],seta_vctrl_0[4/2],seta_vctrl_2[4/2]); diff --git a/src/mame/video/slapfght.c b/src/mame/video/slapfght.c index 0fd958a31c9..b3b03a3b4d5 100644 --- a/src/mame/video/slapfght.c +++ b/src/mame/video/slapfght.c @@ -132,10 +132,10 @@ WRITE8_HANDLER( slapfight_palette_bank_w ) slapfight_palette_bank = offset; } -#ifdef MAME_DEBUG -static void slapfght_log_vram(void) +static void slapfght_log_vram(running_machine *machine) { - if ( input_code_pressed_once(KEYCODE_B) ) +#ifdef MAME_DEBUG + if ( input_code_pressed_once(machine, KEYCODE_B) ) { int i; for (i=0; i<0x800; i++) @@ -143,8 +143,8 @@ static void slapfght_log_vram(void) logerror("Offset:%03x TileRAM:%02x AttribRAM:%02x SpriteRAM:%02x\n",i, videoram[i],colorram[i],spriteram[i]); } } -} #endif +} /*************************************************************************** @@ -199,9 +199,7 @@ VIDEO_UPDATE( perfrman ) tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); draw_sprites(screen->machine, bitmap,cliprect,0x80); -#ifdef MAME_DEBUG - slapfght_log_vram(); -#endif + slapfght_log_vram(screen->machine); return 0; } @@ -245,8 +243,6 @@ VIDEO_UPDATE( slapfight ) tilemap_draw(bitmap,cliprect,fix_tilemap,0,0); -#ifdef MAME_DEBUG - slapfght_log_vram(); -#endif + slapfght_log_vram(screen->machine); return 0; } diff --git a/src/mame/video/slapshot.c b/src/mame/video/slapshot.c index b32f637c202..7264e27bb71 100644 --- a/src/mame/video/slapshot.c +++ b/src/mame/video/slapshot.c @@ -520,31 +520,31 @@ VIDEO_UPDATE( slapshot ) #endif #ifdef MAME_DEBUG - if (input_code_pressed_once (KEYCODE_Z)) + if (input_code_pressed_once (screen->machine, KEYCODE_Z)) { dislayer[0] ^= 1; popmessage("bg0: %01x",dislayer[0]); } - if (input_code_pressed_once (KEYCODE_X)) + if (input_code_pressed_once (screen->machine, KEYCODE_X)) { dislayer[1] ^= 1; popmessage("bg1: %01x",dislayer[1]); } - if (input_code_pressed_once (KEYCODE_C)) + if (input_code_pressed_once (screen->machine, KEYCODE_C)) { dislayer[2] ^= 1; popmessage("bg2: %01x",dislayer[2]); } - if (input_code_pressed_once (KEYCODE_V)) + if (input_code_pressed_once (screen->machine, KEYCODE_V)) { dislayer[3] ^= 1; popmessage("bg3: %01x",dislayer[3]); } - if (input_code_pressed_once (KEYCODE_B)) + if (input_code_pressed_once (screen->machine, KEYCODE_B)) { dislayer[4] ^= 1; popmessage("text: %01x",dislayer[4]); diff --git a/src/mame/video/ssv.c b/src/mame/video/ssv.c index 2299a24349f..1bdabe4d933 100644 --- a/src/mame/video/ssv.c +++ b/src/mame/video/ssv.c @@ -900,7 +900,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta } #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z)) /* Display some info on each sprite */ + if (input_code_pressed(machine, KEYCODE_Z)) /* Display some info on each sprite */ { char buf[30]; sprintf(buf, "%02X",/*(s2[2] & ~0x3ff)>>8*/mode>>8); ui_draw_text(buf, sx, sy); @@ -1078,7 +1078,7 @@ static void gdfs_draw_zooming_sprites(running_machine *machine, bitmap_t *bitmap } #ifdef MAME_DEBUG - if (input_code_pressed(KEYCODE_Z)) /* Display some info on each sprite */ + if (input_code_pressed(machine, KEYCODE_Z)) /* Display some info on each sprite */ { char buf[10]; sprintf(buf, "%X",size); diff --git a/src/mame/video/st0016.c b/src/mame/video/st0016.c index 48351ab08b6..e20aa13ebc7 100644 --- a/src/mame/video/st0016.c +++ b/src/mame/video/st0016.c @@ -594,7 +594,7 @@ VIDEO_UPDATE( st0016 ) { #ifdef MAME_DEBUG - if(input_code_pressed_once(KEYCODE_Z)) + if(input_code_pressed_once(screen->machine, KEYCODE_Z)) { int h,j; FILE *p=fopen("vram.bin","wb"); diff --git a/src/mame/video/stvvdp1.c b/src/mame/video/stvvdp1.c index 6c5a0068bd5..5d041da6f4b 100644 --- a/src/mame/video/stvvdp1.c +++ b/src/mame/video/stvvdp1.c @@ -1997,10 +1997,10 @@ void video_update_vdp1(running_machine *machine) int framebufer_changed = 0; // int enable; -// if (input_code_pressed (KEYCODE_R)) vdp1_sprite_log = 1; -// if (input_code_pressed (KEYCODE_T)) vdp1_sprite_log = 0; +// if (input_code_pressed (machine, KEYCODE_R)) vdp1_sprite_log = 1; +// if (input_code_pressed (machine, KEYCODE_T)) vdp1_sprite_log = 0; -// if (input_code_pressed (KEYCODE_Y)) vdp1_sprite_log = 0; +// if (input_code_pressed (machine, KEYCODE_Y)) vdp1_sprite_log = 0; // { // FILE *fp; // diff --git a/src/mame/video/stvvdp2.c b/src/mame/video/stvvdp2.c index d197da9fd26..af38991e64c 100644 --- a/src/mame/video/stvvdp2.c +++ b/src/mame/video/stvvdp2.c @@ -2163,7 +2163,7 @@ static struct _stv_rbg_cache_data #define mul_fixed32( a, b ) mul_32x32_shift( a, b, 16 ) -static void stv_vdp2_fill_rotation_parameter_table( UINT8 rot_parameter ) +static void stv_vdp2_fill_rotation_parameter_table( running_machine *machine, UINT8 rot_parameter ) { UINT32 address; @@ -2222,10 +2222,10 @@ static void stv_vdp2_fill_rotation_parameter_table( UINT8 rot_parameter ) /*Attempt to show on screen the rotation table*/ if(LOG_ROZ == 2) { - if(input_code_pressed_once(JOYCODE_Y_UP_SWITCH)) + if(input_code_pressed_once(machine, JOYCODE_Y_UP_SWITCH)) debug.roz++; - if(input_code_pressed_once(JOYCODE_Y_DOWN_SWITCH)) + if(input_code_pressed_once(machine, JOYCODE_Y_DOWN_SWITCH)) debug.roz--; if(debug.roz > 10) @@ -4801,7 +4801,7 @@ static void stv_vdp2_draw_rotation_screen(running_machine *machine, bitmap_t *bi stv2_current_tilemap.map_count = 16; } - stv_vdp2_fill_rotation_parameter_table(iRP); + stv_vdp2_fill_rotation_parameter_table(machine, iRP); if ( iRP == 1 ) { @@ -6227,32 +6227,32 @@ VIDEO_UPDATE( stv_vdp2 ) stv_vdp2_draw_back(screen->machine, bitmap,cliprect); #if DEBUG_MODE - if(input_code_pressed_once(KEYCODE_T)) + if(input_code_pressed_once(screen->machine, KEYCODE_T)) { debug.l_en^=1; popmessage("NBG3 %sabled",debug.l_en & 1 ? "en" : "dis"); } - if(input_code_pressed_once(KEYCODE_Y)) + if(input_code_pressed_once(screen->machine, KEYCODE_Y)) { debug.l_en^=2; popmessage("NBG2 %sabled",debug.l_en & 2 ? "en" : "dis"); } - if(input_code_pressed_once(KEYCODE_U)) + if(input_code_pressed_once(screen->machine, KEYCODE_U)) { debug.l_en^=4; popmessage("NBG1 %sabled",debug.l_en & 4 ? "en" : "dis"); } - if(input_code_pressed_once(KEYCODE_I)) + if(input_code_pressed_once(screen->machine, KEYCODE_I)) { debug.l_en^=8; popmessage("NBG0 %sabled",debug.l_en & 8 ? "en" : "dis"); } - if(input_code_pressed_once(KEYCODE_K)) + if(input_code_pressed_once(screen->machine, KEYCODE_K)) { debug.l_en^=0x10; popmessage("RBG0 %sabled",debug.l_en & 0x10 ? "en" : "dis"); } - if(input_code_pressed_once(KEYCODE_O)) + if(input_code_pressed_once(screen->machine, KEYCODE_O)) { debug.l_en^=0x20; popmessage("SPRITE %sabled",debug.l_en & 0x20 ? "en" : "dis"); @@ -6295,7 +6295,7 @@ VIDEO_UPDATE( stv_vdp2 ) ,STV_VDP2_N1ZMXI,STV_VDP2_N1ZMXD ,STV_VDP2_N1ZMYI,STV_VDP2_N1ZMYD);*/ - if ( input_code_pressed_once(KEYCODE_W) ) + if ( input_code_pressed_once(screen->machine, KEYCODE_W) ) { int tilecode; @@ -6339,7 +6339,7 @@ VIDEO_UPDATE( stv_vdp2 ) } } - if ( input_code_pressed_once(KEYCODE_N) ) + if ( input_code_pressed_once(screen->machine, KEYCODE_N) ) { FILE *fp; @@ -6351,7 +6351,7 @@ VIDEO_UPDATE( stv_vdp2 ) } } - if ( input_code_pressed_once(KEYCODE_M) ) + if ( input_code_pressed_once(screen->machine, KEYCODE_M) ) { FILE *fp; diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c index 008dee9eca1..a9cbcbe99c4 100644 --- a/src/mame/video/suna16.c +++ b/src/mame/video/suna16.c @@ -228,10 +228,10 @@ VIDEO_UPDATE( bestbest ) int layers_ctrl = -1; #ifdef MAME_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/video/suna8.c b/src/mame/video/suna8.c index 49882c2085c..3890c32a405 100644 --- a/src/mame/video/suna8.c +++ b/src/mame/video/suna8.c @@ -98,7 +98,7 @@ static int tiles, rombank, page; static TILE_GET_INFO( get_tile_info ) { UINT8 code, attr; - if (input_code_pressed(KEYCODE_X)) + if (input_code_pressed(screen->machine, KEYCODE_X)) { UINT8 *rom = memory_region(machine, REGION_CPU1) + 0x10000 + 0x4000*rombank; code = rom[ 2 * tile_index + 0 ]; attr = rom[ 2 * tile_index + 1 ]; } @@ -412,16 +412,16 @@ VIDEO_UPDATE( suna8 ) #ifdef MAME_DEBUG #if TILEMAPS - if (input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X)) + if (input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X)) { int max_tiles = memory_region_length(machine, "gfx1") / (0x400 * 0x20); - if (input_code_pressed_once(KEYCODE_Q)) { page--; tilemap_mark_all_tiles_dirty_all(screen->machine); } - if (input_code_pressed_once(KEYCODE_W)) { page++; tilemap_mark_all_tiles_dirty_all(screen->machine); } - if (input_code_pressed_once(KEYCODE_E)) { tiles--; tilemap_mark_all_tiles_dirty_all(screen->machine); } - if (input_code_pressed_once(KEYCODE_R)) { tiles++; tilemap_mark_all_tiles_dirty_all(screen->machine); } - if (input_code_pressed_once(KEYCODE_A)) { rombank--; tilemap_mark_all_tiles_dirty_all(screen->machine); } - if (input_code_pressed_once(KEYCODE_S)) { rombank++; tilemap_mark_all_tiles_dirty_all(screen->machine); } + if (input_code_pressed_once(screen->machine, KEYCODE_Q)) { page--; tilemap_mark_all_tiles_dirty_all(screen->machine); } + if (input_code_pressed_once(screen->machine, KEYCODE_W)) { page++; tilemap_mark_all_tiles_dirty_all(screen->machine); } + if (input_code_pressed_once(screen->machine, KEYCODE_E)) { tiles--; tilemap_mark_all_tiles_dirty_all(screen->machine); } + if (input_code_pressed_once(screen->machine, KEYCODE_R)) { tiles++; tilemap_mark_all_tiles_dirty_all(screen->machine); } + if (input_code_pressed_once(screen->machine, KEYCODE_A)) { rombank--; tilemap_mark_all_tiles_dirty_all(screen->machine); } + if (input_code_pressed_once(screen->machine, KEYCODE_S)) { rombank++; tilemap_mark_all_tiles_dirty_all(screen->machine); } rombank &= 0xf; page &= (suna8_text_dim > 0)?3:7; diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c index 74277d8cf4f..712fef878fc 100644 --- a/src/mame/video/superchs.c +++ b/src/mame/video/superchs.c @@ -231,12 +231,12 @@ VIDEO_UPDATE( superchs ) sprites as pdrawgfx cannot yet cope with more than 4 layers */ #ifdef MAME_DEBUG - if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); - if (!input_code_pressed (KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); - if (!input_code_pressed (KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); - if (!input_code_pressed (KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); - if (!input_code_pressed (KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); - if (!input_code_pressed (KEYCODE_N)) draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); + if (!input_code_pressed (screen->machine, KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); + if (!input_code_pressed (screen->machine, KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); + if (!input_code_pressed (screen->machine, KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); + if (!input_code_pressed (screen->machine, KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); + if (!input_code_pressed (screen->machine, KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); + if (!input_code_pressed (screen->machine, KEYCODE_N)) draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); #else TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); diff --git a/src/mame/video/taito_h.c b/src/mame/video/taito_h.c index 1bd7a031051..af698c3ede5 100644 --- a/src/mame/video/taito_h.c +++ b/src/mame/video/taito_h.c @@ -396,15 +396,13 @@ static void dleague_draw_sprites(running_machine *machine, bitmap_t *bitmap, con -#ifdef MAME_DEBUG - -static void taitoh_log_vram(void) +static void taitoh_log_vram(running_machine *machine) { +#ifdef MAME_DEBUG // null function: the necessary pointers are now internal to taitoic.c // Recreate it there if wanted (add prototype to taitoic.h) -} - #endif +} /**************************************************************************/ @@ -413,9 +411,7 @@ VIDEO_UPDATE( syvalion ) { TC0080VCO_tilemap_update(screen->machine); -#ifdef MAME_DEBUG - taitoh_log_vram(); -#endif + taitoh_log_vram(screen->machine); bitmap_fill(bitmap, cliprect, 0); @@ -431,20 +427,18 @@ VIDEO_UPDATE( recordbr ) { TC0080VCO_tilemap_update(screen->machine); -#ifdef MAME_DEBUG - taitoh_log_vram(); -#endif + taitoh_log_vram(screen->machine); bitmap_fill(bitmap, cliprect, 0); #ifdef MAME_DEBUG - if ( !input_code_pressed(KEYCODE_A) ) + if ( !input_code_pressed(screen->machine, KEYCODE_A) ) TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0); - if ( !input_code_pressed(KEYCODE_S) ) + if ( !input_code_pressed(screen->machine, KEYCODE_S) ) recordbr_draw_sprites(screen->machine,bitmap,cliprect,0); - if ( !input_code_pressed(KEYCODE_D) ) + if ( !input_code_pressed(screen->machine, KEYCODE_D) ) TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,1,0,0); - if ( !input_code_pressed(KEYCODE_F) ) + if ( !input_code_pressed(screen->machine, KEYCODE_F) ) recordbr_draw_sprites(screen->machine,bitmap,cliprect,1); #else TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0); @@ -462,20 +456,18 @@ VIDEO_UPDATE( dleague ) { TC0080VCO_tilemap_update(screen->machine); -#ifdef MAME_DEBUG - taitoh_log_vram(); -#endif + taitoh_log_vram(screen->machine); bitmap_fill(bitmap, cliprect, 0); #ifdef MAME_DEBUG - if ( !input_code_pressed(KEYCODE_A) ) + if ( !input_code_pressed(screen->machine, KEYCODE_A) ) TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0); - if ( !input_code_pressed(KEYCODE_S) ) + if ( !input_code_pressed(screen->machine, KEYCODE_S) ) dleague_draw_sprites(screen->machine,bitmap,cliprect,0); - if ( !input_code_pressed(KEYCODE_D) ) + if ( !input_code_pressed(screen->machine, KEYCODE_D) ) TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,1,0,0); - if ( !input_code_pressed(KEYCODE_F) ) + if ( !input_code_pressed(screen->machine, KEYCODE_F) ) dleague_draw_sprites(screen->machine,bitmap,cliprect,1); #else TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0); diff --git a/src/mame/video/taitoair.c b/src/mame/video/taitoair.c index 5a317567e46..a37ea349d42 100644 --- a/src/mame/video/taitoair.c +++ b/src/mame/video/taitoair.c @@ -361,13 +361,13 @@ VIDEO_UPDATE( taitoair ) bitmap_fill(bitmap, cliprect, 0x41); #ifdef MAME_DEBUG - if ( !input_code_pressed(KEYCODE_A) ) + if ( !input_code_pressed(screen->machine, KEYCODE_A) ) TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,0,0); - if ( !input_code_pressed(KEYCODE_S) ) + if ( !input_code_pressed(screen->machine, KEYCODE_S) ) draw_sprites(screen->machine,bitmap,cliprect,0); - if ( !input_code_pressed(KEYCODE_D) ) + if ( !input_code_pressed(screen->machine, KEYCODE_D) ) TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,1,0,0); - if ( !input_code_pressed(KEYCODE_F) ) + if ( !input_code_pressed(screen->machine, KEYCODE_F) ) draw_sprites(screen->machine,bitmap,cliprect,1); #else TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,0,0); diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c index 17600d39436..07739677d8e 100644 --- a/src/mame/video/taitoic.c +++ b/src/mame/video/taitoic.c @@ -3996,36 +3996,36 @@ void TC0150ROD_draw(running_machine *machine, bitmap_t *bitmap,const rectangle * int priority_switch_line = (road_ctrl & 0x00ff) - y_offs; #ifdef MAME_DEBUG - if (input_code_pressed_once (KEYCODE_X)) + if (input_code_pressed_once (machine, KEYCODE_X)) { dislayer[0] ^= 1; popmessage("RoadA body: %01x",dislayer[0]); } - if (input_code_pressed_once (KEYCODE_C)) + if (input_code_pressed_once (machine, KEYCODE_C)) { dislayer[1] ^= 1; popmessage("RoadA l-edge: %01x",dislayer[1]); } - if (input_code_pressed_once (KEYCODE_V)) + if (input_code_pressed_once (machine, KEYCODE_V)) { dislayer[2] ^= 1; popmessage("RoadA r-edge: %01x",dislayer[2]); } - if (input_code_pressed_once (KEYCODE_B)) + if (input_code_pressed_once (machine, KEYCODE_B)) { dislayer[3] ^= 1; popmessage("RoadB body: %01x",dislayer[3]); } - if (input_code_pressed_once (KEYCODE_N)) + if (input_code_pressed_once (machine, KEYCODE_N)) { dislayer[4] ^= 1; popmessage("RoadB l-edge: %01x",dislayer[4]); } - if (input_code_pressed_once (KEYCODE_M)) + if (input_code_pressed_once (machine, KEYCODE_M)) { dislayer[5] ^= 1; popmessage("RoadB r-edge: %01x",dislayer[5]); diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c index ddfdd84c3f3..08b670cee1c 100644 --- a/src/mame/video/taitojc.c +++ b/src/mame/video/taitojc.c @@ -214,10 +214,10 @@ VIDEO_UPDATE( taitojc ) if( tick >= 5 ) { tick = 0; - if( input_code_pressed(KEYCODE_O) ) + if( input_code_pressed(screen->machine, KEYCODE_O) ) debug_tex_pal++; - if( input_code_pressed(KEYCODE_I) ) + if( input_code_pressed(screen->machine, KEYCODE_I) ) debug_tex_pal--; debug_tex_pal &= 0x7f; diff --git a/src/mame/video/tmnt.c b/src/mame/video/tmnt.c index 8f3d3e7fb13..78fb6039ffd 100644 --- a/src/mame/video/tmnt.c +++ b/src/mame/video/tmnt.c @@ -173,9 +173,9 @@ static void lgtnfght_sprite_callback(int *code,int *color,int *priority_mask) static void blswhstl_sprite_callback(int *code,int *color,int *priority_mask) { #if 0 -if (input_code_pressed(KEYCODE_Q) && (*color & 0x20)) *color = rand(); -if (input_code_pressed(KEYCODE_W) && (*color & 0x40)) *color = rand(); -if (input_code_pressed(KEYCODE_E) && (*color & 0x80)) *color = rand(); +if (input_code_pressed(machine, KEYCODE_Q) && (*color & 0x20)) *color = rand(); +if (input_code_pressed(machine, KEYCODE_W) && (*color & 0x40)) *color = rand(); +if (input_code_pressed(machine, KEYCODE_E) && (*color & 0x80)) *color = rand(); #endif int pri = 0x20 | ((*color & 0x60) >> 2); if (pri <= layerpri[2]) *priority_mask = 0; diff --git a/src/mame/video/toaplan1.c b/src/mame/video/toaplan1.c index 3dbb92bf3cd..e3de32bf2ea 100644 --- a/src/mame/video/toaplan1.c +++ b/src/mame/video/toaplan1.c @@ -738,13 +738,13 @@ WRITE16_HANDLER( toaplan1_scroll_regs_w ) -#ifdef MAME_DEBUG -static void toaplan1_log_vram(void) +static void toaplan1_log_vram(running_machine *machine) { - if ( input_code_pressed(KEYCODE_M) ) +#ifdef MAME_DEBUG + if ( input_code_pressed(machine, KEYCODE_M) ) { offs_t sprite_voffs; - while (input_code_pressed(KEYCODE_M)) ; + while (input_code_pressed(machine, KEYCODE_M)) ; if (toaplan1_spritesizeram16) /* FCU controller */ { int schar,sattr,sxpos,sypos,bschar,bsattr,bsxpos,bsypos; @@ -789,12 +789,12 @@ static void toaplan1_log_vram(void) } } - if ( input_code_pressed(KEYCODE_SLASH) ) + if ( input_code_pressed(machine, KEYCODE_SLASH) ) { UINT16 *size = (UINT16 *)(toaplan1_spritesizeram16); UINT16 *bsize = (UINT16 *)(toaplan1_buffered_spritesizeram16); offs_t offs; - while (input_code_pressed(KEYCODE_SLASH)) ; + while (input_code_pressed(machine, KEYCODE_SLASH)) ; if (toaplan1_spritesizeram16) /* FCU controller */ { logerror("Scrolls PF1-X PF1-Y PF2-X PF2-Y PF3-X PF3-Y PF4-X PF4-Y\n"); @@ -810,11 +810,11 @@ static void toaplan1_log_vram(void) } } - if ( input_code_pressed(KEYCODE_N) ) + if ( input_code_pressed(machine, KEYCODE_N) ) { offs_t tile_voffs; int tchar[5], tattr[5]; - while (input_code_pressed(KEYCODE_N)) ; /* BCU controller */ + while (input_code_pressed(machine, KEYCODE_N)) ; /* BCU controller */ logerror("Scrolls PF1-X PF1-Y PF2-X PF2-Y PF3-X PF3-Y PF4-X PF4-Y\n"); logerror("------> #%04x #%04x #%04x #%04x #%04x #%04x #%04x #%04x\n",pf1_scrollx,pf1_scrolly,pf2_scrollx,pf2_scrolly,pf3_scrollx,pf3_scrolly,pf4_scrollx,pf4_scrolly); for ( tile_voffs = 0; tile_voffs < (TOAPLAN1_TILEVRAM_SIZE/2); tile_voffs += 2 ) @@ -834,14 +834,14 @@ static void toaplan1_log_vram(void) } } - if ( input_code_pressed(KEYCODE_W) ) + if ( input_code_pressed(machine, KEYCODE_W) ) { - while (input_code_pressed(KEYCODE_W)) ; + while (input_code_pressed(machine, KEYCODE_W)) ; logerror("Mark here\n"); } - if ( input_code_pressed(KEYCODE_E) ) + if ( input_code_pressed(machine, KEYCODE_E) ) { - while (input_code_pressed(KEYCODE_E)) ; + while (input_code_pressed(machine, KEYCODE_E)) ; displog += 1; displog &= 1; } @@ -850,9 +850,9 @@ static void toaplan1_log_vram(void) logerror("Scrolls PF1-X PF1-Y PF2-X PF2-Y PF3-X PF3-Y PF4-X PF4-Y\n"); logerror("------> #%04x #%04x #%04x #%04x #%04x #%04x #%04x #%04x\n",pf1_scrollx,pf1_scrolly,pf2_scrollx,pf2_scrolly,pf3_scrollx,pf3_scrolly,pf4_scrollx,pf4_scrolly); } - if ( input_code_pressed(KEYCODE_B) ) + if ( input_code_pressed(machine, KEYCODE_B) ) { -// while (input_code_pressed(KEYCODE_B)) ; +// while (input_code_pressed(machine, KEYCODE_B)) ; scrollx_offs1 += 0x1; scrollx_offs2 += 0x1; scrollx_offs3 += 0x1; scrollx_offs4 += 0x1; logerror("Scrollx_offs now = %08x\n",scrollx_offs4); tilemap_set_scrollx(pf1_tilemap,0,(pf1_scrollx >> 7) - (tiles_offsetx - scrollx_offs1)); @@ -860,9 +860,9 @@ static void toaplan1_log_vram(void) tilemap_set_scrollx(pf3_tilemap,0,(pf3_scrollx >> 7) - (tiles_offsetx - scrollx_offs3)); tilemap_set_scrollx(pf4_tilemap,0,(pf4_scrollx >> 7) - (tiles_offsetx - scrollx_offs4)); } - if ( input_code_pressed(KEYCODE_V) ) + if ( input_code_pressed(machine, KEYCODE_V) ) { -// while (input_code_pressed(KEYCODE_V)) ; +// while (input_code_pressed(machine, KEYCODE_V)) ; scrollx_offs1 -= 0x1; scrollx_offs2 -= 0x1; scrollx_offs3 -= 0x1; scrollx_offs4 -= 0x1; logerror("Scrollx_offs now = %08x\n",scrollx_offs4); tilemap_set_scrollx(pf1_tilemap,0,(pf1_scrollx >> 7) - (tiles_offsetx - scrollx_offs1)); @@ -870,9 +870,9 @@ static void toaplan1_log_vram(void) tilemap_set_scrollx(pf3_tilemap,0,(pf3_scrollx >> 7) - (tiles_offsetx - scrollx_offs3)); tilemap_set_scrollx(pf4_tilemap,0,(pf4_scrollx >> 7) - (tiles_offsetx - scrollx_offs4)); } - if ( input_code_pressed(KEYCODE_C) ) + if ( input_code_pressed(machine, KEYCODE_C) ) { -// while (input_code_pressed(KEYCODE_C)) ; +// while (input_code_pressed(machine, KEYCODE_C)) ; scrolly_offs += 0x1; logerror("Scrolly_offs now = %08x\n",scrolly_offs); tilemap_set_scrolly(pf1_tilemap,0,(pf1_scrolly >> 7) - (tiles_offsety - scrolly_offs)); @@ -880,9 +880,9 @@ static void toaplan1_log_vram(void) tilemap_set_scrolly(pf3_tilemap,0,(pf3_scrolly >> 7) - (tiles_offsety - scrolly_offs)); tilemap_set_scrolly(pf4_tilemap,0,(pf4_scrolly >> 7) - (tiles_offsety - scrolly_offs)); } - if ( input_code_pressed(KEYCODE_X) ) + if ( input_code_pressed(machine, KEYCODE_X) ) { -// while (input_code_pressed(KEYCODE_X)) ; +// while (input_code_pressed(machine, KEYCODE_X)) ; scrolly_offs -= 0x1; logerror("Scrolly_offs now = %08x\n",scrolly_offs); tilemap_set_scrolly(pf1_tilemap,0,(pf1_scrolly >> 7) - (tiles_offsety - scrolly_offs)); @@ -891,36 +891,36 @@ static void toaplan1_log_vram(void) tilemap_set_scrolly(pf4_tilemap,0,(pf4_scrolly >> 7) - (tiles_offsety - scrolly_offs)); } - if ( input_code_pressed(KEYCODE_L) ) /* Turn Playfield 4 on/off */ + if ( input_code_pressed(machine, KEYCODE_L) ) /* Turn Playfield 4 on/off */ { - while (input_code_pressed(KEYCODE_L)) ; + while (input_code_pressed(machine, KEYCODE_L)) ; display_pf4 += 1; display_pf4 &= 1; tilemap_set_enable(pf4_tilemap, display_pf4); } - if ( input_code_pressed(KEYCODE_K) ) /* Turn Playfield 3 on/off */ + if ( input_code_pressed(machine, KEYCODE_K) ) /* Turn Playfield 3 on/off */ { - while (input_code_pressed(KEYCODE_K)) ; + while (input_code_pressed(machine, KEYCODE_K)) ; display_pf3 += 1; display_pf3 &= 1; tilemap_set_enable(pf3_tilemap, display_pf3); } - if ( input_code_pressed(KEYCODE_J) ) /* Turn Playfield 2 on/off */ + if ( input_code_pressed(machine, KEYCODE_J) ) /* Turn Playfield 2 on/off */ { - while (input_code_pressed(KEYCODE_J)) ; + while (input_code_pressed(machine, KEYCODE_J)) ; display_pf2 += 1; display_pf2 &= 1; tilemap_set_enable(pf2_tilemap, display_pf2); } - if ( input_code_pressed(KEYCODE_H) ) /* Turn Playfield 1 on/off */ + if ( input_code_pressed(machine, KEYCODE_H) ) /* Turn Playfield 1 on/off */ { - while (input_code_pressed(KEYCODE_H)) ; + while (input_code_pressed(machine, KEYCODE_H)) ; display_pf1 += 1; display_pf1 &= 1; tilemap_set_enable(pf1_tilemap, display_pf1); } -} #endif +} @@ -1134,9 +1134,7 @@ VIDEO_UPDATE( rallybik ) { int priority; -#ifdef MAME_DEBUG - toaplan1_log_vram(); -#endif + toaplan1_log_vram(screen->machine); bitmap_fill(bitmap,cliprect,0); @@ -1158,9 +1156,7 @@ VIDEO_UPDATE( toaplan1 ) { int priority; -#ifdef MAME_DEBUG - toaplan1_log_vram(); -#endif + toaplan1_log_vram(screen->machine); bitmap_fill(screen->machine->priority_bitmap,cliprect,0); bitmap_fill(bitmap,cliprect,0x120); @@ -1185,9 +1181,7 @@ VIDEO_UPDATE( demonwld ) { int priority; -#ifdef MAME_DEBUG - toaplan1_log_vram(); -#endif + toaplan1_log_vram(screen->machine); bitmap_fill(screen->machine->priority_bitmap,cliprect,0); bitmap_fill(bitmap,cliprect,0x120); diff --git a/src/mame/video/toaplan2.c b/src/mame/video/toaplan2.c index 9ab755c3d91..79f6fffd200 100644 --- a/src/mame/video/toaplan2.c +++ b/src/mame/video/toaplan2.c @@ -1029,31 +1029,31 @@ static void toaplan2_scroll_reg_data_w(running_machine *machine, offs_t offset, vid_controllers = 2; } - if ( input_code_pressed_once(KEYCODE_W) ) + if ( input_code_pressed_once(machine, KEYCODE_W) ) { display_tx += 1; display_tx &= 1; if (toaplan2_txvideoram16 != 0) tilemap_set_enable(tx_tilemap, display_tx); } - if ( input_code_pressed_once(KEYCODE_L) ) + if ( input_code_pressed_once(machine, KEYCODE_L) ) { display_sp[0] += 1; display_sp[0] &= 1; } - if ( input_code_pressed_once(KEYCODE_K) ) + if ( input_code_pressed_once(machine, KEYCODE_K) ) { display_top[0] += 1; display_top[0] &= 1; tilemap_set_enable(top_tilemap[0], display_top[0]); } - if ( input_code_pressed_once(KEYCODE_J) ) + if ( input_code_pressed_once(machine, KEYCODE_J) ) { display_fg[0] += 1; display_fg[0] &= 1; tilemap_set_enable(fg_tilemap[0], display_fg[0]); } - if ( input_code_pressed_once(KEYCODE_H) ) + if ( input_code_pressed_once(machine, KEYCODE_H) ) { display_bg[0] += 1; display_bg[0] &= 1; @@ -1061,24 +1061,24 @@ static void toaplan2_scroll_reg_data_w(running_machine *machine, offs_t offset, } if (vid_controllers == 2) { - if ( input_code_pressed_once(KEYCODE_O) ) + if ( input_code_pressed_once(machine, KEYCODE_O) ) { display_sp[1] += 1; display_sp[1] &= 1; } - if ( input_code_pressed_once(KEYCODE_I) ) + if ( input_code_pressed_once(machine, KEYCODE_I) ) { display_top[1] += 1; display_top[1] &= 1; tilemap_set_enable(top_tilemap[1], display_top[1]); } - if ( input_code_pressed_once(KEYCODE_U) ) + if ( input_code_pressed_once(machine, KEYCODE_U) ) { display_fg[1] += 1; display_fg[1] &= 1; tilemap_set_enable(fg_tilemap[1], display_fg[1]); } - if ( input_code_pressed_once(KEYCODE_Y) ) + if ( input_code_pressed_once(machine, KEYCODE_Y) ) { display_bg[1] += 1; display_bg[1] &= 1; @@ -1150,9 +1150,9 @@ WRITE16_HANDLER( pipibibi_spriteram16_w ) -#ifdef MAME_DEBUG -static void toaplan2_log_vram(void) +static void toaplan2_log_vram(running_machine *machine) { +#ifdef MAME_DEBUG offs_t sprite_voffs, tile_voffs; int vid_controllers = 1; @@ -1162,7 +1162,7 @@ static void toaplan2_log_vram(void) vid_controllers = 2; } - if ( input_code_pressed_once(KEYCODE_M) ) + if ( input_code_pressed_once(machine, KEYCODE_M) ) { UINT16 *source_now0 = (UINT16 *)(spriteram16_now[0]); UINT16 *source_new0 = (UINT16 *)(spriteram16_new[0]); @@ -1213,7 +1213,7 @@ static void toaplan2_log_vram(void) } } } - if ( input_code_pressed_once(KEYCODE_N) ) + if ( input_code_pressed_once(machine, KEYCODE_N) ) { int tchar[2], tattr[2]; logerror("Scrolls BG-X BG-Y FG-X FG-Y TOP-X TOP-Y Sprite-X Sprite-Y\n"); @@ -1238,7 +1238,7 @@ static void toaplan2_log_vram(void) } } } - if ( input_code_pressed_once(KEYCODE_B) ) + if ( input_code_pressed_once(machine, KEYCODE_B) ) { int tchar[2], tattr[2]; logerror("Scrolls BG-X BG-Y FG-X FG-Y TOP-X TOP-Y Sprite-X Sprite-Y\n"); @@ -1263,7 +1263,7 @@ static void toaplan2_log_vram(void) } } } - if ( input_code_pressed_once(KEYCODE_V) ) + if ( input_code_pressed_once(machine, KEYCODE_V) ) { int tchar[2], tattr[2]; logerror("Scrolls BG-X BG-Y FG-X FG-Y TOP-X TOP-Y Sprite-X Sprite-Y\n"); @@ -1289,10 +1289,10 @@ static void toaplan2_log_vram(void) } } - if ( input_code_pressed_once(KEYCODE_C) ) + if ( input_code_pressed_once(machine, KEYCODE_C) ) logerror("Mark here\n"); - if ( input_code_pressed_once(KEYCODE_E) ) + if ( input_code_pressed_once(machine, KEYCODE_E) ) { displog += 1; displog &= 1; @@ -1306,8 +1306,8 @@ static void toaplan2_log_vram(void) logerror("---1--> %04x %04x %04x %04x %04x %04x %04x %04x\n", bg_scrollx[1],bg_scrolly[1],fg_scrollx[1],fg_scrolly[1],top_scrollx[1],top_scrolly[1],sprite_scrollx[1], sprite_scrolly[1]); } } -} #endif +} @@ -1493,10 +1493,7 @@ VIDEO_UPDATE( toaplan2_0 ) { int priority; - -#ifdef MAME_DEBUG - toaplan2_log_vram(); -#endif + toaplan2_log_vram(screen->machine); mark_sprite_priority(0); mark_tile_priority(0); @@ -1518,10 +1515,7 @@ VIDEO_UPDATE( dogyuun_1 ) { int priority; - -#ifdef MAME_DEBUG - toaplan2_log_vram(); -#endif + toaplan2_log_vram(screen->machine); mark_sprite_priority(0); mark_sprite_priority(1); @@ -1553,10 +1547,7 @@ VIDEO_UPDATE( batsugun_1 ) { int priority; - -#ifdef MAME_DEBUG - toaplan2_log_vram(); -#endif + toaplan2_log_vram(screen->machine); mark_sprite_priority(0); mark_sprite_priority(1); @@ -1601,9 +1592,7 @@ VIDEO_UPDATE( batrider_0 ) rectangle clip; const rectangle *visarea = video_screen_get_visible_area(screen); -#ifdef MAME_DEBUG - toaplan2_log_vram(); -#endif + toaplan2_log_vram(screen->machine); mark_sprite_priority(0); mark_tile_priority(0); @@ -1648,10 +1637,7 @@ VIDEO_UPDATE( mahoudai_0 ) { int priority; - -#ifdef MAME_DEBUG - toaplan2_log_vram(); -#endif + toaplan2_log_vram(screen->machine); mark_sprite_priority(0); mark_tile_priority(0); diff --git a/src/mame/video/topspeed.c b/src/mame/video/topspeed.c index 8d67eb3a3dd..474e46f299e 100644 --- a/src/mame/video/topspeed.c +++ b/src/mame/video/topspeed.c @@ -125,31 +125,31 @@ VIDEO_UPDATE( topspeed ) #endif #ifdef MAME_DEBUG - if (input_code_pressed_once (KEYCODE_V)) + if (input_code_pressed_once (screen->machine, KEYCODE_V)) { dislayer[0] ^= 1; popmessage("bg: %01x",dislayer[0]); } - if (input_code_pressed_once (KEYCODE_B)) + if (input_code_pressed_once (screen->machine, KEYCODE_B)) { dislayer[1] ^= 1; popmessage("fg: %01x",dislayer[1]); } - if (input_code_pressed_once (KEYCODE_N)) + if (input_code_pressed_once (screen->machine, KEYCODE_N)) { dislayer[2] ^= 1; popmessage("bg2: %01x",dislayer[2]); } - if (input_code_pressed_once (KEYCODE_M)) + if (input_code_pressed_once (screen->machine, KEYCODE_M)) { dislayer[3] ^= 1; popmessage("fg2: %01x",dislayer[3]); } - if (input_code_pressed_once (KEYCODE_C)) + if (input_code_pressed_once (screen->machine, KEYCODE_C)) { dislayer[4] ^= 1; popmessage("sprites: %01x",dislayer[4]); diff --git a/src/mame/video/tsamurai.c b/src/mame/video/tsamurai.c index 90ce8a6ff44..95a6f48d6fe 100644 --- a/src/mame/video/tsamurai.c +++ b/src/mame/video/tsamurai.c @@ -260,8 +260,8 @@ VIDEO_UPDATE( vsgongf ) { #ifdef MAME_DEBUG static int k; - if( input_code_pressed( KEYCODE_Q ) ){ - while( input_code_pressed( KEYCODE_Q ) ){ + if( input_code_pressed( screen->machine, KEYCODE_Q ) ){ + while( input_code_pressed( screen->machine, KEYCODE_Q ) ){ k++; vsgongf_color = k; tilemap_mark_all_tiles_dirty( foreground ); diff --git a/src/mame/video/twincobr.c b/src/mame/video/twincobr.c index 242963cb5f1..220bcbc2973 100644 --- a/src/mame/video/twincobr.c +++ b/src/mame/video/twincobr.c @@ -404,14 +404,14 @@ static void wardner_sprite_priority_hack(void) -#ifdef MAME_DEBUG -static void twincobr_log_vram(void) +static void twincobr_log_vram(running_machine *machine) { - if ( input_code_pressed(KEYCODE_M) ) +#ifdef MAME_DEBUG + if ( input_code_pressed(machine, KEYCODE_M) ) { offs_t tile_voffs; int tcode[4]; - while (input_code_pressed(KEYCODE_M)) ; + while (input_code_pressed(machine, KEYCODE_M)) ; logerror("Scrolls BG-X BG-Y FG-X FG-Y TX-X TX-Y\n"); logerror("------> %04x %04x %04x %04x %04x %04x\n",bgscrollx,bgscrolly,fgscrollx,fgscrolly,txscrollx,txscrolly); for ( tile_voffs = 0; tile_voffs < (twincobr_txvideoram_size/2); tile_voffs++ ) @@ -439,8 +439,8 @@ static void twincobr_log_vram(void) tcode[1] & 0xf000 >> 12, tcode[1] & 0x0fff); } } -} #endif +} /*************************************************************************** @@ -486,9 +486,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta VIDEO_UPDATE( toaplan0 ) { -#ifdef MAME_DEBUG - twincobr_log_vram(); -#endif + twincobr_log_vram(screen->machine); if (wardner_sprite_hack) wardner_sprite_priority_hack(); diff --git a/src/mame/video/undrfire.c b/src/mame/video/undrfire.c index 0df9e780714..9dc28f8a98c 100644 --- a/src/mame/video/undrfire.c +++ b/src/mame/video/undrfire.c @@ -370,36 +370,36 @@ VIDEO_UPDATE( undrfire ) #endif #ifdef MAME_DEBUG - if (input_code_pressed_once (KEYCODE_X)) + if (input_code_pressed_once (screen->machine, KEYCODE_X)) { dislayer[5] ^= 1; popmessage("piv text: %01x",dislayer[5]); } - if (input_code_pressed_once (KEYCODE_C)) + if (input_code_pressed_once (screen->machine, KEYCODE_C)) { dislayer[0] ^= 1; popmessage("bg0: %01x",dislayer[0]); } - if (input_code_pressed_once (KEYCODE_V)) + if (input_code_pressed_once (screen->machine, KEYCODE_V)) { dislayer[1] ^= 1; popmessage("bg1: %01x",dislayer[1]); } - if (input_code_pressed_once (KEYCODE_B)) + if (input_code_pressed_once (screen->machine, KEYCODE_B)) { dislayer[2] ^= 1; popmessage("bg2: %01x",dislayer[2]); } - if (input_code_pressed_once (KEYCODE_N)) + if (input_code_pressed_once (screen->machine, KEYCODE_N)) { dislayer[3] ^= 1; popmessage("bg3: %01x",dislayer[3]); } - if (input_code_pressed_once (KEYCODE_M)) + if (input_code_pressed_once (screen->machine, KEYCODE_M)) { dislayer[4] ^= 1; popmessage("sprites: %01x",dislayer[4]); @@ -514,36 +514,36 @@ VIDEO_UPDATE( cbombers ) #endif #ifdef MAME_DEBUG - if (input_code_pressed_once (KEYCODE_X)) + if (input_code_pressed_once (screen->machine, KEYCODE_X)) { dislayer[5] ^= 1; popmessage("piv text: %01x",dislayer[5]); } - if (input_code_pressed_once (KEYCODE_C)) + if (input_code_pressed_once (screen->machine, KEYCODE_C)) { dislayer[0] ^= 1; popmessage("bg0: %01x",dislayer[0]); } - if (input_code_pressed_once (KEYCODE_V)) + if (input_code_pressed_once (screen->machine, KEYCODE_V)) { dislayer[1] ^= 1; popmessage("bg1: %01x",dislayer[1]); } - if (input_code_pressed_once (KEYCODE_B)) + if (input_code_pressed_once (screen->machine, KEYCODE_B)) { dislayer[2] ^= 1; popmessage("bg2: %01x",dislayer[2]); } - if (input_code_pressed_once (KEYCODE_N)) + if (input_code_pressed_once (screen->machine, KEYCODE_N)) { dislayer[3] ^= 1; popmessage("bg3: %01x",dislayer[3]); } - if (input_code_pressed_once (KEYCODE_M)) + if (input_code_pressed_once (screen->machine, KEYCODE_M)) { dislayer[4] ^= 1; popmessage("sprites: %01x",dislayer[4]); diff --git a/src/mame/video/unico.c b/src/mame/video/unico.c index 6b7f5b1eb82..3facb1faeaa 100644 --- a/src/mame/video/unico.c +++ b/src/mame/video/unico.c @@ -346,13 +346,13 @@ VIDEO_UPDATE( unico ) tilemap_set_scrollx(tilemap_2, 0, *unico_scrollx_2); #ifdef MAME_DEBUG -if ( input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X) ) +if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) ) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_E)) msk |= 4; - if (input_code_pressed(KEYCODE_A)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif @@ -385,13 +385,13 @@ VIDEO_UPDATE( zeropnt2 ) tilemap_set_scrolly(tilemap_2, 0, unico_scroll32[1] >> 16); #ifdef MAME_DEBUG -if ( input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X) ) +if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) ) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; - if (input_code_pressed(KEYCODE_E)) msk |= 4; - if (input_code_pressed(KEYCODE_A)) msk |= 8; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; + if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/mame/video/wgp.c b/src/mame/video/wgp.c index e407ce04271..ad68ff572d9 100644 --- a/src/mame/video/wgp.c +++ b/src/mame/video/wgp.c @@ -653,25 +653,25 @@ VIDEO_UPDATE( wgp ) #endif #ifdef MAME_DEBUG - if (input_code_pressed_once (KEYCODE_V)) + if (input_code_pressed_once (screen->machine, KEYCODE_V)) { dislayer[0] ^= 1; popmessage("piv0: %01x",dislayer[0]); } - if (input_code_pressed_once (KEYCODE_B)) + if (input_code_pressed_once (screen->machine, KEYCODE_B)) { dislayer[1] ^= 1; popmessage("piv1: %01x",dislayer[1]); } - if (input_code_pressed_once (KEYCODE_N)) + if (input_code_pressed_once (screen->machine, KEYCODE_N)) { dislayer[2] ^= 1; popmessage("piv2: %01x",dislayer[2]); } - if (input_code_pressed_once (KEYCODE_M)) + if (input_code_pressed_once (screen->machine, KEYCODE_M)) { dislayer[3] ^= 1; popmessage("TC0100SCN top bg layer: %01x",dislayer[3]); diff --git a/src/mame/video/yunsung8.c b/src/mame/video/yunsung8.c index d37a624c650..531ba249803 100644 --- a/src/mame/video/yunsung8.c +++ b/src/mame/video/yunsung8.c @@ -189,11 +189,11 @@ VIDEO_UPDATE( yunsung8 ) int layers_ctrl = (~yunsung8_layers_ctrl) >> 4; #ifdef MAME_DEBUG -if (input_code_pressed(KEYCODE_Z)) +if (input_code_pressed(screen->machine, KEYCODE_Z)) { int msk = 0; - if (input_code_pressed(KEYCODE_Q)) msk |= 1; - if (input_code_pressed(KEYCODE_W)) msk |= 2; + if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; + if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; if (msk != 0) layers_ctrl &= msk; } #endif diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c index a105e2dd35e..daf0f34a9cd 100644 --- a/src/osd/windows/input.c +++ b/src/osd/windows/input.c @@ -538,8 +538,8 @@ void wininput_poll(running_machine *machine) winwindow_process_events_periodic(machine); // track if mouse/lightgun is enabled, for mouse hiding purposes - mouse_enabled = input_device_class_enabled(DEVICE_CLASS_MOUSE); - lightgun_enabled = input_device_class_enabled(DEVICE_CLASS_LIGHTGUN); + mouse_enabled = input_device_class_enabled(machine, DEVICE_CLASS_MOUSE); + lightgun_enabled = input_device_class_enabled(machine, DEVICE_CLASS_LIGHTGUN); } // poll all of the devices |
