basic kbd handlewith joy

This commit is contained in:
R-type 2015-12-16 00:45:34 +01:00
parent a975525271
commit ca3065cdec
3 changed files with 58 additions and 8 deletions

View File

@ -1,3 +1,36 @@
WIP Libretro port of Atari800 emulator version 3.1.0
----------------------------------------------------
In joy mode
L3 NA
R3 NA
L2 KEY SPACE
R2 KEY ESCAPE
L CONSOL_OPTION
R TOGGLE UI
SEL CONSOL_SELECT
STR CONSOL_START
A FIRE1/KEY RETURN IN GUI
B KEY RETURN
X FIRE2/KEY ESCAPE IN GUI
Y VKBD ON/OFF
In Keayboard mode
F1 MAIN GUI
F2 CONSOL_OPTION
F3 CONSOL_SELECT
F4 CONSOL_START
UP
DOWN
LEFT
RIGHT
RETURN
ESCAPE
SPACE
Atari800 emulator version 3.1.0
-------------------------------

View File

@ -78,7 +78,7 @@ char Key_Sate[512];
char Key_Sate2[512];
static char old_Key_Sate[512];
static int mbt[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int mbt[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//STATS GUI
int BOXDEC= 32+2;

View File

@ -48,6 +48,7 @@ static int swap_joysticks = FALSE;
int PLATFORM_kbd_joy_0_enabled = TRUE; /* enabled by default, doesn't hurt */
int PLATFORM_kbd_joy_1_enabled = FALSE; /* disabled, would steal normal keys */
extern unsigned char MXjoy[2]; // joy
extern int mbt[16];
extern int retro_sound_finalized;
static UWORD *palette = NULL;
@ -117,18 +118,34 @@ int PLATFORM_Keyboard(void)
if (Key_Sate[RETROK_F4])
INPUT_key_consol &= (~INPUT_CONSOL_START);
/* FIXME handle all keys */
if (Key_Sate[RETROK_SPACE])
return AKEY_SPACE;
if (Key_Sate[RETROK_F1])
return AKEY_UI;
if (Key_Sate[RETROK_LEFT])return AKEY_LEFT;
if (Key_Sate[RETROK_RIGHT])return AKEY_RIGHT;
if (Key_Sate[RETROK_UP])return AKEY_UP;
if (Key_Sate[RETROK_DOWN])return AKEY_DOWN;
if (Key_Sate[RETROK_RETURN])return AKEY_RETURN;
if (Key_Sate[RETROK_ESCAPE])return AKEY_ESCAPE;
if (Key_Sate[RETROK_LEFT])return AKEY_LEFT;
if (Key_Sate[RETROK_RIGHT])return AKEY_RIGHT;
if (Key_Sate[RETROK_UP])return AKEY_UP;
if (Key_Sate[RETROK_DOWN])return AKEY_DOWN;
if (Key_Sate[RETROK_RETURN])return AKEY_RETURN;
if (Key_Sate[RETROK_ESCAPE])return AKEY_ESCAPE;
/* FIXME joy bind */
if (mbt[RETRO_DEVICE_ID_JOYPAD_SELECT])
INPUT_key_consol &= (~INPUT_CONSOL_SELECT);
if (mbt[RETRO_DEVICE_ID_JOYPAD_START])
INPUT_key_consol &= (~INPUT_CONSOL_START);
if (mbt[RETRO_DEVICE_ID_JOYPAD_L])
INPUT_key_consol &= (~INPUT_CONSOL_OPTION);
if (mbt[RETRO_DEVICE_ID_JOYPAD_R])
return AKEY_UI;
if (mbt[RETRO_DEVICE_ID_JOYPAD_L2])
return AKEY_SPACE;
if (mbt[RETRO_DEVICE_ID_JOYPAD_R2])
return AKEY_ESCAPE;
if (mbt[RETRO_DEVICE_ID_JOYPAD_B])
return AKEY_RETURN;
if (UI_is_active){
// whitout kbd in GUI