comparison z80_to_x86.h @ 252:63b9a500a00b

Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
author Mike Pavone <pavone@retrodev.com>
date Mon, 29 Apr 2013 21:46:48 -0700
parents df8a36bf5e1d
children 2989ed7b8608
comparison
equal deleted inserted replaced
251:4a7ac10ac2d9 252:63b9a500a00b
2 #define Z80_TO_X86_H_ 2 #define Z80_TO_X86_H_
3 #include "z80inst.h" 3 #include "z80inst.h"
4 #include "x86_backend.h" 4 #include "x86_backend.h"
5 5
6 #define ZNUM_MEM_AREAS 4 6 #define ZNUM_MEM_AREAS 4
7 #define ZMAX_NATIVE_SIZE 128
7 8
8 enum { 9 enum {
9 ZF_C = 0, 10 ZF_C = 0,
10 ZF_N, 11 ZF_N,
11 ZF_PV, 12 ZF_PV,
16 }; 17 };
17 18
18 typedef struct { 19 typedef struct {
19 uint8_t * cur_code; 20 uint8_t * cur_code;
20 uint8_t * code_end; 21 uint8_t * code_end;
22 uint8_t *ram_inst_sizes;
21 deferred_addr * deferred; 23 deferred_addr * deferred;
22 uint32_t flags; 24 uint32_t flags;
23 int8_t regs[Z80_UNUSED]; 25 int8_t regs[Z80_UNUSED];
24 } x86_z80_options; 26 } x86_z80_options;
25 27
44 uint32_t int_cycle; 46 uint32_t int_cycle;
45 native_map_slot * static_code_map; 47 native_map_slot * static_code_map;
46 native_map_slot * banked_code_map; 48 native_map_slot * banked_code_map;
47 void * options; 49 void * options;
48 void * next_context; 50 void * next_context;
51 uint8_t ram_code_flags[(8 * 1024)/128/8];
49 } z80_context; 52 } z80_context;
50 53
51 void translate_z80_stream(z80_context * context, uint32_t address); 54 void translate_z80_stream(z80_context * context, uint32_t address);
52 void init_x86_z80_opts(x86_z80_options * options); 55 void init_x86_z80_opts(x86_z80_options * options);
53 void init_z80_context(z80_context * context, x86_z80_options * options); 56 void init_z80_context(z80_context * context, x86_z80_options * options);