X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fnew_dynarec%2Fnew_dynarec.c;h=f8a67ff9fb6ab5e1b3f1a89649189cfecb2e93d7;hp=f7f19c5fe024375b36027c982caee682546b4bd9;hb=f5b13bdc7678f786f16ef25c1499555ddbc51321;hpb=f18c0f46b9aabbbb7fc71cdbd308b6523adcb759 diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index f7f19c5f..f8a67ff9 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -408,7 +408,7 @@ void *get_addr_32(u_int vaddr,u_int flags) { #ifdef FORCE32 return get_addr(vaddr); -#endif +#else //printf("TRACE: count=%d next=%d (get_addr_32 %x,flags %x)\n",Count,next_interupt,vaddr,flags); int *ht_bin=hash_table[((vaddr>>16)^vaddr)&0xFFFF]; if(ht_bin[0]==vaddr) return (void *)ht_bin[1]; @@ -488,6 +488,7 @@ void *get_addr_32(u_int vaddr,u_int flags) Context=(Context&0xFF80000F)|((BadVAddr>>9)&0x007FFFF0); EntryHi=BadVAddr&0xFFFFE000; return get_addr_ht(0x80000000); +#endif } void clear_all_regs(signed char regmap[]) @@ -3691,7 +3692,7 @@ void mov_assemble(int i,struct regstat *i_regs) { //if(opcode2[i]==0x10||opcode2[i]==0x12) { // MFHI/MFLO //if(opcode2[i]==0x11||opcode2[i]==0x13) { // MTHI/MTLO - assert(rt1[i]>0); + //assert(rt1[i]>0); if(rt1[i]) { signed char sh,sl,th,tl; th=get_reg(i_regs->regmap,rt1[i]|64); @@ -7742,11 +7743,11 @@ int new_recompile_block(int addr) start = (u_int)addr&~3; //assert(((u_int)addr&1)==0); #ifdef PCSX - if (Config.HLE && start == 0x80001000) { + if (Config.HLE && start == 0x80001000) // hlecall + { // XXX: is this enough? Maybe check hleSoftCall? u_int beginning=(u_int)out; u_int page=get_page(start); - ll_add(jump_in+page,start,out); invalid_code[start>>12]=0; emit_movimm(start,0); emit_writeword(0,(int)&pcaddr); @@ -7754,12 +7755,21 @@ int new_recompile_block(int addr) #ifdef __arm__ __clear_cache((void *)beginning,out); #endif + ll_add(jump_in+page,start,(void *)beginning); return 0; } - else if ((u_int)addr < 0x00200000) { + else if ((u_int)addr < 0x00200000 || + (0xa0000000 <= addr && addr < 0xa0200000)) { // used for BIOS calls mostly? - source = (u_int *)((u_int)rdram+start-0); - pagelimit = 0x00200000; + source = (u_int *)((u_int)rdram+(start&0x1fffff)); + pagelimit = (addr&0xa0000000)|0x00200000; + } + else if (!Config.HLE && ( +/* (0x9fc00000 <= addr && addr < 0x9fc80000) ||*/ + (0xbfc00000 <= addr && addr < 0xbfc80000))) { + // BIOS + source = (u_int *)((u_int)psxR+(start&0x7ffff)); + pagelimit = (addr&0xfff00000)|0x80000; } else #endif @@ -7794,7 +7804,7 @@ int new_recompile_block(int addr) else { assem_debug("Compile at unmapped memory address: %x \n", (int)addr); //assem_debug("start: %x next: %x\n",memory_map[start>>12],memory_map[(start+4096)>>12]); - return 1; // Caller will invoke exception handler + return -1; // Caller will invoke exception handler } //printf("source= %x\n",(int)source); } @@ -10497,6 +10507,19 @@ int new_recompile_block(int addr) ds=1; pagespan_ds(); } + u_int instr_addr0_override=0; + +#ifdef PCSX + if (start == 0x80030000) { + // nasty hack for fastbios thing + instr_addr0_override=(u_int)out; + emit_movimm(start,0); + emit_readword((int)&pcaddr,1); + emit_writeword(0,(int)&pcaddr); + emit_cmp(0,1); + emit_jne((int)new_dyna_leave); + } +#endif for(i=0;i