57871462 |
1 | #define NEW_DYNAREC 1 |
2 | |
0b1633d7 |
3 | #define MAXBLOCK 2048 // in mips instructions |
4 | |
0ff8c62c |
5 | #define NDHACK_NO_SMC_CHECK (1<<0) |
6 | #define NDHACK_GTE_UNNEEDED (1<<1) |
7 | #define NDHACK_GTE_NO_FLAGS (1<<2) |
a3203cf4 |
8 | #define NDHACK_OVERRIDE_CYCLE_M (1<<3) |
32631e6a |
9 | #define NDHACK_NO_STALLS (1<<4) |
24058131 |
10 | #define NDHACK_NO_COMPAT_HACKS (1<<5) |
0b1633d7 |
11 | #define NDHACK_THREAD_FORCE (1<<6) |
12 | #define NDHACK_THREAD_FORCE_ON (1<<7) |
13 | |
14 | struct ndrc_globals |
15 | { |
16 | int hacks; |
17 | int hacks_pergame; |
18 | int hacks_old; |
19 | int did_compile; |
20 | int cycle_multiplier_old; |
21 | struct { |
22 | void *handle; |
23 | void *lock; |
24 | void *cond; |
d8f2909e |
25 | void *dirty_start; |
26 | void *dirty_end; |
6994d240 |
27 | unsigned int busy_addr; // 0 is valid, ~0 == none |
0b1633d7 |
28 | int exit; |
0b1633d7 |
29 | } thread; |
30 | }; |
31 | extern struct ndrc_globals ndrc_g; |
0ff8c62c |
32 | |
919981d0 |
33 | void new_dynarec_init(void); |
34 | void new_dynarec_cleanup(void); |
35 | void new_dynarec_clear_full(void); |
03f55e6b |
36 | int new_dynarec_save_blocks(void *save, int size); |
37 | void new_dynarec_load_blocks(const void *save, int size); |
ece032e6 |
38 | void new_dynarec_print_stats(void); |
4b421010 |
39 | |
0b1633d7 |
40 | int new_dynarec_quick_check_range(unsigned int start, unsigned int end); |
104df9d3 |
41 | void new_dynarec_invalidate_range(unsigned int start, unsigned int end); |
42 | void new_dynarec_invalidate_all_pages(void); |
d8f2909e |
43 | void new_dyna_clear_cache(void *start, void *end); |
0b1633d7 |
44 | |
45 | void new_dyna_start(void *context); |
46 | void new_dyna_start_at(void *context, void *compiled_code); |
47 | |
ea5c2d78 |
48 | struct ht_entry; |
0b1633d7 |
49 | enum ndrc_compile_mode { |
50 | ndrc_cm_no_compile = 0, |
51 | ndrc_cm_compile_live, // from executing code, vaddr is the current pc |
52 | ndrc_cm_compile_offline, |
53 | ndrc_cm_compile_in_thread, |
54 | }; |
ea5c2d78 |
55 | void *ndrc_get_addr_ht_param(struct ht_entry *ht, unsigned int vaddr, |
56 | enum ndrc_compile_mode compile_mode); |
0b1633d7 |
57 | |
58 | extern unsigned int ndrc_smrv_regs[32]; |