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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
211
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1 #ifndef X86_BACKEND_H_
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2 #define X86_BACKEND_H_
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
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
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
9 typedef struct {
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
10 int32_t disp;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
11 uint8_t mode;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12 uint8_t base;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 uint8_t index;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14 uint8_t cycles;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
15 } x86_ea;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
16
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
17 typedef struct {
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
18 uint8_t *base;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
19 int32_t *offsets;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
20 } native_map_slot;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
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
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
34 #endif //X86_BACKEND_H_
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
35