mirror of https://github.com/stella-emu/stella.git
Fix compilation in Linux (missing entry in module.mk).
Fix compilation warnings in a few places. Use float instead of floats and doubles in Paddles class (otherwise we get warnings). Thomas, can you check that this doesn't affect functionality?
This commit is contained in:
parent
4d78865ab2
commit
2858cdb7ec
|
@ -301,7 +301,7 @@ class MovieInputs : public Serializable
|
||||||
|
|
||||||
// Automatically generated
|
// Automatically generated
|
||||||
// Several not used
|
// Several not used
|
||||||
#define addr_kernel_48 0x800
|
// #define addr_kernel_48 0x800
|
||||||
#define addr_transport_direction 0x880
|
#define addr_transport_direction 0x880
|
||||||
#define addr_transport_buttons 0x894
|
#define addr_transport_buttons 0x894
|
||||||
#define addr_right_line 0x948
|
#define addr_right_line 0x948
|
||||||
|
@ -317,7 +317,7 @@ class MovieInputs : public Serializable
|
||||||
#define addr_set_gcol7 0x96a
|
#define addr_set_gcol7 0x96a
|
||||||
#define addr_set_gdata7 0x96e
|
#define addr_set_gdata7 0x96e
|
||||||
#define addr_set_gcol8 0x972
|
#define addr_set_gcol8 0x972
|
||||||
#define addr_left_line 0x980
|
// #define addr_left_line 0x980
|
||||||
#define addr_set_gdata1 0x982
|
#define addr_set_gdata1 0x982
|
||||||
#define addr_set_gcol1 0x988
|
#define addr_set_gcol1 0x988
|
||||||
#define addr_set_aud_left 0x98c
|
#define addr_set_aud_left 0x98c
|
||||||
|
@ -331,27 +331,27 @@ class MovieInputs : public Serializable
|
||||||
#define addr_set_gdata2 0x9a8
|
#define addr_set_gdata2 0x9a8
|
||||||
#define addr_set_gcol3 0x9ac
|
#define addr_set_gcol3 0x9ac
|
||||||
#define addr_pick_continue 0x9be
|
#define addr_pick_continue 0x9be
|
||||||
#define addr_main_start 0xa00
|
// #define addr_main_start 0xa00
|
||||||
#define addr_aud_bank_setup 0xa0c
|
// #define addr_aud_bank_setup 0xa0c
|
||||||
#define addr_tg0 0xa24
|
// #define addr_tg0 0xa24
|
||||||
#define addr_title_again 0xa3b
|
// #define addr_title_again 0xa3b
|
||||||
#define addr_wait_cnt 0xa77
|
// #define addr_wait_cnt 0xa77
|
||||||
#define addr_end_lines 0xa80
|
#define addr_end_lines 0xa80
|
||||||
#define addr_set_aud_endlines 0xa80
|
#define addr_set_aud_endlines 0xa80
|
||||||
#define addr_set_overscan_size 0xa9a
|
#define addr_set_overscan_size 0xa9a
|
||||||
#define addr_set_vblank_size 0xab0
|
#define addr_set_vblank_size 0xab0
|
||||||
#define addr_pick_extra_lines 0xab9
|
#define addr_pick_extra_lines 0xab9
|
||||||
#define addr_pick_transport 0xac6
|
#define addr_pick_transport 0xac6
|
||||||
#define addr_wait_lines 0xac9
|
// #define addr_wait_lines 0xac9
|
||||||
#define addr_transport_done1 0xada
|
// #define addr_transport_done1 0xada
|
||||||
#define addr_draw_title 0xb00
|
// #define addr_draw_title 0xb00
|
||||||
#define addr_title_loop 0xb50
|
#define addr_title_loop 0xb50
|
||||||
#define addr_black_bar 0xb52
|
// #define addr_black_bar 0xb52
|
||||||
#define addr_animate_bar1 0xb58
|
// #define addr_animate_bar1 0xb58
|
||||||
#define addr_animate_bar_again1 0xb5a
|
// #define addr_animate_bar_again1 0xb5a
|
||||||
#define addr_animate_dex1 0xb65
|
// #define addr_animate_dex1 0xb65
|
||||||
#define addr_audio_bank 0xb80
|
#define addr_audio_bank 0xb80
|
||||||
#define addr_reset_loop 0xbfa
|
// #define addr_reset_loop 0xbfa
|
||||||
|
|
||||||
// scale adjustments, automatically generated
|
// scale adjustments, automatically generated
|
||||||
static constexpr uInt8 scale0[16] = {
|
static constexpr uInt8 scale0[16] = {
|
||||||
|
@ -480,7 +480,7 @@ static constexpr uInt8 brightLabelEven[] = {
|
||||||
0, 49, 48, 12, 96,
|
0, 49, 48, 12, 96,
|
||||||
6, 140, 231, 96, 0,
|
6, 140, 231, 96, 0,
|
||||||
0, 225, 48, 12, 96,
|
0, 225, 48, 12, 96,
|
||||||
0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0
|
0, 0, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -497,7 +497,7 @@ static constexpr uInt8 brightLabelOdd[] = {
|
||||||
0, 113, 48, 12, 96,
|
0, 113, 48, 12, 96,
|
||||||
7, 142, 127, 96, 0,
|
7, 142, 127, 96, 0,
|
||||||
0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0
|
0, 0, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -514,7 +514,7 @@ static constexpr uInt8 volumeLabelEven[] = {
|
||||||
0, 12, 192, 15, 192,
|
0, 12, 192, 15, 192,
|
||||||
30, 112, 119, 176, 0,
|
30, 112, 119, 176, 0,
|
||||||
0, 7, 252, 12, 254,
|
0, 7, 252, 12, 254,
|
||||||
0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0
|
0, 0, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -531,7 +531,7 @@ static constexpr uInt8 volumeLabelOdd[] = {
|
||||||
0, 14, 192, 13, 192,
|
0, 14, 192, 13, 192,
|
||||||
14, 224, 62, 48, 0,
|
14, 224, 62, 48, 0,
|
||||||
0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0
|
0, 0, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include "System.hxx"
|
#include "System.hxx"
|
||||||
#include "Control.hxx"
|
#include "Control.hxx"
|
||||||
|
|
|
@ -302,7 +302,7 @@ class Controller : public Serializable
|
||||||
/**
|
/**
|
||||||
Retrieves the effective analog dead zone value
|
Retrieves the effective analog dead zone value
|
||||||
*/
|
*/
|
||||||
static int Controller::analogDeadZoneValue(int deadZone);
|
static int analogDeadZoneValue(int deadZone);
|
||||||
|
|
||||||
inline static int digitalDeadZone() { return DIGITAL_DEAD_ZONE; }
|
inline static int digitalDeadZone() { return DIGITAL_DEAD_ZONE; }
|
||||||
|
|
||||||
|
@ -410,10 +410,10 @@ class Controller : public Serializable
|
||||||
/// The callback that is dispatched whenver an analog pin has changed
|
/// The callback that is dispatched whenver an analog pin has changed
|
||||||
onAnalogPinUpdateCallback myOnAnalogPinUpdateCallback{nullptr};
|
onAnalogPinUpdateCallback myOnAnalogPinUpdateCallback{nullptr};
|
||||||
|
|
||||||
/// Defines the dead zone of analog joysticks for digital Atari controllers</summary>
|
/// Defines the dead zone of analog joysticks for digital Atari controllers
|
||||||
static int DIGITAL_DEAD_ZONE;
|
static int DIGITAL_DEAD_ZONE;
|
||||||
|
|
||||||
/// Defines the dead zone of analog joysticks for analog Atari controllers</summary>
|
/// Defines the dead zone of analog joysticks for analog Atari controllers
|
||||||
static int ANALOG_DEAD_ZONE;
|
static int ANALOG_DEAD_ZONE;
|
||||||
|
|
||||||
static int MOUSE_SENSITIVITY;
|
static int MOUSE_SENSITIVITY;
|
||||||
|
|
|
@ -197,7 +197,7 @@ void Paddles::update()
|
||||||
|
|
||||||
AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int center)
|
AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int center)
|
||||||
{
|
{
|
||||||
const double range = ANALOG_RANGE - analogDeadZone() * 2;
|
const float range = ANALOG_RANGE - analogDeadZone() * 2;
|
||||||
|
|
||||||
// dead zone, ignore changes inside the dead zone
|
// dead zone, ignore changes inside the dead zone
|
||||||
if(newAxis > analogDeadZone())
|
if(newAxis > analogDeadZone())
|
||||||
|
@ -207,23 +207,23 @@ AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int ce
|
||||||
else
|
else
|
||||||
newAxis = 0; // treat any dead zone value as zero
|
newAxis = 0; // treat any dead zone value as zero
|
||||||
|
|
||||||
static constexpr std::array<double, MAX_DEJITTER - MIN_DEJITTER + 1> bFac = {
|
static constexpr std::array<float, MAX_DEJITTER - MIN_DEJITTER + 1> bFac = {
|
||||||
// higher values mean more dejitter strength
|
// higher values mean more dejitter strength
|
||||||
0, // off
|
0, // off
|
||||||
0.50, 0.59, 0.67, 0.74, 0.80,
|
0.50, 0.59, 0.67, 0.74, 0.80,
|
||||||
0.85, 0.89, 0.92, 0.94, 0.95
|
0.85, 0.89, 0.92, 0.94, 0.95
|
||||||
};
|
};
|
||||||
static constexpr std::array<double, MAX_DEJITTER - MIN_DEJITTER + 1> dFac = {
|
static constexpr std::array<float, MAX_DEJITTER - MIN_DEJITTER + 1> dFac = {
|
||||||
// lower values mean more dejitter strength
|
// lower values mean more dejitter strength
|
||||||
1, // off
|
1, // off
|
||||||
1.0 / 181, 1.0 / 256, 1.0 / 362, 1.0 / 512, 1.0 / 724,
|
1.0 / 181, 1.0 / 256, 1.0 / 362, 1.0 / 512, 1.0 / 724,
|
||||||
1.0 / 1024, 1.0 / 1448, 1.0 / 2048, 1.0 / 2896, 1.0 / 4096
|
1.0 / 1024, 1.0 / 1448, 1.0 / 2048, 1.0 / 2896, 1.0 / 4096
|
||||||
};
|
};
|
||||||
const double baseFactor = bFac[DEJITTER_BASE];
|
const float baseFactor = bFac[DEJITTER_BASE];
|
||||||
const double diffFactor = dFac[DEJITTER_DIFF];
|
const float diffFactor = dFac[DEJITTER_DIFF];
|
||||||
|
|
||||||
// dejitter, suppress small changes only
|
// dejitter, suppress small changes only
|
||||||
double dejitter = pow(baseFactor, abs(newAxis - lastAxis) * diffFactor);
|
float dejitter = powf(baseFactor, std::abs(newAxis - lastAxis) * diffFactor);
|
||||||
int newVal = newAxis * (1 - dejitter) + lastAxis * dejitter;
|
int newVal = newAxis * (1 - dejitter) + lastAxis * dejitter;
|
||||||
|
|
||||||
// only use new dejittered value for larger differences
|
// only use new dejittered value for larger differences
|
||||||
|
@ -231,12 +231,12 @@ AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int ce
|
||||||
newAxis = newVal;
|
newAxis = newVal;
|
||||||
|
|
||||||
// apply linearity
|
// apply linearity
|
||||||
double linearVal = newAxis / (range / 2); // scale to -1.0..+1.0
|
float linearVal = newAxis / (range / 2); // scale to -1.0..+1.0
|
||||||
|
|
||||||
if(newAxis >= 0)
|
if(newAxis >= 0)
|
||||||
linearVal = pow(abs(linearVal), LINEARITY);
|
linearVal = powf(std::abs(linearVal), LINEARITY);
|
||||||
else
|
else
|
||||||
linearVal = -pow(abs(linearVal), LINEARITY);
|
linearVal = -powf(std::abs(linearVal), LINEARITY);
|
||||||
|
|
||||||
newAxis = linearVal * (range / 2); // scale back to ANALOG_RANGE
|
newAxis = linearVal * (range / 2); // scale back to ANALOG_RANGE
|
||||||
|
|
||||||
|
@ -245,8 +245,8 @@ AnalogReadout::Connection Paddles::getReadOut(int lastAxis, int& newAxis, int ce
|
||||||
|
|
||||||
// scale result
|
// scale result
|
||||||
return AnalogReadout::connectToVcc(MAX_RESISTANCE *
|
return AnalogReadout::connectToVcc(MAX_RESISTANCE *
|
||||||
BSPF::clamp((ANALOG_MAX_VALUE - (scaledAxis * SENSITIVITY + center)) / double(ANALOG_RANGE),
|
BSPF::clamp((ANALOG_MAX_VALUE - (scaledAxis * SENSITIVITY + center)) /
|
||||||
0.0, 1.0));
|
float(ANALOG_RANGE), 0.F, 1.F));
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -35,7 +35,7 @@ MODULE_OBJS := \
|
||||||
src/gui/MessageMenu.o \
|
src/gui/MessageMenu.o \
|
||||||
src/gui/MinUICommandDialog.o\
|
src/gui/MinUICommandDialog.o\
|
||||||
src/gui/OptionsDialog.o \
|
src/gui/OptionsDialog.o \
|
||||||
src/gui/OptionMenu.o \
|
src/gui/OptionsMenu.o \
|
||||||
src/gui/PlusRomsMenu.o\
|
src/gui/PlusRomsMenu.o\
|
||||||
src/gui/PlusRomsSetupDialog.o\
|
src/gui/PlusRomsSetupDialog.o\
|
||||||
src/gui/PopUpWidget.o \
|
src/gui/PopUpWidget.o \
|
||||||
|
|
Loading…
Reference in New Issue