mirror of https://github.com/mgba-emu/mgba.git
Qt: Attach debugger when attaching scripting controller (fixes #3046)
This commit is contained in:
parent
dca568a0be
commit
6ecc182d7c
|
@ -77,7 +77,7 @@ void ScriptingController::setController(std::shared_ptr<CoreController> controll
|
||||||
CoreController::Interrupter interrupter(m_controller);
|
CoreController::Interrupter interrupter(m_controller);
|
||||||
m_controller->thread()->scriptContext = &m_scriptContext;
|
m_controller->thread()->scriptContext = &m_scriptContext;
|
||||||
if (m_controller->hasStarted()) {
|
if (m_controller->hasStarted()) {
|
||||||
mScriptContextAttachCore(&m_scriptContext, m_controller->thread()->core);
|
attach();
|
||||||
}
|
}
|
||||||
updateVideoScale();
|
updateVideoScale();
|
||||||
connect(m_controller.get(), &CoreController::stopping, this, &ScriptingController::clearController);
|
connect(m_controller.get(), &CoreController::stopping, this, &ScriptingController::clearController);
|
||||||
|
@ -154,7 +154,7 @@ void ScriptingController::reset() {
|
||||||
m_activeEngine = nullptr;
|
m_activeEngine = nullptr;
|
||||||
init();
|
init();
|
||||||
if (m_controller && m_controller->hasStarted()) {
|
if (m_controller && m_controller->hasStarted()) {
|
||||||
mScriptContextAttachCore(&m_scriptContext, m_controller->thread()->core);
|
attach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,6 +298,12 @@ void ScriptingController::updateGamepad() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptingController::attach() {
|
||||||
|
CoreController::Interrupter interrupter(m_controller);
|
||||||
|
mScriptContextAttachCore(&m_scriptContext, m_controller->thread()->core);
|
||||||
|
m_controller->attachDebugger(false);
|
||||||
|
}
|
||||||
|
|
||||||
void ScriptingController::attachGamepad() {
|
void ScriptingController::attachGamepad() {
|
||||||
mScriptGamepad* pad = mScriptContextGamepadLookup(&m_scriptContext, 0);
|
mScriptGamepad* pad = mScriptContextGamepadLookup(&m_scriptContext, 0);
|
||||||
if (pad == &m_gamepad) {
|
if (pad == &m_gamepad) {
|
||||||
|
|
|
@ -67,6 +67,7 @@ protected:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateGamepad();
|
void updateGamepad();
|
||||||
|
void attach();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
|
|
Loading…
Reference in New Issue