handle dbra wait loops, update cyclone

This commit is contained in:
notaz 2013-09-08 16:43:54 +03:00
parent e71fae1f13
commit ecc8036ee2
9 changed files with 60 additions and 12 deletions

@ -1 +1 @@
Subproject commit 7ddcd35c8b2a8248257bd89ef989095639c29c08
Subproject commit 590d780f20871b29fdc803bd2c74b046fd2d0f28

View file

@ -10,7 +10,7 @@
#define USE_MS_SYNTAX 0
#define CYCLONE_FOR_GENESIS 2
#define COMPRESS_JUMPTABLE 1
#define COMPRESS_JUMPTABLE 0
#define MEMHANDLERS_ADDR_MASK 0
#define MEMHANDLERS_NEED_PC 0

View file

@ -125,6 +125,7 @@ typedef struct
unsigned int Opcode;
signed int cycles_needed;
unsigned short *PC;
unsigned long BasePC;
unsigned int flag_C;
@ -136,6 +137,9 @@ typedef struct
unsigned int flag_S;
unsigned int flag_I;
unsigned char not_polling;
unsigned char pad[3];
unsigned long Fetch[M68K_FETCHBANK1];
} M68K_CONTEXT;

View file

@ -1,4 +1,10 @@
#ifdef PICODRIVE_HACK
#define NOT_POLLING g_m68kcontext->not_polling = 1;
#else
#define NOT_POLLING
#endif
// ORI
OPCODE(0x0000)
{
@ -23298,6 +23304,8 @@ OPCODE(0x51C8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
res = DREGu16((Opcode >> 0) & 7);
res--;
DREGu16((Opcode >> 0) & 7) = res;
@ -23321,6 +23329,8 @@ OPCODE(0x52C8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if ((!flag_NotZ) || (flag_C & 0x100))
{
res = DREGu16((Opcode >> 0) & 7);
@ -23352,6 +23362,8 @@ OPCODE(0x53C8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (flag_NotZ && (!(flag_C & 0x100)))
{
res = DREGu16((Opcode >> 0) & 7);
@ -23383,6 +23395,8 @@ OPCODE(0x54C8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (flag_C & 0x100)
{
res = DREGu16((Opcode >> 0) & 7);
@ -23414,6 +23428,8 @@ OPCODE(0x55C8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (!(flag_C & 0x100))
{
res = DREGu16((Opcode >> 0) & 7);
@ -23445,6 +23461,8 @@ OPCODE(0x56C8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (!flag_NotZ)
{
res = DREGu16((Opcode >> 0) & 7);
@ -23476,6 +23494,8 @@ OPCODE(0x57C8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (flag_NotZ)
{
res = DREGu16((Opcode >> 0) & 7);
@ -23507,6 +23527,8 @@ OPCODE(0x58C8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (flag_V & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
@ -23538,6 +23560,8 @@ OPCODE(0x59C8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (!(flag_V & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
@ -23569,6 +23593,8 @@ OPCODE(0x5AC8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (flag_N & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
@ -23600,6 +23626,8 @@ OPCODE(0x5BC8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (!(flag_N & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
@ -23631,6 +23659,8 @@ OPCODE(0x5CC8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if ((flag_N ^ flag_V) & 0x80)
{
res = DREGu16((Opcode >> 0) & 7);
@ -23662,6 +23692,8 @@ OPCODE(0x5DC8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (!((flag_N ^ flag_V) & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
@ -23693,6 +23725,8 @@ OPCODE(0x5EC8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
{
res = DREGu16((Opcode >> 0) & 7);
@ -23724,6 +23758,8 @@ OPCODE(0x5FC8)
u32 adr, res;
u32 src, dst;
NOT_POLLING
if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
{
res = DREGu16((Opcode >> 0) & 7);

View file

@ -832,6 +832,8 @@ int m68k_execute(int num_cycles)
m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */
m68ki_trace_t1(); /* notaz */
m68ki_cpu_p->not_polling = 1;
} // while(GET_CYCLES() > 0); // notaz
/* set previous PC to current PC for the next entry into the loop */

View file

@ -919,6 +919,7 @@ typedef struct
// notaz
sint cyc_remaining_cycles;
sint not_polling;
} m68ki_cpu_core;
// notaz