diff options
-rw-r--r-- | src/emu/ioport.c | 28 | ||||
-rw-r--r-- | src/emu/ioport.h | 2 | ||||
-rw-r--r-- | src/emu/render.c | 6 | ||||
-rw-r--r-- | src/emu/render.h | 4 | ||||
-rw-r--r-- | src/emu/rendlay.h | 4 | ||||
-rw-r--r-- | src/mame/drivers/astrocde.c | 2 | ||||
-rw-r--r-- | src/mame/drivers/mw18w.c | 2 | ||||
-rw-r--r-- | src/mame/drivers/mw8080bw.c | 10 | ||||
-rw-r--r-- | src/mame/drivers/sspeedr.c | 2 |
9 files changed, 30 insertions, 30 deletions
diff --git a/src/emu/ioport.c b/src/emu/ioport.c index 3f07a106e7c..691f1540fca 100644 --- a/src/emu/ioport.c +++ b/src/emu/ioport.c @@ -179,18 +179,18 @@ public: INT32 delta() const { return m_delta; } INT32 centerdelta() const { return m_centerdelta; } - // helpers - ioport_value apply_min_max(ioport_value value) const; - ioport_value apply_settings(ioport_value value) const; - ioport_value apply_sensitivity(ioport_value value) const; - ioport_value apply_inverse_sensitivity(ioport_value value) const; - // readers void read(ioport_value &value); float crosshair_read(); void frame_update(running_machine &machine); private: + // helpers + INT32 apply_min_max(INT32 value) const; + INT32 apply_settings(INT32 value) const; + INT32 apply_sensitivity(INT32 value) const; + INT32 apply_inverse_sensitivity(INT32 value) const; + // internal state analog_field * m_next; // link to the next analog state for this port ioport_field & m_field; // pointer to the input field referenced @@ -316,7 +316,7 @@ struct char_info // from a numerator and a denominator //------------------------------------------------- -inline INT32 compute_scale(INT32 num, INT32 den) +inline INT64 compute_scale(INT32 num, INT32 den) { return (INT64(num) << 24) / den; } @@ -327,7 +327,7 @@ inline INT32 compute_scale(INT32 num, INT32 den) // an 8.24 scale value //------------------------------------------------- -inline INT32 recip_scale(INT32 scale) +inline INT64 recip_scale(INT64 scale) { return (INT64(1) << 48) / scale; } @@ -338,7 +338,7 @@ inline INT32 recip_scale(INT32 scale) // a 32-bit value //------------------------------------------------- -inline INT32 apply_scale(INT32 value, INT32 scale) +inline INT32 apply_scale(INT32 value, INT64 scale) { return (INT64(value) * scale) >> 24; } @@ -3035,7 +3035,7 @@ g_profiler.stop(); // values based on the time between frames //------------------------------------------------- -ioport_value ioport_manager::frame_interpolate(ioport_value oldval, ioport_value newval) +INT32 ioport_manager::frame_interpolate(INT32 oldval, INT32 newval) { // if no last delta, just use new value if (m_last_delta_nsec == 0) @@ -4170,7 +4170,7 @@ analog_field::analog_field(ioport_field &field) // the appropriate min/max for the analog control //------------------------------------------------- -inline ioport_value analog_field::apply_min_max(ioport_value value) const +inline INT32 analog_field::apply_min_max(INT32 value) const { // take the analog minimum and maximum values and apply the inverse of the // sensitivity so that we can clamp against them before applying sensitivity @@ -4206,7 +4206,7 @@ inline ioport_value analog_field::apply_min_max(ioport_value value) const // adjustment for a current value //------------------------------------------------- -inline ioport_value analog_field::apply_sensitivity(ioport_value value) const +inline INT32 analog_field::apply_sensitivity(INT32 value) const { return INT32((INT64(value) * m_sensitivity) / 100.0 + 0.5); } @@ -4217,7 +4217,7 @@ inline ioport_value analog_field::apply_sensitivity(ioport_value value) const // sensitivity adjustment for a current value //------------------------------------------------- -inline ioport_value analog_field::apply_inverse_sensitivity(ioport_value value) const +inline INT32 analog_field::apply_inverse_sensitivity(INT32 value) const { return INT32((INT64(value) * 100) / m_sensitivity); } @@ -4228,7 +4228,7 @@ inline ioport_value analog_field::apply_inverse_sensitivity(ioport_value value) // analog input //------------------------------------------------- -ioport_value analog_field::apply_settings(ioport_value value) const +INT32 analog_field::apply_settings(INT32 value) const { // apply the min/max and then the sensitivity value = apply_min_max(value); diff --git a/src/emu/ioport.h b/src/emu/ioport.h index d128031c7f2..5c0b3c42bf6 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -1256,7 +1256,7 @@ public: bool crosshair_position(int player, float &x, float &y); bool has_keyboard() const; void setup_natural_keyboard(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty); - ioport_value frame_interpolate(ioport_value oldval, ioport_value newval); + INT32 frame_interpolate(INT32 oldval, INT32 newval); ioport_type token_to_input_type(const char *string, int &player) const; const char *input_type_to_token(astring &string, ioport_type type, int player); diff --git a/src/emu/render.c b/src/emu/render.c index f9482214cd3..b72bc2a2d6b 100644 --- a/src/emu/render.c +++ b/src/emu/render.c @@ -1455,7 +1455,7 @@ render_primitive_list &render_target::get_primitives() bool render_target::map_point_container(INT32 target_x, INT32 target_y, render_container &container, float &container_x, float &container_y) { const char *input_tag; - UINT32 input_mask; + ioport_value input_mask; return map_point_internal(target_x, target_y, &container, container_x, container_y, input_tag, input_mask); } @@ -1466,7 +1466,7 @@ bool render_target::map_point_container(INT32 target_x, INT32 target_y, render_c // container, if possible //------------------------------------------------- -bool render_target::map_point_input(INT32 target_x, INT32 target_y, const char *&input_tag, UINT32 &input_mask, float &input_x, float &input_y) +bool render_target::map_point_input(INT32 target_x, INT32 target_y, const char *&input_tag, ioport_value &input_mask, float &input_x, float &input_y) { return map_point_internal(target_x, target_y, NULL, input_x, input_y, input_tag, input_mask); } @@ -1918,7 +1918,7 @@ void render_target::add_element_primitives(render_primitive_list &list, const ob // mapping points //------------------------------------------------- -bool render_target::map_point_internal(INT32 target_x, INT32 target_y, render_container *container, float &mapped_x, float &mapped_y, const char *&mapped_input_tag, UINT32 &mapped_input_mask) +bool render_target::map_point_internal(INT32 target_x, INT32 target_y, render_container *container, float &mapped_x, float &mapped_y, const char *&mapped_input_tag, ioport_value &mapped_input_mask) { // default to point not mapped mapped_x = -1.0; diff --git a/src/emu/render.h b/src/emu/render.h index 8171d4b6145..da7e32dea3a 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -663,7 +663,7 @@ public: // hit testing bool map_point_container(INT32 target_x, INT32 target_y, render_container &container, float &container_x, float &container_y); - bool map_point_input(INT32 target_x, INT32 target_y, const char *&input_tag, UINT32 &input_mask, float &input_x, float &input_y); + bool map_point_input(INT32 target_x, INT32 target_y, const char *&input_tag, ioport_value &input_mask, float &input_x, float &input_y); // reference tracking void invalidate_all(void *refptr); @@ -680,7 +680,7 @@ private: bool load_layout_file(const char *dirname, const char *filename); void add_container_primitives(render_primitive_list &list, const object_transform &xform, render_container &container, int blendmode); void add_element_primitives(render_primitive_list &list, const object_transform &xform, layout_element &element, int state, int blendmode); - bool map_point_internal(INT32 target_x, INT32 target_y, render_container *container, float &mapped_x, float &mapped_y, const char *&mapped_input_tag, UINT32 &mapped_input_mask); + bool map_point_internal(INT32 target_x, INT32 target_y, render_container *container, float &mapped_x, float &mapped_y, const char *&mapped_input_tag, ioport_value &mapped_input_mask); // config callbacks void config_load(xml_data_node &targetnode); diff --git a/src/emu/rendlay.h b/src/emu/rendlay.h index cb969b36470..366e44fe2cb 100644 --- a/src/emu/rendlay.h +++ b/src/emu/rendlay.h @@ -232,7 +232,7 @@ public: int orientation() const { return m_orientation; } render_container *screen_container(running_machine &machine) const { return (m_screen != NULL) ? &m_screen->container() : NULL; } bool has_input() const { return bool(m_input_tag); } - const char *input_tag_and_mask(UINT32 &mask) const { mask = m_input_mask; return m_input_tag; } + const char *input_tag_and_mask(ioport_value &mask) const { mask = m_input_mask; return m_input_tag; } // fetch state based on configured source int state() const; @@ -243,7 +243,7 @@ public: layout_element * m_element; // pointer to the associated element (non-screens only) astring m_output_name; // name of this item astring m_input_tag; // input tag of this item - UINT32 m_input_mask; // input mask of this item + ioport_value m_input_mask; // input mask of this item screen_device * m_screen; // pointer to screen int m_orientation; // orientation of this item render_bounds m_bounds; // bounds of the item diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c index 98133ed5b58..9213bf7805f 100644 --- a/src/mame/drivers/astrocde.c +++ b/src/mame/drivers/astrocde.c @@ -722,7 +722,7 @@ ADDRESS_MAP_END * *************************************/ -static const UINT32 controller_table[64] = +static const ioport_value controller_table[64] = { 0x20, 0x21, 0x23, 0x22, 0x26, 0x27, 0x25, 0x24, 0x2c, 0x2d, 0x2f, 0x2e, 0x2a, 0x2b, 0x29, 0x28, diff --git a/src/mame/drivers/mw18w.c b/src/mame/drivers/mw18w.c index 304fd3bcebe..21f34447b43 100644 --- a/src/mame/drivers/mw18w.c +++ b/src/mame/drivers/mw18w.c @@ -94,7 +94,7 @@ static ADDRESS_MAP_START( mw18w_portmap, AS_IO, 8, mw18w_state ) AM_RANGE(0x07, 0x07) AM_WRITE(mw18w_irq0_clear_w) ADDRESS_MAP_END -static const UINT32 mw18w_controller_table[] = +static const ioport_value mw18w_controller_table[] = { // same encoder as sspeedr 0x3f, 0x3e, 0x3c, 0x3d, 0x39, 0x38, 0x3a, 0x3b, diff --git a/src/mame/drivers/mw8080bw.c b/src/mame/drivers/mw8080bw.c index 71d79d2b1ac..753bb7e13d5 100644 --- a/src/mame/drivers/mw8080bw.c +++ b/src/mame/drivers/mw8080bw.c @@ -336,7 +336,7 @@ ADDRESS_MAP_END /* the 30 position encoder is verified */ -static const UINT32 seawolf_controller_table[30] = +static const ioport_value seawolf_controller_table[30] = { 0x1e, 0x1c, 0x1d, 0x19, 0x18, 0x1a, 0x1b, 0x13, 0x12, 0x10, 0x11, 0x15, 0x14, 0x16, 0x17, 0x07, @@ -444,7 +444,7 @@ static ADDRESS_MAP_START( gunfight_io_map, AS_IO, 8, mw8080bw_state ) ADDRESS_MAP_END -static const UINT32 gunfight_controller_table[7] = +static const ioport_value gunfight_controller_table[7] = { 0x06, 0x02, 0x00, 0x04, 0x05, 0x01, 0x03 }; @@ -1000,7 +1000,7 @@ static ADDRESS_MAP_START( boothill_io_map, AS_IO, 8, mw8080bw_state ) ADDRESS_MAP_END -static const UINT32 boothill_controller_table[7] = +static const ioport_value boothill_controller_table[7] = { 0x00, 0x04, 0x06, 0x07, 0x03, 0x01, 0x05 }; @@ -2049,7 +2049,7 @@ static ADDRESS_MAP_START( dogpatch_io_map, AS_IO, 8, mw8080bw_state ) ADDRESS_MAP_END -static const UINT32 dogpatch_controller_table[7] = +static const ioport_value dogpatch_controller_table[7] = { 0x07, 0x06, 0x04, 0x05, 0x01, 0x00, 0x02 }; @@ -2207,7 +2207,7 @@ static ADDRESS_MAP_START( spcenctr_io_map, AS_IO, 8, mw8080bw_state ) ADDRESS_MAP_END -static const UINT32 spcenctr_controller_table[] = +static const ioport_value spcenctr_controller_table[] = { 0x3f, 0x3e, 0x3c, 0x3d, 0x39, 0x38, 0x3a, 0x3b, 0x33, 0x32, 0x30, 0x31, 0x35, 0x34, 0x36, 0x37, diff --git a/src/mame/drivers/sspeedr.c b/src/mame/drivers/sspeedr.c index a9514eadebc..d0562924e3f 100644 --- a/src/mame/drivers/sspeedr.c +++ b/src/mame/drivers/sspeedr.c @@ -108,7 +108,7 @@ static ADDRESS_MAP_START( sspeedr_io_map, AS_IO, 8, sspeedr_state ) ADDRESS_MAP_END -static const UINT32 sspeedr_controller_table[] = +static const ioport_value sspeedr_controller_table[] = { 0x3f, 0x3e, 0x3c, 0x3d, 0x39, 0x38, 0x3a, 0x3b, 0x33, 0x32, 0x30, 0x31, 0x35, 0x34, 0x36, 0x37, |