notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check if DEBUG is set rather than not set.
[picodrive.git]
/
pico
/
patch.c
diff --git
a/pico/patch.c
b/pico/patch.c
index
42c6a4e
..
b961e80
100644
(file)
--- a/
pico/patch.c
+++ b/
pico/patch.c
@@
-21,10
+21,6
@@
* (of course, that's handled by a different source file :)
*/
* (of course, that's handled by a different source file :)
*/
-//#include <stdio.h>
-//#include <string.h>
-#include <ctype.h>
-
#include "pico_int.h"
#include "patch.h"
#include "pico_int.h"
#include "patch.h"
@@
-248,7
+244,8
@@
int PicoPatchLoad(const char *fname)
llen = strlen(buff);
for (clen = 0; clen < llen; clen++)
llen = strlen(buff);
for (clen = 0; clen < llen; clen++)
- if (isspace(buff[clen])) break;
+ if (isspace_(buff[clen]))
+ break;
buff[clen] = 0;
if (clen > 11 || clen < 8)
buff[clen] = 0;
if (clen > 11 || clen < 8)
@@
-271,9
+268,11
@@
int PicoPatchLoad(const char *fname)
strcpy(PicoPatches[PicoPatchCount].code, buff);
/* strip */
for (clen++; clen < llen; clen++)
strcpy(PicoPatches[PicoPatchCount].code, buff);
/* strip */
for (clen++; clen < llen; clen++)
- if (!isspace(buff[clen])) break;
+ if (!isspace_(buff[clen]))
+ break;
for (llen--; llen > 0; llen--)
for (llen--; llen > 0; llen--)
- if (!isspace(buff[llen])) break;
+ if (!isspace_(buff[llen]))
+ break;
buff[llen+1] = 0;
strncpy(PicoPatches[PicoPatchCount].name, buff + clen, 51);
PicoPatches[PicoPatchCount].name[51] = 0;
buff[llen+1] = 0;
strncpy(PicoPatches[PicoPatchCount].name, buff + clen, 51);
PicoPatches[PicoPatchCount].name[51] = 0;
@@
-298,7
+297,8
@@
void PicoPatchPrepare(void)
for (i = 0; i < PicoPatchCount; i++)
{
PicoPatches[i].addr &= ~1;
for (i = 0; i < PicoPatchCount; i++)
{
PicoPatches[i].addr &= ~1;
- PicoPatches[i].data_old = PicoRead16(PicoPatches[i].addr);
+ if (PicoPatches[i].addr < Pico.romsize)
+ PicoPatches[i].data_old = *(unsigned short *)(Pico.rom + PicoPatches[i].addr);
if (strstr(PicoPatches[i].name, "AUTO"))
PicoPatches[i].active = 1;
}
if (strstr(PicoPatches[i].name, "AUTO"))
PicoPatches[i].active = 1;
}
@@
-328,9
+328,7
@@
void PicoPatchApply(void)
}
else
{
}
else
{
- /* RAM or some other weird patch */
- if (PicoPatches[i].active)
- PicoWrite16(addr, PicoPatches[i].data);
+ /* TODO? */
}
}
}
}
}
}