aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2011-02-04 15:10:07 +0200
committernotaz2011-02-04 15:11:59 +0200
commitfd99c4154af2d13702f499360f69756b1dfc48a4 (patch)
tree78d4c8caa8435bde99a65c0c85d01b603128895a
parenta46e46276eb2b6162a101cdc72b6db2d039dba2b (diff)
downloadpcsx_rearmed-fd99c4154af2d13702f499360f69756b1dfc48a4.tar.gz
pcsx_rearmed-fd99c4154af2d13702f499360f69756b1dfc48a4.tar.bz2
pcsx_rearmed-fd99c4154af2d13702f499360f69756b1dfc48a4.zip
drc: handle dummy reads in inline_readstub
-rw-r--r--libpcsxcore/new_dynarec/assem_arm.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/libpcsxcore/new_dynarec/assem_arm.c b/libpcsxcore/new_dynarec/assem_arm.c
index 9c5d1089..976aac8 100644
--- a/libpcsxcore/new_dynarec/assem_arm.c
+++ b/libpcsxcore/new_dynarec/assem_arm.c
@@ -2659,8 +2659,11 @@ inline_readstub(int type, int i, u_int addr, signed char regmap[], int target, i
int rs=get_reg(regmap,target);
int rth=get_reg(regmap,target|64);
int rt=get_reg(regmap,target);
+ // allow for PCSX dummy reads
+ //assert(rt>=0);
+ if(rs<0)
+ rs=get_reg(regmap,-1);
assert(rs>=0);
- assert(rt>=0);
int ftable=0;
if(type==LOADB_STUB||type==LOADBU_STUB)
ftable=(int)readmemb;
@@ -2673,6 +2676,8 @@ inline_readstub(int type, int i, u_int addr, signed char regmap[], int target, i
ftable=(int)readmemd;
#endif
assert(ftable!=0);
+ if(target==0)
+ emit_movimm(addr,rs);
emit_writeword(rs,(int)&address);
//emit_pusha();
save_regs(reglist);
@@ -2706,19 +2711,21 @@ inline_readstub(int type, int i, u_int addr, signed char regmap[], int target, i
}
//emit_popa();
restore_regs(reglist);
- if(type==LOADB_STUB)
- emit_movsbl((int)&readmem_dword,rt);
- if(type==LOADBU_STUB)
- emit_movzbl((int)&readmem_dword,rt);
- if(type==LOADH_STUB)
- emit_movswl((int)&readmem_dword,rt);
- if(type==LOADHU_STUB)
- emit_movzwl((int)&readmem_dword,rt);
- if(type==LOADW_STUB)
- emit_readword((int)&readmem_dword,rt);
- if(type==LOADD_STUB) {
- emit_readword((int)&readmem_dword,rt);
- if(rth>=0) emit_readword(((int)&readmem_dword)+4,rth);
+ if(rt>=0) {
+ if(type==LOADB_STUB)
+ emit_movsbl((int)&readmem_dword,rt);
+ if(type==LOADBU_STUB)
+ emit_movzbl((int)&readmem_dword,rt);
+ if(type==LOADH_STUB)
+ emit_movswl((int)&readmem_dword,rt);
+ if(type==LOADHU_STUB)
+ emit_movzwl((int)&readmem_dword,rt);
+ if(type==LOADW_STUB)
+ emit_readword((int)&readmem_dword,rt);
+ if(type==LOADD_STUB) {
+ emit_readword((int)&readmem_dword,rt);
+ if(rth>=0) emit_readword(((int)&readmem_dword)+4,rth);
+ }
}
}