DynarecCodeEntry* DYNACALL bm_GetCode(u32 addr) { //rdv_FailedToFindBlock_pc=addr; DynarecCodeEntry* rv=FPCA(addr); return rv; }
void bm_AddBlock(RuntimeBlockInfo* blk) { /* if (IsOnRam(blk->addr) && PageIsConst(blk->addr)) { blocks_page[(blk->addr&RAM_MASK)/PAGE_SIZE].push_back(blk); } */ all_blocks.push_back(blk); if (blkmap.find(blk)!=blkmap.end()) { printf("DUP: %08X %08X %08X %08X\n", (*blkmap.find(blk))->addr,(*blkmap.find(blk))->code,blk->addr,blk->code); verify(false); } blkmap.insert(blk); verify(bm_GetCode(blk->addr)==ngen_FailedToFindBlock); FPCA(blk->addr)=blk->code; #ifdef DYNA_OPROF if (oprofHandle) { char fname[512]; sprintf(fname,"sh4:%08X,c:%d,s:%d,h:%d",blk->addr,blk->guest_cycles,blk->guest_opcodes,blk->host_opcodes); if (op_write_native_code(oprofHandle, fname, (uint64_t)blk->code, (void*)blk->code, blk->host_code_size) != 0) { printf("op_write_native_code error\n"); } } #endif }
DynarecCodeEntryPtr DYNACALL bm_GetCode(u32 addr) { //rdv_FailedToFindBlock_pc=addr; DynarecCodeEntryPtr rv=(DynarecCodeEntryPtr)FPCA(addr); return (DynarecCodeEntryPtr)rv; }
void bm_Rebuild() { return; void RASDASD(); RASDASD(); blkmap.clear(); std::sort(all_blocks.begin(),all_blocks.end(),UDgreaterLOC); for(int i=0;i<all_blocks.size();i++) { bool do_opts=((all_blocks[i]->addr&0x3FFFFFFF)>0x0C010100); if (all_blocks[i]->staging_runs<0 && do_opts) { //#if HOST_OS==OS_WINDOWS //constprop(all_blocks[i]); //#endif } ngen_Compile(all_blocks[i],false,false,all_blocks[i]->staging_runs>0,do_opts); blkmap.insert(all_blocks[i]); verify(bm_GetBlock((RuntimeBlockInfo*)all_blocks[i]->code)==all_blocks[i]); FPCA(all_blocks[i]->addr)=all_blocks[i]->code; } for(int i=0;i<all_blocks.size();i++) { all_blocks[i]->Relink(); } rebuild_counter=30; }