From 51f77aa38cd79744046624d358a71e307a8bff89 Mon Sep 17 00:00:00 2001 From: EkeEke Date: Tue, 8 Aug 2017 16:46:11 +0200 Subject: [PATCH] [libretro] bugfix & code cleanup --- builds/genesis_plus_gx_libretro.dll | Bin 2420258 -> 2420770 bytes libretro/libretro.c | 31 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/builds/genesis_plus_gx_libretro.dll b/builds/genesis_plus_gx_libretro.dll index 2e85c048a75f9703094b43462110a226feee5629..3eaff4460b3e0ba2948b7d1cee5d40a7e6289241 100644 GIT binary patch delta 13644 zcmb7rd0bOR_xGJi2wU#GQTA0rqTn7#0!e^?yLCkrtF4OrRu$Zrs$h{?q$)PmQy;r% zYg=o5s#fb&Yb`EytGiZlL);O8!fiuNQ$j=nUC>~qYe!2&i#y*IG|mPZ`l(J045 z+Q3ml14xPE5sH;M!WB{Ek)tDiK6gyOPwH5XpGwCr{1hBzigaaG1l^ng2{)U(3b)8g2mw9($T9TiG5x#7^d1!jM9OXQp-NrD)AMiU-U(!e21jQ) zFQECfyrL;1m_i?<yB(jl9vD81m!q+>HX3_|zK%vG-XR*^Cx;ychN-lV+A%i9?nsG=CU+bp zCfTtT(R|0rm{BCuRi6q+_m;Vrh||BC8=C zSYf%zO1n zNvBkE-N_Hq&hsiYA)mvc3#waW3v9Zmx}`ia*pq{z^D1B1cu7@69>B!Qs;A^1XaRTv1(DDhHy_?9bdXU~j2vld|evtabyp4)EJm)n?Y_n(87AdFwgAKcA68wHswTZPTQ&kWTRz!f|2ZblB{6f(X)-`k&pwiDh znl+xK3{6KngF{tKpu!&+IZo9oMf*OU&~ubq03=nZQek1aY8MFwZMiB4Dl^Ms0{X(PDBzuLb2|?>g6{WFTh9M1c`y>stq;A)1O-z%*=EU8xgpls2#HfB=leT=n@I`<-J|6gZ;^QTK5#ZhP z82Je9-t^u^uE2L?-U%V!^i^`_^S0rPE9Q&;h|Rnls=xdNt2*=Hd71a7fOF|g;0Y5b zax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b iD42WqGaRR^b%&EC;Fxl_7J3C^W^C3=or2Yu&-@?SUW&y4 diff --git a/libretro/libretro.c b/libretro/libretro.c index a4f65f3..b34240c 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -3,7 +3,7 @@ * * Genesis Plus GX libretro port * - * Copyright Eke-Eke (2007-2016) + * Copyright Eke-Eke (2007-2017) * * Copyright Daniel De Matteis (2012-2016) * @@ -1792,7 +1792,7 @@ void retro_set_controller_port_device(unsigned port, unsigned device) break; case RETRO_DEVICE_MDPAD_3B: { - if (port && (input.system[0] >= RETRO_DEVICE_MDPAD_3B_WAYPLAY) && (input.system[0] <= RETRO_DEVICE_MSPAD_2B_MASTERTAP)) + if (port && (input.system[0] >= SYSTEM_MASTERTAP) && (input.system[0] <= SYSTEM_WAYPLAY)) config.input[4].padtype = DEVICE_PAD3B; else config.input[port].padtype = DEVICE_PAD3B; @@ -1801,7 +1801,7 @@ void retro_set_controller_port_device(unsigned port, unsigned device) } case RETRO_DEVICE_MDPAD_6B: { - if (port && (input.system[0] >= RETRO_DEVICE_MDPAD_3B_WAYPLAY) && (input.system[0] <= RETRO_DEVICE_MSPAD_2B_MASTERTAP)) + if (port && (input.system[0] >= SYSTEM_MASTERTAP) && (input.system[0] <= SYSTEM_WAYPLAY)) config.input[4].padtype = DEVICE_PAD6B; else config.input[port].padtype = DEVICE_PAD6B; @@ -1810,7 +1810,7 @@ void retro_set_controller_port_device(unsigned port, unsigned device) } case RETRO_DEVICE_MSPAD_2B: { - if (port && (input.system[0] >= RETRO_DEVICE_MDPAD_3B_WAYPLAY) && (input.system[0] <= RETRO_DEVICE_MSPAD_2B_MASTERTAP)) + if (port && (input.system[0] >= SYSTEM_MASTERTAP) && (input.system[0] <= SYSTEM_WAYPLAY)) config.input[4].padtype = DEVICE_PAD2B; else config.input[port].padtype = DEVICE_PAD2B; @@ -1894,7 +1894,7 @@ void retro_set_controller_port_device(unsigned port, unsigned device) case RETRO_DEVICE_JOYPAD: default: { - if (port && (input.system[0] >= RETRO_DEVICE_MDPAD_3B_WAYPLAY) && (input.system[0] <= RETRO_DEVICE_MSPAD_2B_MASTERTAP)) + if (port && (input.system[0] >= SYSTEM_MASTERTAP) && (input.system[0] <= SYSTEM_WAYPLAY)) config.input[4].padtype = DEVICE_PAD2B | DEVICE_PAD6B | DEVICE_PAD3B; else config.input[port].padtype = DEVICE_PAD2B | DEVICE_PAD6B | DEVICE_PAD3B; @@ -1945,16 +1945,17 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code) { char codeCopy[256]; char *buff; - - /* Avoid crashing when giving empty input */ - if (code=='\0') return; - /* clear existing ROM patches */ - clear_cheats(); + /* Avoid crashing when giving no input */ + if (code==NULL) return; - /* Detect and split multiline cheats */ - strcpy(codeCopy,code); - buff = strtok(codeCopy,"+"); + /* clear existing ROM patches */ + clear_cheats(); + + /* Detect and split multiline cheats */ + strncpy(codeCopy,code,255); + codeCopy[255] = '\0'; + buff = strtok(codeCopy,"+"); while (buff != NULL) { @@ -1984,8 +1985,8 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code) buff = strtok(NULL,"+"); } - /* apply ROM patches */ - apply_cheats(); + /* apply ROM patches */ + apply_cheats(); } bool retro_load_game(const struct retro_game_info *info)