notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix multiline support
[picodrive.git]
/
platform
/
libretro
/
libretro.c
diff --git
a/platform/libretro/libretro.c
b/platform/libretro/libretro.c
index
1b914d5
..
0f060e6
100644
(file)
--- 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;
} pt;
int array_len = 0;
char *buff;
+ bool multiline=0;
//TODO: Split multi-line codes properly
//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)
{
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++;
else
PicoPatches[PicoPatchCount].data_old = (unsigned short) m68k_read16(PicoPatches[PicoPatchCount].addr);
PicoPatchCount++;
+
+ if (!multiline)
+ break;
}
}
}
}