Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions docs/source/luascript/ref-input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,6 @@ field.cocktail (read-only)
field.toggle (read-only)
A Boolean indicating whether the field corresponds to a hardware toggle
switch or push-on, push-off button.
field.rotated (read-only)
A Boolean indicating whether the field corresponds to a control that is
rotated relative its standard orientation.
field.analog_reverse (read-only)
A Boolean indicating whether the field corresponds to an analog control that
increases in the opposite direction to the convention (e.g. larger values
Expand Down
24 changes: 1 addition & 23 deletions src/emu/inputdev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class input_device_absolute_item : public input_device_item

// standard joystick mappings
const char input_class_joystick::map_8way[] = "7778...4445";
const char input_class_joystick::map_4way_diagonal[] = "4444s8888..444458888.444555888.ss5.222555666.222256666.2222s6666.2222s6666";
// const char input_class_joystick::map_4way_diagonal[] = "4444s8888..444458888.444555888.ss5.222555666.222256666.2222s6666.2222s6666";
// const char input_class_joystick::map_4way_sticky[] = "s8.4s8.44s8.4445";


Expand Down Expand Up @@ -669,28 +669,6 @@ input_class_joystick::input_class_joystick(input_manager &manager)
}


//-------------------------------------------------
// set_global_joystick_map - set the map for all
// joysticks
//-------------------------------------------------

bool input_class_joystick::set_global_joystick_map(const char *mapstring)
{
// parse the map
joystick_map map;
if (!map.parse(mapstring))
return false;

osd_printf_verbose("Input: Changing default joystick map = %s\n", map.to_string());

// iterate over joysticks and set the map
for (int joynum = 0; joynum <= maxindex(); joynum++)
if (device(joynum) != nullptr)
downcast<input_device_joystick &>(*device(joynum)).set_joystick_map(map);
return true;
}


//**************************************************************************
// INPUT DEVICE ITEM
//**************************************************************************
Expand Down
4 changes: 0 additions & 4 deletions src/emu/inputdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,8 @@ class input_class_joystick : public input_class
// construction/destruction
input_class_joystick(input_manager &manager);

// misc
bool set_global_joystick_map(const char *mapstring);

// standard joystick maps
static const char map_8way[];
static const char map_4way_diagonal[];

protected:
// specific overrides
Expand Down
12 changes: 0 additions & 12 deletions src/emu/ioport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1871,18 +1871,6 @@ time_t ioport_manager::initialize()
init_autoselect_devices({ IPT_TRACKBALL_X, IPT_TRACKBALL_Y }, OPTION_TRACKBALL_DEVICE, "trackball");
init_autoselect_devices({ IPT_MOUSE_X, IPT_MOUSE_Y }, OPTION_MOUSE_DEVICE, "mouse");

// look for 4-way diagonal joysticks and change the default map if we find any
const char *joystick_map_default = machine().options().joystick_map();
if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0)
for (auto &port : m_portlist)
for (ioport_field const &field : port.second->fields())
if (field.live().joystick != nullptr && field.rotated())
{
input_class_joystick &devclass = downcast<input_class_joystick &>(machine().input().device_class(DEVICE_CLASS_JOYSTICK));
devclass.set_global_joystick_map(input_class_joystick::map_4way_diagonal);
break;
}

// register callbacks for when we load configurations
machine().configuration().config_register(
"input",
Expand Down
14 changes: 4 additions & 10 deletions src/emu/ioport.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,10 @@ class ioport_field
// flags for ioport_fields
static inline constexpr u32 FIELD_FLAG_COCKTAIL = 0x0001; // set if this field is relevant only for cocktail cabinets
static inline constexpr u32 FIELD_FLAG_TOGGLE = 0x0002; // set if this field should behave as a toggle
static inline constexpr u32 FIELD_FLAG_ROTATED = 0x0004; // set if this field represents a rotated control
static inline constexpr u32 ANALOG_FLAG_REVERSE = 0x0008; // analog only: reverse the sense of the axis
static inline constexpr u32 ANALOG_FLAG_RESET = 0x0010; // analog only: always preload in->default for relative axes, returning only deltas
static inline constexpr u32 ANALOG_FLAG_WRAPS = 0x0020; // analog only: positional count wraps around
static inline constexpr u32 ANALOG_FLAG_INVERT = 0x0040; // analog only: bitwise invert bits
static inline constexpr u32 ANALOG_FLAG_REVERSE = 0x0004; // analog only: reverse the sense of the axis
static inline constexpr u32 ANALOG_FLAG_RESET = 0x0008; // analog only: always preload in->default for relative axes, returning only deltas
static inline constexpr u32 ANALOG_FLAG_WRAPS = 0x0010; // analog only: positional count wraps around
static inline constexpr u32 ANALOG_FLAG_INVERT = 0x0020; // analog only: bitwise invert bits

public:
// construction/destruction
Expand Down Expand Up @@ -594,7 +593,6 @@ class ioport_field

bool cocktail() const { return ((m_flags & FIELD_FLAG_COCKTAIL) != 0); }
bool toggle() const { return ((m_flags & FIELD_FLAG_TOGGLE) != 0); }
bool rotated() const { return ((m_flags & FIELD_FLAG_ROTATED) != 0); }
bool analog_reverse() const { return ((m_flags & ANALOG_FLAG_REVERSE) != 0); }
bool analog_reset() const { return ((m_flags & ANALOG_FLAG_RESET) != 0); }
bool analog_wraps() const { return ((m_flags & ANALOG_FLAG_WRAPS) != 0); }
Expand Down Expand Up @@ -1049,7 +1047,6 @@ class ioport_configurer
ioport_configurer& field_add_char(std::initializer_list<char32_t> charlist);
ioport_configurer& field_add_code(input_seq_type which, input_code code);
ioport_configurer& field_set_way(int way) { m_curfield->m_way = way; return *this; }
ioport_configurer& field_set_rotated() { m_curfield->m_flags |= ioport_field::FIELD_FLAG_ROTATED; return *this; }
ioport_configurer& field_set_name(const char *name) { assert(m_curfield != nullptr); m_curfield->m_name = string_from_token(name); return *this; }
ioport_configurer& field_set_player(int player) { m_curfield->m_player = player - 1; return *this; }
ioport_configurer& field_set_cocktail() { m_curfield->m_flags |= ioport_field::FIELD_FLAG_COCKTAIL; field_set_player(2); return *this; }
Expand Down Expand Up @@ -1176,9 +1173,6 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, s
#define PORT_16WAY \
configurer.field_set_way(16);

#define PORT_ROTATED \
configurer.field_set_rotated();

// general flags
#define PORT_NAME(_name) \
configurer.field_set_name(_name);
Expand Down
1 change: 0 additions & 1 deletion src/frontend/mame/luaengine_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ void lua_engine::initialize_input(sol::table &emu)
ioport_field_type["enabled"] = sol::property(&ioport_field::enabled);
ioport_field_type["cocktail"] = sol::property(&ioport_field::cocktail);
ioport_field_type["toggle"] = sol::property(&ioport_field::toggle);
ioport_field_type["rotated"] = sol::property(&ioport_field::rotated);
ioport_field_type["analog_reverse"] = sol::property(&ioport_field::analog_reverse);
ioport_field_type["analog_reset"] = sol::property(&ioport_field::analog_reset);
ioport_field_type["analog_wraps"] = sol::property(&ioport_field::analog_wraps);
Expand Down
Loading