Skip to content

Commit 3cb6ea0

Browse files
committed
Remove PORT_ROTATED from the core. This automatic joystick remapping feature has not been enabled in any driver for years.
1 parent 20a61a4 commit 3cb6ea0

File tree

6 files changed

+9
-57
lines changed

6 files changed

+9
-57
lines changed

docs/source/luascript/ref-input.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,6 @@ field.cocktail (read-only)
339339
field.toggle (read-only)
340340
A Boolean indicating whether the field corresponds to a hardware toggle
341341
switch or push-on, push-off button.
342-
field.rotated (read-only)
343-
A Boolean indicating whether the field corresponds to a control that is
344-
rotated relative its standard orientation.
345342
field.analog_reverse (read-only)
346343
A Boolean indicating whether the field corresponds to an analog control that
347344
increases in the opposite direction to the convention (e.g. larger values

src/emu/inputdev.cpp

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class input_device_absolute_item : public input_device_item
107107

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

113113

@@ -669,28 +669,6 @@ input_class_joystick::input_class_joystick(input_manager &manager)
669669
}
670670

671671

672-
//-------------------------------------------------
673-
// set_global_joystick_map - set the map for all
674-
// joysticks
675-
//-------------------------------------------------
676-
677-
bool input_class_joystick::set_global_joystick_map(const char *mapstring)
678-
{
679-
// parse the map
680-
joystick_map map;
681-
if (!map.parse(mapstring))
682-
return false;
683-
684-
osd_printf_verbose("Input: Changing default joystick map = %s\n", map.to_string());
685-
686-
// iterate over joysticks and set the map
687-
for (int joynum = 0; joynum <= maxindex(); joynum++)
688-
if (device(joynum) != nullptr)
689-
downcast<input_device_joystick &>(*device(joynum)).set_joystick_map(map);
690-
return true;
691-
}
692-
693-
694672
//**************************************************************************
695673
// INPUT DEVICE ITEM
696674
//**************************************************************************

src/emu/inputdev.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,8 @@ class input_class_joystick : public input_class
380380
// construction/destruction
381381
input_class_joystick(input_manager &manager);
382382

383-
// misc
384-
bool set_global_joystick_map(const char *mapstring);
385-
386383
// standard joystick maps
387384
static const char map_8way[];
388-
static const char map_4way_diagonal[];
389385

390386
protected:
391387
// specific overrides

src/emu/ioport.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,7 +1620,7 @@ ioport_value ioport_port::read()
16201620
void ioport_port::write(ioport_value data, ioport_value mem_mask)
16211621
{
16221622
// call device line write handlers
1623-
COMBINE_DATA(&m_live->outputvalue);
1623+
util::putmask(m_live->outputvalue, mem_mask, data);
16241624
for (dynamic_field &dynfield : m_live->writelist)
16251625
if (dynfield.field().type() == IPT_OUTPUT)
16261626
dynfield.write(m_live->outputvalue ^ dynfield.field().defvalue());
@@ -1741,7 +1741,7 @@ void ioport_port::update_defvalue(bool flush_defaults)
17411741
// recompute the default value for the entire port
17421742
for (ioport_field &field : m_fieldlist)
17431743
if (field.enabled())
1744-
m_live->defvalue = (m_live->defvalue & ~field.mask()) | (field.live().value & field.mask());
1744+
util::putmask(m_live->defvalue, field.mask(), field.live().value);
17451745
}
17461746

17471747

@@ -1871,18 +1871,6 @@ time_t ioport_manager::initialize()
18711871
init_autoselect_devices({ IPT_TRACKBALL_X, IPT_TRACKBALL_Y }, OPTION_TRACKBALL_DEVICE, "trackball");
18721872
init_autoselect_devices({ IPT_MOUSE_X, IPT_MOUSE_Y }, OPTION_MOUSE_DEVICE, "mouse");
18731873

