Core: Allow sending thread requests to a crashed core (fixes #2785)

This commit is contained in:
Vicki Pfau 2023-01-28 22:39:00 -08:00
parent 17322e50b8
commit d29e782789
2 changed files with 13 additions and 1 deletions

View File

@ -2,6 +2,7 @@
Emulation fixes:
- GBA Memory: Make VRAM access stalls only apply to BG RAM
Other fixes:
- Core: Allow sending thread requests to a crashed core (fixes mgba.io/i/2785)
- Qt: Fix crash when attempting to use OpenGL 2.1 to 3.1 (fixes mgba.io/i/2794)
- Qt: Disable sync while running scripts from main thread (fixes mgba.io/i/2738)
Misc:

View File

@ -58,8 +58,19 @@ static void _waitOnInterrupt(struct mCoreThreadInternal* threadContext) {
}
static void _pokeRequest(struct mCoreThreadInternal* threadContext) {
if (threadContext->state == mTHREAD_RUNNING || threadContext->state == mTHREAD_PAUSED) {
switch (threadContext->state) {
case mTHREAD_RUNNING:
case mTHREAD_PAUSED:
case mTHREAD_CRASHED:
threadContext->state = mTHREAD_REQUEST;
break;
case mTHREAD_INITIALIZED:
case mTHREAD_REQUEST:
case mTHREAD_INTERRUPTED:
case mTHREAD_INTERRUPTING:
case mTHREAD_EXITING:
case mTHREAD_SHUTDOWN:
break;
}
}