comparison z80_to_x86.h @ 668:5439ae7946ca

Made the Z80 core more contained by refactoring some code in blastem.c into z80_to_x86.c
author Michael Pavone <pavone@retrodev.com>
date Sat, 03 Jan 2015 18:23:04 -0800
parents 30ccf56842d6
children 7ed1dbb48f61
comparison
equal deleted inserted replaced
667:30ccf56842d6 668:5439ae7946ca
68 native_map_slot * banked_code_map; 68 native_map_slot * banked_code_map;
69 z80_options * options; 69 z80_options * options;
70 void * system; 70 void * system;
71 uint8_t ram_code_flags[(8 * 1024)/128/8]; 71 uint8_t ram_code_flags[(8 * 1024)/128/8];
72 uint32_t int_enable_cycle; 72 uint32_t int_enable_cycle;
73 z80_run_fun run; 73 uint16_t pc;
74 uint16_t pc;
75 uint32_t int_pulse_start; 74 uint32_t int_pulse_start;
76 uint32_t int_pulse_end; 75 uint32_t int_pulse_end;
77 uint8_t breakpoint_flags[(16 * 1024)/sizeof(uint8_t)]; 76 uint8_t breakpoint_flags[(16 * 1024)/sizeof(uint8_t)];
78 uint8_t * bp_handler; 77 uint8_t * bp_handler;
79 uint8_t * bp_stub; 78 uint8_t * bp_stub;
80 uint8_t * interp_code[256]; 79 uint8_t * interp_code[256];
81 80 uint8_t reset;
81 uint8_t busreq;
82 uint8_t busack;
82 } z80_context; 83 } z80_context;
83 84
84 void translate_z80_stream(z80_context * context, uint32_t address); 85 void translate_z80_stream(z80_context * context, uint32_t address);
85 void init_z80_opts(z80_options * options, memmap_chunk const * chunks, uint32_t num_chunks, uint32_t clock_divider); 86 void init_z80_opts(z80_options * options, memmap_chunk const * chunks, uint32_t num_chunks, uint32_t clock_divider);
86 void init_z80_context(z80_context * context, z80_options * options); 87 void init_z80_context(z80_context * context, z80_options * options);
87 code_ptr z80_get_native_address(z80_context * context, uint32_t address); 88 code_ptr z80_get_native_address(z80_context * context, uint32_t address);
88 code_ptr z80_get_native_address_trans(z80_context * context, uint32_t address); 89 code_ptr z80_get_native_address_trans(z80_context * context, uint32_t address);
89 z80_context * z80_handle_code_write(uint32_t address, z80_context * context); 90 z80_context * z80_handle_code_write(uint32_t address, z80_context * context);
90 void z80_run(z80_context * context);
91 void z80_reset(z80_context * context); 91 void z80_reset(z80_context * context);
92 void zinsert_breakpoint(z80_context * context, uint16_t address, uint8_t * bp_handler); 92 void zinsert_breakpoint(z80_context * context, uint16_t address, uint8_t * bp_handler);
93 void zremove_breakpoint(z80_context * context, uint16_t address); 93 void zremove_breakpoint(z80_context * context, uint16_t address);
94 void z80_run(z80_context * context, uint32_t target_cycle);
95 void z80_assert_reset(z80_context * context, uint32_t cycle);
96 void z80_clear_reset(z80_context * context, uint32_t cycle);
97 void z80_assert_busreq(z80_context * context, uint32_t cycle);
98 void z80_clear_busreq(z80_context * context, uint32_t cycle);
99 uint8_t z80_get_busack(z80_context * context, uint32_t cycle);
100 void z80_adjust_cycles(z80_context * context, uint32_t deduction);
101 //to be provided by system code
102 void z80_next_int_pulse(z80_context * z_context);
94 103
95 #endif //Z80_TO_X86_H_ 104 #endif //Z80_TO_X86_H_
96 105