@@ -1620,7 +1620,7 @@ ioport_value ioport_port::read()
1620
1620
void ioport_port::write (ioport_value data, ioport_value mem_mask)
1621
1621
{
1622
1622
// call device line write handlers
1623
- COMBINE_DATA (& m_live->outputvalue );
1623
+ util::putmask ( m_live->outputvalue , mem_mask, data );
1624
1624
for (dynamic_field &dynfield : m_live->writelist )
1625
1625
if (dynfield.field ().type () == IPT_OUTPUT)
1626
1626
dynfield.write (m_live->outputvalue ^ dynfield.field ().defvalue ());
@@ -1741,7 +1741,7 @@ void ioport_port::update_defvalue(bool flush_defaults)
1741
1741
// recompute the default value for the entire port
1742
1742
for (ioport_field &field : m_fieldlist)
1743
1743
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 );
1745
1745
}
1746
1746
1747
1747
@@ -1871,18 +1871,6 @@ time_t ioport_manager::initialize()
1871
1871
init_autoselect_devices ({ IPT_TRACKBALL_X, IPT_TRACKBALL_Y }, OPTION_TRACKBALL_DEVICE, " trackball" );
1872
1872
init_autoselect_devices ({ IPT_MOUSE_X, IPT_MOUSE_Y }, OPTION_MOUSE_DEVICE, " mouse" );
1873
1873
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
-
1886
1874
// register callbacks for when we load configurations
1887
1875
machine ().configuration ().config_register (
1888
1876
" input" ,
@@ -3532,7 +3520,7 @@ void dynamic_field::read(ioport_value &result)
3532
3520
m_oldval = newval;
3533
3521
3534
3522
// 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);
3536
3524
}
3537
3525
}
3538
3526
@@ -4038,7 +4026,7 @@ void analog_field::read(ioport_value &result)
4038
4026
value = ~value;
4039
4027
4040
4028
// 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);
4042
4030
}
4043
4031
4044
4032
0 commit comments