}
void *cpu_task() {
- m68k_pulse_reset();
+ m68ki_cpu_core *state = &m68ki_cpu;
+ m68k_pulse_reset(state);
cpu_loop:
if (mouse_hook_enabled) {
printf("%.8X (%.8X)]] %s\n", m68k_get_reg(NULL, M68K_REG_PC), (m68k_get_reg(NULL, M68K_REG_PC) & 0xFFFFFF), disasm_buf);
if (do_disasm)
do_disasm--;
- m68k_execute(1);
+ m68k_execute(state, 1);
}
else {
if (cpu_emulation_running) {
- if (irq)
- m68k_execute(5);
- else
- m68k_execute(loop_cycles);
+ if (irq)
+ m68k_execute(state, 5);
+ else
+ m68k_execute(state, loop_cycles);
}
}
}
void cpu_pulse_reset(void) {
+ m68ki_cpu_core *state = &m68ki_cpu;
ps_pulse_reset();
if (cfg->platform->handle_reset)
cfg->platform->handle_reset(cfg);
//m68k_write_memory_8(0xbfe201, 0x0001); // AMIGA OVL
//m68k_write_memory_8(0xbfe001, 0x0001); // AMIGA OVL high (ROM@0x0)
- m68k_pulse_reset();
+ m68k_pulse_reset(state);
}
int cpu_irq_ack(int level) {
#include MUSASHI_CNF
#else
#include "m68kconf.h"
+
#endif
/* ======================================================================== */
*/
#define M68K_INT_ACK_SPURIOUS 0xfffffffe
+struct m68ki_cpu_core;
/* CPU types for use in m68k_set_cpu_type() */
enum
* the CPU for the first time, the CPU will be set to
* M68K_CPU_TYPE_68000.
*/
-void m68k_pulse_reset(void);
+void m68k_pulse_reset(struct m68ki_cpu_core *state);
/* execute num_cycles worth of instructions. returns number of cycles used */
-int m68k_execute(int num_cycles);
+int m68k_execute(struct m68ki_cpu_core *state, int num_cycles);
/* These functions let you read/write/modify the number of cycles left to run
* while m68k_execute() is running.
}
if (REG_CACR & (M68K_CACR_CI | M68K_CACR_CEI)) {
- m68ki_ic_clear();
+ m68ki_ic_clear(state);
}
return;
}
/* Execute some instructions until we use up num_cycles clock cycles */
/* ASG: removed per-instruction interrupt checks */
-int m68k_execute(int num_cycles)
+int m68k_execute(m68ki_cpu_core *state, int num_cycles)
{
/* eat up any reset cycles */
if (RESET_CYCLES) {
}
/* Pulse the RESET line on the CPU */
-void m68k_pulse_reset(void)
+void m68k_pulse_reset(m68ki_cpu_core *state)
{
/* Disable the PMMU/HMMU on reset, if any */
m68ki_cpu.pmmu_enabled = 0;
if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
{
// clear instruction cache
- m68ki_ic_clear();
+ m68ki_ic_clear(state);
}
}
/* ---------------------------- Read Immediate ---------------------------- */
// clear the instruction cache
-inline void m68ki_ic_clear()
+inline void m68ki_ic_clear(m68ki_cpu_core *state)
{
int i;
for (i=0; i< M68K_IC_SIZE; i++) {