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; BITREVLUT<uint8,8> bitrevlut;
int cpu_ignore;
struct PPUSTATUS struct PPUSTATUS
{ {
int sl; int sl;
@ -2009,18 +2007,7 @@ void runppu(int x) {
//if(cputodo<200) return; //if(cputodo<200) return;
ppur.status.cycle = (ppur.status.cycle + x) % ppur.status.cycle = (ppur.status.cycle + x) %
ppur.status.end_cycle; ppur.status.end_cycle;
if (cpu_ignore) X6502_Run(x);
{
if (cpu_ignore <= x)
{
cpu_ignore = 0;
X6502_Run(x-cpu_ignore);
}
else
cpu_ignore -= x;
}
else
X6502_Run(x);
//pputime -= cputodo<<2; //pputime -= cputodo<<2;
} }
@ -2083,10 +2070,8 @@ int FCEUX_PPU_Loop(int skip) {
else else
runppu(20*kLineTime); runppu(20*kLineTime);
ppur.status.sl = 0; ppur.status.sl = 0;
cpu_ignore = 0;
runppu(242*kLineTime); runppu(242*kLineTime);
ppudead = 0; ppudead = 0;
cpu_ignore = 0;
goto finish; goto finish;
} }
@ -2109,7 +2094,6 @@ int FCEUX_PPU_Loop(int skip) {
else else
runppu(20*(kLineTime)-delay); runppu(20*(kLineTime)-delay);
cpu_ignore = 0; //no ignores because NMI runs full cycle
//this seems to run just before the dummy scanline begins //this seems to run just before the dummy scanline begins
PPU_status = 0; 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 //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 //idle for one line
runppu(kLineTime); runppu(kLineTime);
cpu_ignore = 0;
framectr++; framectr++;
} }

View File

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