comparison z80_to_x86.h @ 235:d9bf8e61c33c

Get Z80 core working for simple programs
author Mike Pavone <pavone@retrodev.com>
date Thu, 25 Apr 2013 21:01:11 -0700
parents 4d4559b04c59
children 2586d49ddd46
comparison
equal deleted inserted replaced
234:f456ee23d372 235:d9bf8e61c33c
14 ZF_S, 14 ZF_S,
15 ZF_NUM 15 ZF_NUM
16 }; 16 };
17 17
18 typedef struct { 18 typedef struct {
19 uint32_t flags; 19 uint8_t * cur_code;
20 int8_t regs[Z80_UNUSED]; 20 uint8_t * code_end;
21 deferred_addr * deferred;
22 uint32_t flags;
23 int8_t regs[Z80_UNUSED];
21 } x86_z80_options; 24 } x86_z80_options;
22 25
23 typedef struct { 26 typedef struct {
24 void * native_pc; 27 void * native_pc;
25 uint16_t sp; 28 uint16_t sp;
26 uint8_t flags[ZF_NUM]; 29 uint8_t flags[ZF_NUM];
27 uint16_t bank_reg; 30 uint16_t bank_reg;
28 uint8_t regs[Z80_A+1]; 31 uint8_t regs[Z80_A+1];
29 uint8_t alt_regs[Z80_A+1]; 32 uint8_t alt_regs[Z80_A+1];
33 uint32_t target_cycle;
34 uint32_t current_cycle;
30 uint8_t * mem_pointers[ZNUM_MEM_AREAS]; 35 uint8_t * mem_pointers[ZNUM_MEM_AREAS];
31 native_map_slot * native_code_map; 36 native_map_slot * static_code_map;
32 void * options 37 native_map_slot * banked_code_map;
38 void * options;
33 void * next_context; 39 void * next_context;
34 } z80_context; 40 } z80_context;
35 41
36 void translate_z80_stream(z80_context * context, uint16_t address); 42 void translate_z80_stream(z80_context * context, uint32_t address);
43 void init_x86_z80_opts(x86_z80_options * options);
44 void init_z80_context(z80_context * context, x86_z80_options * options);
45 uint8_t * z80_get_native_address(z80_context * context, uint32_t address);
46 void z80_run(z80_context * context);
47 void z80_reset(z80_context * context);
37 48
38 #endif //Z80_TO_X86_H_ 49 #endif //Z80_TO_X86_H_
39 50