/* Build the opcode handler table */
void m68ki_build_opcode_table(void);
-extern void (*m68ki_instruction_jump_table[0x10000])(void); /* opcode handler jump table */
+struct m68ki_cpu_core;
+
+extern void (*m68ki_instruction_jump_table[0x10000])(struct m68ki_cpu_core *state); /* opcode handler jump table */
extern unsigned char m68ki_cycles[][0x10000];
#define NUM_CPU_TYPES 5
-void (*m68ki_instruction_jump_table[0x10000])(void); /* opcode handler jump table */
+void (*m68ki_instruction_jump_table[0x10000])(m68ki_cpu_core *state); /* opcode handler jump table */
unsigned char m68ki_cycles[NUM_CPU_TYPES][0x10000]; /* Cycles used by CPU type */
/* This is used to generate the opcode handler jump table */
typedef struct
{
- void (*opcode_handler)(void); /* handler function */
+ void (*opcode_handler)(m68ki_cpu_core *state); /* handler function */
unsigned int mask; /* mask on opcode */
unsigned int match; /* what to match after masking */
unsigned char cycles[NUM_CPU_TYPES]; /* cycles each cpu type takes */
extern void m68040_fpu_op1(void);
extern void m68851_mmu_ops();
extern unsigned char m68ki_cycles[][0x10000];
-extern void (*m68ki_instruction_jump_table[0x10000])(void); /* opcode handler jump table */
extern void m68ki_build_opcode_table(void);
#include "m68kops.h"
/* Read an instruction and call its handler */
REG_IR = m68ki_read_imm_16();
- m68ki_instruction_jump_table[REG_IR]();
+ m68ki_instruction_jump_table[REG_IR](&m68ki_cpu);
USE_CYCLES(CYC_INSTRUCTION[REG_IR]);
/* Trace m68k_exception, if necessary */
-typedef struct
+typedef struct m68ki_cpu_core
{
uint cpu_type; /* CPU Type: 68000, 68008, 68010, 68EC020, 68020, 68EC030, 68030, 68EC040, or 68040 */
uint dar[16]; /* Data and Address Registers */
/* Write the name of an opcode handler function */
void write_function_name(FILE* filep, char* base_name)
{
- fprintf(filep, "static void %s(void)\n", base_name);
+ fprintf(filep, "static void %s(m68ki_cpu_core *state)\n", base_name);
}
void add_opcode_output_table_entry(opcode_struct* op, char* name)