After thinking it clearly, you dont need cpu_ignore, how stupid of me, all the cycles are accounted for, so revert, sorry about that.

This commit is contained in:
qeed 2009-06-25 15:43:48 +00:00
parent 6a34c0ab1a
commit 854553e49d
2 changed files with 7 additions and 35 deletions

View File

@ -100,8 +100,6 @@ struct BITREVLUT {
};
BITREVLUT<uint8,8> bitrevlut;
int cpu_ignore;
struct PPUSTATUS
{
int sl;
@ -2009,18 +2007,7 @@ void runppu(int x) {
//if(cputodo<200) return;
ppur.status.cycle = (ppur.status.cycle + x) %
ppur.status.end_cycle;
if (cpu_ignore)
{
if (cpu_ignore <= x)
{
cpu_ignore = 0;
X6502_Run(x-cpu_ignore);
}
else
cpu_ignore -= x;
}
else
X6502_Run(x);
X6502_Run(x);
//pputime -= cputodo<<2;
}
@ -2083,10 +2070,8 @@ int FCEUX_PPU_Loop(int skip) {
else
runppu(20*kLineTime);
ppur.status.sl = 0;
cpu_ignore = 0;
runppu(242*kLineTime);
ppudead = 0;
cpu_ignore = 0;
goto finish;
}
@ -2109,7 +2094,6 @@ int FCEUX_PPU_Loop(int skip) {
else
runppu(20*(kLineTime)-delay);
cpu_ignore = 0; //no ignores because NMI runs full cycle
//this seems to run just before the dummy scanline begins
PPU_status = 0;
//this early out caused metroid to fail to boot. I am leaving it here as a reminder of what not to do
@ -2416,7 +2400,6 @@ int FCEUX_PPU_Loop(int skip) {
//idle for one line
runppu(kLineTime);
cpu_ignore = 0;
framectr++;
}

View File

@ -29,8 +29,6 @@
#endif
#include "x6502abbrev.h"
extern int newppu;
extern int cpu_ignore;
X6502 X;
uint32 timestamp;
void (*MapIRQHook)(int a);
@ -43,15 +41,6 @@ void (*MapIRQHook)(int a);
timestamp+=__x; \
}
#define XADDCYC(x) \
{ \
int __x=x; \
_tcount+=__x; \
_count-=__x*48; \
timestamp+=__x; \
if (newppu) cpu_ignore += x; \
}
//normal memory read
static INLINE uint8 RdMem(unsigned int A)
{
@ -121,11 +110,11 @@ static uint8 ZNTable[256];
int32 disp; \
disp=(int8)RdMem(_PC); \
_PC++; \
XADDCYC(1); \
ADDCYC(1); \
tmp=_PC; \
_PC+=disp; \
if((tmp^_PC)&0x100) \
XADDCYC(1); \
ADDCYC(1); \
} \
else _PC++; \
}
@ -230,7 +219,7 @@ static uint8 ZNTable[256];
{ \
target&=0xFFFF; \
RdMem(target^0x100); \
XADDCYC(1); \
ADDCYC(1); \
} \
}
@ -287,7 +276,7 @@ static uint8 ZNTable[256];
{ \
target&=0xFFFF; \
RdMem(target^0x100); \
XADDCYC(1); \
ADDCYC(1); \
} \
}
@ -455,7 +444,7 @@ extern int test; test++;
{
if(!_jammed)
{
XADDCYC(7);
ADDCYC(7);
PUSH(_PC>>8);
PUSH(_PC);
PUSH((_P&~B_FLAG)|(U_FLAG));
@ -470,7 +459,7 @@ extern int test; test++;
{
if(!(_PI&I_FLAG) && !_jammed)
{
XADDCYC(7);
ADDCYC(7);
PUSH(_PC>>8);
PUSH(_PC);
PUSH((_P&~B_FLAG)|(U_FLAG));