diff options
Diffstat (limited to 'arm')
-rw-r--r-- | arm/arm_emit.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/arm/arm_emit.h b/arm/arm_emit.h index db894d1..bfd1c49 100644 --- a/arm/arm_emit.h +++ b/arm/arm_emit.h @@ -21,7 +21,10 @@ #define ARM_EMIT_H #include "arm_codegen.h" - +#if defined(VITA) +#define VITA_RW_INIT sceKernelOpenVMDomain +#define VITA_RW_END sceKernelCloseVMDomain +#endif u32 arm_update_gba_arm(u32 pc); u32 arm_update_gba_thumb(u32 pc); u32 arm_update_gba_idle_arm(u32 pc); @@ -46,9 +49,11 @@ void execute_swi_thumb(u32 pc); void execute_store_u32_safe(u32 address, u32 source); #define write32(value) \ + VITA_RW_INIT(); \ *((u32 *)translation_ptr) = value; \ - translation_ptr += 4 \ - + translation_ptr += 4; \ + VITA_RW_END() \ + #define arm_relative_offset(source, offset) \ (((((u32)offset - (u32)source) - 8) >> 2) & 0xFFFFFF) \ @@ -404,12 +409,17 @@ u32 arm_disect_imm_32bit(u32 imm, u32 *stores, u32 *rotations) cycle_count = 0 \ #define generate_branch_patch_conditional(dest, offset) \ + VITA_RW_INIT(); \ *((u32 *)(dest)) = (*((u32 *)dest) & 0xFF000000) | \ - arm_relative_offset(dest, offset) \ + arm_relative_offset(dest, offset); \ + VITA_RW_END(); \ + #define generate_branch_patch_unconditional(dest, offset) \ + VITA_RW_INIT(); \ *((u32 *)(dest)) = (*((u32 *)dest) & 0xFF000000) | \ - arm_relative_offset(dest, offset) \ + arm_relative_offset(dest, offset); \ + VITA_RW_END(); \ // A different function is called for idle updates because of the relative // location of the embedded PC. The idle version could be optimized to put @@ -1931,4 +1941,3 @@ void execute_swi_hle_div_c() generate_indirect_branch_no_cycle_update(type) \ #endif - |