mirror of https://github.com/mgba-emu/mgba.git
GBA: Exit cleanly on FATAL if the port supports it
This commit is contained in:
parent
6bb61bc670
commit
802e4b8720
1
CHANGES
1
CHANGES
|
@ -11,6 +11,7 @@ Bugfixes:
|
||||||
- GBA Memory: Don't call into GPIO write calls if GPIO devices are absent
|
- GBA Memory: Don't call into GPIO write calls if GPIO devices are absent
|
||||||
Misc:
|
Misc:
|
||||||
- Qt: Disable sync to video by default
|
- Qt: Disable sync to video by default
|
||||||
|
- GBA: Exit cleanly on FATAL if the port supports it
|
||||||
|
|
||||||
0.1.0: (2014-12-13)
|
0.1.0: (2014-12-13)
|
||||||
- Initial release
|
- Initial release
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "util/memory.h"
|
#include "util/memory.h"
|
||||||
|
|
||||||
static uint32_t _popcount32(unsigned bits);
|
static uint32_t _popcount32(unsigned bits);
|
||||||
|
static uint32_t _deadbeef = 0xDEADBEEF;
|
||||||
|
|
||||||
static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t region);
|
static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t region);
|
||||||
static void GBAMemoryServiceDMA(struct GBA* gba, int number, struct GBADMA* info);
|
static void GBAMemoryServiceDMA(struct GBA* gba, int number, struct GBADMA* info);
|
||||||
|
@ -157,7 +158,7 @@ static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t address) {
|
||||||
cpu->memory.activeMask = SIZE_CART0 - 1;
|
cpu->memory.activeMask = SIZE_CART0 - 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cpu->memory.activeRegion = 0;
|
cpu->memory.activeRegion = &_deadbeef;
|
||||||
cpu->memory.activeMask = 0;
|
cpu->memory.activeMask = 0;
|
||||||
GBALog(gba, GBA_LOG_FATAL, "Jumped to invalid address");
|
GBALog(gba, GBA_LOG_FATAL, "Jumped to invalid address");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -357,7 +357,9 @@ void GBAThreadEnd(struct GBAThread* threadContext) {
|
||||||
threadContext->debugger->state = DEBUGGER_EXITING;
|
threadContext->debugger->state = DEBUGGER_EXITING;
|
||||||
}
|
}
|
||||||
threadContext->state = THREAD_EXITING;
|
threadContext->state = THREAD_EXITING;
|
||||||
threadContext->gba->cpu->halted = false;
|
if (threadContext->gba) {
|
||||||
|
threadContext->gba->cpu->halted = false;
|
||||||
|
}
|
||||||
ConditionWake(&threadContext->stateCond);
|
ConditionWake(&threadContext->stateCond);
|
||||||
MutexUnlock(&threadContext->stateMutex);
|
MutexUnlock(&threadContext->stateMutex);
|
||||||
MutexLock(&threadContext->sync.audioBufferMutex);
|
MutexLock(&threadContext->sync.audioBufferMutex);
|
||||||
|
|
Loading…
Reference in New Issue