From: notaz Date: Fri, 14 Jan 2011 10:14:05 +0000 (+0200) Subject: drc: rework bios fastboot hack a bit X-Git-Tag: r4~14 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ad4d757bdb3bc5081e0cdaa534a04a1371de0b3;p=pcsx_rearmed.git drc: rework bios fastboot hack a bit it was not handling reloads/resets well. --- diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index 347fd3dd..6061f51e 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -385,9 +385,6 @@ void *get_addr(u_int vaddr) //printf("TRACE: count=%d next=%d (get_addr no-match %x)\n",Count,next_interupt,vaddr); int r=new_recompile_block(vaddr); if(r==0) return get_addr(vaddr); -#ifdef PCSX - return (void *)r; -#else // Execute in unmapped page, generate pagefault execption Status|=2; Cause=(vaddr<<31)|0x8; @@ -396,7 +393,6 @@ void *get_addr(u_int vaddr) Context=(Context&0xFF80000F)|((BadVAddr>>9)&0x007FFFF0); EntryHi=BadVAddr&0xFFFFE000; return get_addr_ht(0x80000000); -#endif } // Look up address in hash table first void *get_addr_ht(u_int vaddr) @@ -7747,8 +7743,7 @@ int new_recompile_block(int addr) start = (u_int)addr&~3; //assert(((u_int)addr&1)==0); #ifdef PCSX - if ((Config.HLE && start == 0x80001000) || // hlecall - (/*psxRegs.pc != 0x80030000 &&*/ start == 0x80030000)) // fastbios thing + if (Config.HLE && start == 0x80001000) // hlecall { // XXX: is this enough? Maybe check hleSoftCall? u_int beginning=(u_int)out; @@ -7760,10 +7755,7 @@ int new_recompile_block(int addr) #ifdef __arm__ __clear_cache((void *)beginning,out); #endif - if (start == 0x80030000) - return beginning; - else - ll_add(jump_in+page,start,(void *)beginning); + ll_add(jump_in+page,start,(void *)beginning); return 0; } else if ((u_int)addr < 0x00200000 || @@ -10515,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