X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Flibretro%2Flibretro.c;h=0f060e6b7e275670b39a731b67c4e055542ec14e;hb=d4089d9b8e132e796dca0382bd237b8efeeeac3d;hp=1b914d547201d1046497901e0ffbfbbe8bf2a689;hpb=6cf45534d325cc4a2e93910e57f5f1eff7443a88;p=picodrive.git diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index 1b914d5..0f060e6 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -722,11 +722,17 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code) } pt; int array_len = 0; char *buff; + bool multiline=0; //TODO: Split multi-line codes properly - buff = strtok(code,"+"); + if (strstr(code,"+")){ + multiline=1; + buff = strtok(code,"+"); + } else { + buff=code; + } - while (buff) + while (buff != NULL) { decode(buff, &pt); if (pt.addr == (unsigned int)-1 || pt.data == (unsigned short)-1) @@ -759,6 +765,9 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code) else PicoPatches[PicoPatchCount].data_old = (unsigned short) m68k_read16(PicoPatches[PicoPatchCount].addr); PicoPatchCount++; + + if (!multiline) + break; } }