summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-08 08:07:45 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-08 08:07:45 +0000
commit85cb5305c337de06976d1a3257864a3ee05ec50a (patch)
treefff0cba7974c20c3c992e15cf08b037aca72f017 /libpcsxcore
parent0abc3643dd620150c4fec7f70cbd32b7d7177c97 (diff)
downloadpcsxr-85cb5305c337de06976d1a3257864a3ee05ec50a.tar.gz
got rid of 0x80000000 flag in psxRegs.interrupt. such flag doesn't seem to exist in other emus and not likely in real hardware either.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@47625 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/cdrom.c3
-rw-r--r--libpcsxcore/ix86/iR3000A.c2
-rw-r--r--libpcsxcore/ix86_64/iR3000A-64.c2
-rw-r--r--libpcsxcore/misc.c42
-rw-r--r--libpcsxcore/misc.h10
-rw-r--r--libpcsxcore/psxcounters.c1
-rw-r--r--libpcsxcore/psxhw.c2
-rw-r--r--libpcsxcore/psxhw.h1
-rw-r--r--libpcsxcore/psxinterpreter.c1
-rw-r--r--libpcsxcore/r3000a.c9
-rw-r--r--libpcsxcore/r3000a.h1
-rw-r--r--libpcsxcore/sio.c3
-rw-r--r--libpcsxcore/spu.c1
13 files changed, 28 insertions, 50 deletions
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c
index 66edcab4..e1047952 100644
--- a/libpcsxcore/cdrom.c
+++ b/libpcsxcore/cdrom.c
@@ -593,7 +593,6 @@ void cdrInterrupt() {
if (cdr.Stat != NoIntr && cdr.Reg2 != 0x18) {
psxHu32ref(0x1070) |= SWAP32((u32)0x4);
- psxRegs.interrupt |= 0x80000000;
}
#ifdef CDR_LOG
@@ -685,7 +684,6 @@ void cdrReadInterrupt() {
CDREAD_INT((cdr.Mode & 0x80) ? (cdReadTime / 2) : cdReadTime);
}
psxHu32ref(0x1070) |= SWAP32((u32)0x4);
- psxRegs.interrupt |= 0x80000000;
}
/*
@@ -992,7 +990,6 @@ void cdrWrite1(unsigned char rt) {
}
if (cdr.Stat != NoIntr) {
psxHu32ref(0x1070) |= SWAP32((u32)0x4);
- psxRegs.interrupt |= 0x80000000;
}
}
diff --git a/libpcsxcore/ix86/iR3000A.c b/libpcsxcore/ix86/iR3000A.c
index 2bd70586..b8076409 100644
--- a/libpcsxcore/ix86/iR3000A.c
+++ b/libpcsxcore/ix86/iR3000A.c
@@ -2707,8 +2707,6 @@ static void recMTC0() {
iFlushRegs();
MOV32ItoM((u32)&psxRegs.pc, (u32)pc);
CALLFunc((u32)psxTestSWInts);
- if (_Rd_ == 12)
- OR32ItoM((u32)&psxRegs.interrupt, 0x80000000);
if (branch == 0) {
branch = 2;
iRet();
diff --git a/libpcsxcore/ix86_64/iR3000A-64.c b/libpcsxcore/ix86_64/iR3000A-64.c
index babec3f1..37cce7dd 100644
--- a/libpcsxcore/ix86_64/iR3000A-64.c
+++ b/libpcsxcore/ix86_64/iR3000A-64.c
@@ -2773,8 +2773,6 @@ static void recMTC0() {
iFlushRegs();
MOV32ItoM((uptr)&psxRegs.pc, (u32)pc);
CALLFunc((uptr)psxTestSWInts);
- if (_Rd_ == 12)
- OR32ItoM((uptr)&psxRegs.interrupt, 0x80000000);
if (branch == 0) {
branch = 2;
iRet();
diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c
index 0d801f7b..e9a069dd 100644
--- a/libpcsxcore/misc.c
+++ b/libpcsxcore/misc.c
@@ -29,7 +29,7 @@
char CdromId[10] = "";
char CdromLabel[33] = "";
-/* PSX Executable types */
+// PSX Executable types
#define PSX_EXE 1
#define CPE_EXE 2
#define COFF_EXE 3
@@ -52,24 +52,24 @@ struct iso_directory_record {
};
void mmssdd( char *b, char *p )
- {
+{
int m, s, d;
#if defined(__BIGENDIAN__)
- int block = (b[0]&0xff) | ((b[1]&0xff)<<8) | ((b[2]&0xff)<<16) | (b[3]<<24);
+ int block = (b[0] & 0xff) | ((b[1] & 0xff) << 8) | ((b[2] & 0xff) << 16) | (b[3] << 24);
#else
int block = *((int*)b);
#endif
-
+
block += 150;
- m = block / 4500; // minuten
- block = block - m * 4500; // minuten rest
- s = block / 75; // sekunden
- d = block - s * 75; // sekunden rest
-
- m = ( ( m / 10 ) << 4 ) | m % 10;
- s = ( ( s / 10 ) << 4 ) | s % 10;
- d = ( ( d / 10 ) << 4 ) | d % 10;
-
+ m = block / 4500; // minutes
+ block = block - m * 4500; // minutes rest
+ s = block / 75; // seconds
+ d = block - s * 75; // seconds rest
+
+ m = ((m / 10) << 4) | m % 10;
+ s = ((s / 10) << 4) | s % 10;
+ d = ((d / 10) << 4) | d % 10;
+
p[0] = m;
p[1] = s;
p[2] = d;
@@ -95,11 +95,11 @@ void mmssdd( char *b, char *p )
#define READDIR(_dir) \
READTRACK(); \
- memcpy(_dir, buf+12, 2048); \
+ memcpy(_dir, buf + 12, 2048); \
\
incTime(); \
READTRACK(); \
- memcpy(_dir+2048, buf+12, 2048);
+ memcpy(_dir + 2048, buf + 12, 2048);
int GetCdromFile(u8 *mdir, u8 *time, s8 *filename) {
struct iso_directory_record *dir;
@@ -223,7 +223,7 @@ int LoadCdrom() {
return 0;
}
-int LoadCdromFile(char *filename, EXE_HEADER *head) {
+int LoadCdromFile(const char *filename, EXE_HEADER *head) {
struct iso_directory_record *dir;
u8 time[4],*buf;
u8 mdir[4096], exename[256];
@@ -372,7 +372,7 @@ static int PSXGetFileType(FILE *f) {
return INVALID_EXE;
}
-int Load(char *ExePath) {
+int Load(const char *ExePath) {
FILE *tmpFile;
EXE_HEADER tmpHead;
int type;
@@ -454,7 +454,7 @@ int Load(char *ExePath) {
const char PcsxHeader[32] = "STv3 PCSX v" PACKAGE_VERSION;
-int SaveState(char *file) {
+int SaveState(const char *file) {
gzFile f;
GPUFreeze_t *gpufP;
SPUFreeze_t *spufP;
@@ -464,7 +464,7 @@ int SaveState(char *file) {
f = gzopen(file, "wb");
if (f == NULL) return -1;
- gzwrite(f, (void*)PcsxHeader, 32);
+ gzwrite(f, (const void *)PcsxHeader, 32);
pMem = (unsigned char *)malloc(128 * 96 * 3);
if (pMem == NULL) return -1;
@@ -508,7 +508,7 @@ int SaveState(char *file) {
return 0;
}
-int LoadState(char *file) {
+int LoadState(const char *file) {
gzFile f;
GPUFreeze_t *gpufP;
SPUFreeze_t *spufP;
@@ -558,7 +558,7 @@ int LoadState(char *file) {
return 0;
}
-int CheckState(char *file) {
+int CheckState(const char *file) {
gzFile f;
char header[32];
diff --git a/libpcsxcore/misc.h b/libpcsxcore/misc.h
index f589ec6c..7a0574f9 100644
--- a/libpcsxcore/misc.h
+++ b/libpcsxcore/misc.h
@@ -57,13 +57,13 @@ extern char CdromId[10];
extern char CdromLabel[33];
int LoadCdrom();
-int LoadCdromFile(char *filename, EXE_HEADER *head);
+int LoadCdromFile(const char *filename, EXE_HEADER *head);
int CheckCdrom();
-int Load(char *ExePath);
+int Load(const char *ExePath);
-int SaveState(char *file);
-int LoadState(char *file);
-int CheckState(char *file);
+int SaveState(const char *file);
+int LoadState(const char *file);
+int CheckState(const char *file);
int SendPcsxInfo();
int RecvPcsxInfo();
diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c
index e66b6ff5..ebfb0612 100644
--- a/libpcsxcore/psxcounters.c
+++ b/libpcsxcore/psxcounters.c
@@ -86,7 +86,6 @@ static inline
void setIrq( u32 irq )
{
psxHu32ref(0x1070) |= SWAPu32(irq);
- psxRegs.interrupt |= 0x80000000;
}
static
diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c
index 3139fc35..52edf4d6 100644
--- a/libpcsxcore/psxhw.c
+++ b/libpcsxcore/psxhw.c
@@ -409,7 +409,6 @@ void psxHwWrite16(u32 add, u16 value) {
PSXHW_LOG("IMASK 16bit write %x\n", value);
#endif
psxHu16ref(0x1074) = SWAPu16(value);
- psxRegs.interrupt |= 0x80000000;
return;
case 0x1f801100:
@@ -518,7 +517,6 @@ void psxHwWrite32(u32 add, u32 value) {
PSXHW_LOG("IMASK 32bit write %lx\n", value);
#endif
psxHu32ref(0x1074) = SWAPu32(value);
- psxRegs.interrupt|= 0x80000000;
return;
#ifdef PSXHW_LOG
diff --git a/libpcsxcore/psxhw.h b/libpcsxcore/psxhw.h
index f6a0a1de..cd4e928c 100644
--- a/libpcsxcore/psxhw.h
+++ b/libpcsxcore/psxhw.h
@@ -61,7 +61,6 @@ extern "C" {
if (SWAPu32(HW_DMA_ICR) & (1 << (16 + n))) { \
HW_DMA_ICR |= SWAP32(1 << (24 + n)); \
psxHu32ref(0x1070) |= SWAP32(8); \
- psxRegs.interrupt |= 0x80000000; \
}
void psxHwReset();
diff --git a/libpcsxcore/psxinterpreter.c b/libpcsxcore/psxinterpreter.c
index ba4104ad..dabec103 100644
--- a/libpcsxcore/psxinterpreter.c
+++ b/libpcsxcore/psxinterpreter.c
@@ -647,7 +647,6 @@ __inline void MTC0(int reg, u32 val) {
case 12: // Status
psxRegs.CP0.r[12] = val;
psxTestSWInts();
- psxRegs.interrupt|= 0x80000000;
break;
case 13: // Cause
diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c
index 877c8ae5..b569e5d7 100644
--- a/libpcsxcore/r3000a.c
+++ b/libpcsxcore/r3000a.c
@@ -88,7 +88,7 @@ void psxException(u32 code, u32 bd) {
PSXCPU_LOG("bd set!!!\n");
#endif
SysPrintf("bd set!!!\n");
- psxRegs.CP0.n.Cause|= 0x80000000;
+ psxRegs.CP0.n.Cause |= 0x80000000;
psxRegs.CP0.n.EPC = (psxRegs.pc - 4);
} else
psxRegs.CP0.n.EPC = (psxRegs.pc);
@@ -145,15 +145,8 @@ void psxBranchTest() {
mdec1Interrupt();
}
}
-
-// if (psxRegs.interrupt & 0x80000000) {
- psxRegs.interrupt&=~0x80000000;
- psxTestHWInts();
-// }
}
-}
-void psxTestHWInts() {
if (psxHu32(0x1070) & psxHu32(0x1074)) {
if ((psxRegs.CP0.n.Status & 0x401) == 0x401) {
#ifdef PSXCPU_LOG
diff --git a/libpcsxcore/r3000a.h b/libpcsxcore/r3000a.h
index 3ae1179c..51cd37cc 100644
--- a/libpcsxcore/r3000a.h
+++ b/libpcsxcore/r3000a.h
@@ -238,7 +238,6 @@ void psxExecuteBios();
int psxTestLoadDelay(int reg, u32 tmp);
void psxDelayTest(int reg, u32 bpc);
void psxTestSWInts();
-void psxTestHWInts();
void psxJumpTest();
#ifdef __cplusplus
diff --git a/libpcsxcore/sio.c b/libpcsxcore/sio.c
index 81dd3fec..8244ee61 100644
--- a/libpcsxcore/sio.c
+++ b/libpcsxcore/sio.c
@@ -303,8 +303,7 @@ void sioInterrupt() {
#endif
// SysPrintf("Sio Interrupt\n");
StatReg|= IRQ;
- psxHu32ref(0x1070)|= SWAPu32(0x80);
- psxRegs.interrupt|= 0x80000000;
+ psxHu32ref(0x1070) |= SWAPu32(0x80);
}
void LoadMcd(int mcd, char *str) {
diff --git a/libpcsxcore/spu.c b/libpcsxcore/spu.c
index 82f04596..a60c0478 100644
--- a/libpcsxcore/spu.c
+++ b/libpcsxcore/spu.c
@@ -25,5 +25,4 @@
void CALLBACK SPUirq(void) {
psxHu32ref(0x1070) |= SWAPu32(0x200);
- psxRegs.interrupt |= 0x80000000;
}