|
@@ -925,22 +925,36 @@ byte GDClass::load(const char *filename, void (*progress)(long, long))
|
|
|
}
|
|
|
|
|
|
// Generated by mk_bsod.py. Blue screen with 'ERROR' text
|
|
|
-static const PROGMEM uint8_t __bsod[31] = {
|
|
|
-0, 255, 255, 255, 255, 0, 0, 2, 7, 0, 0, 38, 12, 255, 255, 255, 240,
|
|
|
-0, 120, 0, 28, 0, 0, 6, 69, 82, 82, 79, 82, 33, 0
|
|
|
+static const PROGMEM uint8_t __bsod[32] = {
|
|
|
+0, 255, 255, 255, 96, 0, 0, 2, 7, 0, 0, 38, 12, 255, 255, 255, 240, 0,
|
|
|
+90, 0, 31, 0, 0, 6, 69, 82, 82, 79, 82, 0, 0, 0
|
|
|
};
|
|
|
-// "Cannot open file" text
|
|
|
-static const PROGMEM uint8_t __bsod_badfile[31] = {
|
|
|
-12, 255, 255, 255, 240, 0, 148, 0, 28, 0, 0, 6, 67, 97, 110, 110, 111,
|
|
|
-116, 32, 111, 112, 101, 110, 32, 102, 105, 108, 101, 0, 0, 0
|
|
|
+static const PROGMEM uint8_t __bsod_badfile[32] = {
|
|
|
+12, 255, 255, 255, 240, 0, 148, 0, 29, 0, 0, 6, 67, 97, 110, 110, 111,
|
|
|
+116, 32, 111, 112, 101, 110, 32, 102, 105, 108, 101, 58, 0, 0, 0
|
|
|
};
|
|
|
|
|
|
+// Fatal error alert.
|
|
|
+// Show a blue screen with message.
|
|
|
+// This method never returns.
|
|
|
+
|
|
|
+void GDClass::alert(const char *message)
|
|
|
+{
|
|
|
+ begin(0);
|
|
|
+ copy(__bsod, sizeof(__bsod));
|
|
|
+ cmd_text(240, 176, 29, OPT_CENTER, message);
|
|
|
+ swap();
|
|
|
+ GD.finish();
|
|
|
+ for (;;)
|
|
|
+ ;
|
|
|
+}
|
|
|
+
|
|
|
void GDClass::safeload(const char *filename)
|
|
|
{
|
|
|
if (!load(filename)) {
|
|
|
copy(__bsod, sizeof(__bsod));
|
|
|
copy(__bsod_badfile, sizeof(__bsod_badfile));
|
|
|
- cmd_text(240, 176, 28, OPT_CENTER, filename);
|
|
|
+ cmd_text(240, 190, 29, OPT_CENTER, filename);
|
|
|
swap();
|
|
|
for (;;)
|
|
|
;
|