Merge upstream changes: Improve error messages for unknown commands

Unlike the upstream, we use fatal() because it generates a message box
even if DEBUG_CONSOLE is disabled.
This commit is contained in:
kichikuou
2020-05-22 09:32:04 +09:00
parent 406a7fe106
commit 131707f9d8
5 changed files with 35 additions and 4 deletions
+6 -1
View File
@@ -165,6 +165,7 @@ void NACT::execute(T* impl)
}
// 1コマンド実行
prev_addr = scenario_addr;
uint8 cmd = getd();
if(set_palette && cmd != 'P') {
@@ -345,7 +346,11 @@ void NACT::execute(T* impl)
}
output_console(string);
} else {
fatal("Unknown command %2x at %d", cmd, scenario_addr);
if(cmd >= 0x20 && cmd < 0x7f) {
fatal("Unknown Command: '%c' at page = %d, addr = %d", cmd, scenario_page, prev_addr);
} else {
fatal("Unknown Command: %02x at page = %d, addr = %d", cmd, scenario_page, prev_addr);
}
}
break;
}