X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Flibretro%2Flibretro.c;h=934b6859f55684238137c9446b124f3d0b6a8a21;hb=cbf31d2c254c956a0b497e3021610ce3a5ff0748;hp=f11b5dae8aadf5353574826ce52fced2d57b4360;hpb=6bf654d0e2fc12b5cbb8bd82ec5136c9ef5ea568;p=picodrive.git diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index f11b5da..934b685 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -696,6 +696,7 @@ typedef struct patch { unsigned int addr; unsigned short data; + unsigned char comp; } patch; extern void decode(char *buff, patch *dest); @@ -728,16 +729,10 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code) int array_len = PicoPatchCount; char codeCopy[256]; char *buff; - bool multiline=0; + if (code=='\0') return; strcpy(codeCopy,code); - - if (strstr(code,"+")){ - multiline=1; - buff = strtok(codeCopy,"+"); - } else { - buff=codeCopy; - } + buff = strtok(codeCopy,"+"); while (buff != NULL) { @@ -766,14 +761,13 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code) PicoPatches[PicoPatchCount].active = enabled; PicoPatches[PicoPatchCount].addr = pt.addr; PicoPatches[PicoPatchCount].data = pt.data; + PicoPatches[PicoPatchCount].comp = pt.comp; if (PicoPatches[PicoPatchCount].addr < Pico.romsize) PicoPatches[PicoPatchCount].data_old = *(uint16_t *)(Pico.rom + PicoPatches[PicoPatchCount].addr); else PicoPatches[PicoPatchCount].data_old = (uint16_t) m68k_read16(PicoPatches[PicoPatchCount].addr); PicoPatchCount++; - if (!multiline) - break; buff = strtok(NULL,"+"); } } @@ -1132,7 +1126,7 @@ void *retro_get_memory_data(unsigned type) break; case RETRO_MEMORY_SYSTEM_RAM: if (PicoAHW & PAHW_SMS) - data = Pico.vramb; + data = Pico.zram; else data = Pico.ram; break; @@ -1168,7 +1162,7 @@ size_t retro_get_memory_size(unsigned type) case RETRO_MEMORY_SYSTEM_RAM: if (PicoAHW & PAHW_SMS) - return sizeof(Pico.vramb); + return 0x2000; else return sizeof(Pico.ram);