--- /dev/null
+#if 0
+#include <stdio.h>
+
+extern uint32 timestamp;
+extern uint32 framecount;
+extern int scanline;
+
+#undef dprintf
+#define dprintf(f,...) printf("%05u:%05u:%03i: " f "\n",timestamp,framecount,scanline,##__VA_ARGS__)
+
+#else
+
+#define dprintf(x...)
+
+#endif
+
int InitBlitToHigh(int b, uint32 rmask, uint32 gmask, uint32 bmask)
{
Bpp=b;
-
+
if(Bpp<=1 || Bpp>4)
return(0);
}
void SetPaletteBlitToHigh(uint8 *src)
-{
+{
int cshiftr[3];
int cshiftl[3];
int a,x,z,y;
{
if(efx)
{
- for(y=yr;y;y--,/*dest+=pinc,*/src+=272-xr)
+ for(y=yr;y;y--,/*dest+=pinc,*/src+=320-xr)
{
int doo=yscale-(yscale>>1);
do
}
else
{
- for(y=yr;y;y--,/*dest+=pinc,*/src+=272-xr)
+ for(y=yr;y;y--,/*dest+=pinc,*/src+=320-xr)
{
int doo=yscale;
do
src+=xr;
}
}
-
+
}
else
{
- for(y=yr;y;y--,dest+=pinc,src+=272-xr)
+ for(y=yr;y;y--,dest+=pinc,src+=320-xr)
for(x=xr;x;x-=4,dest+=4,src+=4)
*(uint32 *)dest=*(uint32 *)src;
}
#include "movie.h"
+#include "dprintf.h"
+
#define Pal (PALRAM)
uint64 timestampbase=0;
+static int ppudead=1;
+static int kook=0;
+
int MMC5Hack;
uint32 MMC5HackVROMMask;
uint8 *MMC5HackExNTARAMPtr;
#ifdef ASM_6502
static void asmcpu_update(int32 cycles)
{
- // timestamp..
- //timestamp += ((cycles >> 4) * 43) >> 7; // aproximating /= 48
-
// some code from x6502.c
fhcnt-=cycles;
if(fhcnt<=0)
#define MMC5BGVRAMADR(V) &MMC5BGVPage[(V)>>10][(V)]
#define VRAMADR(V) &VPage[(V)>>10][(V)]
+static int linestartts;
+static int tofix=0;
+
+static void ResetRL(void)
+{
+ linestartts=timestamp*48+X6502_GetCycleCount();
+ tofix=1;
+}
+
+static INLINE void Fixit1(void);
+
+static void TryFixit1(void)
+{
+ #define TOFIXNUM (272-0x4)
+ int lastpixel;
+
+ if (scanline < 240 && tofix)
+ {
+ lastpixel = (timestamp*48-linestartts)>>4;
+ if (PAL) lastpixel += lastpixel>>4;
+
+ //printf("lastpixel: %i\n", lastpixel);
+
+ if(lastpixel>=TOFIXNUM)
+ {
+ Fixit1();
+ tofix=0;
+ }
+ }
+}
+
+
static DECLFW(BRAML)
{
RAM[A]=V;
static DECLFR(A2002)
{
+ /* merged */
uint8 ret;
+
+ TryFixit1();
ret = PPU_status;
+ ret|=PPUGenLatch&0x1F;
vtoggle=0;
PPU_status&=0x7F;
- return ret|(PPUGenLatch&0x1F);
+ PPUGenLatch=ret;
+ dprintf("r [2002] %02x",ret);
+ return ret;
}
static DECLFR(A200x)
{
+ /* merged */
+ TryFixit1();
return PPUGenLatch;
}
static DECLFR(A2007)
{
+ /* merged */
uint8 ret;
uint32 tmp=RefreshAddr&0x3FFF;
- PPUGenLatch=ret=VRAMBuffer;
+ TryFixit1();
+
+ ret=VRAMBuffer;
+
if(PPU_hook) PPU_hook(tmp);
+ PPUGenLatch=VRAMBuffer;
if(tmp<0x2000)
{
VRAMBuffer=VPage[tmp>>10][tmp];
if (INC32) RefreshAddr+=32;
else RefreshAddr++;
if(PPU_hook) PPU_hook(RefreshAddr&0x3fff);
+ dprintf("r [2007] %02x",ret);
return ret;
}
static DECLFW(B2000)
{
+ /* NMI2? */
+ TryFixit1();
PPUGenLatch=V;
PPU[0]=V;
TempAddr&=0xF3FF;
static DECLFW(B2001)
{
+ /* merged */
+ TryFixit1();
PPUGenLatch=V;
PPU[1]=V;
if(V&0xE0)
static DECLFW(B2002)
{
+ /* merged */
PPUGenLatch=V;
}
static DECLFW(B2003)
{
+ /* merged */
PPUGenLatch=V;
PPU[3]=V;
PPUSPL=V&0x7;
static DECLFW(B2004)
{
+ /* merged */
PPUGenLatch=V;
- //SPRAM[PPU[3]++]=V;
- if(PPUSPL&8)
+ if(PPUSPL>=8)
{
if(PPU[3]>=8)
SPRAM[PPU[3]]=V;
{
//printf("$%02x:$%02x\n",PPUSPL,V);
SPRAM[PPUSPL]=V;
- PPUSPL++;
}
PPU[3]++;
+ PPUSPL++;
}
static DECLFW(B2005)
{
+ /* merged */
uint32 tmp=TempAddr;
-
+ TryFixit1();
PPUGenLatch=V;
if (!vtoggle)
{
static DECLFW(B2006)
{
+ /* merged */
+ TryFixit1();
+
PPUGenLatch=V;
if(!vtoggle)
{
{
TempAddr&=0xFF00;
TempAddr|=V;
- RefreshAddr=TempAddr;
+ RefreshAddr=TempAddr;
if(PPU_hook)
PPU_hook(RefreshAddr);
}
static DECLFW(B2007)
{
+ /* merged */
uint32 tmp=RefreshAddr&0x3FFF;
-
PPUGenLatch=V;
if(tmp>=0x3F00)
{
- // hmmm....
- if(!(tmp&0xf))
- PALRAM[0x00]=PALRAM[0x04]=PALRAM[0x08]=PALRAM[0x0C]=
- PALRAM[0x10]=PALRAM[0x14]=PALRAM[0x18]=PALRAM[0x1c]=V&0x3f;
- else if(tmp&3) PALRAM[(tmp&0x1f)]=V&0x3f;
+ // hmmm....
+ if(!(tmp&0xf))
+ PALRAM[0x00]=PALRAM[0x04]=PALRAM[0x08]=PALRAM[0x0C]=V&0x3f;
+ else if(tmp&3) PALRAM[(tmp&0x1f)]=V&0x3f;
}
else if(tmp<0x2000)
{
{
uint32 t=V<<8;
int x;
+
for(x=0;x<256;x++)
B2004(0x2004,X.DB=ARead[t+x](t+x));
X6502_AddCycles(512);
}
}
-//static INLINE
+static INLINE
void Fixit2(void)
{
if(ScreenON || SpriteON)
}
}
-//static INLINE
+static INLINE
void Fixit1(void)
{
if(ScreenON || SpriteON)
}
}
-//#define NEW_TRY
/* This is called at the beginning of all h-blanks on visible lines. */
-#ifndef NEW_TRY
static void DoHBlank(void)
{
if(ScreenON || SpriteON)
FetchSpriteData();
if(GameHBIRQHook && (ScreenON || SpriteON))
{
- X6502_Run(12);
- GameHBIRQHook();
- X6502_Run(25-12);
+ X6502_Run(6);
Fixit2();
- X6502_Run(85-25);
+ X6502_Run(4);
+ GameHBIRQHook();
+ X6502_Run(85-16-10);
}
else
{
- X6502_Run(25); // Tried 65, caused problems with Slalom(maybe others)
+ X6502_Run(6); // Tried 65, caused problems with Slalom(maybe others)
Fixit2();
- X6502_Run(85-25);
+ X6502_Run(85-6-16);
}
//PPU_hook(0,-1);
//fprintf(stderr,"%3d: $%04x\n",scanline,RefreshAddr);
+ scanline++;
+ ResetRL();
+ X6502_Run(16);
}
-#endif
// ============================//
return 1;
}
-#define harko 0xe //0x9
static INLINE void Thingo(void)
{
Loop6502();
-#ifndef NEW_TRY
+ // check: Battletoads & Double Dragon
if(tosprite>=256)
{
- X6502_Run(256-harko);
- Fixit1();
- X6502_Run(harko);
+ X6502_Run(256);
}
else
{
- if(tosprite<=240)
- {
+ // sky glitches in SMB1 if done wrong
X6502_Run(tosprite);
PPU[2]|=0x40;
- X6502_Run(256-tosprite-harko);
- Fixit1();
- X6502_Run(harko);
- }
- else
- {
- X6502_Run(256-harko);
- Fixit1();
- X6502_Run(tosprite-(256-harko));
- PPU[2]|=0x40;
X6502_Run(256-tosprite);
- }
- tosprite=256;
+ tosprite = 256;
}
+ TryFixit1();
DoHBlank();
-#else
- X6502_Run_scanline();
-#endif
}
-#undef harko
void EmLoop(void)
{
for(;;)
{
uint32 scanlines_per_frame = PAL ? 312 : 262;
+ UpdateInput();
+ ApplyPeriodicCheats();
+
+ // FCEUPPU_Loop:
+ if(ppudead) /* Needed for Knight Rider, possibly others. */
+ {
+ memset(XBuf, 0x80, 256*240);
+ X6502_Run(scanlines_per_frame*(256+85));
+ ppudead--;
+ goto update;
+ }
//extern int asdc;
//printf("asdc: %i\n", asdc);
//asdc=0;
- ApplyPeriodicCheats();
X6502_Run(256+85);
PPU[2]|=0x80;
X6502_Run(256);
{
- static int kook=0;
if(ScreenON || SpriteON)
if(GameHBIRQHook)
GameHBIRQHook();
- X6502_Run(85-kook);
- kook=(kook+1)&1;
- }
+ X6502_Run(85-16);
- if(ScreenON || SpriteON)
- {
- RefreshAddr=TempAddr;
- if(PPU_hook) PPU_hook(RefreshAddr&0x3fff);
+ if(ScreenON || SpriteON)
+ {
+ RefreshAddr=TempAddr;
+ if(PPU_hook) PPU_hook(RefreshAddr&0x3fff);
+ }
+ ResetRL();
+
+ X6502_Run(16-kook);
+ kook ^= 1;
}
+
if(FCEUGameInfo.type==GIT_NSF)
{
X6502_Run((256+85)*240);
deemp=PPU[1]>>5;
SetRefreshLine();
- for(scanline=0;scanline<240;scanline++)
+ for(scanline=0;scanline<240;) // scanline is incremented in DoLine. Evil. :/
{
deempcnt[deemp]++;
Thingo();
SetNESDeemph(maxref,0);
}
+update:
{
int ssize;
ssize=FlushEmulateSound();
+ timestampbase += timestamp;
+ timestamp = 0;
+
#ifdef FRAMESKIP
if(FSkip)
{
FCEU_PutImage();
FCEUD_Update(XBuf+8,WaveFinalMono,ssize);
}
- UpdateInput();
}
if(Exit)
break;
}
- }
+ } // for
}
#ifdef FPS
PPUGenLatch=0;
RefreshAddr=TempAddr=0;
vtoggle = 0;
+ ppudead = 2;
+ kook = 0;
}
static void PowerPPU(void)
}
static void FDSStateRestore(int version)
-{
+{
setmirror(((mapbyte1[5]&8)>>3)^1);
}
SetReadHandler(0x4032,0x4032,FDSRead4032);
SetReadHandler(0x4033,0x4033,FDSRead4033);
- SetWriteHandler(0x4020,0x4020,FDSWrite4020);
+ SetWriteHandler(0x4020,0x4020,FDSWrite4020);
SetWriteHandler(0x4021,0x4021,FDSWrite4021);
SetWriteHandler(0x4022,0x4022,FDSWrite4022);
SetWriteHandler(0x4023,0x4023,FDSWrite4023);
X6502_IRQBegin(FCEU_IQEXT);
}
}
- if(DiskSeekIRQ>0)
+ if(DiskSeekIRQ>0)
{
DiskSeekIRQ-=a;
if(DiskSeekIRQ<=0)
A-=0x4080;
switch(A)
{
- case 0x0:
+ case 0x0:
case 0x4:
if(!(V&0x80))
{
// if(V&0x40) amplitude[(A&0xF)>>2]=0;
// else amplitude[(A&0xF)>>2]=0x3F;
}
- else
+ else
amplitude[(A&0xF)>>2]=V&0x3F;
break;
case 0x7: b17latch76=0;SPSG[0x5]=0;break;
}
else
{
- b19shiftreg60<<=1;
+ b19shiftreg60<<=1;
b8shiftreg88>>=1;
}
b24adder66=(b24latch68+b19shiftreg60)&0xFFFFFF;
int32 x;
start=FBC;
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start)
return;
FBC=end;
FCEU_fseek(fp,0,SEEK_SET);
FCEU_fread(header,16,1,fp);
- if(memcmp(header,"FDS\x1a",4))
+ if(memcmp(header,"FDS\x1a",4))
{
if(!(memcmp(header+1,"*NINTENDO-HVC*",14)))
{
- long t;
+ long t;
t=FCEU_fgetsize(fp);
if(t<65500)
t=65500;
FCEU_fseek(fp,0,SEEK_SET);
}
else
- return 0;
- }
+ return 0;
+ }
if(header[4]>4) header[4]=4;
if(!header[4]) header[4]|=1;
for(x=0;x<header[4];x++)
{
diskdata[x]=FCEU_malloc(65500);
- if(!diskdata[x])
+ if(!diskdata[x])
{
int zol;
for(zol=0;zol<x;zol++)
FCEU_fread(diskdata[x],1,65500,fp);
}
- if(!(zp=fopen(FCEU_MakeFName(FCEUMKF_FDSROM,0,0),"rb")))
+ if(!(zp=fopen(FCEU_MakeFName(FCEUMKF_FDSROM,0,0),"rb")))
{
FCEU_PrintError("FDS BIOS ROM image missing!");
FreeFDSMemory();
for(x=0;x<header[4];x++)
{
- if(FCEU_fwrite(diskdata[x],1,65500,fp)!=65500)
+ if(FCEU_fwrite(diskdata[x],1,65500,fp)!=65500)
{
fdswerr:
FCEU_PrintError("Error writing FDS image \"%s\"!",FDSSaveName);
#include "input.h"
#include "movie.h"
+#include "dprintf.h"
+
extern INPUTC *FCEU_InitZapper(int w);
extern INPUTC *FCEU_InitPowerpad(int w);
extern INPUTC *FCEU_InitArkanoid(int w);
ret=FCExp->Read(A&1,ret);
ret|=X.DB&0xC0;
+ dprintf("JPRead %02x", ret);
return(ret);
}
{
int32 z,a;
- z=((timestamp<<16)/soundtsinc)>>4;
+ z=((SOUNDTS<<16)/soundtsinc)>>4;
a=z-dwave;
if(a)
DoNamcoSound(&Wave[dwave], a);
{
int32 z,a;
- z=((timestamp<<16)/soundtsinc)>>4;
+ z=((SOUNDTS<<16)/soundtsinc)>>4;
a=z-dwave;
if(a)
DoNamcoSound(&Wave[dwave], a);
int32 start,end;
start=CVBC[0];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
CVBC[0]=end;
int32 start,end;
start=CVBC[1];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
CVBC[1]=end;
int32 start,end;
start=CVBC[2];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
CVBC[2]=end;
int32 start,end;
start=CAYBC[x];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
CAYBC[x]=end;
int32 start,end;
start=CAYBC[3];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
CAYBC[3]=end;
void OPL2_setreg(uint8 A, uint8 V)
{
- if(fmob)
+ if(fmob)
OPLWrite(fmob,A,V);
}
for(x=y=0;x<0x40;x++)
y|=MapperExRAM[x];
if(y)
- {
- InitOPL();
+ {
+ InitOPL();
for(x=0;x<6;x++)
{
- VRC7_LoadInstrument(x);
+ VRC7_LoadInstrument(x);
vrc7translate(0x10+x,VRC7Chan[0][x]);
}
}
{
int32 z,a;
- z=((timestamp<<16)/soundtsinc)>>4;
+ z=((SOUNDTS<<16)/soundtsinc)>>4;
a=z-dwave;
if(a && fmob)
{
int32 z,a;
- z=((timestamp<<16)/soundtsinc)>>4;
+ z=((SOUNDTS<<16)/soundtsinc)>>4;
a=z-dwave;
if(fmob && a)
int x;
if(!fmob)
- {
+ {
if(!( fmob=OPLCreate(OPL_TYPE_WAVESEL,1789772*2,FSettings.SndRate)))
return;
}
uint8 *i;
uint8 x = InstTrans[Chan];
uint8 y = (VRC7Chan[2][Chan] >> 4) & 0xF;
-
+
i=VRC7Instrument[y];
OPL2_setreg((0x20+x),i[0]);
OPL2_setreg((0x23+x),i[1]);
OPL2_setreg((0x40+x),i[2]);
- OPL2_setreg((0x43+x),((i[3] & 0xC0)
+ OPL2_setreg((0x43+x),((i[3] & 0xC0)
| ((VRC7Chan[2][Chan] << 2) & 0x3C))); // quiet
OPL2_setreg(0xe0+x,(i[3] >> 3) & 0x01);
OPL2_setreg(0xe3+x,(i[3] >> 4) & 0x01);
int32 start,end;
start=C5BC[2];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
C5BC[2]=end;
int32 freq;
start=C5BC[P];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
C5BC[P]=end;
static uint32 moviedatasize = 0;
static uint32 firstframeoffset = 0;
static uint32 savestate_offset = 0;
-static uint32 framecount = 0;
+/*static*/ uint32 framecount = 0;
static uint32 rerecord_count = 0;
/*static*/ int movie_readonly = 1;
int frame_display = 0;
case 0xCB: LD_IM(AXS);
/* DCP */
-case 0xC7: LD_ZP(DEC;CMP);
-case 0xD7: LD_ZPX(DEC;CMP);
-case 0xCF: LD_AB(DEC;CMP);
-case 0xDF: LD_ABX(DEC;CMP);
-case 0xDB: LD_ABY(DEC;CMP);
-case 0xC3: LD_IX(DEC;CMP);
-case 0xD3: LD_IY(DEC;CMP);
+case 0xC7: RMW_ZP(DEC;CMP);
+case 0xD7: RMW_ZPX(DEC;CMP);
+case 0xCF: RMW_AB(DEC;CMP);
+case 0xDF: RMW_ABX(DEC;CMP);
+case 0xDB: RMW_ABY(DEC;CMP);
+case 0xC3: RMW_IX(DEC;CMP);
+case 0xD3: RMW_IY(DEC;CMP);
/* ISC */
-case 0xE7: LD_ZP(INC;SBC);
-case 0xF7: LD_ZPX(INC;SBC);
-case 0xEF: LD_AB(INC;SBC);
-case 0xFF: LD_ABX(INC;SBC);
-case 0xFB: LD_ABY(INC;SBC);
-case 0xE3: LD_IX(INC;SBC);
-case 0xF3: LD_IY(INC;SBC);
+case 0xE7: RMW_ZP(INC;SBC);
+case 0xF7: RMW_ZPX(INC;SBC);
+case 0xEF: RMW_AB(INC;SBC);
+case 0xFF: RMW_ABX(INC;SBC);
+case 0xFB: RMW_ABY(INC;SBC);
+case 0xE3: RMW_IX(INC;SBC);
+case 0xF3: RMW_IY(INC;SBC);
/* DOP */
static int64 sqacc[2]={0,0};
uint8 sqnon=0;
+uint32 soundtsoffs=0;
+
#undef printf
uint16 nreg;
static DECLFW(Write_PSG)
{
//if((A>=0x4004 && A<=0x4007) || A==0x4015)
- //printf("$%04x:$%02x, %d\n",A,V,timestamp);
+ //printf("$%04x:$%02x, %d\n",A,V,SOUNDTS);
A&=0x1f;
switch(A)
{
uint32 out=PSG[0x11]<<3;
start=ChannelBC[4];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
ChannelBC[4]=end;
CalcRectAmp(0);
start=ChannelBC[0];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
ChannelBC[0]=end;
CalcRectAmp(1);
start=ChannelBC[1];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
ChannelBC[1]=end;
int64 freq=(((PSG[0xa]|((PSG[0xb]&7)<<8))+1));
start=ChannelBC[2];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
ChannelBC[2]=end;
int32 start,end;
start=ChannelBC[3];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
ChannelBC[3]=end;
int FlushEmulateSound(void)
{
- uint32 end;
int x;
-
+ uint32 end;
if(!timestamp) return(0);
goto nosoundo;
}
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
DoSQ1();
DoSQ2();
DoTriangle();
nosoundo:
for(x=0;x<5;x++)
ChannelBC[x]=end&0xF;
- timestampbase+=timestamp;
- timestamp=(soundtsinc*(end&0xF))>>16;
- timestampbase-=timestamp;
+ soundtsoffs=(soundtsinc*(end&0xF))>>16;
return(end>>4);
}
fhcnt=fhinc;
fcnt=0;
nreg=1;
+ soundtsoffs=0;
}
void ResetSound(void)
extern int16 WaveFinalMono[2048];
extern uint32 soundtsinc;
+extern uint32 soundtsoffs;
+#define SOUNDTS (timestamp + soundtsoffs)
+
void SetNESSoundMap(void);
void FrameSoundUpdate(void);
void FixOldSaveStateSFreq(void);
+
#ifndef __FCEU_TYPES
#define __FCEU_TYPES
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned long uint32;
+#include <inttypes.h>
+typedef int8_t int8;
+typedef int16_t int16;
+typedef int32_t int32;
+
+typedef uint8_t uint8;
+typedef uint16_t uint16;
+typedef uint32_t uint32;
+
+//typedef unsigned char uint8;
+//typedef unsigned short uint16;
+//typedef unsigned long uint32;
#ifdef __GNUC__
typedef unsigned long long uint64;
other than Windows/DOS targets?
*/
#endif
-typedef signed char int8;
-typedef signed short int16;
-typedef signed long int32;
+//typedef signed char int8;
+//typedef signed short int16;
+//typedef signed long int32;
#define byte uint8
#define word uint16
#define FASTAPASS(x) __attribute__((regparm(x)))
#define FP_FASTAPASS FASTAPASS
#else
- #define FASTAPASS(x)
- #define FP_FASTAPASS(x)
+ #define FASTAPASS(x)
+ #define FP_FASTAPASS(x)
#endif
#else
#define FP_FASTAPASS(x)
#include "sound.h"
#include "cart.h"
+#include "dprintf.h"
+
#ifdef DEBUG_ASM_6502
#include <stdio.h>
#include <stdlib.h>
{
if(!_jammed)
{
+ dprintf("NMI");
ADDCYC(7);
PUSH(_PC>>8);
PUSH(_PC);
{
if(!(_PI&I_FLAG) && !_jammed)
{
+ dprintf("IRQ");
ADDCYC(7);
PUSH(_PC>>8);
PUSH(_PC);
#define X6502_IRQBegin X6502_IRQBegin_d
#define X6502_IRQEnd X6502_IRQEnd_d
#define X6502_Rebase X6502_Rebase_d
+#define X6502_GetCycleCount() 0
#define X6502_C
#define X6502_A
#define X6502_D
#define X6502_IRQBegin X6502_IRQBegin_a
#define X6502_IRQEnd X6502_IRQEnd_a
#define X6502_Rebase X6502_Rebase_a
+#define X6502_GetCycleCount() ((int32)nes_registers[7]>>16)
#define X6502_A
#define X6502_Run(c) \
#define X6502_IRQBegin X6502_IRQBegin_c
#define X6502_IRQEnd X6502_IRQEnd_c
#define X6502_Rebase(...)
+#define X6502_GetCycleCount() X.count
#define X6502_C
#define X6502_Run(c) \