-Subproject commit 7ddcd35c8b2a8248257bd89ef989095639c29c08
+Subproject commit 590d780f20871b29fdc803bd2c74b046fd2d0f28
\r
#define USE_MS_SYNTAX 0\r
#define CYCLONE_FOR_GENESIS 2\r
-#define COMPRESS_JUMPTABLE 1\r
+#define COMPRESS_JUMPTABLE 0\r
#define MEMHANDLERS_ADDR_MASK 0\r
\r
#define MEMHANDLERS_NEED_PC 0\r
\r
unsigned int Opcode;\r
signed int cycles_needed;\r
+\r
unsigned short *PC;\r
unsigned long BasePC;\r
unsigned int flag_C;\r
unsigned int flag_S;\r
unsigned int flag_I;\r
\r
+ unsigned char not_polling;\r
+ unsigned char pad[3];\r
+\r
unsigned long Fetch[M68K_FETCHBANK1];\r
} M68K_CONTEXT;\r
\r
+#ifdef PICODRIVE_HACK
+#define NOT_POLLING g_m68kcontext->not_polling = 1;
+#else
+#define NOT_POLLING
+#endif
+
// ORI
OPCODE(0x0000)
{
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
res = DREGu16((Opcode >> 0) & 7);
res--;
DREGu16((Opcode >> 0) & 7) = res;
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if ((!flag_NotZ) || (flag_C & 0x100))
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_NotZ && (!(flag_C & 0x100)))
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_C & 0x100)
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (!(flag_C & 0x100))
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (!flag_NotZ)
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_NotZ)
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_V & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (!(flag_V & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_N & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (!(flag_N & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if ((flag_N ^ flag_V) & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (!((flag_N ^ flag_V) & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
u32 adr, res;
u32 src, dst;
+ NOT_POLLING
+
if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
{
res = DREGu16((Opcode >> 0) & 7);
m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */\r
\r
m68ki_trace_t1(); /* notaz */\r
+\r
+ m68ki_cpu_p->not_polling = 1;\r
} // while(GET_CYCLES() > 0); // notaz\r
\r
/* set previous PC to current PC for the next entry into the loop */\r
\r
// notaz\r
sint cyc_remaining_cycles;\r
+ sint not_polling;\r
} m68ki_cpu_core;\r
\r
// notaz\r
int ret = 0;
if (a - 2 <= m68k_poll.addr && m68k_poll.addr <= a + 2
- && cycles - m68k_poll.cycles <= 64)
+ && cycles - m68k_poll.cycles <= 64 && !SekNotPolling)
{
if (m68k_poll.cnt++ > POLL_THRESHOLD) {
if (!(Pico32x.emu_flags & flags)) {
else {
m68k_poll.cnt = 0;
m68k_poll.addr = a;
+ SekNotPolling = 0;
}
m68k_poll.cycles = cycles;
return sh2_comm_faker(a);
#else
if ((a & 0x30) == 0x20) {
- static u32 dr2 = 0;
unsigned int cycles = SekCyclesDone();
int comreg = 1 << (a & 0x0f) / 2;
- // evil X-Men proto polls in a dbra loop and expects it to expire..
- if (SekDar(2) != dr2)
- m68k_poll.cnt = 0;
- dr2 = SekDar(2);
-
if (cycles - msh2.m68krcycles_done > 244
|| (Pico32x.comm_dirty_68k & comreg))
p32x_sync_sh2s(cycles);
SekSetStop(1);
SekEndRun(16);
}
- dr2 = SekDar(2);
goto out;
}
#endif
void m68k_comm_check(u32 a)\r
{\r
pcd_sync_s68k(SekCyclesDone(), 0);\r
- if (a != Pico_mcd->m.m68k_poll_a) {\r
+ if (SekNotPolling || a != Pico_mcd->m.m68k_poll_a) {\r
Pico_mcd->m.m68k_poll_a = a;\r
Pico_mcd->m.m68k_poll_cnt = 0;\r
+ SekNotPolling = 0;\r
return;\r
}\r
Pico_mcd->m.m68k_poll_cnt++;\r
return d;\r
\r
cycles = SekCyclesDoneS68k();\r
- if (a == Pico_mcd->m.s68k_poll_a) {\r
+ if (!SekNotPolling && a == Pico_mcd->m.s68k_poll_a) {\r
u32 clkdiff = cycles - Pico_mcd->m.s68k_poll_clk;\r
if (clkdiff <= POLL_CYCLES) {\r
cnt = Pico_mcd->m.s68k_poll_cnt + 1;\r
Pico_mcd->m.s68k_poll_a = a;\r
Pico_mcd->m.s68k_poll_clk = cycles;\r
Pico_mcd->m.s68k_poll_cnt = cnt;\r
+ SekNotPollingS68k = 0;\r
#endif\r
return d;\r
}\r
#define SekIsStoppedS68k() (PicoCpuCS68k.state_flags&1)\r
#define SekShouldInterrupt() (PicoCpuCM68k.irq > (PicoCpuCM68k.srh&7))\r
\r
+#define SekNotPolling PicoCpuCM68k.not_pol\r
+#define SekNotPollingS68k PicoCpuCS68k.not_pol\r
+\r
#define SekInterrupt(i) PicoCpuCM68k.irq=i\r
#define SekIrqLevel PicoCpuCM68k.irq\r
\r
#define SekIsStoppedS68k() (PicoCpuFS68k.execinfo&FM68K_HALTED)\r
#define SekShouldInterrupt() fm68k_would_interrupt()\r
\r
+#define SekNotPolling PicoCpuFM68k.not_polling\r
+#define SekNotPollingS68k PicoCpuFS68k.not_polling\r
+\r
#define SekInterrupt(irq) PicoCpuFM68k.interrupts[0]=irq\r
#define SekIrqLevel PicoCpuFM68k.interrupts[0]\r
\r
#define SekIsStoppedS68k() (PicoCpuMS68k.stopped==STOP_LEVEL_STOP)\r
#define SekShouldInterrupt() (CPU_INT_LEVEL > FLAG_INT_MASK)\r
\r
+#define SekNotPolling PicoCpuMM68k.not_polling\r
+#define SekNotPollingS68k PicoCpuMS68k.not_polling\r
+\r
#define SekInterrupt(irq) { \\r
void *oldcontext = m68ki_cpu_p; \\r
m68k_set_context(&PicoCpuMM68k); \\r