all repos — mgba @ 4b40c5cd1a319866407984e560f312f7fd31702a

mGBA Game Boy Advance Emulator

GBA BIOS: Crash on BIOS misuse if hardCrash is enabled
Vicki Pfau vi@endrift.com
Sun, 19 Nov 2017 07:43:43 -0800
commit

4b40c5cd1a319866407984e560f312f7fd31702a

parent

c9145e18d7504e07c3d67aaadae7de5e22ea3179

3 files changed, 10 insertions(+), 2 deletions(-)

jump to
M src/core/thread.csrc/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.csrc/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.cppsrc/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;