X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Finform.c;h=9b30ad3b8ff0d3610fa74c63dddeed3fff3d1b56;hb=c881aa3386c00d7021ffabf2f66275d6c110c1c1;hp=93bfcc7964f738609f7f4a418a9743e81ce78e5b;hpb=8760c1ba6442153afe76bcac742e086f90c59fe8;p=inform.git diff --git a/src/inform.c b/src/inform.c index 93bfcc7..9b30ad3 100644 --- a/src/inform.c +++ b/src/inform.c @@ -3,7 +3,7 @@ /* conventions, ICL (Inform Command Line) files, main */ /* */ /* Part of Inform 6.35 */ -/* copyright (c) Graham Nelson 1993 - 2020 */ +/* copyright (c) Graham Nelson 1993 - 2021 */ /* */ /* Inform is free software: you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ @@ -219,6 +219,34 @@ static void select_target(int targ) DICT_ENTRY_FLAG_POS = (4+DICT_WORD_BYTES); } } + + if (!targ) { + /* Z-machine */ + /* The Z-machine's 96 abbreviations are used for these two purposes. + Make sure they are set consistently. If exactly one has been + set non-default, set the other to match. */ + if (MAX_DYNAMIC_STRINGS == 32 && MAX_ABBREVS != 64) { + MAX_DYNAMIC_STRINGS = 96 - MAX_ABBREVS; + } + if (MAX_ABBREVS == 64 && MAX_DYNAMIC_STRINGS != 32) { + MAX_ABBREVS = 96 - MAX_DYNAMIC_STRINGS; + } + if (MAX_ABBREVS + MAX_DYNAMIC_STRINGS != 96 + || MAX_ABBREVS < 0 + || MAX_DYNAMIC_STRINGS < 0) { + warning("MAX_ABBREVS plus MAX_DYNAMIC_STRINGS must be 96 in Z-code; resetting both"); + MAX_DYNAMIC_STRINGS = 32; + MAX_ABBREVS = 64; + } + } + else { + if (MAX_DYNAMIC_STRINGS > 100) { + MAX_DYNAMIC_STRINGS = 100; + warning("MAX_DYNAMIC_STRINGS cannot exceed 100; resetting to 100"); + /* This is because they are specified in text literals like "@00", + with two digits. */ + } + } } /* ------------------------------------------------------------------------- */ @@ -1238,7 +1266,7 @@ static void cli_print_help(int help_level) printf( "\nThis program is a compiler of Infocom format (also called \"Z-machine\")\n\ story files, as well as \"Glulx\" story files:\n\ -Copyright (c) Graham Nelson 1993 - 2020.\n\n"); +Copyright (c) Graham Nelson 1993 - 2021.\n\n"); /* For people typing just "inform", a summary only: */ @@ -1917,8 +1945,9 @@ static void read_command_line(int argc, char **argv) for (i=1, cli_files_specified=0; i