Print one of several messages on normal exit.
authorJoe Marshall <jmarshall@alum.mit.edu>
Wed, 8 Jul 2015 18:35:10 +0000 (11:35 -0700)
committerJoe Marshall <jmarshall@alum.mit.edu>
Wed, 8 Jul 2015 18:35:10 +0000 (11:35 -0700)
src/microcode/errors.h
src/microcode/extern.h
src/microcode/storage.c
src/microcode/term.c

index cf641352e0401205d2ee53a2d31cb9b1a80acd03..05b26859f7452736123933f7bd7384499039f037 100644 (file)
@@ -240,7 +240,7 @@ USA.
 \f
 #define TERM_MESSAGE_TABLE                                             \
 {                                                                      \
-/* 0x00 */             "Moriturus te saluto",                          \
+/* 0x00 */             0,                                              \
 /* 0x01 */             "Unrecoverable error while loading a band",     \
 /* 0x02 */             "Broken heart encountered",                     \
 /* 0x03 */             "Non pointer relocation",                       \
@@ -268,5 +268,14 @@ USA.
 /* 0x19 */             "User requested termination after trap",        \
 /* 0x1A */             "Backing out of non-primitive"                  \
 }
+\f
+#define MAX_HALT_MESSAGE       4
 
+#define TERM_HALT_MESSAGE_TABLE                                                \
+{                                                                      \
+    "Moriturus te saluto.",                                            \
+    "Happy happy joy joy!",                                            \
+    "Ceterum censeo Carthaginem esse delendam.",                       \
+    "..#]^@^@^@ NO CARRIER"                                            \
+}
 #endif /* SCM_ERRORS_H */
index e55cd1736979c208c088da967beedddd298a8531..b08f7dd4620eb0ebcc20af95bf9fd120c4246350 100644 (file)
@@ -174,6 +174,7 @@ extern const char * Abort_Names [];
 extern const char * Error_Names [];
 extern const char * Term_Names [];
 extern const char * term_messages [];
+extern const char * term_halt_messages [];
 extern const char * fixed_objects_names [];
 
 extern bool trapping;
index 39121de9e511f67f7002084f110baa53816d28b5..d5b30145b1b56b4edca01f147617d13f6eba1db5 100644 (file)
@@ -135,4 +135,5 @@ const char * Abort_Names [] = ABORT_NAME_TABLE;             /* in const.h */
 const char * Error_Names [] = ERROR_NAME_TABLE;                /* in errors.h */
 const char * Term_Names [] = TERM_NAME_TABLE;          /* in errors.h */
 const char * term_messages [] = TERM_MESSAGE_TABLE;    /* in errors.h */
+const char * term_halt_messages [] = TERM_HALT_MESSAGE_TABLE; /* in errors.h */
 const char * fixed_objects_names [] = FIXED_OBJECTS_NAMES; /* in fixobj.h */
index de63d2537b5a6643292451405180f1bb2eae72e8..c69c6d408d9c3459fc9fabbb88b9ebfeb793715b 100644 (file)
@@ -113,7 +113,9 @@ termination_prefix (int code)
     {
       if (!option_batch_mode)
        {
-         outf_console ("\n%s.\n", (term_messages[code]));
+         /* Pick a message "randomly" */
+         unsigned long i = (((unsigned long) Free) >> 3) % MAX_HALT_MESSAGE;
+         outf_console ("\n%s\n", (term_halt_messages[i]));
          outf_flush_console ();
        }
     }