aboutsummaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/cdriso.c4
-rw-r--r--libpcsxcore/gte.c15
-rw-r--r--libpcsxcore/psxmem.c2
3 files changed, 13 insertions, 8 deletions
diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c
index 515370f..dca64fa 100644
--- a/libpcsxcore/cdriso.c
+++ b/libpcsxcore/cdriso.c
@@ -1089,7 +1089,7 @@ static int cdread_sub_mixed(FILE *f, unsigned int base, void *dest, int sector)
return ret;
}
-static int uncompress2(void *out, unsigned long *out_size, void *in, unsigned long in_size)
+static int uncompress2_pcsx(void *out, unsigned long *out_size, void *in, unsigned long in_size)
{
static z_stream z;
int ret = 0;
@@ -1169,7 +1169,7 @@ static int cdread_compressed(FILE *f, unsigned int base, void *dest, int sector)
if (is_compressed) {
cdbuffer_size_expect = sizeof(compr_img->buff_raw[0]) << compr_img->block_shift;
cdbuffer_size = cdbuffer_size_expect;
- ret = uncompress2(compr_img->buff_raw[0], &cdbuffer_size, compr_img->buff_compressed, size);
+ ret = uncompress2_pcsx(compr_img->buff_raw[0], &cdbuffer_size, compr_img->buff_compressed, size);
if (ret != 0) {
SysPrintf("uncompress failed with %d for block %d, sector %d\n",
ret, block, sector);
diff --git a/libpcsxcore/gte.c b/libpcsxcore/gte.c
index 62fc7f3..77dff1b 100644
--- a/libpcsxcore/gte.c
+++ b/libpcsxcore/gte.c
@@ -170,7 +170,7 @@
#ifndef FLAGLESS
-static inline s32 BOUNDS_(psxCP2Regs *regs, s64 n_value, s64 n_max, int n_maxflag, s64 n_min, int n_minflag) {
+static inline s64 BOUNDS_(psxCP2Regs *regs, s64 n_value, s64 n_max, int n_maxflag, s64 n_min, int n_minflag) {
if (n_value > n_max) {
gteFLAG |= n_maxflag;
} else if (n_value < n_min) {
@@ -404,6 +404,7 @@ static u32 DIVIDE_(s16 n, u16 d) {
void gteRTPS(psxCP2Regs *regs) {
int quotient;
+ s64 tmp;
#ifdef GTE_LOG
GTE_LOG("GTE RTPS\n");
@@ -426,14 +427,16 @@ void gteRTPS(psxCP2Regs *regs) {
gteSX2 = limG1(F((s64)gteOFX + ((s64)gteIR1 * quotient)) >> 16);
gteSY2 = limG2(F((s64)gteOFY + ((s64)gteIR2 * quotient)) >> 16);
- gteMAC0 = F((s64)gteDQB + ((s64)gteDQA * quotient));
- gteIR0 = limH(gteMAC0 >> 12);
+ tmp = (s64)gteDQB + ((s64)gteDQA * quotient);
+ gteMAC0 = F(tmp);
+ gteIR0 = limH(tmp >> 12);
}
void gteRTPT(psxCP2Regs *regs) {
int quotient;
int v;
s32 vx, vy, vz;
+ s64 tmp;
#ifdef GTE_LOG
GTE_LOG("GTE RTPT\n");
@@ -456,8 +459,10 @@ void gteRTPT(psxCP2Regs *regs) {
fSX(v) = limG1(F((s64)gteOFX + ((s64)gteIR1 * quotient)) >> 16);
fSY(v) = limG2(F((s64)gteOFY + ((s64)gteIR2 * quotient)) >> 16);
}
- gteMAC0 = F((s64)gteDQB + ((s64)gteDQA * quotient));
- gteIR0 = limH(gteMAC0 >> 12);
+
+ tmp = (s64)gteDQB + ((s64)gteDQA * quotient);
+ gteMAC0 = F(tmp);
+ gteIR0 = limH(tmp >> 12);
}
void gteMVMVA(psxCP2Regs *regs) {
diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c
index 14fd911..a1a641d 100644
--- a/libpcsxcore/psxmem.c
+++ b/libpcsxcore/psxmem.c
@@ -187,7 +187,7 @@ void psxMemReset() {
char bios[1024];
memset(psxM, 0, 0x00200000);
- memset(psxP, 0, 0x00010000);
+ memset(psxP, 0xff, 0x00010000);
if (strcmp(Config.Bios, "HLE") != 0) {
sprintf(bios, "%s/%s", Config.BiosDir, Config.Bios);