notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support multiline codes
[picodrive.git]
/
platform
/
libretro
/
libretro.c
diff --git
a/platform/libretro/libretro.c
b/platform/libretro/libretro.c
index
73733fd
..
1b914d5
100644
(file)
--- a/
platform/libretro/libretro.c
+++ b/
platform/libretro/libretro.c
@@
-713,7
+713,7
@@
void retro_cheat_reset(void)
PicoPatchUnload();
}
PicoPatchUnload();
}
-void retro_cheat_set(unsigned index, bool enabled, const char *
buff
)
+void retro_cheat_set(unsigned index, bool enabled, const char *
code
)
{
struct patch
{
{
struct patch
{
@@
-721,11
+721,16
@@
void retro_cheat_set(unsigned index, bool enabled, const char *buff)
unsigned short data;
} pt;
int array_len = 0;
unsigned short data;
} pt;
int array_len = 0;
+ char *buff;
//TODO: Split multi-line codes properly
//TODO: Split multi-line codes properly
+ buff = strtok(code,"+");
+ while (buff)
+ {
decode(buff, &pt);
decode(buff, &pt);
- if (pt.addr == (unsigned int)-1 || pt.data == (unsigned short)-1){
+ if (pt.addr == (unsigned int)-1 || pt.data == (unsigned short)-1)
+ {
log_cb(RETRO_LOG_ERROR,"CHEATS: Invalid code: %s\n",buff);
return;
}
log_cb(RETRO_LOG_ERROR,"CHEATS: Invalid code: %s\n",buff);
return;
}
@@
-754,6
+759,7
@@
void retro_cheat_set(unsigned index, bool enabled, const char *buff)
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++;
+ }
}
/* multidisk support */
}
/* multidisk support */