comparison z80_to_x86.h @ 593:5ef3fe516da9

Z80 core is sort of working again
author Michael Pavone <pavone@retrodev.com>
date Mon, 22 Dec 2014 20:55:10 -0800
parents 4ff7bbb3943b
children 086de8692932
comparison
equal deleted inserted replaced
592:4ff7bbb3943b 593:5ef3fe516da9
19 ZF_Z, 19 ZF_Z,
20 ZF_S, 20 ZF_S,
21 ZF_NUM 21 ZF_NUM
22 }; 22 };
23 23
24 typedef void (*z80_run_fun)(void * context);
25
24 typedef struct { 26 typedef struct {
25 cpu_options gen; 27 cpu_options gen;
26 code_ptr save_context_scratch; 28 code_ptr save_context_scratch;
27 code_ptr load_context_scratch; 29 code_ptr load_context_scratch;
28 code_ptr read_8; 30 code_ptr native_addr;
29 code_ptr write_8; 31 code_ptr retrans_stub;
32 code_ptr do_sync;
33 code_ptr read_8;
34 code_ptr write_8;
30 code_ptr write_8_noinc; 35 code_ptr write_8_noinc;
31 code_ptr read_16; 36 code_ptr read_16;
32 code_ptr write_16_highfirst; 37 code_ptr write_16_highfirst;
33 code_ptr write_16_lowfirst; 38 code_ptr write_16_lowfirst;
39 code_ptr read_io;
40 code_ptr write_io;
34 41
35 uint32_t flags; 42 uint32_t flags;
36 int8_t regs[Z80_UNUSED]; 43 int8_t regs[Z80_UNUSED];
37 int8_t bank_reg; 44 int8_t bank_reg;
38 int8_t bank_pointer; 45 int8_t bank_pointer;
46 z80_run_fun run;
39 } z80_options; 47 } z80_options;
40 48
41 typedef struct { 49 typedef struct {
42 void * native_pc; 50 void * native_pc;
43 uint16_t sp; 51 uint16_t sp;
61 native_map_slot * banked_code_map; 69 native_map_slot * banked_code_map;
62 z80_options * options; 70 z80_options * options;
63 void * system; 71 void * system;
64 uint8_t ram_code_flags[(8 * 1024)/128/8]; 72 uint8_t ram_code_flags[(8 * 1024)/128/8];
65 uint32_t int_enable_cycle; 73 uint32_t int_enable_cycle;
74 z80_run_fun run;
66 uint16_t pc; 75 uint16_t pc;
67 } z80_context; 76 } z80_context;
68 77
69 void translate_z80_stream(z80_context * context, uint32_t address); 78 void translate_z80_stream(z80_context * context, uint32_t address);
70 void init_x86_z80_opts(z80_options * options, memmap_chunk const * chunks, uint32_t num_chunks); 79 void init_x86_z80_opts(z80_options * options, memmap_chunk const * chunks, uint32_t num_chunks);