mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
68k, synchronize timing in fame and musashi (for debugging)
This commit is contained in:
parent
b26071be31
commit
5e04c2f37f
6 changed files with 15 additions and 9 deletions
|
@ -19318,6 +19318,7 @@ OPCODE(0x4E73)
|
|||
AREG(7) = ASP;
|
||||
ASP = res;
|
||||
}
|
||||
CHECK_BRANCH_EXCEPTION(res)
|
||||
POST_IO
|
||||
ctx->execinfo &= ~(FM68K_EMULATE_GROUP_0|FM68K_EMULATE_TRACE|FM68K_DO_TRACE);
|
||||
CHECK_INT_TO_JUMP(20)
|
||||
|
|
|
@ -389,7 +389,7 @@ addi 32 . . 0000011010...... A+-DXWL... U U U U 20 20 4 4
|
|||
addq 8 . d 0101...000000... .......... U U U U 4 4 2 2
|
||||
addq 8 . . 0101...000...... A+-DXWL... U U U U 8 8 4 4
|
||||
addq 16 . d 0101...001000... .......... U U U U 4 4 2 2
|
||||
addq 16 . a 0101...001001... .......... U U U U 4 4 2 2
|
||||
addq 16 . a 0101...001001... .......... U U U U 8 8 2 2
|
||||
addq 16 . . 0101...001...... A+-DXWL... U U U U 8 8 4 4
|
||||
addq 32 . d 0101...010000... .......... U U U U 8 8 2 2
|
||||
addq 32 . a 0101...010001... .......... U U U U 8 8 2 2
|
||||
|
|
|
@ -43,7 +43,7 @@ extern void m68040_fpu_op1(void);
|
|||
/* ================================= DATA ================================= */
|
||||
/* ======================================================================== */
|
||||
|
||||
int m68ki_initial_cycles;
|
||||
//int m68ki_initial_cycles;
|
||||
//int m68ki_remaining_cycles = 0; /* Number of clocks remaining */
|
||||
uint m68ki_tracing = 0;
|
||||
uint m68ki_address_space;
|
||||
|
@ -828,6 +828,10 @@ int m68k_execute(int num_cycles)
|
|||
m68ki_instruction_jump_table[REG_IR]();
|
||||
USE_CYCLES(CYC_INSTRUCTION[REG_IR]); // moving this up may cause a deadlock
|
||||
|
||||
/* ASG: update cycles */
|
||||
USE_CYCLES(CPU_INT_CYCLES);
|
||||
CPU_INT_CYCLES = 0;
|
||||
|
||||
/* Trace m68k_exception, if necessary */
|
||||
m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */
|
||||
|
||||
|
@ -839,10 +843,6 @@ int m68k_execute(int num_cycles)
|
|||
/* set previous PC to current PC for the next entry into the loop */
|
||||
REG_PPC = REG_PC;
|
||||
|
||||
/* ASG: update cycles */
|
||||
USE_CYCLES(CPU_INT_CYCLES);
|
||||
CPU_INT_CYCLES = 0;
|
||||
|
||||
/* return how many clocks we used */
|
||||
return m68ki_initial_cycles - GET_CYCLES();
|
||||
}
|
||||
|
|
|
@ -916,6 +916,7 @@ typedef struct
|
|||
void (*instr_hook_callback)(void); /* Called every instruction cycle prior to execution */
|
||||
|
||||
// notaz
|
||||
sint cyc_initial_cycles;
|
||||
sint cyc_remaining_cycles;
|
||||
sint not_polling;
|
||||
} m68ki_cpu_core;
|
||||
|
@ -923,6 +924,7 @@ typedef struct
|
|||
// notaz
|
||||
extern m68ki_cpu_core *m68ki_cpu_p;
|
||||
#define m68ki_cpu (*m68ki_cpu_p)
|
||||
#define m68ki_initial_cycles m68ki_cpu_p->cyc_initial_cycles
|
||||
#define m68ki_remaining_cycles m68ki_cpu_p->cyc_remaining_cycles
|
||||
|
||||
|
||||
|
|
|
@ -641,6 +641,9 @@ int get_oper_cycles(opcode_struct* op, int ea_mode, int cpu_type)
|
|||
strcmp(op->name, "suba") == 0))
|
||||
return op->cycles[cpu_type] + g_ea_cycle_table[ea_mode][cpu_type][size] + 2;
|
||||
|
||||
if(cpu_type == CPU_TYPE_000 && ea_mode == EA_MODE_I && op->size == 8 && strcmp(op->name, "btst") == 0)
|
||||
return op->cycles[cpu_type] + g_ea_cycle_table[ea_mode][cpu_type][size] + 2;
|
||||
|
||||
if(strcmp(op->name, "jmp") == 0)
|
||||
return op->cycles[cpu_type] + g_jmp_cycle_table[ea_mode];
|
||||
if(strcmp(op->name, "jsr") == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue