summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/input.c')
-rw-r--r--src/emu/input.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/emu/input.c b/src/emu/input.c
index d8e748fd7ef..969d6bf4107 100644
--- a/src/emu/input.c
+++ b/src/emu/input.c
@@ -131,12 +131,12 @@ class input_device_switch_item : public input_device_item
public:
// construction/destruction
input_device_switch_item(input_device &device, const char *name, void *internal, input_item_id itemid, item_get_state_func getstate);
-
+
// readers
virtual INT32 read_as_switch(input_item_modifier modifier);
virtual INT32 read_as_relative(input_item_modifier modifier);
virtual INT32 read_as_absolute(input_item_modifier modifier);
-
+
// steadykey helper
bool steadykey_changed();
void steadykey_update_to_current() { m_steadykey = m_current; }
@@ -156,7 +156,7 @@ class input_device_relative_item : public input_device_item
public:
// construction/destruction
input_device_relative_item(input_device &device, const char *name, void *internal, input_item_id itemid, item_get_state_func getstate);
-
+
// readers
virtual INT32 read_as_switch(input_item_modifier modifier);
virtual INT32 read_as_relative(input_item_modifier modifier);
@@ -172,7 +172,7 @@ class input_device_absolute_item : public input_device_item
public:
// construction/destruction
input_device_absolute_item(input_device &device, const char *name, void *internal, input_item_id itemid, item_get_state_func getstate);
-
+
// readers
virtual INT32 read_as_switch(input_item_modifier modifier);
virtual INT32 read_as_relative(input_item_modifier modifier);
@@ -192,7 +192,7 @@ struct code_string_table
return current->m_code;
return ~0;
}
-
+
const char *operator[](UINT32 code) const
{
for (const code_string_table *current = this; current->m_code != ~0; current++)
@@ -650,7 +650,7 @@ UINT8 joystick_map::update(INT32 xaxisval, INT32 yaxisval)
//**************************************************************************
//-------------------------------------------------
-// input_code - construct an input code from a
+// input_code - construct an input code from a
// device/item pair
//-------------------------------------------------
@@ -669,7 +669,7 @@ input_code::input_code(input_device &device, input_item_id itemid)
//**************************************************************************
//-------------------------------------------------
-// operator+= - append a code to the end of an
+// operator+= - append a code to the end of an
// input sequence
//-------------------------------------------------
@@ -687,8 +687,8 @@ input_seq &input_seq::operator+=(input_code code)
//-------------------------------------------------
-// operator|= - append a code to a sequence; if
-// the sequence is non-empty, insert an OR
+// operator|= - append a code to a sequence; if
+// the sequence is non-empty, insert an OR
// before the new code
//-------------------------------------------------
@@ -697,7 +697,7 @@ input_seq &input_seq::operator|=(input_code code)
// overwrite end/default with the new code
if (m_code[0] == end_code || m_code[0] == default_code)
m_code[0] = code;
-
+
// otherwise, append an OR token and then the new code
else
{
@@ -723,7 +723,7 @@ int input_seq::length() const
//-------------------------------------------------
-// is_valid - return true if a given sequence is
+// is_valid - return true if a given sequence is
// valid
//-------------------------------------------------
@@ -817,7 +817,7 @@ void input_seq::set(input_code code0, input_code code1, input_code code2, input_
//-------------------------------------------------
-// backspace - "backspace" over the last entry in
+// backspace - "backspace" over the last entry in
// a sequence
//-------------------------------------------------
@@ -908,7 +908,7 @@ input_item_id input_device::add_item(const char *name, input_item_id itemid, ite
// make sure we don't have any overlap
assert(m_item[itemid] == NULL);
-
+
// determine the class and create the appropriate item class
input_device_item *item = NULL;
switch (m_class.standard_item_class(originalid))
@@ -924,7 +924,7 @@ input_item_id input_device::add_item(const char *name, input_item_id itemid, ite
case ITEM_CLASS_ABSOLUTE:
item = auto_alloc(machine(), input_device_absolute_item(*this, name, internal, itemid, getstate));
break;
-
+
default:
assert(false);
}
@@ -983,7 +983,7 @@ void input_device::apply_steadykey() const
// ignore if not enabled
if (!m_steadykey_enabled)
return;
-
+
// update the state of all the keys and see if any changed state
bool anything_changed = false;
for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= m_maxitem; itemid++)
@@ -1040,7 +1040,7 @@ input_device *input_class::add_device(const char *name, void *internal)
for (devindex = 0; devindex < DEVICE_INDEX_MAXIMUM; devindex++)
if (m_device[devindex] == NULL)
break;
-
+
// call through
return add_device(devindex, name, internal);
}
@@ -1064,7 +1064,7 @@ input_device *input_class::add_device(int devindex, const char *name, void *inte
//-------------------------------------------------
-// standard_item_class - return the class of a
+// standard_item_class - return the class of a
// standard item
//-------------------------------------------------
@@ -1129,7 +1129,7 @@ input_manager::input_manager(running_machine &machine)
//-------------------------------------------------
-// code_value - return the value of a given
+// code_value - return the value of a given
// input code
//-------------------------------------------------
@@ -1145,7 +1145,7 @@ INT32 input_manager::code_value(input_code code)
input_device *device = device_from_code(code);
if (device == NULL)
break;
-
+
// also return 0 if the device class is disabled
input_class &devclass = *m_class[code.device_class()];
if (!devclass.enabled())
@@ -1200,8 +1200,8 @@ INT32 input_manager::code_value(input_code code)
//-------------------------------------------------
-// code_pressed_once - return non-zero if a given
-// input code has transitioned from off to on
+// code_pressed_once - return non-zero if a given
+// input code has transitioned from off to on
// since the last call
//-------------------------------------------------
@@ -1352,7 +1352,7 @@ input_code input_manager::poll_switches()
//-------------------------------------------------
-// poll_keyboard_switches - poll for any
+// poll_keyboard_switches - poll for any
// keyboard-specific input
//-------------------------------------------------
@@ -1385,7 +1385,7 @@ input_code input_manager::poll_keyboard_switches()
//-------------------------------------------------
-// code_check_axis - see if axis has moved far
+// code_check_axis - see if axis has moved far
// enough to trigger a read when polling
//-------------------------------------------------
@@ -1398,7 +1398,7 @@ bool input_manager::code_check_axis(input_device_item &item, input_code code)
// ignore min/max for lightguns
// so the selection will not be affected by a gun going out of range
INT32 curval = code_value(code);
- if (code.device_class() == DEVICE_CLASS_LIGHTGUN &&
+ if (code.device_class() == DEVICE_CLASS_LIGHTGUN &&
(code.item_id() == ITEM_ID_XAXIS || code.item_id() == ITEM_ID_YAXIS) &&
(curval == INPUT_ABSOLUTE_MAX || curval == INPUT_ABSOLUTE_MIN))
return false;
@@ -1486,14 +1486,14 @@ input_device_item *input_manager::item_from_code(input_code code) const
input_device *device = device_from_code(code);
if (device == NULL)
return NULL;
-
+
// then return the device's item
return device->item(code.item_id());
}
//-------------------------------------------------
-// reset_memory - reset the array of memory for
+// reset_memory - reset the array of memory for
// pressed switches
//-------------------------------------------------
@@ -1506,7 +1506,7 @@ void input_manager::reset_memory()
//-------------------------------------------------
-// code_from_itemid - translates an input_item_id
+// code_from_itemid - translates an input_item_id
// to an input_code
//-------------------------------------------------
@@ -1625,7 +1625,7 @@ const char *input_manager::code_to_token(astring &string, input_code code) const
//-------------------------------------------------
-// code_from_token - extract an input code from a
+// code_from_token - extract an input code from a
// token
//-------------------------------------------------
@@ -1729,7 +1729,7 @@ input_code input_manager::code_from_token(const char *_token)
//-------------------------------------------------
-// seq_pressed - return true if the given sequence
+// seq_pressed - return true if the given sequence
// of switch inputs is "pressed"
//-------------------------------------------------
@@ -1781,7 +1781,7 @@ bool input_manager::seq_pressed(const input_seq &seq)
//-------------------------------------------------
-// seq_axis_value - return the value of an axis
+// seq_axis_value - return the value of an axis
// defined in an input sequence
//-------------------------------------------------
@@ -1866,7 +1866,7 @@ INT32 input_manager::seq_axis_value(const input_seq &seq, input_item_class &item
//-------------------------------------------------
-// seq_poll_start - begin polling for a new
+// seq_poll_start - begin polling for a new
// sequence of the given itemclass
//-------------------------------------------------
@@ -1990,7 +1990,7 @@ bool input_manager::seq_poll()
//-------------------------------------------------
-// seq_name - generate the friendly name of a
+// seq_name - generate the friendly name of a
// sequence
//-------------------------------------------------
@@ -2043,7 +2043,7 @@ const char *input_manager::seq_name(astring &string, const input_seq &seq) const
//-------------------------------------------------
-// seq_to_tokens - generate the tokenized form of
+// seq_to_tokens - generate the tokenized form of
// a sequence
//-------------------------------------------------
@@ -2078,7 +2078,7 @@ const char *input_manager::seq_to_tokens(astring &string, const input_seq &seq)
//-------------------------------------------------
-// seq_from_tokens - generate the tokenized form
+// seq_from_tokens - generate the tokenized form
// of a sequence
//-------------------------------------------------
@@ -2130,7 +2130,7 @@ void input_manager::seq_from_tokens(input_seq &seq, const char *string)
//-------------------------------------------------
-// set_global_joystick_map - set the joystick map
+// set_global_joystick_map - set the joystick map
// for all devices
//-------------------------------------------------
@@ -2360,7 +2360,7 @@ INT32 input_device_absolute_item::read_as_switch(input_item_modifier modifier)
// start with the current value
INT32 result = m_device.apply_deadzone_and_saturation(update_value());
assert(result >= INPUT_ABSOLUTE_MIN && result <= INPUT_ABSOLUTE_MAX);
-
+
// left/right/up/down: if this is a joystick, fetch the paired X/Y axis values and convert
if (m_device.devclass() == DEVICE_CLASS_JOYSTICK && modifier >= ITEM_MODIFIER_LEFT && modifier <= ITEM_MODIFIER_DOWN)
{
@@ -2392,7 +2392,7 @@ INT32 input_device_absolute_item::read_as_switch(input_item_modifier modifier)
//-------------------------------------------------
-// read_as_relative - return the absolute input
+// read_as_relative - return the absolute input
// as a relative axis value
//-------------------------------------------------
@@ -2414,7 +2414,7 @@ INT32 input_device_absolute_item::read_as_absolute(input_item_modifier modifier)
// start with the current value
INT32 result = m_device.apply_deadzone_and_saturation(update_value());
assert(result >= INPUT_ABSOLUTE_MIN && result <= INPUT_ABSOLUTE_MAX);
-
+
// if we're doing a lightgun reload hack, override the value
if (m_device.devclass() == DEVICE_CLASS_LIGHTGUN && m_device.lightgun_reload_button())
{