Mercurial > repos > blastem
comparison backend.h @ 1931:374a5ae694e8 mame_interp
Merge from default
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 18 Apr 2020 11:42:53 -0700 |
parents | 8fe162bdb038 0c1491818f4b |
children |
comparison
equal
deleted
inserted
replaced
1843:13abdc98379e | 1931:374a5ae694e8 |
---|---|
6 #ifndef BACKEND_H_ | 6 #ifndef BACKEND_H_ |
7 #define BACKEND_H_ | 7 #define BACKEND_H_ |
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
11 #ifdef USE_NATIVE | 11 #ifndef NEW_CORE |
12 #include "gen.h" | 12 #include "gen.h" |
13 #else | 13 #else |
14 typedef uint8_t * code_ptr; | 14 typedef uint8_t * code_ptr; |
15 typedef struct { | 15 typedef struct { |
16 code_ptr cur; | 16 code_ptr cur; |
52 #include "memmap.h" | 52 #include "memmap.h" |
53 #include "system.h" | 53 #include "system.h" |
54 | 54 |
55 typedef struct { | 55 typedef struct { |
56 uint32_t flags; | 56 uint32_t flags; |
57 #ifdef USE_NATIVE | 57 #ifndef NEW_CORE |
58 native_map_slot *native_code_map; | 58 native_map_slot *native_code_map; |
59 deferred_addr *deferred; | 59 deferred_addr *deferred; |
60 code_info code; | 60 code_info code; |
61 uint8_t **ram_inst_sizes; | 61 uint8_t **ram_inst_sizes; |
62 #endif | 62 #endif |
63 memmap_chunk const *memmap; | 63 memmap_chunk const *memmap; |
64 #ifdef USE_NATIVE | 64 #ifndef NEW_CORE |
65 code_ptr save_context; | 65 code_ptr save_context; |
66 code_ptr load_context; | 66 code_ptr load_context; |
67 code_ptr handle_cycle_limit; | 67 code_ptr handle_cycle_limit; |
68 code_ptr handle_cycle_limit_int; | 68 code_ptr handle_cycle_limit_int; |
69 code_ptr handle_code_write; | 69 code_ptr handle_code_write; |
74 uint32_t memmap_chunks; | 74 uint32_t memmap_chunks; |
75 uint32_t address_mask; | 75 uint32_t address_mask; |
76 uint32_t max_address; | 76 uint32_t max_address; |
77 uint32_t bus_cycles; | 77 uint32_t bus_cycles; |
78 uint32_t clock_divider; | 78 uint32_t clock_divider; |
79 #ifdef USE_NATIVE | 79 #ifndef NEW_CORE |
80 uint32_t move_pc_off; | 80 uint32_t move_pc_off; |
81 uint32_t move_pc_size; | 81 uint32_t move_pc_size; |
82 int32_t mem_ptr_off; | 82 int32_t mem_ptr_off; |
83 int32_t ram_flags_off; | 83 int32_t ram_flags_off; |
84 uint8_t ram_flags_shift; | 84 uint8_t ram_flags_shift; |
85 #endif | 85 #endif |
86 uint8_t address_size; | 86 uint8_t address_size; |
87 uint8_t byte_swap; | 87 uint8_t byte_swap; |
88 #ifdef USE_NATIVE | 88 #ifndef NEW_CORE |
89 int8_t context_reg; | 89 int8_t context_reg; |
90 int8_t cycles; | 90 int8_t cycles; |
91 int8_t limit; | 91 int8_t limit; |
92 int8_t scratch1; | 92 int8_t scratch1; |
93 int8_t scratch2; | 93 int8_t scratch2; |
94 uint8_t align_error_mask; | 94 uint8_t align_error_mask; |
95 #endif | 95 #endif |
96 } cpu_options; | 96 } cpu_options; |
97 | 97 |
98 #ifdef USE_NATIVE | 98 #ifndef NEW_CORE |
99 typedef uint8_t * (*native_addr_func)(void * context, uint32_t address); | 99 typedef uint8_t * (*native_addr_func)(void * context, uint32_t address); |
100 | 100 |
101 deferred_addr * defer_address(deferred_addr * old_head, uint32_t address, uint8_t *dest); | 101 deferred_addr * defer_address(deferred_addr * old_head, uint32_t address, uint8_t *dest); |
102 void remove_deferred_until(deferred_addr **head_ptr, deferred_addr * remove_to); | 102 void remove_deferred_until(deferred_addr **head_ptr, deferred_addr * remove_to); |
103 void process_deferred(deferred_addr ** head_ptr, void * context, native_addr_func get_native); | 103 void process_deferred(deferred_addr ** head_ptr, void * context, native_addr_func get_native); |