GBA BIOS: Crash on BIOS misuse if hardCrash is enabled
Vicki Pfau vi@endrift.com
Sun, 19 Nov 2017 07:43:43 -0800
3 files changed,
10 insertions(+),
2 deletions(-)
M
src/core/thread.c
→
src/core/thread.c
@@ -623,6 +623,10 @@ UNUSED(level);
printf("%s: ", mLogCategoryName(category)); vprintf(format, args); printf("\n"); + struct mCoreThread* thread = mCoreThreadGet(); + if (thread && level == mLOG_FATAL) { + mCoreThreadMarkCrashed(thread); + } } struct mLogger* mCoreThreadLogger(void) {
M
src/gba/bios.c
→
src/gba/bios.c
@@ -531,7 +531,11 @@ disp = dest - (block & 0x0FFF) - 1;
bytes = (block >> 12) + 3; while (bytes--) { if (!remaining) { - mLOG(GBA_BIOS, GAME_ERROR, "Improperly compressed LZ77 data. Real BIOS would hang."); + if (gba->hardCrash) { + mLOG(GBA_BIOS, FATAL, "Improperly compressed LZ77 data. Real BIOS would hang."); + } else { + mLOG(GBA_BIOS, GAME_ERROR, "Improperly compressed LZ77 data. Real BIOS would hang."); + } break; } --remaining;
M
src/platform/qt/LogController.cpp
→
src/platform/qt/LogController.cpp
@@ -13,7 +13,7 @@ LogController::LogController(int levels, QObject* parent)
: QObject(parent) { mLogFilterInit(&m_filter); - mLogFilterSet(&m_filter, "gba.bios", mLOG_STUB); + mLogFilterSet(&m_filter, "gba.bios", mLOG_STUB | mLOG_FATAL); mLogFilterSet(&m_filter, "core.status", mLOG_ALL & ~mLOG_DEBUG); m_filter.defaultLevels = levels;