X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flightrec%2Flightrec.h;h=0798b581c760076938676f95d255a3e2800a4f35;hb=82d049361e59ca58ebf85d17b8a2324a2a9181a3;hp=4f51e1f6aa34189c39222cd4a64db95e5825e397;hpb=02487de7ff9fcbb6d7d692a6b3ae6e6539708abc;p=pcsx_rearmed.git diff --git a/deps/lightrec/lightrec.h b/deps/lightrec/lightrec.h index 4f51e1f6..0798b581 100644 --- a/deps/lightrec/lightrec.h +++ b/deps/lightrec/lightrec.h @@ -28,6 +28,21 @@ extern "C" { # define __api #endif +#ifndef __cnst +# ifdef __GNUC__ +# define __cnst __attribute__((const)) +# else +# define __cnst +# endif +#endif +#ifndef __pure +# ifdef __GNUC__ +# define __pure __attribute__((pure)) +# else +# define __pure +# endif +#endif + typedef uint64_t u64; typedef uint32_t u32; typedef uint16_t u16; @@ -47,6 +62,7 @@ struct lightrec_mem_map; #define LIGHTREC_EXIT_BREAK (1 << 1) #define LIGHTREC_EXIT_SYSCALL (1 << 2) #define LIGHTREC_EXIT_SEGFAULT (1 << 3) +#define LIGHTREC_EXIT_NOMEM (1 << 4) enum psx_map { PSX_MAP_KERNEL_USER_RAM, @@ -59,6 +75,7 @@ enum psx_map { PSX_MAP_MIRROR2, PSX_MAP_MIRROR3, PSX_MAP_CODE_BUFFER, + PSX_MAP_PPORT_MIRROR, PSX_MAP_UNKNOWN, }; @@ -84,8 +101,11 @@ struct lightrec_mem_map { }; struct lightrec_ops { + void (*cop2_notify)(struct lightrec_state *state, u32 op, u32 data); void (*cop2_op)(struct lightrec_state *state, u32 op); void (*enable_ram)(struct lightrec_state *state, _Bool enable); + _Bool (*hw_direct)(u32 kaddr, _Bool is_write, u8 size); + void (*code_inv)(void *addr, u32 len); }; struct lightrec_registers { @@ -104,8 +124,8 @@ __api void lightrec_destroy(struct lightrec_state *state); __api u32 lightrec_execute(struct lightrec_state *state, u32 pc, u32 target_cycle); -__api u32 lightrec_execute_one(struct lightrec_state *state, u32 pc); -__api u32 lightrec_run_interpreter(struct lightrec_state *state, u32 pc); +__api u32 lightrec_run_interpreter(struct lightrec_state *state, + u32 pc, u32 target_cycle); __api void lightrec_invalidate(struct lightrec_state *state, u32 addr, u32 len); __api void lightrec_invalidate_all(struct lightrec_state *state); @@ -115,7 +135,8 @@ __api void lightrec_set_invalidate_mode(struct lightrec_state *state, __api void lightrec_set_exit_flags(struct lightrec_state *state, u32 flags); __api u32 lightrec_exit_flags(struct lightrec_state *state); -__api struct lightrec_registers * lightrec_get_registers(struct lightrec_state *state); +__api __cnst struct lightrec_registers * +lightrec_get_registers(struct lightrec_state *state); __api u32 lightrec_current_cycle_count(const struct lightrec_state *state); __api void lightrec_reset_cycle_count(struct lightrec_state *state, u32 cycles);