diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-01-01 14:36:55 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-01-01 14:36:55 -0800 |
commit | ec4eed4f35910aa27ca353fceea38155806ef188 (patch) | |
tree | 584f2856096548fca66984e84649ee5db2ea7500 /backend.h | |
parent | fd85c8d7a74d44f169db4a51a600295042682ee8 (diff) |
Remove some of the hard coded assumptions about the memory map from the CPU cores
Diffstat (limited to 'backend.h')
-rw-r--r-- | backend.h | 56 |
1 files changed, 29 insertions, 27 deletions
@@ -46,33 +46,6 @@ typedef enum { WRITE_8 } ftype; -typedef struct { - uint32_t flags; - native_map_slot *native_code_map; - deferred_addr *deferred; - code_info code; - uint8_t **ram_inst_sizes; - code_ptr save_context; - code_ptr load_context; - code_ptr handle_cycle_limit; - code_ptr handle_cycle_limit_int; - code_ptr handle_code_write; - uint32_t address_mask; - uint32_t max_address; - uint32_t bus_cycles; - int32_t mem_ptr_off; - int32_t ram_flags_off; - uint8_t ram_flags_shift; - uint8_t address_size; - uint8_t byte_swap; - uint8_t context_reg; - uint8_t cycles; - uint8_t limit; - uint8_t scratch1; - uint8_t scratch2; -} cpu_options; - - #define MMAP_READ 0x01 #define MMAP_WRITE 0x02 #define MMAP_CODE 0x04 @@ -100,6 +73,34 @@ typedef struct { write_8_fun write_8; } memmap_chunk; +typedef struct { + uint32_t flags; + native_map_slot *native_code_map; + deferred_addr *deferred; + code_info code; + uint8_t **ram_inst_sizes; + memmap_chunk const *memmap; + code_ptr save_context; + code_ptr load_context; + code_ptr handle_cycle_limit; + code_ptr handle_cycle_limit_int; + code_ptr handle_code_write; + uint32_t memmap_chunks; + uint32_t address_mask; + uint32_t max_address; + uint32_t bus_cycles; + int32_t mem_ptr_off; + int32_t ram_flags_off; + uint8_t ram_flags_shift; + uint8_t address_size; + uint8_t byte_swap; + uint8_t context_reg; + uint8_t cycles; + uint8_t limit; + uint8_t scratch1; + uint8_t scratch2; +} cpu_options; + typedef uint8_t * (*native_addr_func)(void * context, uint32_t address); deferred_addr * defer_address(deferred_addr * old_head, uint32_t address, uint8_t *dest); @@ -112,6 +113,7 @@ void check_cycles(cpu_options * opts); void check_code_prologue(code_info *code); code_ptr gen_mem_fun(cpu_options * opts, memmap_chunk const * memmap, uint32_t num_chunks, ftype fun_type, code_ptr *after_inc); +void * get_native_pointer(uint32_t address, void ** mem_pointers, cpu_options * opts); #endif //BACKEND_H_ |