GBA BIOS: Crash on BIOS misuse if hardCrash is enabled

This commit is contained in:
Vicki Pfau 2017-11-19 07:43:43 -08:00
parent c9145e18d7
commit 4b40c5cd1a
3 changed files with 10 additions and 2 deletions

View File

@ -623,6 +623,10 @@ static void _mCoreLog(struct mLogger* logger, int category, enum mLogLevel 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) {

View File

@ -531,7 +531,11 @@ static void _unLz77(struct GBA* gba, int width) {
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;

View File

@ -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;