*
* Allocate memory and load the story file.
*
+ * Data collected from http://www.russotto.net/zplet/ivl.html
+ *
*/
void init_memory (void)
{
zword release;
zbyte serial[6];
} records[] = {
+ { ZORK1, 2, "AS000C" },
+ { ZORK1, 5, "" },
+ { ZORK1, 15, "UG3AU5" },
+ { ZORK1, 23, "820428" },
+ { ZORK1, 25, "820515" },
+ { ZORK1, 26, "820803" },
+ { ZORK1, 28, "821013" },
+ { ZORK1, 30, "830330" },
+ { ZORK1, 75, "830929" },
+ { ZORK1, 76, "840509" },
+ { ZORK1, 88, "840726" },
+ { ZORK1, 52, "871125" },
+ { ZORK1G, 3, "880113" },
+ { ZORK2, 7, "UG3AU5" },
+ { ZORK2, 15, "820308" },
+ { ZORK2, 17, "820427" },
+ { ZORK2, 18, "820512" },
+ { ZORK2, 18, "820517" },
+ { ZORK2, 19, "820721" },
+ { ZORK2, 22, "830331" },
+ { ZORK2, 23, "830411" },
+ { ZORK2, 48, "840904" },
+ { ZORK3, 10, "820818" },
+ { ZORK3, 12, "821025" },
+ { ZORK3, 15, "830331" },
+ { ZORK3, 15, "840518" },
+ { ZORK3, 16, "830410" },
+ { ZORK3, 17, "840727" },
+ { MINIZORK, 34, "871124" },
+ { SAMPLER1, 26, "840731" },
+ { SAMPLER1, 53, "850407" },
+ { SAMPLER1, 55, "850823" },
+ { SAMPLER2, 97, "870601" },
+ { ENCHANTER, 10, "830810" },
+ { ENCHANTER, 15, "831107" },
+ { ENCHANTER, 16, "831118" },
+ { ENCHANTER, 24, "851118" },
+ { ENCHANTER, 29, "860820" },
+ { SORCERER, 4, "840131" },
+ { SORCERER, 6, "840508" },
+ { SORCERER, 13, "851021" },
+ { SORCERER, 15, "851108" },
+ { SORCERER, 18, "860904" },
+ { SORCERER, 67, "0" },
+ { SORCERER, 63, "850916" },
+ { SORCERER, 87, "860904" },
+ { SPELLBREAKER, 63, "850916" },
+ { SPELLBREAKER, 87, "860904" },
+ { PLANETFALL, 20, "830708" },
+ { PLANETFALL, 26, "831014" },
+ { PLANETFALL, 29, "840118" },
+ { PLANETFALL, 37, "851003" },
+ { PLANETFALL, 10, "880531" },
+ { STATIONFALL, 107, "870430" },
+ { BALLYHOO, 97, "851218" },
+ { BORDER_ZONE, 9, "871008" },
+ { AMFV, 77, "850814" },
+ { AMFV, 79, "851122" },
+ { HHGG, 47, "840914" },
+ { HHGG, 56, "841221" },
+ { HHGG, 58, "851002" },
+ { HHGG, 59, "851108" },
+ { HHGG, 31, "871119" },
+ { LGOP, 0, "BLOWN!" },
+ { LGOP, 50, "860711" },
+ { LGOP, 59, "860730" },
+ { LGOP, 59, "861114" },
+ { LGOP, 118, "860325" },
+ { LGOP, 4, "880405" },
+ { SUSPECT, 14, "841005" },
{ SHERLOCK, 21, "871214" },
{ SHERLOCK, 26, "880127" },
{ BEYOND_ZORK, 47, "870915" },
extern void tokenise_line (zword, zword, zword, bool);
+static bool truncate_question_mark(void);
+
/*
* is_terminator
*
for (i = 0; buffer[i] != 0; i++) {
if (key == ZC_RETURN) {
-
if (buffer[i] >= 'A' && buffer[i] <= 'Z')
buffer[i] += 'a' - 'A';
if (buffer[i] >= 0xc0 && buffer[i] <= 0xde && buffer[i] != 0xd7)
}
+ if (truncate_question_mark()) {
+ if (buffer[i] == '?')
+ buffer[i] = ' ';
+ }
+
storeb ((zword) (zargs[0] + ((h_version <= V4) ? 1 : 2) + i), translate_to_zscii (buffer[i]));
}
storew ((zword) (zargs[0] + 6), 0); /* menu selection */
}/* z_read_mouse */
+
+/*
+ * truncate_question_mark
+ *
+ * check if this game is one that expects theinterpreter to truncate a
+ * trailing question mark from the input buffer.
+ *
+ * For some games, Infocom modified the interpreter to truncate trailing
+ * question marks. Presumably this was to make it easier to deal with
+ * questions asked of the narrator or interpreter, such as "WHAT IS A
+ * GRUE?". This is a deviation from the Z-Machine Standard (written
+ * after Infocom's demise). Some interpreters written later
+ * incorrectly truncate aswell. In the interest of making sure the
+ * original Infocom games play exactly as they did with Infocom's own
+ * interpreters, this function checks for those games that expect the
+ * trailing question mark to be truncated.
+ *
+ */
+static bool truncate_question_mark(void)
+{
+ if (story_id == ZORK1) return TRUE;
+ if (story_id == ZORK2) return TRUE;
+ if (story_id == ZORK3) return TRUE;
+ if (story_id == MINIZORK) return TRUE;
+ if (story_id == SAMPLER1) return TRUE;
+ if (story_id == SAMPLER2) return TRUE;
+ if (story_id == ENCHANTER) return TRUE;
+ if (story_id == SORCERER) return TRUE;
+ if (story_id == SPELLBREAKER) return TRUE;
+ if (story_id == PLANETFALL) return TRUE;
+ if (story_id == STATIONFALL) return TRUE;
+ if (story_id == BALLYHOO) return TRUE;
+ if (story_id == BORDER_ZONE) return TRUE;
+ if (story_id == AMFV) return TRUE;
+ if (story_id == HHGG) return TRUE;
+ if (story_id == LGOP) return TRUE;
+ if (story_id == SUSPECT) return TRUE;
+
+ return FALSE;
+}