diff --git a/Frameworks/lazyusf/lazyusf/interpreter_cpu.c b/Frameworks/lazyusf/lazyusf/interpreter_cpu.c index f0f3f9c4d..605f65490 100644 --- a/Frameworks/lazyusf/lazyusf/interpreter_cpu.c +++ b/Frameworks/lazyusf/lazyusf/interpreter_cpu.c @@ -46,45 +46,45 @@ void (* R4300i_CoP1_W[64])(usf_state_t *); void (* R4300i_CoP1_L[64])(usf_state_t *); void R4300i_opcode_SPECIAL (usf_state_t * state) { - ((void (*)()) R4300i_Special[ state->Opcode.u.e.funct ])(state); + R4300i_Special[ state->Opcode.u.e.funct ](state); } void R4300i_opcode_REGIMM (usf_state_t * state) { - ((void (*)()) R4300i_Regimm[ state->Opcode.u.b.rt ])(state); + R4300i_Regimm[ state->Opcode.u.b.rt ](state); } void R4300i_opcode_COP0 (usf_state_t * state) { - ((void (*)()) R4300i_CoP0[ state->Opcode.u.b.rs ])(state); + R4300i_CoP0[ state->Opcode.u.b.rs ](state); } void R4300i_opcode_COP0_CO (usf_state_t * state) { - ((void (*)()) R4300i_CoP0_Function[ state->Opcode.u.e.funct ])(state); + R4300i_CoP0_Function[ state->Opcode.u.e.funct ](state); } void R4300i_opcode_COP1 (usf_state_t * state) { - ((void (*)()) R4300i_CoP1[ state->Opcode.u.f.fmt ])(state); + R4300i_CoP1[ state->Opcode.u.f.fmt ](state); } void R4300i_opcode_COP1_BC (usf_state_t * state) { - ((void (*)()) R4300i_CoP1_BC[ state->Opcode.u.f.ft ])(state); + R4300i_CoP1_BC[ state->Opcode.u.f.ft ](state); } void R4300i_opcode_COP1_S (usf_state_t * state) { // controlfp(RoundingModel); - ((void (*)()) R4300i_CoP1_S[ state->Opcode.u.e.funct ])(state); + R4300i_CoP1_S[ state->Opcode.u.e.funct ](state); } void R4300i_opcode_COP1_D (usf_state_t * state) { // controlfp(RoundingModel); - ((void (*)()) R4300i_CoP1_D[ state->Opcode.u.e.funct ])(state); + R4300i_CoP1_D[ state->Opcode.u.e.funct ](state); } void R4300i_opcode_COP1_W (usf_state_t * state) { - ((void (*)()) R4300i_CoP1_W[ state->Opcode.u.e.funct ])(state); + R4300i_CoP1_W[ state->Opcode.u.e.funct ](state); } void R4300i_opcode_COP1_L (usf_state_t * state) { - ((void (*)()) R4300i_CoP1_L[ state->Opcode.u.e.funct ])(state); + R4300i_CoP1_L[ state->Opcode.u.e.funct ](state); } diff --git a/Frameworks/lazyusf/lazyusf/rsp/su.h b/Frameworks/lazyusf/lazyusf/rsp/su.h index fd4177821..dd15a47b5 100644 --- a/Frameworks/lazyusf/lazyusf/rsp/su.h +++ b/Frameworks/lazyusf/lazyusf/rsp/su.h @@ -75,14 +75,6 @@ void set_PC(usf_state_t * state, int address) #define SE(x, b) (-(x & (1 << b)) | (x & ~(~0 << b))) #define ZE(x, b) (+(x & (1 << b)) | (x & ~(~0 << b))) -static union { - unsigned char B[4]; - signed char SB[4]; - unsigned short H[2]; - signed short SH[2]; - unsigned W: 32; -} SR_temp; - extern void ULW(usf_state_t *, int rd, uint32_t addr); extern void USW(usf_state_t *, int rs, uint32_t addr); @@ -1507,6 +1499,13 @@ INLINE static void STV(usf_state_t * state, int vt, int element, int offset, int /*** Modern pseudo-operations (not real instructions, but nice shortcuts) ***/ void ULW(usf_state_t * state, int rd, uint32_t addr) { /* "Unaligned Load Word" */ + union { + unsigned char B[4]; + signed char SB[4]; + unsigned short H[2]; + signed short SH[2]; + unsigned W: 32; + } SR_temp; if (addr & 0x00000001) { SR_temp.B[03] = state->DMEM[BES(addr)]; @@ -1529,6 +1528,13 @@ void ULW(usf_state_t * state, int rd, uint32_t addr) } void USW(usf_state_t * state, int rs, uint32_t addr) { /* "Unaligned Store Word" */ + union { + unsigned char B[4]; + signed char SB[4]; + unsigned short H[2]; + signed short SH[2]; + unsigned W: 32; + } SR_temp; SR_temp.W = state->SR[rs]; if (addr & 0x00000001) {