notaz.gp2x.de
/
pcsx_rearmed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0148ffb
)
psxbios: Add checks for bzero.
author
gameblabla
<gameblabla@openmailbox.org>
Thu, 18 Jul 2019 00:15:27 +0000
(
02:15
+0200)
committer
gameblabla
<gameblabla@openmailbox.org>
Thu, 18 Jul 2019 00:15:27 +0000
(
02:15
+0200)
Only return 0 if size is invalid. (0 or 0x7FFFFFFF), return dst if not.
libpcsxcore/psxbios.c
patch
|
blob
|
blame
|
history
diff --git
a/libpcsxcore/psxbios.c
b/libpcsxcore/psxbios.c
index
4019234
..
c362a75
100644
(file)
--- a/
libpcsxcore/psxbios.c
+++ b/
libpcsxcore/psxbios.c
@@
-752,7
+752,21
@@
void psxBios_bcopy() { // 0x27
void psxBios_bzero() { // 0x28
char *p = (char *)Ra0;
+ v0 = a0;
+ /* Same as memset here (See memset below) */
+ if (a1 > 0x7FFFFFFF || a1 == 0)
+ {
+ v0 = 0;
+ pc0 = ra;
+ return;
+ }
+ else if (a0 == 0)
+ {
+ pc0 = ra;
+ return;
+ }
while ((s32)a1-- > 0) *p++ = '\0';
+ a1 = 0;
pc0 = ra;
}