Mercurial > repos > blastem
annotate x86_backend.h @ 335:14a937097c2b
Some Z80 interrupt fixes
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 14 May 2013 21:59:56 -0700 |
parents | 7b8a49220e3b |
children | 467bfa17004a |
rev | line source |
---|---|
211 | 1 #ifndef X86_BACKEND_H_ |
2 #define X86_BACKEND_H_ | |
3 | |
235
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
4 #include <stdint.h> |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
5 |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
6 #define INVALID_OFFSET 0xFFFFFFFF |
252
63b9a500a00b
Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents:
235
diff
changeset
|
7 #define EXTENSION_WORD 0xFFFFFFFE |
235
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
8 |
211 | 9 typedef struct { |
10 int32_t disp; | |
11 uint8_t mode; | |
12 uint8_t base; | |
13 uint8_t index; | |
14 uint8_t cycles; | |
15 } x86_ea; | |
16 | |
17 typedef struct { | |
18 uint8_t *base; | |
19 int32_t *offsets; | |
20 } native_map_slot; | |
21 | |
235
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
22 typedef struct deferred_addr { |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
23 struct deferred_addr *next; |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
24 uint8_t *dest; |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
25 uint32_t address; |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
26 } deferred_addr; |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
27 |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
28 typedef uint8_t * (*native_addr_func)(void * context, uint32_t address); |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
29 |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
30 deferred_addr * defer_address(deferred_addr * old_head, uint32_t address, uint8_t *dest); |
282
7b8a49220e3b
Remove deferred address entries from abandoned translations inside z80_retrans_inst
Mike Pavone <pavone@retrodev.com>
parents:
252
diff
changeset
|
31 void remove_deferred_until(deferred_addr **head_ptr, deferred_addr * remove_to); |
235
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
32 void process_deferred(deferred_addr ** head_ptr, void * context, native_addr_func get_native); |
d9bf8e61c33c
Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents:
211
diff
changeset
|
33 |
211 | 34 #endif //X86_BACKEND_H_ |
35 |