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
flycast
Commits
aa109dab
Commit
aa109dab
authored
May 23, 2019
by
David Walters
Browse files
Allow L2 and R2 to function as Z and C respectively.
parent
717913dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/libretro/libretro.cpp
View file @
aa109dab
...
...
@@ -2683,10 +2683,30 @@ void UpdateInputState(u32 port)
// buttons
setDeviceButtonStateDirect
(
port
,
RETRO_DEVICE_ASCIISTICK
,
RETRO_DEVICE_ID_JOYPAD_B
,
2
);
// A
setDeviceButtonStateDirect
(
port
,
RETRO_DEVICE_ASCIISTICK
,
RETRO_DEVICE_ID_JOYPAD_A
,
1
);
// B
setDeviceButtonStateDirect
(
port
,
RETRO_DEVICE_ASCIISTICK
,
RETRO_DEVICE_ID_JOYPAD_R
,
0
);
// C
setDeviceButtonStateDirect
(
port
,
RETRO_DEVICE_ASCIISTICK
,
RETRO_DEVICE_ID_JOYPAD_Y
,
10
);
// X
setDeviceButtonStateDirect
(
port
,
RETRO_DEVICE_ASCIISTICK
,
RETRO_DEVICE_ID_JOYPAD_X
,
9
);
// Y
setDeviceButtonStateDirect
(
port
,
RETRO_DEVICE_ASCIISTICK
,
RETRO_DEVICE_ID_JOYPAD_L
,
8
);
// Z
// Z
{
uint32_t
dc_key
=
1
<<
8
;
// Z
bool
is_down
=
input_cb
(
port
,
RETRO_DEVICE_ASCIISTICK
,
0
,
RETRO_DEVICE_ID_JOYPAD_L
)
||
input_cb
(
port
,
RETRO_DEVICE_ASCIISTICK
,
0
,
RETRO_DEVICE_ID_JOYPAD_L2
);
if
(
is_down
)
kcode
[
port
]
&=
~
dc_key
;
else
kcode
[
port
]
|=
dc_key
;
}
// C
{
uint32_t
dc_key
=
1
<<
0
;
// C
bool
is_down
=
input_cb
(
port
,
RETRO_DEVICE_ASCIISTICK
,
0
,
RETRO_DEVICE_ID_JOYPAD_R
)
||
input_cb
(
port
,
RETRO_DEVICE_ASCIISTICK
,
0
,
RETRO_DEVICE_ID_JOYPAD_R2
);
if
(
is_down
)
kcode
[
port
]
&=
~
dc_key
;
else
kcode
[
port
]
|=
dc_key
;
}
setDeviceButtonStateDirect
(
port
,
RETRO_DEVICE_ASCIISTICK
,
RETRO_DEVICE_ID_JOYPAD_START
,
3
);
// Start
...
...
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