output_w32(0xe5900000|rd_rn_rm(rt,15,0));
}
+#ifdef HAVE_ARMV7
static void emit_movw(u_int imm,u_int rt)
{
assert(imm<65536);
assem_debug("movt %s,#%d (0x%x)\n",regname[rt],imm&0xffff0000,imm&0xffff0000);
output_w32(0xe3400000|rd_rn_rm(rt,0,0)|((imm>>16)&0xfff)|((imm>>12)&0xf0000));
}
+#endif
static void emit_movimm(u_int imm,u_int rt)
{
if((r&63)==0)
emit_zeroreg(hr);
else {
- int addr = (int)&psxRegs.GPR.r[r];
+ void *addr;
switch (r) {
//case HIREG: addr = &hi; break;
//case LOREG: addr = &lo; break;
- case CCREG: addr = (int)&cycle_count; break;
- case CSREG: addr = (int)&Status; break;
- case INVCP: addr = (int)&invc_ptr; break;
- case ROREG: addr = (int)&ram_offset; break;
- default: assert(r < 34); break;
+ case CCREG: addr = &cycle_count; break;
+ case CSREG: addr = &Status; break;
+ case INVCP: addr = &invc_ptr; break;
+ case ROREG: addr = &ram_offset; break;
+ default:
+ assert(r < 34);
+ addr = &psxRegs.GPR.r[r];
+ break;
}
- u_int offset = addr-(u_int)&dynarec_local;
+ u_int offset = (u_char *)addr - (u_char *)&dynarec_local;
assert(offset<4096);
assem_debug("ldr %s,fp+%d\n",regname[hr],offset);
output_w32(0xe5900000|rd_rn_rm(hr,FP,0)|offset);
}
#else
if(cv==3&&shift)
- emit_far_call((int)gteMVMVA_part_cv3sh12_arm);
+ emit_far_call(gteMVMVA_part_cv3sh12_arm);
else {
emit_movimm(shift,1);
- emit_far_call((int)(need_flags?gteMVMVA_part_arm:gteMVMVA_part_nf_arm));
+ emit_far_call(need_flags?gteMVMVA_part_arm:gteMVMVA_part_nf_arm);
}
if(need_flags||need_ir)
c2op_call_MACtoIR(lm,need_flags);
if (r == 0)
emit_zeroreg(hr);
else {
- void *addr = &psxRegs.GPR.r[r];
+ void *addr;
switch (r) {
//case HIREG: addr = &hi; break;
//case LOREG: addr = &lo; break;
case CSREG: addr = &Status; break;
case INVCP: addr = &invc_ptr; is64 = 1; break;
case ROREG: addr = &ram_offset; is64 = 1; break;
- default: assert(r < 34); break;
+ default:
+ assert(r < 34);
+ addr = &psxRegs.GPR.r[r];
+ break;
}
if (is64)
emit_readdword(addr, hr);
spu.pSpuBuffer = (unsigned char *)malloc(32768); // alloc mixing buffer
spu.SSumLR = calloc(NSSIZE * 2, sizeof(spu.SSumLR[0]));
- spu.XAStart = // alloc xa buffer
- (uint32_t *)malloc(44100 * sizeof(uint32_t));
+ spu.XAStart = malloc(44100 * sizeof(uint32_t)); // alloc xa buffer
spu.XAEnd = spu.XAStart + 44100;
spu.XAPlay = spu.XAStart;
spu.XAFeed = spu.XAStart;
- spu.CDDAStart = // alloc cdda buffer
- (uint32_t *)malloc(CDDA_BUFFER_SIZE);
+ spu.CDDAStart = malloc(CDDA_BUFFER_SIZE); // alloc cdda buffer
spu.CDDAEnd = spu.CDDAStart + 16384;
spu.CDDAPlay = spu.CDDAStart;
spu.CDDAFeed = spu.CDDAStart;