notaz.gp2x.de
/
fceu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
asm cpu works, added sync()s
[fceu.git]
/
x6502.c
diff --git
a/x6502.c
b/x6502.c
index
c1e55b3
..
cb0d761
100644
(file)
--- a/
x6502.c
+++ b/
x6502.c
@@
-37,7
+37,7
@@
void FP_FASTAPASS(1) (*MapIRQHook)(int a);
#define _S X.S
#define _P X.P
#define _PI X.mooPI
#define _S X.S
#define _P X.P
#define _PI X.mooPI
-#define _PZ X.PZ
+//#define _PZ X.PZ // unused?
#define _DB X.DB
#define _count X.count
#define _tcount X.tcount
#define _DB X.DB
#define _count X.count
#define _tcount X.tcount
@@
-88,7
+88,7
@@
static INLINE void ADDCYC(int x)
timestamp+=x;
}
timestamp+=x;
}
-void FASTAPASS(1) X6502_AddCycles(int x)
+void FASTAPASS(1) X6502_AddCycles
_c
(int x)
{
ADDCYC(x);
}
{
ADDCYC(x);
}
@@
-366,22
+366,22
@@
static uint8 CycTable[256] =
/*0xF0*/ 2,5,2,8,4,4,6,6,2,4,2,7,4,4,7,7,
};
/*0xF0*/ 2,5,2,8,4,4,6,6,2,4,2,7,4,4,7,7,
};
-void FASTAPASS(1) X6502_IRQBegin(int w)
+void FASTAPASS(1) X6502_IRQBegin
_c
(int w)
{
_IRQlow|=w;
}
{
_IRQlow|=w;
}
-void FASTAPASS(1) X6502_IRQEnd(int w)
+void FASTAPASS(1) X6502_IRQEnd
_c
(int w)
{
_IRQlow&=~w;
}
{
_IRQlow&=~w;
}
-void TriggerIRQ
(void)
/* This function should probably be phased out. */
+void TriggerIRQ
_c(void)
/* This function should probably be phased out. */
{
_IRQlow|=FCEU_IQTEMP;
}
{
_IRQlow|=FCEU_IQTEMP;
}
-void TriggerNMINSF(void)
+void TriggerNMINSF
_c
(void)
{
ADDCYC(7);
PUSH(_PC>>8);
{
ADDCYC(7);
PUSH(_PC>>8);
@@
-390,7
+390,7
@@
void TriggerNMINSF(void)
_PC=0x3800;
}
_PC=0x3800;
}
-void TriggerNMI(void)
+void TriggerNMI
_c
(void)
{
_IRQlow|=FCEU_IQNMI;
}
{
_IRQlow|=FCEU_IQNMI;
}
@@
-422,7
+422,7
@@
void TriggerIRQReal(void)
}
}
}
}
-void X6502_Reset(void)
+void X6502_Reset
_c
(void)
{
_PC=RdMem(0xFFFC);
_PC|=RdMem(0xFFFD)<<8;
{
_PC=RdMem(0xFFFC);
_PC|=RdMem(0xFFFD)<<8;
@@
-431,17
+431,17
@@
void X6502_Reset(void)
_PI=_P=I_FLAG;
}
_PI=_P=I_FLAG;
}
-void X6502_Power(void)
+void X6502_Power
_c
(void)
{
memset((void *)&X,0,sizeof(X));
timestamp=0;
{
memset((void *)&X,0,sizeof(X));
timestamp=0;
- X6502_Reset();
+ X6502_Reset
_c
();
}
//int asdc = 0;
}
//int asdc = 0;
-void X6502_Run_(void/*int32 cycles*/)
+void X6502_Run_
c
(void/*int32 cycles*/)
{
/*
if(PAL)
{
/*
if(PAL)
@@
-475,6
+475,7
@@
void X6502_Run_(void/*int32 cycles*/)
ADDCYC(temp);
//temp=_tcount;
//_tcount=0;
ADDCYC(temp);
//temp=_tcount;
//_tcount=0;
+
if(MapIRQHook) MapIRQHook(temp);
temp*=48;
if(MapIRQHook) MapIRQHook(temp);
temp*=48;
@@
-486,7
+487,6
@@
void X6502_Run_(void/*int32 cycles*/)
fhcnt+=fhinc;
}
fhcnt+=fhinc;
}
-
if(PCMIRQCount>0)
{
PCMIRQCount-=temp;
if(PCMIRQCount>0)
{
PCMIRQCount-=temp;
@@
-497,10
+497,11
@@
void X6502_Run_(void/*int32 cycles*/)
{
extern uint8 SIRQStat;
SIRQStat|=0x80;
{
extern uint8 SIRQStat;
SIRQStat|=0x80;
- X6502_IRQBegin(FCEU_IQDPCM);
+ X6502_IRQBegin
_c
(FCEU_IQDPCM);
}
}
}
}
}
}
+
//printf("$%04x:$%02x\n",_PC,b1);
//_PC++;
//printf("$%02x\n",b1);
//printf("$%04x:$%02x\n",_PC,b1);
//_PC++;
//printf("$%02x\n",b1);
@@
-509,6
+510,10
@@
void X6502_Run_(void/*int32 cycles*/)
{
#include "ops.h"
}
{
#include "ops.h"
}
+
+#ifdef DEBUG_ASM_6502
+ _PI=_P;
+#endif
}
}
}
}