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
d76e605a
Commit
d76e605a
authored
Aug 12, 2015
by
Jan Holthuis
Browse files
linux-dist: Use a switch case in UpdateInputState
parent
73a9269f
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/linux-dist/main.cpp
View file @
d76e605a
...
...
@@ -449,42 +449,46 @@ void UpdateInputState(u32 port)
return
;
#endif
for
(;;)
bool
done
=
false
;
while
(
!
done
)
{
key
=
0
;
read
(
STDIN_FILENO
,
&
key
,
1
);
if
(
0
==
key
||
EOF
==
key
)
{
break
;
}
if
(
'k'
==
key
)
{
KillTex
=
true
;
}
#ifdef TARGET_PANDORA
if
(
' '
==
key
)
{
kcode
[
port
]
&=
~
Btn_C
;
}
if
(
'6'
==
key
)
{
kcode
[
port
]
&=
~
Btn_A
;
}
if
(
'O'
==
key
)
{
kcode
[
port
]
&=
~
Btn_B
;
}
if
(
'5'
==
key
)
{
kcode
[
port
]
&=
~
Btn_Y
;
}
if
(
'H'
==
key
)
{
kcode
[
port
]
&=
~
Btn_X
;
}
if
(
'A'
==
key
)
{
kcode
[
port
]
&=
~
DPad_Up
;
}
if
(
'B'
==
key
)
{
kcode
[
port
]
&=
~
DPad_Down
;
}
if
(
'D'
==
key
)
{
kcode
[
port
]
&=
~
DPad_Left
;
}
if
(
'C'
==
key
)
{
kcode
[
port
]
&=
~
DPad_Right
;
}
if
(
'q'
==
key
)
{
die
(
"death by escape key"
);
}
#endif
//if (0x1b == key){ die("death by escape key"); } //this actually quits when i press left for some reason
if
(
'a'
==
key
)
{
rt
[
port
]
=
255
;
}
if
(
's'
==
key
)
{
lt
[
port
]
=
255
;
}
#if FEAT_SHREC != DYNAREC_NONE
if
(
'b'
==
key
)
{
emit_WriteCodeCache
();
}
if
(
'n'
==
key
)
{
bm_Reset
();
}
if
(
'm'
==
key
)
{
bm_Sort
();
}
if
(
','
==
key
)
{
emit_WriteCodeCache
();
bm_Sort
();
}
#endif
switch
(
key
)
{
case
0
:
case
EOF
:
done
=
true
;
break
;
case
'k'
:
KillTex
=
true
;
break
;
case
'a'
:
rt
[
port
]
=
255
;
break
;
case
's'
:
lt
[
port
]
=
255
;
break
;
//case 0x1b: die("death by escape key"); break; //this actually quits when i press left for some reason
#ifdef TARGET_PANDORA
case
' '
:
kcode
[
port
]
&=
~
Btn_C
;
break
;
case
'6'
:
kcode
[
port
]
&=
~
Btn_A
;
break
;
case
'O'
:
kcode
[
port
]
&=
~
Btn_B
;
break
;
case
'5'
:
kcode
[
port
]
&=
~
Btn_Y
;
break
;
case
'H'
:
kcode
[
port
]
&=
~
Btn_X
;
break
;
case
'A'
:
kcode
[
port
]
&=
~
DPad_Up
;
break
;
case
'B'
:
kcode
[
port
]
&=
~
DPad_Down
;
break
;
case
'D'
:
kcode
[
port
]
&=
~
DPad_Left
;
break
;
case
'C'
:
kcode
[
port
]
&=
~
DPad_Right
;
break
;
case
'q'
:
die
(
"death by escape key"
);
break
;
#endif
#if FEAT_SHREC != DYNAREC_NONE
case
'b'
:
emit_WriteCodeCache
();
break
;
case
'n'
:
bm_Reset
();
break
;
case
'm'
:
bm_Sort
();
break
;
case
','
:
emit_WriteCodeCache
();
bm_Sort
();
break
;
#endif
}
}
}
...
...
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