X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=m68k.h;h=ce9e648d7b4ec15c2a56cbc76dca2937fab9bad2;hb=HEAD;hp=3c6ee81fd5205b8ed50ebdb7fc94f3323e5fe595;hpb=60acb37185f21046cd798729e0cccf92dbe796c0;p=pistorm diff --git a/m68k.h b/m68k.h index 3c6ee81..ce9e648 100644 --- a/m68k.h +++ b/m68k.h @@ -52,6 +52,7 @@ extern "C" { #include MUSASHI_CNF #else #include "m68kconf.h" + #endif /* ======================================================================== */ @@ -71,6 +72,10 @@ extern "C" { #define M68K_IRQ_6 6 #define M68K_IRQ_7 7 +#define M68K_SZ_LONG 0 +#define M68K_SZ_BYTE 1 +#define M68K_SZ_WORD 2 + /* Special interrupt acknowledge values. * Use these as special returns from the interrupt acknowledge callback @@ -89,6 +94,7 @@ extern "C" { */ #define M68K_INT_ACK_SPURIOUS 0xfffffffe +struct m68ki_cpu_core; /* CPU types for use in m68k_set_cpu_type() */ enum @@ -185,13 +191,13 @@ unsigned int m68k_read_memory_16(unsigned int address); unsigned int m68k_read_memory_32(unsigned int address); /* Read data immediately following the PC */ -unsigned int m68k_read_immediate_16(unsigned int address); -unsigned int m68k_read_immediate_32(unsigned int address); +unsigned int m68k_read_immediate_16(struct m68ki_cpu_core *state, unsigned int address); +unsigned int m68k_read_immediate_32(struct m68ki_cpu_core *state, unsigned int address); /* Read data relative to the PC */ -unsigned int m68k_read_pcrelative_8(unsigned int address); -unsigned int m68k_read_pcrelative_16(unsigned int address); -unsigned int m68k_read_pcrelative_32(unsigned int address); +unsigned int m68k_read_pcrelative_8(struct m68ki_cpu_core *state, unsigned int address); +unsigned int m68k_read_pcrelative_16(struct m68ki_cpu_core *state, unsigned int address); +unsigned int m68k_read_pcrelative_32(struct m68ki_cpu_core *state, unsigned int address); /* Memory access for the disassembler */ unsigned int m68k_read_disassembler_8 (unsigned int address); @@ -206,6 +212,8 @@ void m68k_write_memory_32(unsigned int address, unsigned int value); /* PiStorm speed hax */ void m68k_add_ram_range(uint32_t addr, uint32_t upper, unsigned char *ptr); void m68k_add_rom_range(uint32_t addr, uint32_t upper, unsigned char *ptr); +void m68k_remove_range(unsigned char *ptr); +void m68k_clear_ranges(); /* Special call to simulate undocumented 68k behavior when move.l with a * predecrement destination mode is executed. @@ -309,7 +317,7 @@ void m68k_set_instr_hook_callback(void (*callback)(unsigned int pc)); * Currently supported types are: M68K_CPU_TYPE_68000, M68K_CPU_TYPE_68010, * M68K_CPU_TYPE_EC020, and M68K_CPU_TYPE_68020. */ -void m68k_set_cpu_type(unsigned int cpu_type); +void m68k_set_cpu_type(struct m68ki_cpu_core *state, unsigned int cpu_type); /* Do whatever initialisations the core requires. Should be called * at least once at init time. @@ -322,10 +330,10 @@ void m68k_init(void); * 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. @@ -355,7 +363,7 @@ void m68k_pulse_halt(void); /* Trigger a bus error exception */ -void m68k_pulse_bus_error(void); +void m68k_pulse_bus_error(struct m68ki_cpu_core *state); /* Context switching to allow multiple CPUs */ @@ -380,7 +388,7 @@ void m68k_state_register(const char *type, int index); unsigned int m68k_get_reg(void* context, m68k_register_t reg); /* Poke values into the internals of the currently running CPU context */ -void m68k_set_reg(m68k_register_t reg, unsigned int value); +void m68k_set_reg(void *context, m68k_register_t regnum, unsigned int value); /* Check if an instruction is valid for the specified CPU type */ unsigned int m68k_is_valid_instruction(unsigned int instruction, unsigned int cpu_type);