famec hack, CPU debug in CD mode

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@292 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2007-11-10 15:49:07 +00:00
parent 9caf44b59b
commit b5e5172d04
11 changed files with 279 additions and 66 deletions

View file

@ -28,6 +28,7 @@
#define USE_CYCLONE_TIMING
#define USE_CYCLONE_TIMING_DIV
#define PICODRIVE_HACK
// Options //
@ -521,6 +522,10 @@ static u32 flag_I;
static u32 initialised = 0;
#ifdef PICODRIVE_HACK
extern M68K_CONTEXT PicoCpuFS68k;
#endif
/* Custom function handler */
typedef void (*opcode_func)(void);
@ -793,6 +798,9 @@ int fm68k_emulate(s32 cycles)
// won't emulate double fault
// if (m68kcontext.execinfo & M68K_FAULTED) return -1;
// Cache PPL
flag_I = M68K_PPL;
if (m68kcontext.execinfo & FM68K_HALTED)
{
if (interrupt_chk__() <= 0)
@ -812,9 +820,6 @@ int fm68k_emulate(s32 cycles)
// Cache SR
SET_SR(m68kcontext.sr)
// Cache PPL
flag_I = M68K_PPL;
// Fijar PC
SET_PC(m68kcontext.pc)
@ -943,8 +948,6 @@ init_jump_table:
#endif
u32 i, j;
m68kcontext.sr = 0x2704; // Z flag
for(i = 0x0000; i <= 0xFFFF; i += 0x0001)
JumpTable[0x0000 + i] = CAST_OP(0x4AFC);
for(i = 0x0000; i <= 0x0007; i += 0x0001)

View file

@ -18292,8 +18292,19 @@ OPCODE(0x4AD0)
flag_V = 0;
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
if (g_m68kcontext == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
#endif
POST_IO
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
RET(8)
#endif
}
// TAS
@ -18310,8 +18321,20 @@ OPCODE(0x4AD8)
flag_V = 0;
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
if (g_m68kcontext == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
#endif
POST_IO
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
RET(8)
#endif
}
// TAS
@ -18328,8 +18351,20 @@ OPCODE(0x4AE0)
flag_V = 0;
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
if (g_m68kcontext == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
#endif
POST_IO
#ifdef USE_CYCLONE_TIMING
RET(20)
#else
RET(10)
#endif
}
// TAS
@ -18346,8 +18381,20 @@ OPCODE(0x4AE8)
flag_V = 0;
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
if (g_m68kcontext == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
#endif
POST_IO
#ifdef USE_CYCLONE_TIMING
RET(22)
#else
RET(12)
#endif
}
// TAS
@ -18364,8 +18411,20 @@ OPCODE(0x4AF0)
flag_V = 0;
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
if (g_m68kcontext == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
#endif
POST_IO
#ifdef USE_CYCLONE_TIMING
RET(24)
#else
RET(14)
#endif
}
// TAS
@ -18381,8 +18440,20 @@ OPCODE(0x4AF8)
flag_V = 0;
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
if (g_m68kcontext == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
#endif
POST_IO
#ifdef USE_CYCLONE_TIMING
RET(22)
#else
RET(12)
#endif
}
// TAS
@ -18398,8 +18469,20 @@ OPCODE(0x4AF9)
flag_V = 0;
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
if (g_m68kcontext == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
#endif
POST_IO
#ifdef USE_CYCLONE_TIMING
RET(26)
#else
RET(16)
#endif
}
// TAS
@ -18416,8 +18499,20 @@ OPCODE(0x4ADF)
flag_V = 0;
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
if (g_m68kcontext == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
#endif
POST_IO
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
RET(8)
#endif
}
// TAS
@ -18434,8 +18529,20 @@ OPCODE(0x4AE7)
flag_V = 0;
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
if (g_m68kcontext == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
#endif
POST_IO
RET(10)
#ifdef USE_CYCLONE_TIMING
RET(20)
#else
RET(8)
#endif
}
// ILLEGAL