X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fnew_dynarec%2Fnew_dynarec.c;h=f597646283b8a9c957f10902fbaac42fafc89063;hb=bc7c5acb6eb1ac9adc6b4381a2c2b2baffd5aebe;hp=2673a6ea93ca7c5f76f1d6993a28049b3a7623d3;hpb=d75460620efa21df695967c72a92265dac04001f;p=pcsx_rearmed.git diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index 2673a6ea..f5976462 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -242,6 +242,7 @@ static struct decoded_insn } dops[MAXBLOCK]; static u_char *out; + static char invalid_code[0x100000]; static struct ht_entry hash_table[65536]; static struct block_info *blocks[PAGE_COUNT]; static struct jump_info *jumps[PAGE_COUNT]; @@ -783,7 +784,7 @@ static void noinline *get_addr(u_int vaddr, int can_compile) return ndrc_get_addr_ht(vaddr); // generate an address error - psxRegs.CP0.n.Status |= 2; + psxRegs.CP0.n.SR |= 2; psxRegs.CP0.n.Cause = (vaddr<<31) | (4<<2); psxRegs.CP0.n.EPC = (vaddr&1) ? vaddr-5 : vaddr; psxRegs.CP0.n.BadVAddr = vaddr & ~1; @@ -3558,11 +3559,11 @@ static void cop0_assemble(int i, const struct regstat *i_regs, int ccadj_) assert(dops[i].opcode2==0x10); //if((source[i]&0x3f)==0x10) // RFE { - emit_readword(&psxRegs.CP0.n.Status,0); + emit_readword(&psxRegs.CP0.n.SR,0); emit_andimm(0,0x3c,1); emit_andimm(0,~0xf,0); emit_orrshr_imm(1,2,0); - emit_writeword(0,&psxRegs.CP0.n.Status); + emit_writeword(0,&psxRegs.CP0.n.SR); } } } @@ -3605,7 +3606,7 @@ static void do_cop1stub(int n) //else {printf("fp exception in delay slot\n");} wb_dirtys(i_regs->regmap_entry,i_regs->wasdirty); if(regs[i].regmap_entry[HOST_CCREG]!=CCREG) emit_loadreg(CCREG,HOST_CCREG); - emit_movimm(start+(i-ds)*4,EAX); // Get PC + emit_movimm(start+(i-ds)*4,0); // Get PC emit_addimm(HOST_CCREG,ccadj[i],HOST_CCREG); // CHECK: is this right? There should probably be an extra cycle... emit_far_jump(ds?fp_exception_ds:fp_exception); } @@ -4131,6 +4132,7 @@ static void call_c_cpu_handler(int i, const struct regstat *i_regs, int ccadj_, emit_addimm(HOST_CCREG,ccadj_,HOST_CCREG); emit_add(2,HOST_CCREG,2); emit_writeword(2,&psxRegs.cycle); + emit_addimm_ptr(FP,(u_char *)&psxRegs - (u_char *)&dynarec_local,0); emit_far_call(func); emit_far_jump(jump_to_new_pc); } @@ -4148,9 +4150,14 @@ static void syscall_assemble(int i, const struct regstat *i_regs, int ccadj_) emit_far_jump(func); } +static void hlecall_bad() +{ + SysPrintf("bad hlecall\n"); +} + static void hlecall_assemble(int i, const struct regstat *i_regs, int ccadj_) { - void *hlefunc = gteNULL; + void *hlefunc = hlecall_bad; uint32_t hleCode = source[i] & 0x03ffffff; if (hleCode < ARRAY_SIZE(psxHLEt)) hlefunc = psxHLEt[hleCode]; @@ -5071,8 +5078,8 @@ static void do_ccstub(int n) if(stubs[n].c!=-1) { // Save PC as return address - emit_movimm(stubs[n].c,EAX); - emit_writeword(EAX,&pcaddr); + emit_movimm(stubs[n].c,0); + emit_writeword(0,&pcaddr); } else {