X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fnew_dynarec%2Fnew_dynarec.h;h=d18ff63090e378b5da2593a6f6fc0565f9698e8c;hp=d139052fdb680c9622b7e4e15777f677b4f25992;hb=HEAD;hpb=7139f3c8070e9aa14fd36c2451d7f10079caa37a diff --git a/libpcsxcore/new_dynarec/new_dynarec.h b/libpcsxcore/new_dynarec/new_dynarec.h index d139052f..0d3a6868 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.h +++ b/libpcsxcore/new_dynarec/new_dynarec.h @@ -1,7 +1,58 @@ #define NEW_DYNAREC 1 -extern int pcaddr; -extern int pending_exception; +#define MAXBLOCK 2048 // in mips instructions -void new_dynarec_init(); -void new_dynarec_cleanup(); +#define NDHACK_NO_SMC_CHECK (1<<0) +#define NDHACK_GTE_UNNEEDED (1<<1) +#define NDHACK_GTE_NO_FLAGS (1<<2) +#define NDHACK_OVERRIDE_CYCLE_M (1<<3) +#define NDHACK_NO_STALLS (1<<4) +#define NDHACK_NO_COMPAT_HACKS (1<<5) +#define NDHACK_THREAD_FORCE (1<<6) +#define NDHACK_THREAD_FORCE_ON (1<<7) + +struct ndrc_globals +{ + int hacks; + int hacks_pergame; + int hacks_old; + int did_compile; + int cycle_multiplier_old; + struct { + void *handle; + void *lock; + void *cond; + void *dirty_start; + void *dirty_end; + unsigned int busy_addr; // 0 is valid, ~0 == none + int exit; + } thread; +}; +extern struct ndrc_globals ndrc_g; + +void new_dynarec_init(void); +void new_dynarec_cleanup(void); +void new_dynarec_clear_full(void); +int new_dynarec_save_blocks(void *save, int size); +void new_dynarec_load_blocks(const void *save, int size); +void new_dynarec_print_stats(void); + +int new_dynarec_quick_check_range(unsigned int start, unsigned int end); +void new_dynarec_invalidate_range(unsigned int start, unsigned int end); +void new_dynarec_invalidate_all_pages(void); +void new_dyna_clear_cache(void *start, void *end); + +void new_dyna_start(void *context); +void new_dyna_start_at(void *context, void *compiled_code); + +struct ht_entry; +enum ndrc_compile_mode { + ndrc_cm_no_compile = 0, + ndrc_cm_compile_live, // from executing code, vaddr is the current pc + ndrc_cm_compile_offline, + ndrc_cm_compile_in_thread, +}; +void *ndrc_get_addr_ht_param(struct ht_entry *ht, unsigned int vaddr, + enum ndrc_compile_mode compile_mode); + +extern unsigned int ndrc_smrv_regs[32];