mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
bugfixes, adjusted famec timing
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@283 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
80db44425a
commit
03e4f2a349
15 changed files with 324 additions and 344 deletions
|
@ -18,13 +18,13 @@ extern "C" {
|
|||
#define M68K_FETCHBANK1 (1 << FAMEC_FETCHBITS)
|
||||
|
||||
//#define M68K_RUNNING 0x01
|
||||
#define M68K_HALTED 0x80
|
||||
#define M68K_WAITING 0x04
|
||||
#define M68K_DISABLE 0x20
|
||||
#define M68K_FAULTED 0x40
|
||||
#define M68K_EMULATE_GROUP_0 0x02
|
||||
#define M68K_EMULATE_TRACE 0x08
|
||||
#define M68K_DO_TRACE 0x10
|
||||
#define FM68K_HALTED 0x80
|
||||
//#define M68K_WAITING 0x04
|
||||
//#define M68K_DISABLE 0x20
|
||||
//#define M68K_FAULTED 0x40
|
||||
#define FM68K_EMULATE_GROUP_0 0x02
|
||||
#define FM68K_EMULATE_TRACE 0x08
|
||||
#define FM68K_DO_TRACE 0x10
|
||||
|
||||
|
||||
/************************************/
|
||||
|
@ -92,29 +92,6 @@ extern "C" {
|
|||
/* Data definition */
|
||||
/*******************/
|
||||
|
||||
/* M68K registers */
|
||||
typedef enum {
|
||||
M68K_REG_D0=0,
|
||||
M68K_REG_D1,
|
||||
M68K_REG_D2,
|
||||
M68K_REG_D3,
|
||||
M68K_REG_D4,
|
||||
M68K_REG_D5,
|
||||
M68K_REG_D6,
|
||||
M68K_REG_D7,
|
||||
M68K_REG_A0,
|
||||
M68K_REG_A1,
|
||||
M68K_REG_A2,
|
||||
M68K_REG_A3,
|
||||
M68K_REG_A4,
|
||||
M68K_REG_A5,
|
||||
M68K_REG_A6,
|
||||
M68K_REG_A7,
|
||||
M68K_REG_ASP,
|
||||
M68K_REG_PC,
|
||||
M68K_REG_SR
|
||||
} m68k_register;
|
||||
|
||||
typedef union
|
||||
{
|
||||
unsigned char B;
|
||||
|
@ -155,13 +132,12 @@ extern M68K_CONTEXT *g_m68kcontext;
|
|||
/************************/
|
||||
|
||||
/* General purpose functions */
|
||||
void m68k_init(void);
|
||||
int m68k_reset(void);
|
||||
int m68k_emulate(int n);
|
||||
void fm68k_init(void);
|
||||
int fm68k_reset(void);
|
||||
int fm68k_emulate(int n);
|
||||
int fm68k_would_interrupt(void); // to be called from fm68k_emulate()
|
||||
|
||||
unsigned m68k_get_pc(M68K_CONTEXT *context);
|
||||
unsigned m68k_get_register(M68K_CONTEXT *context, m68k_register reg);
|
||||
unsigned m68k_set_register(M68K_CONTEXT *context, m68k_register reg, unsigned value);
|
||||
unsigned fm68k_get_pc(M68K_CONTEXT *context);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
189
cpu/fame/famec.c
189
cpu/fame/famec.c
|
@ -481,7 +481,7 @@ static u32 flag_I;
|
|||
if ((_PC_)&1) \
|
||||
{ \
|
||||
u32 pr_PC=GET_PC; \
|
||||
m68kcontext.execinfo |= M68K_EMULATE_GROUP_0; \
|
||||
m68kcontext.execinfo |= FM68K_EMULATE_GROUP_0; \
|
||||
execute_exception_group_0(M68K_ADDRESS_ERROR_EX, 0, pr_PC, 0x12 ); \
|
||||
CHECK_BRANCH_EXCEPTION_GOTO_END \
|
||||
}
|
||||
|
@ -602,14 +602,14 @@ static const s32 exception_cycle_table[256] =
|
|||
/* Debe ser llamado para inicializar la tabla de saltos de instruccion */
|
||||
/* No recibe parametros y no devuelve nada */
|
||||
/***************************************************************************/
|
||||
void m68k_init(void)
|
||||
void fm68k_init(void)
|
||||
{
|
||||
#ifdef FAMEC_DEBUG
|
||||
puts("Initializing FAME...");
|
||||
#endif
|
||||
|
||||
if (!initialised)
|
||||
m68k_emulate(0);
|
||||
fm68k_emulate(0);
|
||||
|
||||
#ifdef FAMEC_DEBUG
|
||||
puts("FAME initialized.");
|
||||
|
@ -625,17 +625,17 @@ void m68k_init(void)
|
|||
/* M68K_NO_SUP_ADDR_SPACE (2): No se puede resetear porque no hay mapa */
|
||||
/* de memoria supervisor de extraccion de opcodes */
|
||||
/******************************************************************************/
|
||||
int m68k_reset(void)
|
||||
int fm68k_reset(void)
|
||||
{
|
||||
if (!initialised)
|
||||
m68k_emulate(0);
|
||||
fm68k_emulate(0);
|
||||
|
||||
// Si la CPU esta en ejecucion, salir con M68K_RUNNING
|
||||
if (m68kcontext.execinfo & M68K_RUNNING)
|
||||
return M68K_RUNNING;
|
||||
|
||||
// Resetear registros
|
||||
memset(&m68kcontext.dreg[0], 0, 16*4);
|
||||
//memset(&m68kcontext.dreg[0], 0, 16*4);
|
||||
|
||||
// Resetear interrupts, execinfo y ASP
|
||||
m68kcontext.interrupts[0] = 0;
|
||||
|
@ -643,7 +643,7 @@ int m68k_reset(void)
|
|||
ASP = 0;
|
||||
|
||||
// Fijar registro de estado
|
||||
m68kcontext.sr = 0x2700;
|
||||
m68kcontext.sr = (m68kcontext.sr & 0xff) | 0x2700;
|
||||
|
||||
// Obtener puntero de pila inicial y PC
|
||||
AREG(7) = m68kcontext.read_long(0);
|
||||
|
@ -663,138 +663,12 @@ int m68k_reset(void)
|
|||
/* No recibe parametros */
|
||||
/* Retorna 68k PC */
|
||||
/****************************************************************************/
|
||||
u32 m68k_get_pc(M68K_CONTEXT *context)
|
||||
u32 fm68k_get_pc(M68K_CONTEXT *context)
|
||||
{
|
||||
return (context->execinfo & M68K_RUNNING)?(u32)PC-BasePC:context->pc;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* m68k_get_register(register) */
|
||||
/* Parametro: Registro a obtener valor (indice) */
|
||||
/* Retorno: Valor del registro requerido */
|
||||
/* Observacion: En caso de que el indice no sea correcto */
|
||||
/* la funcion devolvera -1 */
|
||||
/***************************************************************************/
|
||||
u32 m68k_get_register(M68K_CONTEXT *context, m68k_register reg)
|
||||
{
|
||||
M68K_CONTEXT *oldcontext = g_m68kcontext;
|
||||
s32 ret;
|
||||
|
||||
g_m68kcontext = context;
|
||||
|
||||
switch (reg)
|
||||
{
|
||||
case M68K_REG_D0:
|
||||
case M68K_REG_D1:
|
||||
case M68K_REG_D2:
|
||||
case M68K_REG_D3:
|
||||
case M68K_REG_D4:
|
||||
case M68K_REG_D5:
|
||||
case M68K_REG_D6:
|
||||
case M68K_REG_D7:
|
||||
ret = DREG(reg - M68K_REG_D0);
|
||||
break;
|
||||
|
||||
case M68K_REG_A0:
|
||||
case M68K_REG_A1:
|
||||
case M68K_REG_A2:
|
||||
case M68K_REG_A3:
|
||||
case M68K_REG_A4:
|
||||
case M68K_REG_A5:
|
||||
case M68K_REG_A6:
|
||||
case M68K_REG_A7:
|
||||
ret = AREG(reg - M68K_REG_A0);
|
||||
break;
|
||||
|
||||
case M68K_REG_ASP:
|
||||
ret = ASP;
|
||||
break;
|
||||
|
||||
case M68K_REG_PC:
|
||||
ret = m68k_get_pc(context);
|
||||
break;
|
||||
|
||||
case M68K_REG_SR:
|
||||
ret = m68kcontext.sr;
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = M68K_INV_REG;
|
||||
break;
|
||||
}
|
||||
|
||||
g_m68kcontext = oldcontext;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
/* m68k_set_register(register,value) */
|
||||
/* Parametros: Registro (indice) y valor a asignar */
|
||||
/* Retorno: Exito de la operacion */
|
||||
/* 0 La operacion se ha realizado satisfactoriamente */
|
||||
/* 1 El indice del registro no es valido (fuera de limites) */
|
||||
/***********************************************************************/
|
||||
u32 m68k_set_register(M68K_CONTEXT *context, m68k_register reg, u32 value)
|
||||
{
|
||||
M68K_CONTEXT *oldcontext = g_m68kcontext;
|
||||
s32 ret = M68K_OK;
|
||||
|
||||
g_m68kcontext = context;
|
||||
|
||||
switch (reg)
|
||||
{
|
||||
case M68K_REG_D0:
|
||||
case M68K_REG_D1:
|
||||
case M68K_REG_D2:
|
||||
case M68K_REG_D3:
|
||||
case M68K_REG_D4:
|
||||
case M68K_REG_D5:
|
||||
case M68K_REG_D6:
|
||||
case M68K_REG_D7:
|
||||
DREG(reg - M68K_REG_D0) = value;
|
||||
break;
|
||||
|
||||
case M68K_REG_A0:
|
||||
case M68K_REG_A1:
|
||||
case M68K_REG_A2:
|
||||
case M68K_REG_A3:
|
||||
case M68K_REG_A4:
|
||||
case M68K_REG_A5:
|
||||
case M68K_REG_A6:
|
||||
case M68K_REG_A7:
|
||||
AREG(reg - M68K_REG_A0) = value;
|
||||
break;
|
||||
|
||||
case M68K_REG_ASP:
|
||||
ASP = value;
|
||||
break;
|
||||
|
||||
case M68K_REG_PC:
|
||||
if (m68kcontext.execinfo & M68K_RUNNING)
|
||||
{
|
||||
SET_PC(value & M68K_ADR_MASK);
|
||||
}
|
||||
else
|
||||
{
|
||||
m68kcontext.pc = value;
|
||||
}
|
||||
break;
|
||||
|
||||
case M68K_REG_SR:
|
||||
m68kcontext.sr = value & 0xFFFF;
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = M68K_INV_REG;
|
||||
break;
|
||||
}
|
||||
|
||||
g_m68kcontext = oldcontext;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////
|
||||
// Chequea las interrupciones y las inicia
|
||||
static FAMEC_EXTRA_INLINE s32 interrupt_chk__(void)
|
||||
|
@ -805,6 +679,10 @@ static FAMEC_EXTRA_INLINE s32 interrupt_chk__(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int fm68k_would_interrupt(void)
|
||||
{
|
||||
return interrupt_chk__();
|
||||
}
|
||||
|
||||
static FAMEC_EXTRA_INLINE void execute_exception(s32 vect)
|
||||
{
|
||||
|
@ -839,7 +717,7 @@ static FAMEC_EXTRA_INLINE void execute_exception(s32 vect)
|
|||
/* adjust SR */
|
||||
flag_S = M68K_SR_S;
|
||||
|
||||
newPC&=M68K_ADR_MASK;
|
||||
newPC&=M68K_ADR_MASK&~1; // don't crash on games with bad vector tables
|
||||
|
||||
SET_PC(newPC)
|
||||
|
||||
|
@ -873,7 +751,7 @@ static u32 Opcode;
|
|||
// main exec function
|
||||
//////////////////////
|
||||
|
||||
int m68k_emulate(s32 cycles)
|
||||
int fm68k_emulate(s32 cycles)
|
||||
{
|
||||
if (!initialised)
|
||||
{
|
||||
|
@ -885,16 +763,16 @@ int m68k_emulate(s32 cycles)
|
|||
#endif
|
||||
}
|
||||
|
||||
/* Comprobar si la CPU esta detenida debido a un doble error de bus */
|
||||
if (m68kcontext.execinfo & M68K_FAULTED) return -1;
|
||||
// won't emulate double fault
|
||||
// if (m68kcontext.execinfo & M68K_FAULTED) return -1;
|
||||
|
||||
if (m68kcontext.execinfo & M68K_HALTED)
|
||||
if (m68kcontext.execinfo & FM68K_HALTED)
|
||||
{
|
||||
if (interrupt_chk__() <= 0)
|
||||
{
|
||||
return cycles;
|
||||
}
|
||||
m68kcontext.execinfo &= ~M68K_HALTED;
|
||||
m68kcontext.execinfo &= ~FM68K_HALTED;
|
||||
}
|
||||
|
||||
#ifdef FAMEC_DEBUG
|
||||
|
@ -923,7 +801,7 @@ int m68k_emulate(s32 cycles)
|
|||
cycles_needed = 0;
|
||||
|
||||
#ifdef FAMEC_EMULATE_TRACE
|
||||
if (!(m68kcontext.execinfo & M68K_EMULATE_TRACE))
|
||||
if (!(m68kcontext.execinfo & FM68K_EMULATE_TRACE))
|
||||
#endif
|
||||
{
|
||||
s32 line=interrupt_chk__();
|
||||
|
@ -937,12 +815,13 @@ int m68k_emulate(s32 cycles)
|
|||
|
||||
execute_exception(line + 0x18);
|
||||
flag_I = (u32)line;
|
||||
if (m68kcontext.io_cycle_counter <= 0) goto famec_End;
|
||||
}
|
||||
#ifdef FAMEC_EMULATE_TRACE
|
||||
else
|
||||
if (flag_T)
|
||||
{
|
||||
m68kcontext.execinfo |= M68K_EMULATE_TRACE;
|
||||
m68kcontext.execinfo |= FM68K_EMULATE_TRACE;
|
||||
cycles_needed= m68kcontext.io_cycle_counter;
|
||||
m68kcontext.io_cycle_counter=0;
|
||||
}
|
||||
|
@ -950,9 +829,9 @@ int m68k_emulate(s32 cycles)
|
|||
}
|
||||
|
||||
|
||||
#ifndef FAMEC_NO_GOTOS
|
||||
//#ifndef FAMEC_NO_GOTOS
|
||||
famec_Exec:
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
#ifdef FAMEC_DEBUG
|
||||
printf("Antes de NEXT... PC = %p\n", PC);
|
||||
|
@ -970,11 +849,11 @@ famec_Exec:
|
|||
#endif
|
||||
|
||||
#ifdef FAMEC_EMULATE_TRACE
|
||||
if (m68kcontext.execinfo & M68K_EMULATE_TRACE)
|
||||
if (m68kcontext.execinfo & FM68K_EMULATE_TRACE)
|
||||
{
|
||||
m68kcontext.io_cycle_counter= cycles_needed;
|
||||
m68kcontext.execinfo &= ~M68K_EMULATE_TRACE;
|
||||
m68kcontext.execinfo |= M68K_DO_TRACE;
|
||||
m68kcontext.execinfo &= ~FM68K_EMULATE_TRACE;
|
||||
m68kcontext.execinfo |= FM68K_DO_TRACE;
|
||||
execute_exception(M68K_TRACE_EX);
|
||||
flag_T=0;
|
||||
if (m68kcontext.io_cycle_counter > 0)
|
||||
|
@ -984,7 +863,7 @@ famec_Exec:
|
|||
}
|
||||
else
|
||||
#endif
|
||||
if (cycles_needed>0)
|
||||
if (cycles_needed != 0)
|
||||
{
|
||||
s32 line=interrupt_chk__();
|
||||
m68kcontext.io_cycle_counter= cycles_needed;
|
||||
|
@ -1003,10 +882,12 @@ famec_Exec:
|
|||
#endif
|
||||
if (m68kcontext.io_cycle_counter > 0)
|
||||
{
|
||||
NEXT
|
||||
//NEXT
|
||||
goto famec_Exec;
|
||||
}
|
||||
}
|
||||
|
||||
famec_End:
|
||||
m68kcontext.sr = GET_SR;
|
||||
m68kcontext.pc = GET_PC;
|
||||
|
||||
|
@ -1032,6 +913,8 @@ 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)
|
||||
|
@ -1542,6 +1425,7 @@ init_jump_table:
|
|||
JumpTable[0x1EC0 + i] = CAST_OP(0x1EC0);
|
||||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
JumpTable[0x1F00 + i] = CAST_OP(0x1F00);
|
||||
#if 0
|
||||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0x1008 + i + j] = CAST_OP(0x1008);
|
||||
|
@ -1568,6 +1452,7 @@ init_jump_table:
|
|||
JumpTable[0x1EC8 + i] = CAST_OP(0x1EC8);
|
||||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
JumpTable[0x1F08 + i] = CAST_OP(0x1F08);
|
||||
#endif
|
||||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0x1010 + i + j] = CAST_OP(0x1010);
|
||||
|
@ -3697,9 +3582,11 @@ init_jump_table:
|
|||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0x9000 + i + j] = CAST_OP(0x9000);
|
||||
#if 0
|
||||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0x9008 + i + j] = CAST_OP(0x9008);
|
||||
#endif
|
||||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0x9010 + i + j] = CAST_OP(0x9010);
|
||||
|
@ -3976,9 +3863,11 @@ init_jump_table:
|
|||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0xB000 + i + j] = CAST_OP(0xB000);
|
||||
#if 0
|
||||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0xB008 + i + j] = CAST_OP(0xB008);
|
||||
#endif
|
||||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0xB010 + i + j] = CAST_OP(0xB010);
|
||||
|
@ -4502,9 +4391,11 @@ init_jump_table:
|
|||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0xD000 + i + j] = CAST_OP(0xD000);
|
||||
#if 0
|
||||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0xD008 + i + j] = CAST_OP(0xD008);
|
||||
#endif
|
||||
for(i = 0x0000; i <= 0x0007; i += 0x0001)
|
||||
for(j = 0x0000; j <= 0x0E00; j += 0x0200)
|
||||
JumpTable[0xD010 + i + j] = CAST_OP(0xD010);
|
||||
|
|
|
@ -1953,7 +1953,7 @@ OPCODE(0x0A7C)
|
|||
u32 newPC = (u32)(PC) - BasePC;
|
||||
SET_PC(newPC-2);
|
||||
execute_exception(M68K_PRIVILEGE_VIOLATION_EX);
|
||||
RET(4)
|
||||
RET(0)
|
||||
}
|
||||
RET(20)
|
||||
}
|
||||
|
@ -5213,7 +5213,11 @@ OPCODE(0x0108)
|
|||
READ_BYTE_F(adr + 2, src)
|
||||
DREGu16((Opcode >> 9) & 7) = (res << 8) | src;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(16)
|
||||
#else
|
||||
RET(24)
|
||||
#endif
|
||||
}
|
||||
|
||||
// MOVEPLaD
|
||||
|
@ -5237,7 +5241,11 @@ OPCODE(0x0148)
|
|||
READ_BYTE_F(adr, src)
|
||||
DREG((Opcode >> 9) & 7) = res | src;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(24)
|
||||
#else
|
||||
RET(32)
|
||||
#endif
|
||||
}
|
||||
|
||||
// MOVEPWDa
|
||||
|
@ -5253,7 +5261,11 @@ OPCODE(0x0188)
|
|||
WRITE_BYTE_F(adr + 0, res >> 8)
|
||||
WRITE_BYTE_F(adr + 2, res >> 0)
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(16)
|
||||
#else
|
||||
RET(24)
|
||||
#endif
|
||||
}
|
||||
|
||||
// MOVEPLDa
|
||||
|
@ -5274,7 +5286,11 @@ OPCODE(0x01C8)
|
|||
adr += 2;
|
||||
WRITE_BYTE_F(adr, res >> 0)
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(24)
|
||||
#else
|
||||
RET(32)
|
||||
#endif
|
||||
}
|
||||
|
||||
// MOVEB
|
||||
|
@ -5460,6 +5476,7 @@ OPCODE(0x1F00)
|
|||
RET(8)
|
||||
}
|
||||
|
||||
#if 0
|
||||
// MOVEB
|
||||
OPCODE(0x1008)
|
||||
{
|
||||
|
@ -5692,6 +5709,7 @@ OPCODE(0x1F08)
|
|||
*/
|
||||
RET(8)
|
||||
}
|
||||
#endif
|
||||
|
||||
// MOVEB
|
||||
OPCODE(0x1010)
|
||||
|
@ -8279,7 +8297,7 @@ OPCODE(0x2F00)
|
|||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
PRE_IO
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(12)
|
||||
}
|
||||
|
@ -8462,7 +8480,7 @@ OPCODE(0x2F08)
|
|||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
PRE_IO
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(12)
|
||||
}
|
||||
|
@ -8657,7 +8675,7 @@ OPCODE(0x2F10)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(20)
|
||||
}
|
||||
|
@ -8862,7 +8880,7 @@ OPCODE(0x2F18)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(20)
|
||||
}
|
||||
|
@ -9067,7 +9085,7 @@ OPCODE(0x2F20)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(22)
|
||||
}
|
||||
|
@ -9272,7 +9290,7 @@ OPCODE(0x2F28)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(24)
|
||||
}
|
||||
|
@ -9477,7 +9495,7 @@ OPCODE(0x2F30)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(26)
|
||||
}
|
||||
|
@ -9672,7 +9690,7 @@ OPCODE(0x2F38)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(24)
|
||||
}
|
||||
|
@ -9867,7 +9885,7 @@ OPCODE(0x2F39)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(28)
|
||||
}
|
||||
|
@ -10072,7 +10090,7 @@ OPCODE(0x2F3A)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(24)
|
||||
}
|
||||
|
@ -10277,7 +10295,7 @@ OPCODE(0x2F3B)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(26)
|
||||
}
|
||||
|
@ -10460,7 +10478,7 @@ OPCODE(0x2F3C)
|
|||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
PRE_IO
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(20)
|
||||
}
|
||||
|
@ -10665,7 +10683,7 @@ OPCODE(0x2F1F)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(20)
|
||||
}
|
||||
|
@ -10870,7 +10888,7 @@ OPCODE(0x2F27)
|
|||
flag_N = res >> 24;
|
||||
adr = AREG(7) - 4;
|
||||
AREG(7) = adr;
|
||||
WRITE_LONG_F(adr, res)
|
||||
WRITE_LONG_DEC_F(adr, res)
|
||||
POST_IO
|
||||
RET(22)
|
||||
}
|
||||
|
@ -18458,7 +18476,7 @@ OPCODE(0x4AFC)
|
|||
u32 oldPC=GET_PC;
|
||||
SET_PC(oldPC-2)
|
||||
execute_exception(M68K_ILLEGAL_INSTRUCTION_EX);
|
||||
RET(4)
|
||||
RET(0)
|
||||
}
|
||||
|
||||
// ILLEGAL A000-AFFF
|
||||
|
@ -18467,7 +18485,7 @@ OPCODE(0xA000)
|
|||
u32 oldPC=GET_PC;
|
||||
SET_PC(oldPC-2)
|
||||
execute_exception(M68K_1010_EX);
|
||||
RET(4)
|
||||
RET(0)
|
||||
}
|
||||
|
||||
// ILLEGAL F000-FFFF
|
||||
|
@ -18476,7 +18494,7 @@ OPCODE(0xF000)
|
|||
u32 oldPC=GET_PC;
|
||||
SET_PC(oldPC-2)
|
||||
execute_exception(M68K_1111_EX);
|
||||
RET(4)
|
||||
RET(0) // 4 already taken by exc. handler
|
||||
}
|
||||
|
||||
// MOVEMaR
|
||||
|
@ -19183,7 +19201,7 @@ OPCODE(0x4E72)
|
|||
AREG(7) = ASP;
|
||||
ASP = res;
|
||||
}
|
||||
m68kcontext.execinfo |= M68K_HALTED;
|
||||
m68kcontext.execinfo |= FM68K_HALTED;
|
||||
m68kcontext.io_cycle_counter = 0;
|
||||
RET(4)
|
||||
}
|
||||
|
@ -19213,7 +19231,7 @@ OPCODE(0x4E73)
|
|||
ASP = res;
|
||||
}
|
||||
POST_IO
|
||||
m68kcontext.execinfo &= ~(M68K_EMULATE_GROUP_0|M68K_EMULATE_TRACE|M68K_DO_TRACE);
|
||||
m68kcontext.execinfo &= ~(FM68K_EMULATE_GROUP_0|FM68K_EMULATE_TRACE|FM68K_DO_TRACE);
|
||||
CHECK_INT_TO_JUMP(20)
|
||||
RET(20)
|
||||
}
|
||||
|
@ -23892,7 +23910,7 @@ OPCODE(0x5048)
|
|||
dst = AREGu32((Opcode >> 0) & 7);
|
||||
res = dst + src;
|
||||
AREG((Opcode >> 0) & 7) = res;
|
||||
#ifdef USE_CYCLONE_TIMING_ // breaks Project-X
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(4)
|
||||
#else
|
||||
RET(8)
|
||||
|
@ -28333,6 +28351,7 @@ RET(4)
|
|||
}
|
||||
|
||||
// SUBaD
|
||||
#if 0
|
||||
OPCODE(0x9008)
|
||||
{
|
||||
u32 adr, res;
|
||||
|
@ -28352,6 +28371,7 @@ OPCODE(0x9008)
|
|||
*/
|
||||
RET(4)
|
||||
}
|
||||
#endif
|
||||
|
||||
// SUBaD
|
||||
OPCODE(0x9010)
|
||||
|
@ -30461,6 +30481,7 @@ RET(4)
|
|||
}
|
||||
|
||||
// CMP
|
||||
#if 0
|
||||
OPCODE(0xB008)
|
||||
{
|
||||
u32 adr, res;
|
||||
|
@ -30479,6 +30500,7 @@ OPCODE(0xB008)
|
|||
*/
|
||||
RET(4)
|
||||
}
|
||||
#endif
|
||||
|
||||
// CMP
|
||||
OPCODE(0xB010)
|
||||
|
@ -34756,6 +34778,7 @@ RET(4)
|
|||
}
|
||||
|
||||
// ADDaD
|
||||
#if 0
|
||||
OPCODE(0xD008)
|
||||
{
|
||||
u32 adr, res;
|
||||
|
@ -34775,6 +34798,7 @@ OPCODE(0xD008)
|
|||
*/
|
||||
RET(4)
|
||||
}
|
||||
#endif
|
||||
|
||||
// ADDaD
|
||||
OPCODE(0xD010)
|
||||
|
@ -36449,7 +36473,11 @@ OPCODE(0xD0D0)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(12)
|
||||
#else
|
||||
RET(10)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
@ -36466,7 +36494,11 @@ OPCODE(0xD0D8)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(12)
|
||||
#else
|
||||
RET(10)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
@ -36483,7 +36515,11 @@ OPCODE(0xD0E0)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(14)
|
||||
#else
|
||||
RET(12)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
@ -36500,7 +36536,11 @@ OPCODE(0xD0E8)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(16)
|
||||
#else
|
||||
RET(14)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
@ -36517,7 +36557,11 @@ OPCODE(0xD0F0)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(18)
|
||||
#else
|
||||
RET(16)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
@ -36533,7 +36577,11 @@ OPCODE(0xD0F8)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(16)
|
||||
#else
|
||||
RET(14)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
@ -36549,7 +36597,11 @@ OPCODE(0xD0F9)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(20)
|
||||
#else
|
||||
RET(18)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
@ -36566,7 +36618,11 @@ OPCODE(0xD0FA)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(16)
|
||||
#else
|
||||
RET(14)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
@ -36583,7 +36639,11 @@ OPCODE(0xD0FB)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(18)
|
||||
#else
|
||||
RET(16)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
@ -36613,7 +36673,11 @@ OPCODE(0xD0DF)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(12)
|
||||
#else
|
||||
RET(10)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
@ -36630,7 +36694,11 @@ OPCODE(0xD0E7)
|
|||
res = dst + src;
|
||||
AREG((Opcode >> 9) & 7) = res;
|
||||
POST_IO
|
||||
#ifdef USE_CYCLONE_TIMING
|
||||
RET(14)
|
||||
#else
|
||||
RET(12)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ADDA
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue