void MDDBG_CPUHook(void) //uint32 PC, uint16 op) { uint32 PC = C68k_Get_PC(&Main68K); std::vector<MD_BPOINT>::iterator bpit; FoundBPoint = 0; for(bpit = BreakPointsPC.begin(); bpit != BreakPointsPC.end(); bpit++) { if(PC >= bpit->A[0] && PC <= bpit->A[1]) { FoundBPoint = TRUE; break; } } if(BPNonPCActive) { MD_HackyHackyMode++; C68k_Copy_State2(&Main68K, &Main68K_BP); //printf("Moo: %08x\n", C68k_Get_PC(&Main68K_BP)); //, (int)(((uint8 *)&(Main68K.dirty1)) - ((uint8 *)&(Main68K.D[0])))); C68k_Exec(&Main68K_BP); MD_HackyHackyMode--; } if(FoundBPoint) BPCallB(PC); if(DriverCPUHook) DriverCPUHook(PC); }
void NESDBG_TestFoundBPoint(void) { if(FoundBPoint) { BPCallB(X.PC); } FoundBPoint = 0; }
static void CPUHandler(uint32 PC) { std::vector<PCFX_BPOINT>::iterator bpit; for(bpit = BreakPointsPC.begin(); bpit != BreakPointsPC.end(); bpit++) { if(PC >= bpit->A[0] && PC <= bpit->A[1]) { FoundBPoint = TRUE; break; } } fx_vdc_chips[0]->ResetSimulate(); fx_vdc_chips[1]->ResetSimulate(); PCFX_V810.CheckBreakpoints(PCFXDBG_CheckBP, mem_peekhword, NULL); // FIXME: mem_peekword if(PCFX_LoggingOn) { // FIXME: There is a little race condition if a user turns on logging right between jump instruction and the first // instruction at 0xFFF0000C, in which case the call-from address will be wrong. static uint32 lastPC = ~0; if(PC == 0xFFF0000C) { static const char *font_sizes[6] = { "KANJI16x16", "KANJI12x12", "ANK8x16", "ANK6x12", "ANK8x8", "ANK8x12" }; // FIXME, overflow possible and speed PCFXDBG_DoLog("ROMFONT", "0x%08x->0xFFF0000C, PR7=0x%08x=%s, PR6=0x%04x = %s", lastPC, PCFX_V810.GetPR(7), (PCFX_V810.GetPR(7) > 5) ? "?" : font_sizes[PCFX_V810.GetPR(7)], PCFX_V810.GetPR(6) & 0xFFFF, PCFXDBG_ShiftJIS_to_UTF8(PCFX_V810.GetPR(6) & 0xFFFF)); setvbuf(stdout, NULL, _IONBF, 0); printf("%s", PCFXDBG_ShiftJIS_to_UTF8(PCFX_V810.GetPR(6) & 0xFFFF)); } else if(PC == 0xFFF00008) DoSyscallLog(); lastPC = PC; } if(FoundBPoint) { BPCallB(PC); FoundBPoint = 0; } if(CPUHook) CPUHook(PC); }
static void CPUHandler(uint32 PC) { std::vector<WSWAN_BPOINT>::iterator bpit; if(!FoundBPoint) for(bpit = BreakPointsPC.begin(); bpit != BreakPointsPC.end(); bpit++) { if(PC >= bpit->A[0] && PC <= bpit->A[1]) { BPCallB(PC); break; } } if(FoundBPoint) { BPCallB(PC); FoundBPoint = 0; } if(CPUHook) CPUHook(PC); }