1874-
// look for 4-way diagonal joysticks and change the default map if we find any
1875-
const char *joystick_map_default = machine().options().joystick_map();
1876-
if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0)
1877-
for (auto &port : m_portlist)
1878-
for (ioport_field const &field : port.second->fields())
1879-
if (field.live().joystick != nullptr && field.rotated())
1880-
{
1881-
input_class_joystick &devclass = downcast<input_class_joystick &>(machine().input().device_class(DEVICE_CLASS_JOYSTICK));
1882-
devclass.set_global_joystick_map(input_class_joystick::map_4way_diagonal);
1883-
break;
1884-
}
1885-
18861874
// register callbacks for when we load configurations
18871875
machine().configuration().config_register(
18881876
"input",
@@ -3532,7 +3520,7 @@ void dynamic_field::read(ioport_value &result)
35323520
m_oldval = newval;
35333521

35343522
// merge in the bits (don't invert yet, as all digitals are inverted together)
3535-
result = (result & ~m_field.mask()) | ((newval << m_shift) & m_field.mask());
3523+
util::putmask(result, m_field.mask(), newval << m_shift);
35363524
}
35373525
}
35383526

@@ -4038,7 +4026,7 @@ void analog_field::read(ioport_value &result)
40384026
value = ~value;
40394027

40404028
// insert into the port
4041-
result = (result & ~m_field.mask()) | ((value << m_shift) & m_field.mask());
4029+
util::putmask(result, m_field.mask(), value << m_shift);
40424030
}
40434031

40444032

src/emu/ioport.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -561,11 +561,10 @@ class ioport_field
561561
// flags for ioport_fields
562562
static inline constexpr u32 FIELD_FLAG_COCKTAIL = 0x0001; // set if this field is relevant only for cocktail cabinets
563563
static inline constexpr u32 FIELD_FLAG_TOGGLE = 0x0002; // set if this field should behave as a toggle
564-
static inline constexpr u32 FIELD_FLAG_ROTATED = 0x0004; // set if this field represents a rotated control
565-
static inline constexpr u32 ANALOG_FLAG_REVERSE = 0x0008; // analog only: reverse the sense of the axis
566-
static inline constexpr u32 ANALOG_FLAG_RESET = 0x0010; // analog only: always preload in->default for relative axes, returning only deltas
567-
static inline constexpr u32 ANALOG_FLAG_WRAPS = 0x0020; // analog only: positional count wraps around
568-
static inline constexpr u32 ANALOG_FLAG_INVERT = 0x0040; // analog only: bitwise invert bits
564+
static inline constexpr u32 ANALOG_FLAG_REVERSE = 0x0004; // analog only: reverse the sense of the axis
565+
static inline constexpr u32 ANALOG_FLAG_RESET = 0x0008; // analog only: always preload in->default for relative axes, returning only deltas
566+
static inline constexpr u32 ANALOG_FLAG_WRAPS = 0x0010; // analog only: positional count wraps around
567+
static inline constexpr u32 ANALOG_FLAG_INVERT = 0x0020; // analog only: bitwise invert bits
569568

570569
public:
571570
// construction/destruction
@@ -594,7 +593,6 @@ class ioport_field
594593

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

1179-
#define PORT_ROTATED \
1180-
configurer.field_set_rotated();
1181-
11821176
// general flags
11831177
#define PORT_NAME(_name) \
11841178
configurer.field_set_name(_name);

src/frontend/mame/luaengine_input.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ void lua_engine::initialize_input(sol::table &emu)
357357
ioport_field_type["enabled"] = sol::property(&ioport_field::enabled);
358358
ioport_field_type["cocktail"] = sol::property(&ioport_field::cocktail);
359359
ioport_field_type["toggle"] = sol::property(&ioport_field::toggle);
360-
ioport_field_type["rotated"] = sol::property(&ioport_field::rotated);
361360
ioport_field_type["analog_reverse"] = sol::property(&ioport_field::analog_reverse);
362361
ioport_field_type["analog_reset"] = sol::property(&ioport_field::analog_reset);
363362
ioport_field_type["analog_wraps"] = sol::property(&ioport_field::analog_wraps);

0 commit comments

Comments
 (0)