diff options
| author | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-05-14 08:20:51 +0000 |
|---|---|---|
| committer | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-05-14 08:20:51 +0000 |
| commit | 830a16adf3b87c887ce43143b7f45fd8d970e608 (patch) | |
| tree | fc58ab59671a7a98a1f28c2e30781626b729897f /libpcsxcore | |
| parent | bccb9c573355bcecfc03115d1f07776af993b7e3 (diff) | |
| download | pcsxr-830a16adf3b87c887ce43143b7f45fd8d970e608.tar.gz | |
BIAS was moved into rec/int.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@48024 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
| -rw-r--r-- | libpcsxcore/cdrom.c | 4 | ||||
| -rw-r--r-- | libpcsxcore/ix86/iR3000A.c | 12 | ||||
| -rw-r--r-- | libpcsxcore/ix86_64/iR3000A-64.c | 12 | ||||
| -rw-r--r-- | libpcsxcore/mdec.c | 8 | ||||
| -rw-r--r-- | libpcsxcore/ppc/pR3000A.c | 16 | ||||
| -rw-r--r-- | libpcsxcore/psxcommon.h | 1 | ||||
| -rw-r--r-- | libpcsxcore/psxcounters.c | 14 | ||||
| -rw-r--r-- | libpcsxcore/psxdma.c | 2 | ||||
| -rw-r--r-- | libpcsxcore/psxinterpreter.c | 4 | ||||
| -rw-r--r-- | libpcsxcore/sio.c | 5 |
10 files changed, 39 insertions, 39 deletions
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 75d1b5a1..db449103 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) / BIAS = cdr read time (linuzappz) -#define cdReadTime ((PSXCLK / 75) / BIAS) +// so (PSXCLK / 75) = cdr read time (linuzappz) +#define cdReadTime (PSXCLK / 75) static struct CdrStat stat; static struct SubQ *subq; diff --git a/libpcsxcore/ix86/iR3000A.c b/libpcsxcore/ix86/iR3000A.c index b8076409..f8583d84 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; + count = ((pc - pcold) / 4) * BIAS; 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; + count = ((pc - pcold) / 4) * BIAS; 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; + count = ((pc - pcold) / 4) * BIAS; 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; + count = ((pc - pcold) / 4) * BIAS; 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; + count = (((pc+4) - pcold) / 4) * BIAS; 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; + count = ((pc - pcold) / 4) * BIAS; 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 37cce7dd..a0ffd0d2 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; + count = ((pc - pcold) / 4) * BIAS; 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; + count = ((pc - pcold) / 4) * BIAS; 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; + count = ((pc - pcold) / 4) * BIAS; 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; + count = ((pc - pcold) / 4) * BIAS; 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; + count = (((pc+4) - pcold) / 4) * BIAS; 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; + count = ((pc - pcold) / 4) * BIAS; ADD32ItoM((uptr)&psxRegs.cycle, count); StackRes(); diff --git a/libpcsxcore/mdec.c b/libpcsxcore/mdec.c index 5cba2796..8048cf32 100644 --- a/libpcsxcore/mdec.c +++ b/libpcsxcore/mdec.c @@ -516,16 +516,16 @@ 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*/ / BIAS); - MDECOUTDMA_INT((size / 4) / BIAS); + // MDECOUTDMA_INT(((size * (1000000 / 9000)) / 4) /** 4*/); + MDECOUTDMA_INT((size / 4)); 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*/ / BIAS); - MDECOUTDMA_INT((size / 4) / BIAS); + // MDECOUTDMA_INT(((size * (1000000 / 9000)) / 4) /** 4*/); + MDECOUTDMA_INT((size / 4)); size = size / ((24 * 16) / 2); for (; size>0; size--, image += (24 * 16)) { mdec.rl = rl2blk(blk, mdec.rl); diff --git a/libpcsxcore/ppc/pR3000A.c b/libpcsxcore/ppc/pR3000A.c index d0037b64..93745f82 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; + count = (idlecyclecount + (pc - pcold) / 4) * BIAS; 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; + count = (idlecyclecount + (pc - pcold) / 4) * BIAS; 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; + count = (idlecyclecount + (pc - pcold) / 4) * BIAS; 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; + count = (idlecyclecount + (pc - pcold) / 4) * BIAS; 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; + count = (idlecyclecount + (pc - pcold) / 4) * BIAS; //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; + count = (idlecyclecount + ((pc+4) - pcold) / 4) * BIAS; 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; + count = (idlecyclecount + (pc - pcold) / 4) * BIAS; //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; + count = (idlecyclecount + (pc - pcold) / 4 + 20) * BIAS; ADDI(PutHWRegSpecial(CYCLECOUNT), GetHWRegSpecial(CYCLECOUNT), count); FlushAllHWReg(); CALLFunc((u32)psxBranchTest); diff --git a/libpcsxcore/psxcommon.h b/libpcsxcore/psxcommon.h index d04be1e8..1d60c3e5 100644 --- a/libpcsxcore/psxcommon.h +++ b/libpcsxcore/psxcommon.h @@ -140,7 +140,6 @@ extern boolean NetOpened; if (Mode == 1) gzwrite(f, ptr, size); \ if (Mode == 0) gzread(f, ptr, size); -//#define BIAS 4 #define BIAS 2 #define PSXCLK 33868800 /* 33.8688 Mhz */ diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c index d26a3d93..d1089b66 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 * BIAS; + rcnts[index].cycleStart = psxRegs.cycle; rcnts[index].cycleStart -= value * rcnts[index].rate; // TODO: <=. @@ -137,7 +137,7 @@ u32 _psxRcntRcount( u32 index ) { u32 count; - count = psxRegs.cycle * BIAS; + count = psxRegs.cycle; count -= rcnts[index].cycleStart; count /= rcnts[index].rate; @@ -158,7 +158,7 @@ void psxRcntSet() s32 countToUpdate; u32 i; - psxNextsCounter = psxRegs.cycle * BIAS; + psxNextsCounter = psxRegs.cycle; psxNextCounter = 0x7fffffff; for( i = 0; i < CounterQuantity; ++i ) @@ -189,7 +189,7 @@ void psxRcntReset( u32 index ) { if( rcnts[index].mode & RcCountToTarget ) { - count = psxRegs.cycle * BIAS; + count = psxRegs.cycle; 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 * BIAS; + count = psxRegs.cycle; count -= rcnts[index].cycleStart; count /= rcnts[index].rate; count -= 0xffff; @@ -244,7 +244,7 @@ void psxRcntUpdate() { u32 cycle; - cycle = psxRegs.cycle * BIAS; + cycle = psxRegs.cycle; // rcnt 0. if( cycle - rcnts[0].cycleStart >= rcnts[0].cycle ) @@ -291,7 +291,7 @@ void psxRcntUpdate() } */ // Update lace. (with InuYasha fix) - if( hSyncCount == (Config.VSyncWA ? HSyncTotal[Config.PsxType] / 2 : HSyncTotal[Config.PsxType]) ) + if( hSyncCount == (Config.VSyncWA ? HSyncTotal[Config.PsxType] / BIAS : HSyncTotal[Config.PsxType]) ) { hSyncCount = 0; diff --git a/libpcsxcore/psxdma.c b/libpcsxcore/psxdma.c index 7a1d2ae0..e5222be9 100644 --- a/libpcsxcore/psxdma.c +++ b/libpcsxcore/psxdma.c @@ -106,7 +106,7 @@ void psxDma2(u32 madr, u32 bcr, u32 chcr) { // GPU } size = (bcr >> 16) * (bcr & 0xffff); GPU_writeDataMem(ptr, size); - GPUDMA_INT((size / 4) / BIAS); + GPUDMA_INT((size / 4)); return; // break; diff --git a/libpcsxcore/psxinterpreter.c b/libpcsxcore/psxinterpreter.c index dabec103..af352823 100644 --- a/libpcsxcore/psxinterpreter.c +++ b/libpcsxcore/psxinterpreter.c @@ -286,7 +286,7 @@ __inline void doBranch(u32 tar) { debugI(); psxRegs.pc += 4; - psxRegs.cycle++; + psxRegs.cycle += BIAS; // check for load delay tmp = psxRegs.code >> 26; @@ -789,7 +789,7 @@ inline void execI() { if (Config.Debug) ProcessDebug(); psxRegs.pc += 4; - psxRegs.cycle++; + psxRegs.cycle += BIAS; psxBSC[psxRegs.code >> 26](); } diff --git a/libpcsxcore/sio.c b/libpcsxcore/sio.c index 4f4552ea..cc179e25 100644 --- a/libpcsxcore/sio.c +++ b/libpcsxcore/sio.c @@ -66,11 +66,12 @@ static unsigned int padst; char Mcd1Data[MCD_SIZE], Mcd2Data[MCD_SIZE]; // clk cycle byte -// 4us * 8bits = ((PSXCLK / 1000000) * 32) / BIAS; (linuzappz) +// 4us * 8bits = ((PSXCLK / 1000000) * 32); (linuzappz) +// TODO: add SioModePrescaler and BaudReg #define SIO_INT() { \ if (!Config.Sio) { \ psxRegs.interrupt |= 0x80; \ - psxRegs.intCycle[7 + 1] = 200; /*271;*/ \ + psxRegs.intCycle[7 + 1] = 400; \ psxRegs.intCycle[7] = psxRegs.cycle; \ } \ } |
