summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-19 10:52:11 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-19 10:52:11 +0000
commit0956549379a239182714ca5f06bb40748e3a54a5 (patch)
treef3b4e0b2e5ef1125940ad6ae029ffdf066063484 /libpcsxcore
parentb24d4d3cd394aa86691d69156f3fb108c3537582 (diff)
downloadpcsxr-0956549379a239182714ca5f06bb40748e3a54a5.tar.gz
Use SDL for sound plugin, reverted the change to BIAS in r48024. (and I'm too lazy to hunt down the bug with x64 dynarec :( feel free to revert this revert if not preferred :P)
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@48308 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/Makefile.in4
-rw-r--r--libpcsxcore/cdrom.c10
-rw-r--r--libpcsxcore/ix86/iR3000A.c12
-rw-r--r--libpcsxcore/ix86_64/iR3000A-64.c22
-rw-r--r--libpcsxcore/mdec.c16
-rw-r--r--libpcsxcore/ppc/pR3000A.c16
-rw-r--r--libpcsxcore/psxcounters.c12
-rw-r--r--libpcsxcore/psxdma.c10
-rw-r--r--libpcsxcore/psxinterpreter.c4
-rw-r--r--libpcsxcore/r3000a.c34
-rw-r--r--libpcsxcore/sio.c14
11 files changed, 72 insertions, 82 deletions
diff --git a/libpcsxcore/Makefile.in b/libpcsxcore/Makefile.in
index 923f99b9..fb8a7b8e 100644
--- a/libpcsxcore/Makefile.in
+++ b/libpcsxcore/Makefile.in
@@ -173,8 +173,6 @@ ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
-ALSA_CFLAGS = @ALSA_CFLAGS@
-ALSA_LIBS = @ALSA_LIBS@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
@@ -254,8 +252,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PEOPSXGL = @PEOPSXGL@
PKG_CONFIG = @PKG_CONFIG@
POSUB = @POSUB@
-PULSEAUDIO_CFLAGS = @PULSEAUDIO_CFLAGS@
-PULSEAUDIO_LIBS = @PULSEAUDIO_LIBS@
RANLIB = @RANLIB@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_CONFIG = @SDL_CONFIG@
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c
index db449103..30ead1c2 100644
--- a/libpcsxcore/cdrom.c
+++ b/libpcsxcore/cdrom.c
@@ -85,8 +85,8 @@ unsigned char Test23[] = { 0x43, 0x58, 0x44, 0x32, 0x39 ,0x34, 0x30, 0x51 };
// 1x = 75 sectors per second
// PSXCLK = 1 sec in the ps
-// so (PSXCLK / 75) = cdr read time (linuzappz)
-#define cdReadTime (PSXCLK / 75)
+// so (PSXCLK / 75) / BIAS = cdr read time (linuzappz)
+#define cdReadTime ((PSXCLK / 75) / BIAS)
static struct CdrStat stat;
static struct SubQ *subq;
@@ -1057,9 +1057,9 @@ void cdrWrite3(unsigned char rt) {
cdr.Irq = 0;
return;
}
- if (cdr.Irq)
+ if (cdr.Irq)
CDR_INT(cdr.eCycle);
- if (cdr.Reading && !cdr.ResultReady)
+ if (cdr.Reading && !cdr.ResultReady)
CDREAD_INT((cdr.Mode & 0x80) ? (cdReadTime / 2) : cdReadTime);
return;
@@ -1068,7 +1068,7 @@ void cdrWrite3(unsigned char rt) {
cdr.Readed = 1;
cdr.pTransfer = cdr.Transfer;
- switch (cdr.Mode&0x30) {
+ switch (cdr.Mode & 0x30) {
case 0x10:
case 0x00:
cdr.pTransfer += 12;
diff --git a/libpcsxcore/ix86/iR3000A.c b/libpcsxcore/ix86/iR3000A.c
index f8583d84..b8076409 100644
--- a/libpcsxcore/ix86/iR3000A.c
+++ b/libpcsxcore/ix86/iR3000A.c
@@ -97,7 +97,7 @@ static void iFlushRegs() {
static void iRet() {
/* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
+ count = (pc - pcold)/4;
ADD32ItoM((u32)&psxRegs.cycle, count);
if (resp) ADD32ItoR(ESP, resp);
RET();
@@ -148,7 +148,7 @@ static void SetBranch() {
iFlushRegs();
MOV32ItoM((u32)&psxRegs.code, psxRegs.code);
/* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
+ count = (pc - pcold) / 4;
ADD32ItoM((u32)&psxRegs.cycle, count);
if (resp) ADD32ItoR(ESP, resp);
@@ -180,7 +180,7 @@ static void iJump(u32 branchPC) {
iFlushRegs();
MOV32ItoM((u32)&psxRegs.code, psxRegs.code);
/* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
+ count = (pc - pcold)/4;
ADD32ItoM((u32)&psxRegs.cycle, count);
if (resp) ADD32ItoR(ESP, resp);
@@ -199,7 +199,7 @@ static void iJump(u32 branchPC) {
MOV32ItoM((u32)&psxRegs.pc, branchPC);
CALLFunc((u32)psxBranchTest);
/* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
+ count = (pc - pcold)/4;
ADD32ItoM((u32)&psxRegs.cycle, count);
if (resp) ADD32ItoR(ESP, resp);
@@ -236,7 +236,7 @@ static void iBranch(u32 branchPC, int savectx) {
iFlushRegs();
MOV32ItoM((u32)&psxRegs.code, psxRegs.code);
/* store cycle */
- count = (((pc+4) - pcold) / 4) * BIAS;
+ count = ((pc+4) - pcold)/4;
ADD32ItoM((u32)&psxRegs.cycle, count);
if (resp) ADD32ItoR(ESP, resp);
@@ -256,7 +256,7 @@ static void iBranch(u32 branchPC, int savectx) {
MOV32ItoM((u32)&psxRegs.pc, branchPC);
CALLFunc((u32)psxBranchTest);
/* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
+ count = (pc - pcold)/4;
ADD32ItoM((u32)&psxRegs.cycle, count);
if (resp) ADD32ItoR(ESP, resp);
diff --git a/libpcsxcore/ix86_64/iR3000A-64.c b/libpcsxcore/ix86_64/iR3000A-64.c
index a0ffd0d2..d7754bb9 100644
--- a/libpcsxcore/ix86_64/iR3000A-64.c
+++ b/libpcsxcore/ix86_64/iR3000A-64.c
@@ -110,7 +110,7 @@ static void iFlushRegs() {
static void iRet() {
/* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
+ count = (pc - pcold)/4;
ADD32ItoM((uptr)&psxRegs.cycle, count);
StackRes();
RET();
@@ -161,7 +161,7 @@ static void SetBranch() {
iFlushRegs();
MOV32ItoM((uptr)&psxRegs.code, psxRegs.code);
/* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
+ count = (pc - pcold)/4;
ADD32ItoM((uptr)&psxRegs.cycle, count);
//PUSH64M((uptr)&target);
@@ -193,7 +193,7 @@ static void iJump(u32 branchPC) {
iFlushRegs();
MOV32ItoM((uptr)&psxRegs.code, psxRegs.code);
/* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
+ count = (pc - pcold)/4;
ADD32ItoM((uptr)&psxRegs.cycle, count);
//PUSHI(branchPC);
@@ -213,7 +213,7 @@ static void iJump(u32 branchPC) {
MOV32ItoM((uptr)&psxRegs.pc, branchPC);
CALLFunc((uptr)psxBranchTest);
/* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
+ count = (pc - pcold)/4;
ADD32ItoM((uptr)&psxRegs.cycle, count);
StackRes();
@@ -257,7 +257,7 @@ static void iBranch(u32 branchPC, int savectx) {
iFlushRegs();
MOV32ItoM((uptr)&psxRegs.code, psxRegs.code);
/* store cycle */
- count = (((pc+4) - pcold) / 4) * BIAS;
+ count = ((pc+4) - pcold)/4;
ADD32ItoM((uptr)&psxRegs.cycle, count);
//if (resp) ADD32ItoR(ESP, resp);
@@ -278,7 +278,7 @@ static void iBranch(u32 branchPC, int savectx) {
MOV32ItoM((uptr)&psxRegs.pc, branchPC);
CALLFunc((uptr)psxBranchTest);
/* store cycle */
- count = ((pc - pcold) / 4) * BIAS;
+ count = (pc - pcold)/4;
ADD32ItoM((uptr)&psxRegs.cycle, count);
StackRes();
@@ -415,8 +415,6 @@ static int recInit() {
recRAM = mmap(0,
0x280000*PTRMULT,
PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- //recRAM = (uptr*) malloc(0x200000 * sizeof(void*));
- //recROM = (uptr*) malloc(0x080000 * sizeof(void*));
recROM = &recRAM[0x200000*PTRMULT];
if (recRAM == NULL || recROM == NULL || recMem == NULL || psxRecLUT == NULL) {
@@ -452,11 +450,8 @@ static void recReset() {
static void recShutdown() {
if (recMem == NULL) return;
free(psxRecLUT);
- //free(recMem);
munmap(recMem, RECMEM_SIZE + PTRMULT*0x1000);
- //free(recRAM);
munmap(recRAM, 0x280000*PTRMULT);
- //free(recROM);
x86Shutdown();
}
@@ -2344,7 +2339,7 @@ REC_SYS(SYSCALL);
REC_SYS(BREAK);
#endif
-int dump;
+int dump = 0;
#if 1
static void recSYSCALL() {
@@ -2878,7 +2873,7 @@ static void recRecompile() {
char *p;
char *ptr;
- dump=0;
+ dump = 0;
resp = 0;
/* if x86Ptr reached the mem limit reset whole mem */
@@ -2966,4 +2961,3 @@ R3000Acpu psxRec = {
recClear,
recShutdown
};
-
diff --git a/libpcsxcore/mdec.c b/libpcsxcore/mdec.c
index 8048cf32..7165af4b 100644
--- a/libpcsxcore/mdec.c
+++ b/libpcsxcore/mdec.c
@@ -516,18 +516,18 @@ void psxDma1(u32 adr, u32 bcr, u32 chcr) {
image = (u16 *)PSXM(adr);
if (mdec.reg0 & MDEC0_RGB24) { // 15-b decoding
- // MDECOUTDMA_INT(((size * (1000000 / 9000)) / 4) /** 4*/);
- MDECOUTDMA_INT((size / 4));
+ // MDECOUTDMA_INT(((size * (1000000 / 9000)) / 4) /** 4*/ / BIAS);
+ MDECOUTDMA_INT((size / 4) / BIAS);
size = size / ((16 * 16) / 2);
for (; size > 0; size--, image += (16 * 16)) {
mdec.rl = rl2blk(blk, mdec.rl);
yuv2rgb15(blk, image);
}
} else { // 24-b decoding
- // MDECOUTDMA_INT(((size * (1000000 / 9000)) / 4) /** 4*/);
- MDECOUTDMA_INT((size / 4));
+ // MDECOUTDMA_INT(((size * (1000000 / 9000)) / 4) /** 4*/ / BIAS);
+ MDECOUTDMA_INT((size / 4) / BIAS);
size = size / ((24 * 16) / 2);
- for (; size>0; size--, image += (24 * 16)) {
+ for (; size > 0; size--, image += (24 * 16)) {
mdec.rl = rl2blk(blk, mdec.rl);
yuv2rgb24(blk, (u8 *)image);
}
@@ -546,9 +546,9 @@ void mdec1Interrupt() {
// PSXCLK / 1000 seems good for FF9. (for FF9 need < ~28000)
// CAUTION: commented interrupt-handling may lead to problems, keep an eye ;-)
MDECOUTDMA_INT(PSXCLK / 1000);
- // psxRegs.interrupt |= 0x02000000;
- // psxRegs.intCycle[5 + 24 + 1] *= 8;
- // psxRegs.intCycle[5 + 24] = psxRegs.cycle;
+// psxRegs.interrupt |= 0x02000000;
+// psxRegs.intCycle[5 + 24 + 1] *= 8;
+// psxRegs.intCycle[5 + 24] = psxRegs.cycle;
HW_DMA1_CHCR &= SWAP32(~0x01000000);
DMA_INTERRUPT(1);
} else {
diff --git a/libpcsxcore/ppc/pR3000A.c b/libpcsxcore/ppc/pR3000A.c
index 93745f82..d0037b64 100644
--- a/libpcsxcore/ppc/pR3000A.c
+++ b/libpcsxcore/ppc/pR3000A.c
@@ -741,7 +741,7 @@ static void Return()
static void iRet() {
/* store cycle */
- count = (idlecyclecount + (pc - pcold) / 4) * BIAS;
+ count = idlecyclecount + (pc - pcold)/4;
ADDI(PutHWRegSpecial(CYCLECOUNT), GetHWRegSpecial(CYCLECOUNT), count);
Return();
}
@@ -793,7 +793,7 @@ static void SetBranch() {
LIW(0, psxRegs.code);
STW(0, OFFSET(&psxRegs, &psxRegs.code), GetHWRegSpecial(PSXREGS));
/* store cycle */
- count = (idlecyclecount + (pc - pcold) / 4) * BIAS;
+ count = idlecyclecount + (pc - pcold)/4;
ADDI(PutHWRegSpecial(CYCLECOUNT), GetHWRegSpecial(CYCLECOUNT), count);
treg = GetHWRegSpecial(TARGET);
@@ -816,7 +816,7 @@ static void SetBranch() {
DisposeHWReg(GetHWRegFromCPUReg(treg));
FlushAllHWReg();
- count = (idlecyclecount + (pc - pcold) / 4) * BIAS;
+ count = idlecyclecount + (pc - pcold)/4;
ADDI(PutHWRegSpecial(CYCLECOUNT), GetHWRegSpecial(CYCLECOUNT), count);
FlushAllHWReg();
CALLFunc((u32)psxBranchTest);
@@ -836,7 +836,7 @@ static void iJump(u32 branchPC) {
LIW(0, psxRegs.code);
STW(0, OFFSET(&psxRegs, &psxRegs.code), GetHWRegSpecial(PSXREGS));
/* store cycle */
- count = (idlecyclecount + (pc - pcold) / 4) * BIAS;
+ count = idlecyclecount + (pc - pcold)/4;
ADDI(PutHWRegSpecial(CYCLECOUNT), GetHWRegSpecial(CYCLECOUNT), count);
LIW(PutHWRegSpecial(ARG2), branchPC);
@@ -855,7 +855,7 @@ static void iJump(u32 branchPC) {
LIW(PutHWRegSpecial(PSXPC), branchPC);
FlushAllHWReg();
- count = (idlecyclecount + (pc - pcold) / 4) * BIAS;
+ count = idlecyclecount + (pc - pcold)/4;
//if (/*psxRegs.code == 0 &&*/ count == 2 && branchPC == pcold) {
// LIW(PutHWRegSpecial(CYCLECOUNT), 0);
//} else {
@@ -916,7 +916,7 @@ static void iBranch(u32 branchPC, int savectx) {
LIW(0, psxRegs.code);
STW(0, OFFSET(&psxRegs, &psxRegs.code), GetHWRegSpecial(PSXREGS));
/* store cycle */
- count = (idlecyclecount + ((pc+4) - pcold) / 4) * BIAS;
+ count = idlecyclecount + ((pc+4) - pcold)/4;
ADDI(PutHWRegSpecial(CYCLECOUNT), GetHWRegSpecial(CYCLECOUNT), count);
LIW(PutHWRegSpecial(ARG2), branchPC);
@@ -937,7 +937,7 @@ static void iBranch(u32 branchPC, int savectx) {
FlushAllHWReg();
/* store cycle */
- count = (idlecyclecount + (pc - pcold) / 4) * BIAS;
+ count = idlecyclecount + (pc - pcold)/4;
//if (/*psxRegs.code == 0 &&*/ count == 2 && branchPC == pcold) {
// LIW(PutHWRegSpecial(CYCLECOUNT), 0);
//} else {
@@ -3324,7 +3324,7 @@ static void recHLE() {
CALLFunc((u32)psxHLEt[0]); // call dummy function
}
- count = (idlecyclecount + (pc - pcold) / 4 + 20) * BIAS;
+ count = idlecyclecount + (pc - pcold)/4 + 20;
ADDI(PutHWRegSpecial(CYCLECOUNT), GetHWRegSpecial(CYCLECOUNT), count);
FlushAllHWReg();
CALLFunc((u32)psxBranchTest);
diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c
index d1089b66..961739cb 100644
--- a/libpcsxcore/psxcounters.c
+++ b/libpcsxcore/psxcounters.c
@@ -116,7 +116,7 @@ void _psxRcntWcount( u32 index, u32 value )
value &= 0xffff;
}
- rcnts[index].cycleStart = psxRegs.cycle;
+ rcnts[index].cycleStart = psxRegs.cycle * BIAS;
rcnts[index].cycleStart -= value * rcnts[index].rate;
// TODO: <=.
@@ -137,7 +137,7 @@ u32 _psxRcntRcount( u32 index )
{
u32 count;
- count = psxRegs.cycle;
+ count = psxRegs.cycle * BIAS;
count -= rcnts[index].cycleStart;
count /= rcnts[index].rate;
@@ -158,7 +158,7 @@ void psxRcntSet()
s32 countToUpdate;
u32 i;
- psxNextsCounter = psxRegs.cycle;
+ psxNextsCounter = psxRegs.cycle * BIAS;
psxNextCounter = 0x7fffffff;
for( i = 0; i < CounterQuantity; ++i )
@@ -189,7 +189,7 @@ void psxRcntReset( u32 index )
{
if( rcnts[index].mode & RcCountToTarget )
{
- count = psxRegs.cycle;
+ count = psxRegs.cycle * BIAS;
count -= rcnts[index].cycleStart;
count /= rcnts[index].rate;
count -= rcnts[index].target;
@@ -215,7 +215,7 @@ void psxRcntReset( u32 index )
}
else if( rcnts[index].counterState == CountToOverflow )
{
- count = psxRegs.cycle;
+ count = psxRegs.cycle * BIAS;
count -= rcnts[index].cycleStart;
count /= rcnts[index].rate;
count -= 0xffff;
@@ -244,7 +244,7 @@ void psxRcntUpdate()
{
u32 cycle;
- cycle = psxRegs.cycle;
+ cycle = psxRegs.cycle * BIAS;
// rcnt 0.
if( cycle - rcnts[0].cycleStart >= rcnts[0].cycle )
diff --git a/libpcsxcore/psxdma.c b/libpcsxcore/psxdma.c
index 91dfea96..f6c3807e 100644
--- a/libpcsxcore/psxdma.c
+++ b/libpcsxcore/psxdma.c
@@ -27,8 +27,8 @@
// Dma3 in CdRom.c
void spuInterrupt() {
- HW_DMA4_CHCR &= SWAP32(~0x01000000);
- DMA_INTERRUPT(4);
+ HW_DMA4_CHCR &= SWAP32(~0x01000000);
+ DMA_INTERRUPT(4);
}
void psxDma4(u32 madr, u32 bcr, u32 chcr) { // SPU
@@ -48,7 +48,7 @@ void psxDma4(u32 madr, u32 bcr, u32 chcr) { // SPU
break;
}
SPU_writeDMAMem(ptr, (bcr >> 16) * (bcr & 0xffff) * 2);
- SPUDMA_INT((bcr >> 16) * (bcr & 0xffff) / 2);
+ SPUDMA_INT(((bcr >> 16) * (bcr & 0xffff) / 2) / BIAS);
return;
case 0x01000200: //spu to cpu transfer
@@ -63,7 +63,7 @@ void psxDma4(u32 madr, u32 bcr, u32 chcr) { // SPU
break;
}
size = (bcr >> 16) * (bcr & 0xffff) * 2;
- SPU_readDMAMem(ptr, size);
+ SPU_readDMAMem(ptr, size);
psxCpu->Clear(madr, size);
break;
@@ -112,7 +112,7 @@ void psxDma2(u32 madr, u32 bcr, u32 chcr) { // GPU
}
size = (bcr >> 16) * (bcr & 0xffff);
GPU_writeDataMem(ptr, size);
- GPUDMA_INT((size / 4));
+ GPUDMA_INT((size / 4) / BIAS);
return;
case 0x01000401: // dma chain
diff --git a/libpcsxcore/psxinterpreter.c b/libpcsxcore/psxinterpreter.c
index af352823..dabec103 100644
--- a/libpcsxcore/psxinterpreter.c
+++ b/libpcsxcore/psxinterpreter.c
@@ -286,7 +286,7 @@ __inline void doBranch(u32 tar) {
debugI();
psxRegs.pc += 4;
- psxRegs.cycle += BIAS;
+ psxRegs.cycle++;
// check for load delay
tmp = psxRegs.code >> 26;
@@ -789,7 +789,7 @@ inline void execI() {
if (Config.Debug) ProcessDebug();
psxRegs.pc += 4;
- psxRegs.cycle += BIAS;
+ psxRegs.cycle++;
psxBSC[psxRegs.code >> 26]();
}
diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c
index b60f058d..8c6289e6 100644
--- a/libpcsxcore/r3000a.c
+++ b/libpcsxcore/r3000a.c
@@ -115,42 +115,42 @@ void psxBranchTest() {
psxRcntUpdate();
if (psxRegs.interrupt) {
- if ((psxRegs.interrupt & 0x80) && (!Config.Sio)) { // sio
- if ((psxRegs.cycle - psxRegs.intCycle[7]) >= psxRegs.intCycle[7+1]) {
- psxRegs.interrupt&=~0x80;
+ if ((psxRegs.interrupt & 0x80) && !Config.Sio) { // sio
+ if ((psxRegs.cycle - psxRegs.intCycle[7]) >= psxRegs.intCycle[7 + 1]) {
+ psxRegs.interrupt &= ~0x80;
sioInterrupt();
}
}
if (psxRegs.interrupt & 0x04) { // cdr
- if ((psxRegs.cycle - psxRegs.intCycle[2]) >= psxRegs.intCycle[2+1]) {
- psxRegs.interrupt&=~0x04;
+ if ((psxRegs.cycle - psxRegs.intCycle[2]) >= psxRegs.intCycle[2 + 1]) {
+ psxRegs.interrupt &= ~0x04;
cdrInterrupt();
}
}
if (psxRegs.interrupt & 0x040000) { // cdr read
- if ((psxRegs.cycle - psxRegs.intCycle[2+16]) >= psxRegs.intCycle[2+16+1]) {
- psxRegs.interrupt&=~0x040000;
+ if ((psxRegs.cycle - psxRegs.intCycle[2 + 16]) >= psxRegs.intCycle[2 + 16 + 1]) {
+ psxRegs.interrupt &= ~0x040000;
cdrReadInterrupt();
}
}
if (psxRegs.interrupt & 0x01000000) { // gpu dma
- if ((psxRegs.cycle - psxRegs.intCycle[3+24]) >= psxRegs.intCycle[3+24+1]) {
- psxRegs.interrupt&=~0x01000000;
+ if ((psxRegs.cycle - psxRegs.intCycle[3 + 24]) >= psxRegs.intCycle[3 + 24 + 1]) {
+ psxRegs.interrupt &= ~0x01000000;
gpuInterrupt();
}
}
if (psxRegs.interrupt & 0x02000000) { // mdec out dma
- if ((psxRegs.cycle - psxRegs.intCycle[5+24]) >= psxRegs.intCycle[5+24+1]) {
- psxRegs.interrupt&=~0x02000000;
+ if ((psxRegs.cycle - psxRegs.intCycle[5 + 24]) >= psxRegs.intCycle[5 + 24 + 1]) {
+ psxRegs.interrupt &= ~0x02000000;
mdec1Interrupt();
}
}
- if (psxRegs.interrupt & 0x04000000) { // spu dma
- if ((psxRegs.cycle - psxRegs.intCycle[1+24]) >= psxRegs.intCycle[1+24+1]) {
- psxRegs.interrupt&=~0x04000000;
- spuInterrupt();
- }
- }
+ if (psxRegs.interrupt & 0x04000000) { // spu dma
+ if ((psxRegs.cycle - psxRegs.intCycle[1 + 24]) >= psxRegs.intCycle[1 + 24 + 1]) {
+ psxRegs.interrupt &= ~0x04000000;
+ spuInterrupt();
+ }
+ }
}
if (psxHu32(0x1070) & psxHu32(0x1074)) {
diff --git a/libpcsxcore/sio.c b/libpcsxcore/sio.c
index cc179e25..a4b1a491 100644
--- a/libpcsxcore/sio.c
+++ b/libpcsxcore/sio.c
@@ -66,14 +66,14 @@ static unsigned int padst;
char Mcd1Data[MCD_SIZE], Mcd2Data[MCD_SIZE];
// clk cycle byte
-// 4us * 8bits = ((PSXCLK / 1000000) * 32); (linuzappz)
+// 4us * 8bits = ((PSXCLK / 1000000) * 32) / BIAS; (linuzappz)
// TODO: add SioModePrescaler and BaudReg
-#define SIO_INT() { \
- if (!Config.Sio) { \
- psxRegs.interrupt |= 0x80; \
- psxRegs.intCycle[7 + 1] = 400; \
- psxRegs.intCycle[7] = psxRegs.cycle; \
- } \
+static inline void SIO_INT() {
+ if (!Config.Sio) {
+ psxRegs.interrupt |= 0x80;
+ psxRegs.intCycle[7 + 1] = 200; /*271;*/
+ psxRegs.intCycle[7] = psxRegs.cycle;
+ }
}
void sioWrite8(unsigned char value) {