Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
hatari
Commits
c1e01fc0
Commit
c1e01fc0
authored
Oct 31, 2020
by
bbbradsmith
Browse files
option to disable mouse input if needed
parent
9a7ca63f
Changes
2
Hide whitespace changes
Inline
Side-by-side
libretro/hatari-mapper.c
View file @
c1e01fc0
...
...
@@ -13,6 +13,7 @@ extern const char *retro_system_directory;
extern
const
char
*
retro_content_directory
;
char
RETRO_DIR
[
512
];
char
RETRO_TOS
[
512
];
extern
bool
hatari_nomouse
;
//HATARI PROTOTYPES
#include "configuration.h"
...
...
@@ -49,7 +50,7 @@ char RPATH[512];
//EMU FLAGS
int
NPAGE
=-
1
,
KCOL
=
1
,
BKGCOLOR
=
0
,
MAXPAS
=
6
;
int
SHIFTON
=-
1
,
MOUSEMODE
=-
1
,
SHOWKEY
=-
1
,
PAS
=
4
,
STATUTON
=-
1
;
int
SHIFTON
=-
1
,
MOUSEMODE
=-
1
,
SHOWKEY
=-
1
,
PAS
=
2
,
STATUTON
=-
1
;
int
SND
=
1
;
//SOUND ON/OFF
int
pauseg
=
0
;
//enter_gui
int
slowdown
=
0
;
...
...
@@ -723,13 +724,20 @@ void update_input(void)
MXjoy0
&=
~
ATARIJOY_BITMASK_FIRE
;
}
mouse_x
=
input_state_cb
(
0
,
RETRO_DEVICE_MOUSE
,
0
,
RETRO_DEVICE_ID_MOUSE_X
);
mouse_y
=
input_state_cb
(
0
,
RETRO_DEVICE_MOUSE
,
0
,
RETRO_DEVICE_ID_MOUSE_Y
);
mouse_l
=
input_state_cb
(
0
,
RETRO_DEVICE_MOUSE
,
0
,
RETRO_DEVICE_ID_MOUSE_LEFT
);
mouse_r
=
input_state_cb
(
0
,
RETRO_DEVICE_MOUSE
,
0
,
RETRO_DEVICE_ID_MOUSE_RIGHT
);
fmousex
=
mouse_x
;
fmousey
=
mouse_y
;
if
(
hatari_nomouse
)
{
mouse_l
=
0
;
mouse_r
=
0
;
}
else
{
mouse_x
=
input_state_cb
(
0
,
RETRO_DEVICE_MOUSE
,
0
,
RETRO_DEVICE_ID_MOUSE_X
);
mouse_y
=
input_state_cb
(
0
,
RETRO_DEVICE_MOUSE
,
0
,
RETRO_DEVICE_ID_MOUSE_Y
);
mouse_l
=
input_state_cb
(
0
,
RETRO_DEVICE_MOUSE
,
0
,
RETRO_DEVICE_ID_MOUSE_LEFT
);
mouse_r
=
input_state_cb
(
0
,
RETRO_DEVICE_MOUSE
,
0
,
RETRO_DEVICE_ID_MOUSE_RIGHT
);
fmousex
=
mouse_x
;
fmousey
=
mouse_y
;
}
}
else
// MOUSEMODE >= 0
...
...
libretro/libretro.c
View file @
c1e01fc0
...
...
@@ -62,6 +62,7 @@ float FRAMERATE = 50.0, SAMPLERATE = 44100.0;
extern
bool
UseNonPolarizedLowPassFilter
;
bool
hatari_twojoy
=
true
;
bool
hatari_nomouse
=
false
;
bool
hatari_fastfdc
=
true
;
bool
hatari_borders
=
true
;
char
hatari_frameskips
[
2
];
...
...
@@ -104,7 +105,7 @@ void retro_set_environment(retro_environment_t cb)
static
struct
retro_core_option_definition
core_options
[]
=
{
//
Second joystick
//
Input
{
"hatari_twojoy"
,
"Enable second joystick"
,
...
...
@@ -116,6 +117,17 @@ void retro_set_environment(retro_environment_t cb)
},
"true"
},
{
"hatari_nomouse"
,
"Disable mouse"
,
"Disables input from your sytem mouse device. Gamepad mouse mode (select) is not disabled."
,
{
{
"false"
,
"disabled"
},
{
"true"
,
"enabled"
},
{
NULL
,
NULL
},
},
"false"
},
// Floppy speed
{
"hatari_fastfdc"
,
...
...
@@ -221,7 +233,8 @@ static void update_variables(void)
{
struct
retro_variable
var
=
{
0
};
// Joystick
// Input
var
.
key
=
"hatari_twojoy"
;
var
.
value
=
NULL
;
if
(
environ_cb
(
RETRO_ENVIRONMENT_GET_VARIABLE
,
&
var
)
&&
var
.
value
)
...
...
@@ -232,6 +245,18 @@ static void update_variables(void)
ConfigureParams
.
Joysticks
.
Joy
[
0
].
nJoystickMode
=
hatari_twojoy
?
JOYSTICK_REALSTICK
:
JOYSTICK_DISABLED
;
}
var
.
key
=
"hatari_nomouse"
;
var
.
value
=
NULL
;
if
(
environ_cb
(
RETRO_ENVIRONMENT_GET_VARIABLE
,
&
var
)
&&
var
.
value
)
{
hatari_nomouse
=
false
;
if
(
strcmp
(
var
.
value
,
"true"
)
==
0
)
hatari_nomouse
=
true
;
// This doesn't correspond to any Hatari configuration setting, as far as I could find,
// but instead just disables input from the RetroArch mouse device for the user (outside the Hatari GUI),
// to prevent conflicts if needed, because Hatari seems to automatically merge/combine mouse and joystick in a weird way.
}
// Floppy
var
.
key
=
"hatari_fastfdc"
;
var
.
value
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment