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
This commit is contained in:
parent
0abc3643dd
commit
85cb5305c3
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
May 8, 2010 Wei Mingzhi <whistler_wmz@users.sf.net>
|
||||
|
||||
* libpcsxcore/misc.c: Use const for input strings.
|
||||
* libpcsxcore/misc.h: Likewise.
|
||||
* libpcsxcore/spu.c: Got rid of 0x80000000 flag of psxRegs.interrupt.
|
||||
* libpcsxcore/psxinterpreter.c: Likewise.
|
||||
* libpcsxcore/cdrom.c: Likewise.
|
||||
* libpcsxcore/ix86_64/iR3000A-64.c: Likewise.
|
||||
* libpcsxcore/r3000a.c: Likewise.
|
||||
* libpcsxcore/psxhw.c: Likewise.
|
||||
* libpcsxcore/r3000a.h: Likewise.
|
||||
* libpcsxcore/ix86/iR3000A.c: Likewise.
|
||||
* libpcsxcore/psxhw.h: Likewise.
|
||||
* libpcsxcore/sio.c: Likewise.
|
||||
* libpcsxcore/psxcounters.c: Likewise.
|
||||
|
||||
May 8, 2010 Wei Mingzhi <whistler_wmz@users.sf.net>
|
||||
|
||||
* libpcsxcore/sio.h: Added extern "C" to all headers.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -86,7 +86,6 @@ static inline
|
|||
void setIrq( u32 irq )
|
||||
{
|
||||
psxHu32ref(0x1070) |= SWAPu32(irq);
|
||||
psxRegs.interrupt |= 0x80000000;
|
||||
}
|
||||
|
||||
static
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -25,5 +25,4 @@
|
|||
|
||||
void CALLBACK SPUirq(void) {
|
||||
psxHu32ref(0x1070) |= SWAPu32(0x200);
|
||||
psxRegs.interrupt |= 0x80000000;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user