mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-22 21:09:52 +00:00
Split Core_EnableStepping into Core_Break and Core_Resume
This commit is contained in:
parent
cbd19c967f
commit
d3e9398cb3
@ -333,26 +333,26 @@ bool Core_Run(GraphicsContext *ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
void Core_EnableStepping(bool step, const char *reason, u32 relatedAddress) {
|
||||
if (step) {
|
||||
// Stop the tracer
|
||||
mipsTracer.stop_tracing();
|
||||
void Core_Break(const char *reason, u32 relatedAddress) {
|
||||
// Stop the tracer
|
||||
mipsTracer.stop_tracing();
|
||||
|
||||
Core_UpdateState(CORE_STEPPING);
|
||||
steppingCounter++;
|
||||
_assert_msg_(reason != nullptr, "No reason specified for break");
|
||||
steppingReason = reason;
|
||||
steppingAddress = relatedAddress;
|
||||
} else {
|
||||
// Clear the exception if we resume.
|
||||
Core_ResetException();
|
||||
coreState = CORE_RUNNING;
|
||||
coreStatePending = false;
|
||||
m_StepCond.notify_all();
|
||||
}
|
||||
Core_UpdateState(CORE_STEPPING);
|
||||
steppingCounter++;
|
||||
_assert_msg_(reason != nullptr, "No reason specified for break");
|
||||
steppingReason = reason;
|
||||
steppingAddress = relatedAddress;
|
||||
System_Notify(SystemNotification::DEBUG_MODE_CHANGE);
|
||||
}
|
||||
|
||||
void Core_Resume() {
|
||||
// Clear the exception if we resume.
|
||||
Core_ResetException();
|
||||
coreState = CORE_RUNNING;
|
||||
coreStatePending = false;
|
||||
m_StepCond.notify_all();
|
||||
}
|
||||
|
||||
bool Core_NextFrame() {
|
||||
if (coreState == CORE_RUNNING) {
|
||||
coreState = CORE_NEXTFRAME;
|
||||
@ -428,7 +428,7 @@ void Core_MemoryException(u32 address, u32 accessSize, u32 pc, MemoryExceptionTy
|
||||
e.accessSize = accessSize;
|
||||
e.stackTrace = stackTrace;
|
||||
e.pc = pc;
|
||||
Core_EnableStepping(true, "memory.exception", address);
|
||||
Core_Break("memory.exception", address);
|
||||
}
|
||||
}
|
||||
|
||||
@ -456,7 +456,7 @@ void Core_MemoryExceptionInfo(u32 address, u32 accessSize, u32 pc, MemoryExcepti
|
||||
e.accessSize = accessSize;
|
||||
e.stackTrace = stackTrace;
|
||||
e.pc = pc;
|
||||
Core_EnableStepping(true, "memory.exception", address);
|
||||
Core_Break("memory.exception", address);
|
||||
}
|
||||
}
|
||||
|
||||
@ -475,10 +475,10 @@ void Core_ExecException(u32 address, u32 pc, ExecExceptionType type) {
|
||||
e.pc = pc;
|
||||
// This just records the closest value that could be useful as reference.
|
||||
e.ra = currentMIPS->r[MIPS_REG_RA];
|
||||
Core_EnableStepping(true, "cpu.exception", address);
|
||||
Core_Break("cpu.exception", address);
|
||||
}
|
||||
|
||||
void Core_Break(u32 pc) {
|
||||
void Core_BreakException(u32 pc) {
|
||||
ERROR_LOG(Log::CPU, "BREAK!");
|
||||
|
||||
MIPSExceptionInfo &e = g_exceptionInfo;
|
||||
@ -488,7 +488,7 @@ void Core_Break(u32 pc) {
|
||||
e.pc = pc;
|
||||
|
||||
if (!g_Config.bIgnoreBadMemAccess) {
|
||||
Core_EnableStepping(true, "cpu.breakInstruction", currentMIPS->pc);
|
||||
Core_Break("cpu.breakInstruction", currentMIPS->pc);
|
||||
}
|
||||
}
|
||||
|
||||
|
29
Core/Core.h
29
Core/Core.h
@ -28,23 +28,36 @@ class GraphicsContext;
|
||||
// called from emu thread
|
||||
void UpdateRunLoop(GraphicsContext *ctx);
|
||||
|
||||
// For platforms that don't call Core_Run
|
||||
void Core_SetGraphicsContext(GraphicsContext *ctx);
|
||||
|
||||
// Returns false when an UI exit state is detected.
|
||||
bool Core_Run(GraphicsContext *ctx);
|
||||
void Core_Stop();
|
||||
|
||||
// For platforms that don't call Core_Run
|
||||
void Core_SetGraphicsContext(GraphicsContext *ctx);
|
||||
/*
|
||||
enum class CPUStepType {
|
||||
None,
|
||||
Into,
|
||||
Over,
|
||||
Out,
|
||||
};
|
||||
*/
|
||||
|
||||
// called from gui
|
||||
void Core_EnableStepping(bool step, const char *reason = nullptr, u32 relatedAddress = 0);
|
||||
// Async, called from gui
|
||||
void Core_Break(const char *reason, u32 relatedAddress = 0);
|
||||
// void Core_Step(CPUStepType type); // CPUStepType::None not allowed
|
||||
void Core_Resume();
|
||||
|
||||
// Refactor.
|
||||
void Core_DoSingleStep();
|
||||
void Core_UpdateSingleStep();
|
||||
void Core_ProcessStepping();
|
||||
|
||||
bool Core_ShouldRunBehind();
|
||||
bool Core_MustRunBehind();
|
||||
|
||||
bool Core_NextFrame();
|
||||
void Core_DoSingleStep();
|
||||
void Core_UpdateSingleStep();
|
||||
void Core_ProcessStepping();
|
||||
|
||||
// Changes every time we enter stepping.
|
||||
int Core_GetSteppingCounter();
|
||||
@ -113,7 +126,7 @@ void Core_MemoryException(u32 address, u32 accessSize, u32 pc, MemoryExceptionTy
|
||||
void Core_MemoryExceptionInfo(u32 address, u32 accessSize, u32 pc, MemoryExceptionType type, std::string_view additionalInfo, bool forceReport);
|
||||
|
||||
void Core_ExecException(u32 address, u32 pc, ExecExceptionType type);
|
||||
void Core_Break(u32 pc);
|
||||
void Core_BreakException(u32 pc);
|
||||
// Call when loading save states, etc.
|
||||
void Core_ResetException();
|
||||
|
||||
|
@ -153,7 +153,7 @@ int RegisterEvent(const char *name, TimedCallback callback) {
|
||||
|
||||
void AntiCrashCallback(u64 userdata, int cyclesLate) {
|
||||
ERROR_LOG(Log::SaveState, "Savestate broken: an unregistered event was called.");
|
||||
Core_EnableStepping(true, "savestate.crash", 0);
|
||||
Core_Break("savestate.crash", 0);
|
||||
}
|
||||
|
||||
void RestoreRegisterEvent(int &event_type, const char *name, TimedCallback callback) {
|
||||
|
@ -75,7 +75,7 @@ BreakAction MemCheck::Action(u32 addr, bool write, int size, u32 pc, const char
|
||||
// Conditions have always already been checked if we get here.
|
||||
Log(addr, write, size, pc, reason);
|
||||
if ((result & BREAK_ACTION_PAUSE) && coreState != CORE_POWERUP) {
|
||||
Core_EnableStepping(true, "memory.breakpoint", start);
|
||||
Core_Break("memory.breakpoint", start);
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -331,7 +331,7 @@ BreakAction CBreakPoints::ExecBreakPoint(u32 addr) {
|
||||
}
|
||||
}
|
||||
if ((info.result & BREAK_ACTION_PAUSE) && coreState != CORE_POWERUP) {
|
||||
Core_EnableStepping(true, "cpu.breakpoint", info.addr);
|
||||
Core_Break("cpu.breakpoint", info.addr);
|
||||
}
|
||||
|
||||
return info.result;
|
||||
@ -653,7 +653,7 @@ void CBreakPoints::Update(u32 addr) {
|
||||
if (MIPSComp::jit && addr != -1) {
|
||||
bool resume = false;
|
||||
if (Core_IsStepping() == false) {
|
||||
Core_EnableStepping(true, "cpu.breakpoint.update", addr);
|
||||
Core_Break("cpu.breakpoint.update", addr);
|
||||
Core_WaitInactive(200);
|
||||
resume = true;
|
||||
}
|
||||
@ -665,7 +665,7 @@ void CBreakPoints::Update(u32 addr) {
|
||||
mipsr4k.ClearJitCache();
|
||||
|
||||
if (resume)
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
|
||||
if (anyMemChecks_ && addr != -1)
|
||||
|
@ -71,7 +71,7 @@ void WebSocketCPUStepping(DebuggerRequest &req) {
|
||||
return req.Fail("CPU not started");
|
||||
}
|
||||
if (!Core_IsStepping() && Core_IsActive()) {
|
||||
Core_EnableStepping(true, "cpu.stepping", 0);
|
||||
Core_Break("cpu.stepping", 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ void WebSocketCPUResume(DebuggerRequest &req) {
|
||||
if (currentMIPS->inDelaySlot) {
|
||||
Core_DoSingleStep();
|
||||
}
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
|
||||
// Request the current CPU status (cpu.status)
|
||||
|
@ -64,7 +64,7 @@ static AutoDisabledReplacements LockMemoryAndCPU(uint32_t addr, bool keepReplace
|
||||
if (Core_IsStepping()) {
|
||||
result.wasStepping = true;
|
||||
} else {
|
||||
Core_EnableStepping(true, "memory.access", addr);
|
||||
Core_Break("memory.access", addr);
|
||||
Core_WaitInactive();
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ AutoDisabledReplacements::~AutoDisabledReplacements() {
|
||||
RestoreSavedReplacements(replacements);
|
||||
}
|
||||
if (!wasStepping)
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
delete lock;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ void WebSocketSteppingState::Into(DebuggerRequest &req) {
|
||||
if (!currentDebugMIPS->isAlive())
|
||||
return req.Fail("CPU not started");
|
||||
if (!Core_IsStepping()) {
|
||||
Core_EnableStepping(true, "cpu.stepInto", 0);
|
||||
Core_Break("cpu.stepInto", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ void WebSocketSteppingState::Into(DebuggerRequest &req) {
|
||||
if (cpuDebug != currentDebugMIPS) {
|
||||
CBreakPoints::AddBreakPoint(breakpointAddress, true);
|
||||
AddThreadCondition(breakpointAddress, threadID);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -173,7 +173,7 @@ void WebSocketSteppingState::Over(DebuggerRequest &req) {
|
||||
CBreakPoints::AddBreakPoint(breakpointAddress, true);
|
||||
if (cpuDebug != currentDebugMIPS)
|
||||
AddThreadCondition(breakpointAddress, threadID);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
}
|
||||
|
||||
@ -222,7 +222,7 @@ void WebSocketSteppingState::Out(DebuggerRequest &req) {
|
||||
CBreakPoints::AddBreakPoint(breakpointAddress, true);
|
||||
if (cpuDebug != currentDebugMIPS)
|
||||
AddThreadCondition(breakpointAddress, threadID);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,7 +248,7 @@ void WebSocketSteppingState::RunUntil(DebuggerRequest &req) {
|
||||
// We may have arrived already if PauseResume() stepped out of a delay slot.
|
||||
if (currentMIPS->pc != address || wasAtAddress) {
|
||||
CBreakPoints::AddBreakPoint(address, true);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@ void WebSocketSteppingState::HLE(DebuggerRequest &req) {
|
||||
|
||||
PrepareResume();
|
||||
hleDebugBreak();
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
|
||||
uint32_t WebSocketSteppingState::GetNextAddress(DebugInterface *cpuDebug) {
|
||||
|
@ -361,7 +361,7 @@ bool hleExecuteDebugBreak(const HLEFunction &func)
|
||||
return false;
|
||||
}
|
||||
|
||||
Core_EnableStepping(true, "hle.step", latestSyscallPC);
|
||||
Core_Break("hle.step", latestSyscallPC);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,7 @@ void Arm64JitBackend::CompIR_System(IRInst inst) {
|
||||
RestoreRoundingMode(true);
|
||||
SaveStaticRegisters();
|
||||
MovFromPC(W0);
|
||||
QuickCallFunction(SCRATCH2_64, &Core_Break);
|
||||
QuickCallFunction(SCRATCH2_64, &Core_BreakException);
|
||||
LoadStaticRegisters();
|
||||
ApplyRoundingMode(true);
|
||||
MovFromPC(SCRATCH1);
|
||||
|
@ -1196,7 +1196,7 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst) {
|
||||
break;
|
||||
|
||||
case IROp::Break:
|
||||
Core_Break(mips->pc);
|
||||
Core_BreakException(mips->pc);
|
||||
return mips->pc + 4;
|
||||
|
||||
case IROp::Breakpoint:
|
||||
|
@ -178,7 +178,7 @@ namespace MIPSInt
|
||||
void Int_Break(MIPSOpcode op)
|
||||
{
|
||||
Reporting::ReportMessage("BREAK instruction hit");
|
||||
Core_Break(PC);
|
||||
Core_BreakException(PC);
|
||||
PC += 4;
|
||||
}
|
||||
|
||||
|
@ -1004,7 +1004,7 @@ static void RunUntilWithChecks(u64 globalTicks) {
|
||||
if (hasBPs && CBreakPoints::IsAddressBreakPoint(curMips->pc) && CBreakPoints::CheckSkipFirst() != curMips->pc) {
|
||||
auto cond = CBreakPoints::GetBreakPointCondition(currentMIPS->pc);
|
||||
if (!cond || cond->Evaluate()) {
|
||||
Core_EnableStepping(true, "cpu.breakpoint", curMips->pc);
|
||||
Core_Break("cpu.breakpoint", curMips->pc);
|
||||
if (CBreakPoints::IsTempBreakPoint(curMips->pc))
|
||||
CBreakPoints::RemoveBreakPoint(curMips->pc);
|
||||
break;
|
||||
|
@ -232,7 +232,7 @@ void RiscVJitBackend::CompIR_System(IRInst inst) {
|
||||
RestoreRoundingMode(true);
|
||||
SaveStaticRegisters();
|
||||
MovFromPC(X10);
|
||||
QuickCallFunction(&Core_Break, SCRATCH2);
|
||||
QuickCallFunction(&Core_BreakException, SCRATCH2);
|
||||
LoadStaticRegisters();
|
||||
ApplyRoundingMode(true);
|
||||
MovFromPC(SCRATCH1);
|
||||
|
@ -109,7 +109,7 @@ static void JitBranchLogMismatch(MIPSOpcode op, u32 pc)
|
||||
char temp[256];
|
||||
MIPSDisAsm(op, pc, temp, sizeof(temp), true);
|
||||
ERROR_LOG(Log::JIT, "Bad jump: %s - int:%08x jit:%08x", temp, currentMIPS->intBranchExit, currentMIPS->jitBranchExit);
|
||||
Core_EnableStepping(true, "jit.branchdebug", pc);
|
||||
Core_Break("jit.branchdebug", pc);
|
||||
}
|
||||
|
||||
void Jit::BranchLog(MIPSOpcode op)
|
||||
|
@ -255,7 +255,7 @@ void X64JitBackend::CompIR_System(IRInst inst) {
|
||||
RestoreRoundingMode(true);
|
||||
SaveStaticRegisters();
|
||||
MovFromPC(SCRATCH1);
|
||||
ABI_CallFunctionR((const void *)&Core_Break, SCRATCH1);
|
||||
ABI_CallFunctionR((const void *)&Core_BreakException, SCRATCH1);
|
||||
LoadStaticRegisters();
|
||||
ApplyRoundingMode(true);
|
||||
MovFromPC(SCRATCH1);
|
||||
|
@ -554,7 +554,7 @@ static void raintegration_event_handler(const rc_client_raintegration_event_t *e
|
||||
break;
|
||||
case RC_CLIENT_RAINTEGRATION_EVENT_PAUSE:
|
||||
// The toolkit has hit a breakpoint and wants to pause the emulator. Do so.
|
||||
Core_EnableStepping(true, "ra_breakpoint");
|
||||
Core_Break("ra_breakpoint");
|
||||
break;
|
||||
case RC_CLIENT_RAINTEGRATION_EVENT_HARDCORE_CHANGED:
|
||||
// Hardcore mode has been changed (either directly by the user, or disabled through the use of the tools).
|
||||
|
@ -426,7 +426,7 @@ namespace SaveState
|
||||
{
|
||||
rewindStates.NotifyState();
|
||||
if (coreState == CoreState::CORE_RUNTIME_ERROR)
|
||||
Core_EnableStepping(true, "savestate.load", 0);
|
||||
Core_Break("savestate.load", 0);
|
||||
Enqueue(Operation(SAVESTATE_LOAD, filename, slot, callback, cbUserData));
|
||||
}
|
||||
|
||||
@ -434,7 +434,7 @@ namespace SaveState
|
||||
{
|
||||
rewindStates.NotifyState();
|
||||
if (coreState == CoreState::CORE_RUNTIME_ERROR)
|
||||
Core_EnableStepping(true, "savestate.save", 0);
|
||||
Core_Break("savestate.save", 0);
|
||||
Enqueue(Operation(SAVESTATE_SAVE, filename, slot, callback, cbUserData));
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ namespace SaveState
|
||||
void Rewind(Callback callback, void *cbUserData)
|
||||
{
|
||||
if (coreState == CoreState::CORE_RUNTIME_ERROR)
|
||||
Core_EnableStepping(true, "savestate.rewind", 0);
|
||||
Core_Break("savestate.rewind", 0);
|
||||
Enqueue(Operation(SAVESTATE_REWIND, Path(), -1, callback, cbUserData));
|
||||
}
|
||||
|
||||
|
@ -438,10 +438,10 @@ void OSXOpenURL(const char *url) {
|
||||
std::shared_ptr<I18NCategory> developerUILocalization = GetI18NCategory(I18NCat::DEVELOPER);
|
||||
#define DEVELOPERUI_LOCALIZED(key) @(developerUILocalization->T_cstr(key))
|
||||
if (Core_IsStepping()) {
|
||||
Core_EnableStepping(false, "ui.break");
|
||||
Core_Resume();
|
||||
item.title = DESKTOPUI_LOCALIZED("Break");
|
||||
} else {
|
||||
Core_EnableStepping(true, "ui.break");
|
||||
Core_Break("ui.break", 0);
|
||||
item.title = DEVELOPERUI_LOCALIZED("Resume");
|
||||
}
|
||||
}
|
||||
@ -452,7 +452,7 @@ void OSXOpenURL(const char *url) {
|
||||
|
||||
-(void)resetAction: (NSMenuItem *)item {
|
||||
System_PostUIMessage(UIMessage::REQUEST_GAME_RESET);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
|
||||
-(void)chatAction: (NSMenuItem *)item {
|
||||
|
@ -843,7 +843,7 @@ static void ProcessSDLEvent(SDL_Window *window, const SDL_Event &event, InputSta
|
||||
if (ctrl && (k == SDLK_w))
|
||||
{
|
||||
if (Core_IsStepping())
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
Core_Stop();
|
||||
System_PostUIMessage(UIMessage::REQUEST_GAME_STOP);
|
||||
// NOTE: Unlike Windows version, this
|
||||
@ -854,7 +854,7 @@ static void ProcessSDLEvent(SDL_Window *window, const SDL_Event &event, InputSta
|
||||
if (ctrl && (k == SDLK_b))
|
||||
{
|
||||
System_PostUIMessage(UIMessage::REQUEST_GAME_RESET);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -118,7 +118,7 @@ static void __EmuScreenVblank()
|
||||
if (frameStep_ && lastNumFlips != gpuStats.numFlips)
|
||||
{
|
||||
frameStep_ = false;
|
||||
Core_EnableStepping(true, "ui.frameAdvance", 0);
|
||||
Core_Break("ui.frameAdvance", 0);
|
||||
lastNumFlips = gpuStats.numFlips;
|
||||
}
|
||||
#ifndef MOBILE_DEVICE
|
||||
@ -495,7 +495,7 @@ static void AfterSaveStateAction(SaveState::Status status, std::string_view mess
|
||||
|
||||
static void AfterStateBoot(SaveState::Status status, std::string_view message, void *ignored) {
|
||||
AfterSaveStateAction(status, message, ignored);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
System_Notify(SystemNotification::DISASSEMBLY);
|
||||
}
|
||||
|
||||
@ -658,7 +658,7 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
|
||||
case VIRTKEY_FASTFORWARD:
|
||||
if (down) {
|
||||
if (coreState == CORE_STEPPING) {
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
PSP_CoreParameter().fastForward = true;
|
||||
} else {
|
||||
@ -1452,10 +1452,10 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
|
||||
// If game is running, pause emulation immediately. Otherwise, advance a single frame.
|
||||
if (Core_IsStepping()) {
|
||||
frameStep_ = true;
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
} else if (!frameStep_) {
|
||||
lastNumFlips = gpuStats.numFlips;
|
||||
Core_EnableStepping(true, "ui.frameAdvance", 0);
|
||||
Core_Break("ui.frameAdvance", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -918,7 +918,7 @@ UI::ViewGroup *CreatePadLayout(float xres, float yres, bool *pause, bool showPau
|
||||
fastForward->SetAngle(180.0f);
|
||||
fastForward->OnChange.Add([](UI::EventParams &e) {
|
||||
if (e.a && coreState == CORE_STEPPING) {
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
|
@ -427,7 +427,7 @@ void CtrlMemView::onChar(WPARAM wParam, LPARAM lParam) {
|
||||
|
||||
bool active = Core_IsActive();
|
||||
if (active)
|
||||
Core_EnableStepping(true, "memory.access", curAddress_);
|
||||
Core_Break("memory.access", curAddress_);
|
||||
|
||||
if (asciiSelected_) {
|
||||
Memory::WriteUnchecked_U8((u8)wParam, curAddress_);
|
||||
@ -452,7 +452,7 @@ void CtrlMemView::onChar(WPARAM wParam, LPARAM lParam) {
|
||||
|
||||
Reporting::NotifyDebugger();
|
||||
if (active)
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
|
||||
void CtrlMemView::redraw() {
|
||||
|
@ -286,7 +286,7 @@ void CDisasm::stepOver()
|
||||
}
|
||||
|
||||
CBreakPoints::AddBreakPoint(breakpointAddress,true);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
Sleep(1);
|
||||
ptr->gotoAddr(breakpointAddress);
|
||||
UpdateDialog();
|
||||
@ -322,7 +322,7 @@ void CDisasm::stepOut() {
|
||||
ptr->setDontRedraw(true);
|
||||
|
||||
CBreakPoints::AddBreakPoint(breakpointAddress,true);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
Sleep(1);
|
||||
ptr->gotoAddr(breakpointAddress);
|
||||
UpdateDialog();
|
||||
@ -340,7 +340,7 @@ void CDisasm::runToLine()
|
||||
lastTicks = CoreTiming::GetTicks();
|
||||
ptr->setDontRedraw(true);
|
||||
CBreakPoints::AddBreakPoint(pos,true);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
|
||||
BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
@ -418,7 +418,7 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
bool isRunning = Core_IsActive();
|
||||
if (isRunning)
|
||||
{
|
||||
Core_EnableStepping(true, "cpu.breakpoint.add", 0);
|
||||
Core_Break("cpu.breakpoint.add", 0);
|
||||
Core_WaitInactive(200);
|
||||
}
|
||||
|
||||
@ -426,7 +426,7 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if (bpw.exec()) bpw.addBreakpoint();
|
||||
|
||||
if (isRunning)
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
view->UnlockPosition();
|
||||
keepStatusBarText = false;
|
||||
}
|
||||
@ -519,7 +519,7 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if (!Core_IsStepping()) // stop
|
||||
{
|
||||
ptr->setDontRedraw(false);
|
||||
Core_EnableStepping(true, "ui.break", 0);
|
||||
Core_Break("ui.break", 0);
|
||||
Sleep(1); //let cpu catch up
|
||||
ptr->gotoPC();
|
||||
UpdateDialog();
|
||||
@ -529,7 +529,7 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
// If the current PC is on a breakpoint, the user doesn't want to do nothing.
|
||||
CBreakPoints::SetSkipFirst(currentMIPS->pc);
|
||||
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -556,7 +556,7 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
CBreakPoints::SetSkipFirst(currentMIPS->pc);
|
||||
|
||||
hleDebugBreak();
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -82,7 +82,7 @@ INT_PTR CALLBACK DumpMemoryWindow::dlgFunc(HWND hwnd, UINT iMsg, WPARAM wParam,
|
||||
bool priorDumpWasStepping = Core_IsStepping();
|
||||
if (!priorDumpWasStepping && PSP_IsInited()) {
|
||||
// If emulator isn't paused force paused state, but wait before locking.
|
||||
Core_EnableStepping(true, "memory.access", bp->start);
|
||||
Core_Break("memory.access", bp->start);
|
||||
Core_WaitInactive();
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ INT_PTR CALLBACK DumpMemoryWindow::dlgFunc(HWND hwnd, UINT iMsg, WPARAM wParam,
|
||||
fclose(output);
|
||||
if (!priorDumpWasStepping) {
|
||||
// If emulator wasn't paused before memory dump resume emulation automatically.
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
|
||||
MessageBoxA(hwnd, "Done.", "Information", MB_OK);
|
||||
|
@ -285,7 +285,7 @@ void MainThreadFunc() {
|
||||
if (g_Config.bBrowse)
|
||||
PostMessage(MainWindow::GetHWND(), WM_COMMAND, ID_FILE_LOAD, 0);
|
||||
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
|
||||
if (useEmuThread) {
|
||||
while (emuThreadState != (int)EmuThreadState::DISABLED) {
|
||||
|
@ -841,10 +841,15 @@ namespace MainWindow
|
||||
}
|
||||
if (!noFocusPause && g_Config.bPauseOnLostFocus && GetUIState() == UISTATE_INGAME) {
|
||||
if (pause != Core_IsStepping()) {
|
||||
if (disasmWindow)
|
||||
if (disasmWindow) {
|
||||
SendMessage(disasmWindow->GetDlgHandle(), WM_COMMAND, IDC_STOPGO, 0);
|
||||
else
|
||||
Core_EnableStepping(pause, "ui.lost_focus", 0);
|
||||
} else {
|
||||
if (pause) {
|
||||
Core_Break("ui.lost_focus", 0);
|
||||
} else {
|
||||
Core_Resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1018,7 +1023,7 @@ namespace MainWindow
|
||||
if (DragQueryFile(hdrop, 0, filename, ARRAY_SIZE(filename)) != 0) {
|
||||
const std::string utf8_filename = ReplaceAll(ConvertWStringToUTF8(filename), "\\", "/");
|
||||
System_PostUIMessage(UIMessage::REQUEST_GAME_BOOT, utf8_filename);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
}
|
||||
DragFinish(hdrop);
|
||||
|
@ -330,7 +330,7 @@ namespace MainWindow {
|
||||
if (GetUIState() == UISTATE_INGAME) {
|
||||
browsePauseAfter = Core_IsStepping();
|
||||
if (!browsePauseAfter)
|
||||
Core_EnableStepping(true, "ui.boot", 0);
|
||||
Core_Break("ui.boot", 0);
|
||||
}
|
||||
auto mm = GetI18NCategory(I18NCat::MAINMENU);
|
||||
|
||||
@ -349,7 +349,7 @@ namespace MainWindow {
|
||||
|
||||
void BrowseAndBootDone(std::string filename) {
|
||||
if (GetUIState() == UISTATE_INGAME || GetUIState() == UISTATE_EXCEPTION || GetUIState() == UISTATE_PAUSEMENU) {
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
}
|
||||
filename = ReplaceAll(filename, "\\", "/");
|
||||
System_PostUIMessage(UIMessage::REQUEST_GAME_BOOT, filename);
|
||||
@ -475,12 +475,12 @@ namespace MainWindow {
|
||||
if (disasmWindow)
|
||||
SendMessage(disasmWindow->GetDlgHandle(), WM_COMMAND, IDC_STOPGO, 0);
|
||||
else
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
} else {
|
||||
if (disasmWindow)
|
||||
SendMessage(disasmWindow->GetDlgHandle(), WM_COMMAND, IDC_STOPGO, 0);
|
||||
else
|
||||
Core_EnableStepping(true, "ui.break", 0);
|
||||
Core_Break("ui.break", 0);
|
||||
}
|
||||
noFocusPause = !noFocusPause; // If we pause, override pause on lost focus
|
||||
break;
|
||||
@ -491,7 +491,7 @@ namespace MainWindow {
|
||||
|
||||
case ID_EMULATION_STOP:
|
||||
if (Core_IsStepping())
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
|
||||
Core_Stop();
|
||||
System_PostUIMessage(UIMessage::REQUEST_GAME_STOP);
|
||||
@ -500,7 +500,7 @@ namespace MainWindow {
|
||||
|
||||
case ID_EMULATION_RESET:
|
||||
System_PostUIMessage(UIMessage::REQUEST_GAME_RESET);
|
||||
Core_EnableStepping(false);
|
||||
Core_Resume();
|
||||
break;
|
||||
|
||||
case ID_EMULATION_SWITCH_UMD:
|
||||
|
Loading…
Reference in New Issue
Block a user