[Scummvm-git-logs] scummvm master -> a662df81c781f8caa5e059b32498507c2ea7ae63

sev- noreply at scummvm.org
Sat Jul 2 13:18:06 UTC 2022


This automated email contains information about 22 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
23f4211038 GLK: SCOTT: Add TI99 loading
0557e9818c GLK: SCOTT: Implement detectTI994A
f0b030b971 GLK: SCOTT: Implement getMaxTI99Messages
08ae18b5b4 GLK: SCOTT: Implement getMaxTI99Items
64bc7401b8 GLK: SCOTT: Implement tryLoadingTI994A
93e7d4de16 GLK: SCOTT: Implement fixAddress
46fb85112d GLK: SCOTT: Implement fixWord
db6b013402 GLK: SCOTT: Implement getTI994AString and getWord
309dab7c8f GLK: SCOTT: Implement getTI994AWord
3d9f511881 GLK: SCOTT: Implement readTI99ImplicitActions
b90a145c29 GLK: SCOTT: Implement readTI99ExplicitActions
f6a6b83367 GLK: SCOTT: Implement loadTitleScreen
c6e730a291 GLK: SCOTT: Add ti99_4a_terp.h/cpp
49e9f404d2 GLK: SCOTT: Implement runImplicitTI99Actions
9e4d5408de GLK: SCOTT: Implement runExplicitTI99Actions
5aadf6e7e0 GLK: SCOTT: Implement performTI99Line
4367c39472 GLK: SCOTT: Fix bugs in TI99 game loading
4d66e735ba COMMON: Add new platform TI-99/4A
28fcbeb230 GLK: SCOTT: Add TI-99/4A games to detection
74ccdfe57b GLK: SCOTT: Fix signed/unsigned mismatch
264c3541c7 GLK: SCOTT: Fix incorrect type cast
a662df81c7 COMMON: Rename TI99 platform


Commit: 23f4211038709d2f5799c5cccb51a96226447a00
    https://github.com/scummvm/scummvm/commit/23f4211038709d2f5799c5cccb51a96226447a00
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Add TI99 loading

Changed paths:
  A engines/glk/scott/load_ti99_4a.cpp
  A engines/glk/scott/load_ti99_4a.h
    engines/glk/module.mk
    engines/glk/scott/load_game.cpp


diff --git a/engines/glk/module.mk b/engines/glk/module.mk
index a34a9587651..70b1320d129 100644
--- a/engines/glk/module.mk
+++ b/engines/glk/module.mk
@@ -248,6 +248,7 @@ MODULE_OBJS := \
 	scott/hulk.o \
 	scott/layout_text.o \
 	scott/line_drawing.o \
+	scott/load_ti99_4a.o \
 	scott/resource.o \
 	scott/restore_state.o \
 	scott/ring_buffer.o \
diff --git a/engines/glk/scott/load_game.cpp b/engines/glk/scott/load_game.cpp
index c757924fc63..de331cb3a99 100644
--- a/engines/glk/scott/load_game.cpp
+++ b/engines/glk/scott/load_game.cpp
@@ -49,6 +49,7 @@
 #include "glk/scott/robin_of_sherwood.h"
 #include "glk/scott/gremlins.h"
 #include "glk/scott/seas_of_blood.h"
+#include "glk/scott/load_ti99_4a.h"
 
 namespace Glk {
 namespace Scott {
@@ -86,6 +87,15 @@ void loadC64(Common::SeekableReadStream* f, Common::String md5) {
 	_G(_fallbackGame)._gameID = static_cast<GameIDType>(detectC64(&_G(_entireFile), &_G(_fileLength)));
 }
 
+void loadTI994A(Common::SeekableReadStream *f) {
+	_G(_entireFile) = new uint8_t[_G(_fileLength)];
+	size_t result = f->read(_G(_entireFile), _G(_fileLength));
+	if (result != _G(_fileLength))
+		g_scott->fatal("File empty or read error!");
+
+	_G(_fallbackGame)._gameID = detectTI994A(&_G(_entireFile), &_G(_fileLength));
+}
+
 void loadGameFile(Common::SeekableReadStream *f) {
 
 	for (int i = 0; i < NUMBER_OF_DIRECTIONS; i++)
@@ -115,9 +125,10 @@ void loadGameFile(Common::SeekableReadStream *f) {
 			} else if (!scumm_stricmp(p->_extra, "C64")) {
 				loadC64(f, md5);
 				break;
+			} else {
+				loadTI994A(f);
+				break;
 			}
-			// TODO
-			// TI99/4A Detection
 		}
 		++p;
 	}
diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
new file mode 100644
index 00000000000..9e89eb68fdc
--- /dev/null
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/*
+ * Based on ScottFree interpreter version 1.14 developed by Swansea
+ * University Computer Society without disassembly of any other game
+ * drivers, only of game databases as permitted by EEC law (for purposes
+ * of compatibility).
+ *
+ * Licensed under GPLv2
+ *
+ * https://github.com/angstsmurf/spatterlight/tree/master/terps/scott
+ */
+
+#include "glk/scott/load_ti99_4a.h"
+
+namespace Glk {
+namespace Scott {
+
+GameIDType detectTI994A(uint8_t **sf, size_t *extent) {
+	return GameIDType();
+}
+
+} // End of namespace Scott
+} // End of namespace Glk
diff --git a/engines/glk/scott/load_ti99_4a.h b/engines/glk/scott/load_ti99_4a.h
new file mode 100644
index 00000000000..a92d8b3a822
--- /dev/null
+++ b/engines/glk/scott/load_ti99_4a.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/*
+ * Based on ScottFree interpreter version 1.14 developed by Swansea
+ * University Computer Society without disassembly of any other game
+ * drivers, only of game databases as permitted by EEC law (for purposes
+ * of compatibility).
+ *
+ * Licensed under GPLv2
+ *
+ * https://github.com/angstsmurf/spatterlight/tree/master/terps/scott
+ */
+
+#ifndef GLK_SCOTT_LOAD_TI99_4A_H
+#define GLK_SCOTT_LOAD_TI99_4A_H
+
+#include "glk/scott/types.h"
+#include "glk/scott/definitions.h"
+
+namespace Glk {
+namespace Scott {
+
+GameIDType detectTI994A(uint8_t **sf, size_t *extent);
+
+} // End of namespace Scott
+} // End of namespace Glk
+
+#endif


Commit: 0557e9818c7e25058b0089ff7a177d2990a0ede4
    https://github.com/scummvm/scummvm/commit/0557e9818c7e25058b0089ff7a177d2990a0ede4
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement detectTI994A

Changed paths:
    engines/glk/scott/load_game.cpp
    engines/glk/scott/load_ti99_4a.cpp
    engines/glk/scott/load_ti99_4a.h


diff --git a/engines/glk/scott/load_game.cpp b/engines/glk/scott/load_game.cpp
index de331cb3a99..91668464b77 100644
--- a/engines/glk/scott/load_game.cpp
+++ b/engines/glk/scott/load_game.cpp
@@ -93,7 +93,7 @@ void loadTI994A(Common::SeekableReadStream *f) {
 	if (result != _G(_fileLength))
 		g_scott->fatal("File empty or read error!");
 
-	_G(_fallbackGame)._gameID = detectTI994A(&_G(_entireFile), &_G(_fileLength));
+	_G(_fallbackGame)._gameID = detectTI994A(f, &_G(_entireFile), &_G(_fileLength));
 }
 
 void loadGameFile(Common::SeekableReadStream *f) {
diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index 9e89eb68fdc..cd20159c844 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -30,13 +30,98 @@
  * https://github.com/angstsmurf/spatterlight/tree/master/terps/scott
  */
 
+#include "glk/scott/scott.h"
+#include "glk/scott/globals.h"
+#include "glk/scott/resource.h"
 #include "glk/scott/load_ti99_4a.h"
 
 namespace Glk {
 namespace Scott {
 
-GameIDType detectTI994A(uint8_t **sf, size_t *extent) {
-	return GameIDType();
+struct DataHeader {
+	uint8_t _numObjects;			/* number of objects */
+	uint8_t _numVerbs;				/* number of verbs */
+	uint8_t _numNouns;				/* number of nouns */
+	uint8_t _redRoom;				/* the red room (dead room) */
+	uint8_t _maxItemsCarried;		/* max number of items can be carried */
+	uint8_t _beginLocn;				/* room to start in */
+	uint8_t _numTreasures;			/* number of treasures */
+	uint8_t _cmdLength;				/* number of letters in commands */
+	uint16_t _lightTurns;			/* max number of turns light lasts */
+	uint8_t _treasureLocn;			/* location of where to store treasures */
+	uint8_t _strange;				/* !?! not known. */
+
+	uint16_t _pObjTable;			/* pointer to object table */
+	uint16_t _pOrigItems;			/* pointer to original items */
+	uint16_t _pObjLink;				/* pointer to link table from noun to object */
+	uint16_t _pObjDescr;			/* pointer to object descriptions */
+	uint16_t _pMessage;				/* pointer to message pointers */
+	uint16_t _pRoomExit;			/* pointer to room exits table */
+	uint16_t _pRoomDescr;			/* pointer to room descr table */
+
+	uint16_t _pNounTable;			/* pointer to noun table */
+	uint16_t _pVerbTable;			/* pointer to verb table */
+
+	uint16_t _pExplicit;			/* pointer to explicit action table */
+	uint16_t _pImplicit;			/* pointer to implicit actions */
+};
+
+void getMaxTI99Messages(DataHeader dh) {
+	
+}
+
+void getMaxTI99Items(DataHeader dh) {
+
+}
+
+int tryLoadingTI994A(DataHeader dh, int loud) {
+	return 0;
+}
+
+void readHeader(Common::SeekableReadStream *f, DataHeader &dh) {
+	f->seek(0);
+	f->seek(_G(_fileBaselineOffset) + 0x8a0);
+	dh._numObjects = f->readByte();
+	dh._numVerbs = f->readByte();
+	dh._numNouns = f->readByte();
+	dh._redRoom = f->readByte();
+	dh._maxItemsCarried = f->readByte();
+	dh._beginLocn = f->readByte();
+	dh._numTreasures = f->readByte();
+	dh._cmdLength = f->readByte();
+	dh._lightTurns = f->readUint16LE();
+	dh._treasureLocn = f->readByte();
+	dh._strange = f->readByte();
+
+	dh._pObjTable = f->readUint16LE();
+	dh._pOrigItems = f->readUint16LE();
+	dh._pObjLink = f->readUint16LE();
+	dh._pObjDescr = f->readUint16LE();
+	dh._pMessage = f->readUint16LE();
+	dh._pRoomExit = f->readUint16LE();
+	dh._pRoomDescr = f->readUint16LE();
+
+	dh._pNounTable = f->readUint16LE();
+	dh._pVerbTable = f->readUint16LE();
+
+	dh._pExplicit = f->readUint16LE();
+	dh._pImplicit = f->readUint16LE();
+}
+
+GameIDType detectTI994A(Common::SeekableReadStream *f, uint8_t **sf, size_t *extent) {
+	int offset = findCode("\x30\x30\x30\x30\x00\x30\x30\x00\x28\x28", 0);
+	if (offset == -1)
+		return UNKNOWN_GAME;
+
+	_G(_fileBaselineOffset) = offset - 0x589;
+
+	DataHeader dh;
+	readHeader(f, dh);
+
+	getMaxTI99Messages(dh);
+	getMaxTI99Items(dh);
+
+	return static_cast<GameIDType>(tryLoadingTI994A(dh, 0));
 }
 
 } // End of namespace Scott
diff --git a/engines/glk/scott/load_ti99_4a.h b/engines/glk/scott/load_ti99_4a.h
index a92d8b3a822..0e867102f5a 100644
--- a/engines/glk/scott/load_ti99_4a.h
+++ b/engines/glk/scott/load_ti99_4a.h
@@ -33,13 +33,14 @@
 #ifndef GLK_SCOTT_LOAD_TI99_4A_H
 #define GLK_SCOTT_LOAD_TI99_4A_H
 
+#include "common/file.h"
 #include "glk/scott/types.h"
 #include "glk/scott/definitions.h"
 
 namespace Glk {
 namespace Scott {
 
-GameIDType detectTI994A(uint8_t **sf, size_t *extent);
+GameIDType detectTI994A(Common::SeekableReadStream *f, uint8_t **sf, size_t *extent);
 
 } // End of namespace Scott
 } // End of namespace Glk


Commit: f0b030b9712db5ef057c33018e532902d595bdc7
    https://github.com/scummvm/scummvm/commit/f0b030b9712db5ef057c33018e532902d595bdc7
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement getMaxTI99Messages

Changed paths:
    engines/glk/scott/globals.h
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/globals.h b/engines/glk/scott/globals.h
index ac03a15e11d..84c372a4b76 100644
--- a/engines/glk/scott/globals.h
+++ b/engines/glk/scott/globals.h
@@ -209,6 +209,9 @@ public:
 	uint8_t *_saveIslandAppendix2 = nullptr;
 	int _saveIslandAppendix2Length = 0;
 
+	// load TI994A
+	int _maxMessages = 0;
+
 public:
 	Globals();
 	~Globals();
diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index cd20159c844..9e59d31b792 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -66,8 +66,25 @@ struct DataHeader {
 	uint16_t _pImplicit;			/* pointer to implicit actions */
 };
 
+uint16_t fixAddress(uint16_t ina) {
+	return 0;
+}
+
+uint16_t fixWord(uint16_t word) {
+	return 0;
+}
+
+uint16_t getWord(uint8_t *mem) {
+	return 0;
+}
+
 void getMaxTI99Messages(DataHeader dh) {
-	
+	uint8_t *msg;
+	uint16_t msg1;
+
+	msg = _G(_entireFile) + fixAddress(fixWord(dh._pMessage));
+	msg1 = fixAddress(getWord(msg));
+	_G(_maxMessages) = (msg1 - fixAddress(fixWord(dh._pMessage))) / 2;
 }
 
 void getMaxTI99Items(DataHeader dh) {


Commit: 08ae18b5b4ea016d8b151a63944150811ef4b2e6
    https://github.com/scummvm/scummvm/commit/08ae18b5b4ea016d8b151a63944150811ef4b2e6
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement getMaxTI99Items

Changed paths:
    engines/glk/scott/globals.h
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/globals.h b/engines/glk/scott/globals.h
index 84c372a4b76..68e5ea21a14 100644
--- a/engines/glk/scott/globals.h
+++ b/engines/glk/scott/globals.h
@@ -211,6 +211,7 @@ public:
 
 	// load TI994A
 	int _maxMessages = 0;
+	int _maxItemDescr = 0;
 
 public:
 	Globals();
diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index 9e59d31b792..2fdf9b26527 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -88,7 +88,12 @@ void getMaxTI99Messages(DataHeader dh) {
 }
 
 void getMaxTI99Items(DataHeader dh) {
+	uint8_t *msg;
+	uint16_t msg1;
 
+	msg = _G(_entireFile) + fixAddress(fixWord(dh._pObjDescr));
+	msg1 = fixAddress(getWord(msg));
+	_G(_maxItemDescr) = (msg1 - fixAddress(fixWord(dh._pObjDescr))) / 2;
 }
 
 int tryLoadingTI994A(DataHeader dh, int loud) {


Commit: 64bc7401b8faf729f78450cdbde4427e30b7f8b5
    https://github.com/scummvm/scummvm/commit/64bc7401b8faf729f78450cdbde4427e30b7f8b5
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement tryLoadingTI994A

Changed paths:
    engines/glk/scott/globals.h
    engines/glk/scott/load_ti99_4a.cpp
    engines/glk/scott/scott.cpp
    engines/glk/scott/scott.h


diff --git a/engines/glk/scott/globals.h b/engines/glk/scott/globals.h
index 68e5ea21a14..ba58d3e6d70 100644
--- a/engines/glk/scott/globals.h
+++ b/engines/glk/scott/globals.h
@@ -98,6 +98,8 @@ public:
 	int _animationFlag = 0;
 	uint8_t _enemyTable[126];
 	const char *_battleMessages[33];
+	int _options = 0; ///< Option flags set
+	Common::String _titleScreen;
 
 	// sagadraw
 	int _drawToBuffer = 0;
diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index 2fdf9b26527..8098203612e 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -33,6 +33,7 @@
 #include "glk/scott/scott.h"
 #include "glk/scott/globals.h"
 #include "glk/scott/resource.h"
+#include "glk/scott/game_info.h"
 #include "glk/scott/load_ti99_4a.h"
 
 namespace Glk {
@@ -96,8 +97,189 @@ void getMaxTI99Items(DataHeader dh) {
 	_G(_maxItemDescr) = (msg1 - fixAddress(fixWord(dh._pObjDescr))) / 2;
 }
 
+char *getTI994AString(uint16_t table, int tableOffset) {
+	return nullptr;
+}
+
+void loadTI994ADict(int vorn, uint16_t table, int numWords, Common::StringArray dict) {
+
+}
+
+void readTI99ImplicitActions(DataHeader dh) {
+
+}
+
+void readTI99ExplicitActions(DataHeader dh) {
+
+}
+
+uint8_t *loadTitleScreen() {
+	return nullptr;
+}
+
 int tryLoadingTI994A(DataHeader dh, int loud) {
-	return 0;
+	int ni, nw, nr, mc, pr, tr, wl, lt, mn, trm;
+	int ct;
+
+	Room *rp;
+	Item *ip;
+	/* Load the header */
+
+	ni = dh._numObjects;
+	nw = MAX(dh._numVerbs, dh._numNouns);
+	nr = dh._redRoom;
+	mc = dh._maxItemsCarried;
+	pr = dh._beginLocn;
+	tr = 0;
+	trm = dh._treasureLocn;
+	wl = dh._cmdLength;
+	lt = fixWord(dh._lightTurns);
+	mn = _G(_maxMessages);
+
+	uint8_t *ptr = _G(_entireFile);
+
+	_G(_gameHeader)->_numItems = ni;
+	_G(_items).resize(ni + 1);
+	_G(_gameHeader)->_numActions = 0;
+	_G(_gameHeader)->_numWords = nw;
+	_G(_gameHeader)->_wordLength = wl;
+	_G(_verbs).resize(nw + 2);
+	_G(_nouns).resize(nw + 2);
+	_G(_gameHeader)->_numRooms = nr;
+	_G(_rooms).resize(nr + 1);
+	_G(_gameHeader)->_maxCarry = mc;
+	_G(_gameHeader)->_playerRoom = pr;
+	_G(_gameHeader)->_lightTime = lt;
+	_G(_lightRefill) = lt;
+	_G(_gameHeader)->_numMessages = mn;
+	_G(_messages).resize(mn + 1);
+	_G(_gameHeader)->_treasureRoom = trm;
+
+	int offset;
+
+	if (seekIfNeeded(fixAddress(fixWord(dh._pRoomDescr)), &offset, &ptr) == 0)
+		return 0;
+
+	ct = 0;
+	rp = &_G(_rooms)[0];
+
+	do {
+		rp->_text = getTI994AString(dh._pRoomDescr, ct);
+		if (rp->_text.size() == 0)
+			rp->_text = ".\0";
+		if (loud)
+			debug("Room %d: %s", ct, rp->_text.c_str());
+		rp->_image = 255;
+		ct++;
+		rp++;
+	} while (ct < nr + 1);
+
+	ct = 0;
+	while (ct < mn + 1) {
+		_G(_messages)[ct] = getTI994AString(dh._pMessage, ct);
+		if (_G(_messages)[ct].size() == 0)
+			_G(_messages)[ct] = ".\0";
+		if (loud)
+			debug("Message %d: %s", ct, _G(_messages)[ct].c_str());
+		ct++;
+	}
+
+	ct = 0;
+	ip = &_G(_items)[0];
+	do {
+		ip->_text = getTI994AString(dh._pObjDescr, ct);
+		if (ip->_text.size() == 0)
+			ip->_text = ".\0";
+		if (ip->_text.size() && ip->_text[0] == '*')
+			tr++;
+		if (loud)
+			debug("Item %d: %s", ct, ip->_text.c_str());
+		ct++;
+		ip++;
+	} while (ct < ni + 1);
+
+	_G(_gameHeader)->_treasures = tr;
+	if (loud)
+		debug("Number of treasures %d", _G(_gameHeader)->_treasures);
+
+	if (seekIfNeeded(fixAddress(fixWord(dh._pRoomExit)), &offset, &ptr) == 0)
+		return 0;
+
+	ct = 0;
+	rp = &_G(_rooms)[0];
+
+	while (ct < nr + 1) {
+		for (int j = 0; j < 6; j++) {
+			rp->_exits[j] = *(ptr++ - _G(_fileBaselineOffset));
+		}
+		ct++;
+		rp++;
+	}
+
+	if (seekIfNeeded(fixAddress(fixWord(dh._pOrigItems)), &offset, &ptr) == 0)
+		return 0;
+
+	ct = 0;
+	ip = &_G(_items)[0];
+	while (ct < ni + 1) {
+		ip->_location = *(ptr++ - _G(_fileBaselineOffset));
+		ip->_initialLoc = ip->_location;
+		ip++;
+		ct++;
+	}
+
+	loadTI994ADict(0, dh._pVerbTable, dh._numVerbs + 1, _G(_verbs));
+	loadTI994ADict(1, dh._pNounTable, dh._numNouns + 1, _G(_nouns));
+
+	for (int i = 1; i <= dh._numNouns - dh._numVerbs; i++)
+		_G(_verbs)[dh._numVerbs + i] = ".\0";
+
+	for (int i = 1; i <= dh._numVerbs - dh._numNouns; i++)
+		_G(_nouns)[dh._numNouns + i] = ".\0";
+
+	if (loud) {
+		for (int i = 0; i <= _G(_gameHeader)->_numWords; i++)
+			debug("Verb %d: %s", i, _G(_verbs)[i].c_str());
+		for (int i = 0; i <= _G(_gameHeader)->_numWords; i++)
+			debug("Noun %d: %s", i, _G(_nouns)[i].c_str());
+	}
+
+	ct = 0;
+	ip = &_G(_items)[0];
+
+	int *objectlinks = new int[ni + 1];
+
+	if (seekIfNeeded(fixAddress(fixWord(dh._pObjLink)), &offset, &ptr) == 0)
+		return 0;
+
+	do {
+		objectlinks[ct] = *(ptr++ - _G(_fileBaselineOffset));
+		if (objectlinks[ct] && objectlinks[ct] <= nw) {
+			ip->_autoGet = _G(_nouns)[objectlinks[ct]];
+			if (ct == 3 && scumm_strnicmp("bird", _G(_items)[ct]._text.c_str(), 4) == 0)
+				ip->_autoGet = "BIRD";
+		} else {
+			ip->_autoGet = "";
+		}
+		ct++;
+		ip++;
+	} while (ct < ni + 1);
+
+	readTI99ImplicitActions(dh);
+	readTI99ExplicitActions(dh);
+
+	_G(_autoInventory) = 1;
+	_G(_sys)[INVENTORY] = "I'm carrying: ";
+
+	_G(_titleScreen) = (char *)loadTitleScreen();
+	delete[] _G(_entireFile);
+
+	for (int i = 0; i < MAX_SYSMESS && g_sysDictTI994A[i] != nullptr; i++) {
+		_G(_sys)[i] = g_sysDictTI994A[i];
+	}
+
+	_G(_options) |= TI994A_STYLE;
+	return TI994A;
 }
 
 void readHeader(Common::SeekableReadStream *f, DataHeader &dh) {
diff --git a/engines/glk/scott/scott.cpp b/engines/glk/scott/scott.cpp
index 8a86ede52c6..5682ef5a8ce 100644
--- a/engines/glk/scott/scott.cpp
+++ b/engines/glk/scott/scott.cpp
@@ -80,7 +80,7 @@ void Scott::runGame() {
 
 	const char **dictpointer;
 
-	if (_options & YOUARE)
+	if (_G(_options) & YOUARE)
 		dictpointer = g_sysDict;
 	else
 		dictpointer = g_sysDictIAm;
@@ -92,28 +92,28 @@ void Scott::runGame() {
 	loadGameFile(&_gameFile);
 
 	if (CURRENT_GAME == SCOTTFREE)
-		loadDatabase(&_gameFile, (_options & DEBUGGING) ? 1 : 0);
+		loadDatabase(&_gameFile, (_G(_options) & DEBUGGING) ? 1 : 0);
 
 	if (!CURRENT_GAME)
 		fatal("Unsupported game!");
 
 	if (CURRENT_GAME != SCOTTFREE && CURRENT_GAME != TI994A) {
-		_options |= SPECTRUM_STYLE;
+		_G(_options) |= SPECTRUM_STYLE;
 		_splitScreen = 1;
 	} else {
 		if (CURRENT_GAME != TI994A)
-			_options |= TRS80_STYLE;
+			_G(_options) |= TRS80_STYLE;
 		_splitScreen = 1;
 	}
 
-	if (!_titleScreen.empty()) {
+	if (!_G(_titleScreen).empty()) {
 		if (_splitScreen)
 			printTitleScreenGrid();
 		else
 			printTitleScreenBuffer();
 	}
 
-	if (_options & TRS80_STYLE) {
+	if (_G(_options) & TRS80_STYLE) {
 		_topWidth = 64;
 		_topHeight = 11;
 	} else {
@@ -192,11 +192,11 @@ void Scott::runGame() {
 				if (_G(_items)[LIGHT_SOURCE]._location == CARRIED || _G(_items)[LIGHT_SOURCE]._location == MY_LOC) {
 					output(_G(_sys)[LIGHT_HAS_RUN_OUT]);
 				}
-				if ((_options & PREHISTORIC_LAMP) || (_G(_game)->_subType & MYSTERIOUS) || CURRENT_GAME == TI994A)
+				if ((_G(_options) & PREHISTORIC_LAMP) || (_G(_game)->_subType & MYSTERIOUS) || CURRENT_GAME == TI994A)
 					_G(_items)[LIGHT_SOURCE]._location = DESTROYED;
 			} else if (_G(_gameHeader)->_lightTime < 25) {
 				if (_G(_items)[LIGHT_SOURCE]._location == CARRIED || _G(_items)[LIGHT_SOURCE]._location == MY_LOC) {
-					if ((_options & SCOTTLIGHT) || (_G(_game)->_subType & MYSTERIOUS)) {
+					if ((_G(_options) & SCOTTLIGHT) || (_G(_game)->_subType & MYSTERIOUS)) {
 						display(_G(_bottomWindow), "%s %d %s\n", _G(_sys)[LIGHT_RUNS_OUT_IN].c_str(), _G(_gameHeader)->_lightTime, _G(_sys)[TURNS].c_str());
 					} else {
 						if (_G(_gameHeader)->_lightTime % 5 == 0)
@@ -213,18 +213,18 @@ void Scott::runGame() {
 void Scott::initialize() {
 	if (ConfMan.hasKey("YOUARE")) {
 		if (ConfMan.getBool("YOUARE"))
-			_options |= YOUARE;
+			_G(_options) |= YOUARE;
 		else
-			_options &= ~YOUARE;
+			_G(_options) &= ~YOUARE;
 	}
 	if (gDebugLevel > 0)
-		_options |= DEBUGGING;
+		_G(_options) |= DEBUGGING;
 	if (ConfMan.hasKey("SCOTTLIGHT") && ConfMan.getBool("SCOTTLIGHT"))
-		_options |= SCOTTLIGHT;
+		_G(_options) |= SCOTTLIGHT;
 	if (ConfMan.hasKey("TRS80_STYLE") && ConfMan.getBool("TRS80_STYLE"))
-		_options |= TRS80_STYLE;
+		_G(_options) |= TRS80_STYLE;
 	if (ConfMan.hasKey("PREHISTORIC_LAMP") && ConfMan.getBool("PREHISTORIC_LAMP"))
-		_options |= PREHISTORIC_LAMP;
+		_G(_options) |= PREHISTORIC_LAMP;
 }
 
 void Scott::display(winid_t w, const char *fmt, ...) {
@@ -258,9 +258,9 @@ void Scott::updateSettings() {
 		glk_request_timer_events(20);
 
 	PaletteType previousPal = _G(_palChosen);
-	if (_options & FORCE_PALETTE_ZX)
+	if (_G(_options) & FORCE_PALETTE_ZX)
 		_G(_palChosen) = ZXOPT;
-	else if (_options & FORCE_PALETTE_C64) {
+	else if (_G(_options) & FORCE_PALETTE_C64) {
 		if (_G(_game)->_pictureFormatVersion == 99)
 			_G(_palChosen) = C64A;
 		else
@@ -311,7 +311,7 @@ void Scott::updates(event_t ev) {
 }
 
 void Scott::delay(double seconds) {
-	if (_options & NO_DELAYS)
+	if (_G(_options) & NO_DELAYS)
 		return;
 
 	event_t ev;
@@ -592,7 +592,7 @@ void Scott::look(void) {
 		writeToRoomDescriptionStream("%s%s", _G(_sys)[YOU_ARE].c_str(), r->_text.c_str());
 	}
 
-	if (!(_options & SPECTRUM_STYLE)) {
+	if (!(_G(_options) & SPECTRUM_STYLE)) {
 		listExits();
 		writeToRoomDescriptionStream(".\n");
 	}
@@ -609,30 +609,30 @@ void Scott::look(void) {
 			if (f == 0) {
 				writeToRoomDescriptionStream("%s", _G(_sys)[YOU_SEE].c_str());
 				f++;
-				if (_options & SPECTRUM_STYLE)
+				if (_G(_options) & SPECTRUM_STYLE)
 					writeToRoomDescriptionStream("\n");
-			} else if (!(_options & (TRS80_STYLE | SPECTRUM_STYLE))) {
+			} else if (!(_G(_options) & (TRS80_STYLE | SPECTRUM_STYLE))) {
 				writeToRoomDescriptionStream("%s", _G(_sys)[ITEM_DELIMITER].c_str());
 			}
 			writeToRoomDescriptionStream("%s", _G(_items)[ct]._text.c_str());
-			if (_options & (TRS80_STYLE | SPECTRUM_STYLE)) {
+			if (_G(_options) & (TRS80_STYLE | SPECTRUM_STYLE)) {
 				writeToRoomDescriptionStream("%s", _G(_sys)[ITEM_DELIMITER].c_str());
 			}
 		}
 		ct++;
 	}
 
-	if ((_options & TI994A_STYLE) && f) {
+	if ((_G(_options) & TI994A_STYLE) && f) {
 		writeToRoomDescriptionStream("%s", ".");
 	}
 
-	if (_options & SPECTRUM_STYLE) {
+	if (_G(_options) & SPECTRUM_STYLE) {
 		listExitsSpectrumStyle();
 	} else if (f) {
 		writeToRoomDescriptionStream("\n");
 	}
 
-	if ((_G(_autoInventory) || (_options & FORCE_INVENTORY)) && !(_options & FORCE_INVENTORY_OFF))
+	if ((_G(_autoInventory) || (_G(_options) & FORCE_INVENTORY)) && !(_G(_options) & FORCE_INVENTORY_OFF))
 		listInventoryInUpperWindow();
 
 	flushRoomDescription(buf);
@@ -1094,7 +1094,7 @@ ActionResultType Scott::performLine(int ct) {
 				output("\n");
 				break;
 			case 86:
-				if (!(_options & SPECTRUM_STYLE))
+				if (!(_G(_options) & SPECTRUM_STYLE))
 					output("\n");
 				break;
 			case 87:
@@ -1192,7 +1192,7 @@ ExplicitResultType Scott::performActions(int vb, int no) {
 			/* Seas of Blood needs this to be able to flee back to the last room */
 			if (_G(_game)->_type == SEAS_OF_BLOOD_VARIANT)
 				_G(_savedRoom) = MY_LOC;
-			if (_options & (SPECTRUM_STYLE | TI994A_STYLE))
+			if (_G(_options) & (SPECTRUM_STYLE | TI994A_STYLE))
 				output(_G(_sys)[OK]);
 			MY_LOC = nl;
 			_shouldLookInTranscript = 1;
@@ -1409,7 +1409,7 @@ void Scott::flushRoomDescription(char *buf) {
 	if (!_printLookToTranscript)
 		_G(_transcript) = nullptr;
 
-	int printDelimiter = (_options & (TRS80_STYLE | SPECTRUM_STYLE | TI994A_STYLE));
+	int printDelimiter = (_G(_options) & (TRS80_STYLE | SPECTRUM_STYLE | TI994A_STYLE));
 
 	if (_splitScreen) {
 		glk_window_clear(_G(_topWindow));
@@ -1477,7 +1477,7 @@ void Scott::printWindowDelimiter() {
 	glk_window_get_size(_G(_topWindow), (uint *)&_topWidth, (uint *)&_topHeight);
 	glk_window_move_cursor(_G(_topWindow), 0, _topHeight - 1);
 	glk_stream_set_current(glk_window_get_stream(_G(_topWindow)));
-	if (_options & SPECTRUM_STYLE)
+	if (_G(_options) & SPECTRUM_STYLE)
 		for (int i = 0; i < _topWidth; i++)
 			glk_put_char('*');
 	else {
@@ -1542,12 +1542,12 @@ void Scott::listInventoryInUpperWindow() {
 				i++;
 				continue;
 			}
-			if (lastitem > -1 && (_options & (TRS80_STYLE | SPECTRUM_STYLE)) == 0) {
+			if (lastitem > -1 && (_G(_options) & (TRS80_STYLE | SPECTRUM_STYLE)) == 0) {
 				writeToRoomDescriptionStream("%s", _G(_sys)[ITEM_DELIMITER].c_str());
 			}
 			lastitem = i;
 			writeToRoomDescriptionStream("%s", _G(_items)[i]._text.c_str());
-			if (_options & (TRS80_STYLE | SPECTRUM_STYLE)) {
+			if (_G(_options) & (TRS80_STYLE | SPECTRUM_STYLE)) {
 				writeToRoomDescriptionStream("%s", _G(_sys)[ITEM_DELIMITER].c_str());
 			}
 		}
@@ -1556,7 +1556,7 @@ void Scott::listInventoryInUpperWindow() {
 	if (lastitem == -1) {
 		writeToRoomDescriptionStream("%s\n", _G(_sys)[NOTHING].c_str());
 	} else {
-		if (_options & TI994A_STYLE && !itemEndsWithPeriod(lastitem))
+		if (_G(_options) & TI994A_STYLE && !itemEndsWithPeriod(lastitem))
 			writeToRoomDescriptionStream(".");
 		writeToRoomDescriptionStream("\n");
 	}
@@ -1957,12 +1957,12 @@ void Scott::listInventory() {
 				i++;
 				continue;
 			}
-			if (lastitem > -1 && (_options & (TRS80_STYLE | SPECTRUM_STYLE)) == 0) {
+			if (lastitem > -1 && (_G(_options) & (TRS80_STYLE | SPECTRUM_STYLE)) == 0) {
 				output(_G(_sys)[ITEM_DELIMITER]);
 			}
 			lastitem = i;
 			output(_G(_items)[i]._text);
-			if (_options & (TRS80_STYLE | SPECTRUM_STYLE)) {
+			if (_G(_options) & (TRS80_STYLE | SPECTRUM_STYLE)) {
 				output(_G(_sys)[ITEM_DELIMITER]);
 			}
 		}
@@ -1970,7 +1970,7 @@ void Scott::listInventory() {
 	}
 	if (lastitem == -1)
 		output(_G(_sys)[NOTHING]);
-	else if (_options & TI994A_STYLE) {
+	else if (_G(_options) & TI994A_STYLE) {
 		if (!itemEndsWithPeriod(lastitem))
 			output(".");
 		output(" ");
@@ -2130,17 +2130,17 @@ void Scott::printTitleScreenBuffer() {
 	glk_stream_set_current(glk_window_get_stream(_G(_bottomWindow)));
 	glk_set_style(style_User1);
 	clearScreen();
-	output(_titleScreen);
+	output(_G(_titleScreen));
 	glk_set_style(style_Normal);
 	hitEnter();
 	clearScreen();
 }
 
 void Scott::printTitleScreenGrid() {
-	int titleLength = _titleScreen.size();
+	int titleLength = _G(_titleScreen).size();
 	int rows = 0;
 	for (int i = 0; i < titleLength; i++)
-		if (_titleScreen[i] == '\n')
+		if (_G(_titleScreen)[i] == '\n')
 			rows++;
 	winid_t titlewin = glk_window_open(_G(_bottomWindow), winmethod_Above | winmethod_Fixed, rows + 2,
 									   wintype_TextGrid, 0);
@@ -2155,8 +2155,8 @@ void Scott::printTitleScreenGrid() {
 	int pos = 0;
 	for (int i = 1; i <= rows; i++) {
 		glk_window_move_cursor(titlewin, offset, i);
-		while (_titleScreen[pos] != '\n' && pos < titleLength)
-			display(titlewin, "%c", _titleScreen[pos++]);
+		while (_G(_titleScreen)[pos] != '\n' && pos < titleLength)
+			display(titlewin, "%c", _G(_titleScreen)[pos++]);
 		pos++;
 	}
 	hitEnter();
diff --git a/engines/glk/scott/scott.h b/engines/glk/scott/scott.h
index 5b49acf32ad..60979248b46 100644
--- a/engines/glk/scott/scott.h
+++ b/engines/glk/scott/scott.h
@@ -143,14 +143,12 @@ class Scott : public GlkAPI {
 private:
 	Globals _globals;
 	char _nounText[16];
-	int _options = 0;   ///< Option flags set
 	//int _width = 0;     ///< Terminal width
 	int _topHeight = 0; ///< Height of top window
 	int _topWidth = 0;
 
 	bool _splitScreen = true;
 	int _saveSlot = -1;   ///< Save slot when loading savegame from launcher
-	Common::String _titleScreen;
 
 	int _shouldLookInTranscript = 0;
 	int _printLookToTranscript = 0;


Commit: 93e7d4de169e133a42b2e44341f199dfb159e098
    https://github.com/scummvm/scummvm/commit/93e7d4de169e133a42b2e44341f199dfb159e098
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement fixAddress

Changed paths:
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index 8098203612e..6495510ecd4 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -68,7 +68,7 @@ struct DataHeader {
 };
 
 uint16_t fixAddress(uint16_t ina) {
-	return 0;
+	return (ina - 0x380 + _G(_fileBaselineOffset));
 }
 
 uint16_t fixWord(uint16_t word) {


Commit: 46fb85112dfc9453744ac1455a6f1851d4d13177
    https://github.com/scummvm/scummvm/commit/46fb85112dfc9453744ac1455a6f1851d4d13177
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement fixWord

Changed paths:
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index 6495510ecd4..6c3a234fcd3 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -72,7 +72,7 @@ uint16_t fixAddress(uint16_t ina) {
 }
 
 uint16_t fixWord(uint16_t word) {
-	return 0;
+	return (((word & 0xFF) << 8) | ((word >> 8) & 0xFF));
 }
 
 uint16_t getWord(uint8_t *mem) {


Commit: db6b013402cdee2955b674762311a4a8928cc0ea
    https://github.com/scummvm/scummvm/commit/db6b013402cdee2955b674762311a4a8928cc0ea
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement getTI994AString and getWord

Changed paths:
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index 6c3a234fcd3..cce25a85202 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -76,7 +76,8 @@ uint16_t fixWord(uint16_t word) {
 }
 
 uint16_t getWord(uint8_t *mem) {
-	return 0;
+	uint16_t x = *(uint16_t *)mem;
+	return fixWord(x);
 }
 
 void getMaxTI99Messages(DataHeader dh) {
@@ -97,10 +98,54 @@ void getMaxTI99Items(DataHeader dh) {
 	_G(_maxItemDescr) = (msg1 - fixAddress(fixWord(dh._pObjDescr))) / 2;
 }
 
-char *getTI994AString(uint16_t table, int tableOffset) {
+uint8_t *getTI994AWord(uint8_t* string, uint8_t** result, size_t* length) {
 	return nullptr;
 }
 
+char *getTI994AString(uint16_t table, int tableOffset) {
+	uint8_t *msgx, *msgy, *nextword;
+	char *result;
+	uint16_t msg1, msg2;
+	uint8_t buffer[1024];
+	size_t length, totalLength = 0;
+
+	uint8_t *game = _G(_entireFile);
+
+	msgx = game + fixAddress(fixWord(table));
+
+	msgx += tableOffset * 2;
+	msg1 = fixAddress(getWord((uint8_t *)msgx));
+	msg2 = fixAddress(getWord((uint8_t *)msgx + 2));
+
+	msgy = game + msg2;
+	msgx = game + msg1;
+
+	while (msgx < msgy) {
+		msgx = getTI994AWord(msgx, &nextword, &length);
+		if (length == 0 || nextword == nullptr) {
+			return nullptr;
+		}
+		if (length > 100) {
+			delete[] nextword;
+			return nullptr;
+		}
+		memcpy(buffer + totalLength, nextword, length);
+		delete[] nextword;
+		totalLength += length;
+		if (totalLength > 1000)
+			break;
+		if (msgx < msgy)
+			buffer[totalLength++] = ' ';
+	}
+	if (totalLength == 0)
+		return nullptr;
+	totalLength++;
+	result = new char[totalLength];
+	memcpy(result, buffer, totalLength);
+	result[totalLength - 1] = '\0';
+	return result;
+}
+
 void loadTI994ADict(int vorn, uint16_t table, int numWords, Common::StringArray dict) {
 
 }


Commit: 309dab7c8f74aef3d9541c5ffc68b1c6e7b2c1a0
    https://github.com/scummvm/scummvm/commit/309dab7c8f74aef3d9541c5ffc68b1c6e7b2c1a0
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement getTI994AWord

Changed paths:
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index cce25a85202..635dee8b92b 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -99,7 +99,22 @@ void getMaxTI99Items(DataHeader dh) {
 }
 
 uint8_t *getTI994AWord(uint8_t* string, uint8_t** result, size_t* length) {
-	return nullptr;
+	uint8_t *msg;
+
+	msg = string;
+	*length = msg[0];
+	if (*length == 0 || *length > 100) {
+		*length = 0;
+		*result = nullptr;
+		return nullptr;
+	}
+	msg++;
+	*result = new uint8_t[*length];
+	memcpy(*result, msg, *length);
+
+	msg += *length;
+
+	return (msg);
 }
 
 char *getTI994AString(uint16_t table, int tableOffset) {


Commit: 3d9f5118814655886590b1cf7fea164a92c2fcf6
    https://github.com/scummvm/scummvm/commit/3d9f5118814655886590b1cf7fea164a92c2fcf6
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement readTI99ImplicitActions

Changed paths:
    engines/glk/scott/globals.h
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/globals.h b/engines/glk/scott/globals.h
index ba58d3e6d70..186d9715dbc 100644
--- a/engines/glk/scott/globals.h
+++ b/engines/glk/scott/globals.h
@@ -214,6 +214,8 @@ public:
 	// load TI994A
 	int _maxMessages = 0;
 	int _maxItemDescr = 0;
+	size_t _ti99ImplicitExtent = 0;
+	uint8_t *_ti99ImplicitActions = nullptr;
 
 public:
 	Globals();
diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index 635dee8b92b..f471b87d003 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -162,11 +162,57 @@ char *getTI994AString(uint16_t table, int tableOffset) {
 }
 
 void loadTI994ADict(int vorn, uint16_t table, int numWords, Common::StringArray dict) {
-
+	uint16_t *wtable;
+	int i;
+	int wordLen;
+	char *w1;
+	char *w2;
+
+	/* table is either verb or noun table */
+	wtable = (uint16_t *)(_G(_entireFile) + fixAddress(fixWord(table)));
+
+	for (i = 0; i <= numWords; i++) {
+		do {
+			w1 = (char *)_G(_entireFile) + fixAddress(getWord((uint8_t *)wtable + (i * 2)));
+			w2 = (char *)_G(_entireFile) + fixAddress(getWord((uint8_t *)wtable + ((1 + i) * 2)));
+		} while (w1 == w2);
+
+		wordLen = w2 - w1;
+
+		if (wordLen < 20) {
+			char *text = new char[wordLen + 1];
+			strncpy(text, w1, wordLen);
+			text[wordLen] = 0;
+			dict[i] = text;
+		}
+	}
 }
 
 void readTI99ImplicitActions(DataHeader dh) {
+	uint8_t *ptr, *implicitStart;
+	int loopFlag;
+
+	implicitStart = _G(_entireFile) + fixAddress(fixWord(dh._pImplicit));
+	ptr = implicitStart;
+	loopFlag = 0;
+
+	/* fall out, if no auto acts in the game. */
+	if (*ptr == 0x0)
+		loopFlag = 1;
 
+	while (loopFlag == 0) {
+		if (ptr[1] == 0)
+			loopFlag = 1;
+
+		/* skip code chunk */
+		ptr += 1 + ptr[1];
+	}
+
+	_G(_ti99ImplicitExtent) = MIN(static_cast<long long>(_G(_fileLength)), ptr - _G(_entireFile));
+	if (_G(_ti99ImplicitExtent)) {
+		_G(_ti99ImplicitActions) = new uint8_t[_G(_ti99ImplicitExtent)];
+		memcpy(_G(_ti99ImplicitActions), implicitStart, _G(_ti99ImplicitExtent));
+	}
 }
 
 void readTI99ExplicitActions(DataHeader dh) {


Commit: b90a145c29d206a397120afce2ba5b92d0e7b3ec
    https://github.com/scummvm/scummvm/commit/b90a145c29d206a397120afce2ba5b92d0e7b3ec
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement readTI99ExplicitActions

Changed paths:
    engines/glk/scott/globals.h
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/globals.h b/engines/glk/scott/globals.h
index 186d9715dbc..aab63fbba59 100644
--- a/engines/glk/scott/globals.h
+++ b/engines/glk/scott/globals.h
@@ -215,7 +215,10 @@ public:
 	int _maxMessages = 0;
 	int _maxItemDescr = 0;
 	size_t _ti99ImplicitExtent = 0;
+	size_t _ti99ExplicitExtent = 0;
 	uint8_t *_ti99ImplicitActions = nullptr;
+	uint8_t *_ti99ExplicitActions = nullptr;
+	uint8_t **_verbActionOffsets = nullptr;
 
 public:
 	Globals();
diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index f471b87d003..d2e4e2a8230 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -216,7 +216,52 @@ void readTI99ImplicitActions(DataHeader dh) {
 }
 
 void readTI99ExplicitActions(DataHeader dh) {
+	uint8_t *ptr, *start, *end, *blockstart;
+	uint16_t address;
+	int loopFlag;
+	int i;
+
+	start = _G(_entireFile) + _G(_fileLength);
+	end = _G(_entireFile);
+
+	size_t explicitOffset = fixAddress(fixWord(dh._pExplicit));
+	blockstart = _G(_entireFile) + explicitOffset;
+
+	_G(_verbActionOffsets) = new uint8_t*[dh._numVerbs + 1];
+
+	for (i = 0; i <= dh._numVerbs; i++) {
+		ptr = blockstart;
+		address = getWord(ptr + ((i)*2));
+
+		_G(_verbActionOffsets)[i] = nullptr;
 
+		if (address != 0) {
+			ptr = _G(_entireFile) + fixAddress(address);
+			if (ptr < start)
+				start = ptr;
+			_G(_verbActionOffsets)[i] = ptr;
+			loopFlag = 0;
+
+			while (loopFlag != 1) {
+				if (ptr[1] == 0)
+					loopFlag = 1;
+
+				/* go to next block. */
+				ptr += 1 + ptr[1];
+				if (ptr > end)
+					end = ptr;
+			}
+		}
+	}
+
+	_G(_ti99ExplicitExtent) = end - start;
+	_G(_ti99ExplicitActions) = new uint8_t[_G(_ti99ExplicitExtent)];
+	memcpy(_G(_ti99ExplicitActions), start, _G(_ti99ExplicitExtent));
+	for (i = 0; i <= dh._numVerbs; i++) {
+		if (_G(_verbActionOffsets)[i] != nullptr) {
+			_G(_verbActionOffsets)[i] = _G(_ti99ExplicitActions) + (_G(_verbActionOffsets)[i] - start);
+		}
+	}
 }
 
 uint8_t *loadTitleScreen() {


Commit: f6a6b833670db61d2c4e4a9fd12a40dba426d681
    https://github.com/scummvm/scummvm/commit/f6a6b833670db61d2c4e4a9fd12a40dba426d681
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement loadTitleScreen

Changed paths:
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index d2e4e2a8230..14d80e60253 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -265,7 +265,53 @@ void readTI99ExplicitActions(DataHeader dh) {
 }
 
 uint8_t *loadTitleScreen() {
-	return nullptr;
+	char buf[3074];
+	int offset = 0;
+	uint8_t *p;
+	int lines;
+
+	/* title screen offset starts at 0x80 */
+	p = _G(_entireFile) + 0x80 + _G(_fileBaselineOffset);
+	if (p - _G(_entireFile) > _G(_fileLength))
+		return nullptr;
+	int parens = 0;
+	for (lines = 0; lines < 24; lines++) {
+		for (int i = 0; i < 40; i++) {
+			char c = *(p++);
+			if (p - _G(_entireFile) >= _G(_fileLength))
+				return nullptr;
+			if (!((c <= 127) && (c >= 0))) /* isascii() */
+				c = '?';
+			switch (c) {
+			case '\\':
+				c = ' ';
+				break;
+			case '(':
+				parens = 1;
+				break;
+			case ')':
+				if (!parens)
+					c = '@';
+				parens = 0;
+				break;
+			case '|':
+				if (*p != ' ')
+					c = 12;
+				break;
+			default:
+				break;
+			}
+			buf[offset++] = c;
+			if (offset >= 3072)
+				return nullptr;
+		}
+		buf[offset++] = '\n';
+	}
+
+	buf[offset] = '\0';
+	uint8_t *result = new uint8_t[offset + 1];
+	memcpy(result, buf, offset + 1);
+	return result;
 }
 
 int tryLoadingTI994A(DataHeader dh, int loud) {


Commit: c6e730a291e5a83ef332128a3a8891cb83c237bc
    https://github.com/scummvm/scummvm/commit/c6e730a291e5a83ef332128a3a8891cb83c237bc
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Add ti99_4a_terp.h/cpp

Changed paths:
  A engines/glk/scott/ti99_4a_terp.cpp
  A engines/glk/scott/ti99_4a_terp.h
    engines/glk/module.mk
    engines/glk/scott/scott.cpp


diff --git a/engines/glk/module.mk b/engines/glk/module.mk
index 70b1320d129..3fd465faea4 100644
--- a/engines/glk/module.mk
+++ b/engines/glk/module.mk
@@ -256,6 +256,7 @@ MODULE_OBJS := \
 	scott/saga_draw.o \
 	scott/scott.o \
 	scott/seas_of_blood.o \
+	scott/ti99_4a_terp.o \
 	scott/unp64/unp64.o \
 	scott/unp64/6502_emu.o \
 	scott/unp64/exo_util.o \
diff --git a/engines/glk/scott/scott.cpp b/engines/glk/scott/scott.cpp
index 5682ef5a8ce..813f74aabb6 100644
--- a/engines/glk/scott/scott.cpp
+++ b/engines/glk/scott/scott.cpp
@@ -49,6 +49,7 @@
 #include "glk/scott/gremlins.h"
 #include "glk/scott/seas_of_blood.h"
 #include "glk/scott/game_specific.h"
+#include "glk/scott/ti99_4a_terp.h"
 
 namespace Glk {
 namespace Scott {
@@ -1269,12 +1270,10 @@ ExplicitResultType Scott::performActions(int vb, int no) {
 		}
 	} else {
 		if (vb == 0) {
-			// TODO
-			// RunImplicitTI99Actions();
+			runImplicitTI99Actions();
 			return ER_NO_RESULT;
 		} else {
-			// TODO
-			// flag = RunExplicitTI99Actions(vb, no);
+			flag = runExplicitTI99Actions(vb, no);
 		}
 	}
 
diff --git a/engines/glk/scott/ti99_4a_terp.cpp b/engines/glk/scott/ti99_4a_terp.cpp
new file mode 100644
index 00000000000..a800c60ad03
--- /dev/null
+++ b/engines/glk/scott/ti99_4a_terp.cpp
@@ -0,0 +1,48 @@
+#include "ti99_4a_terp.h"
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/*
+ * Based on ScottFree interpreter version 1.14 developed by Swansea
+ * University Computer Society without disassembly of any other game
+ * drivers, only of game databases as permitted by EEC law (for purposes
+ * of compatibility).
+ *
+ * Licensed under GPLv2
+ *
+ * https://github.com/angstsmurf/spatterlight/tree/master/terps/scott
+ */
+
+#include "glk/scott/ti99_4a_terp.h"
+
+namespace Glk {
+namespace Scott {
+
+void runImplicitTI99Actions() {
+
+}
+
+ExplicitResultType runExplicitTI99Actions(int verbNum, int nounNum) {
+	return ER_NO_RESULT;
+}
+
+} // End of namespace Scott
+} // End of namespace Glk
diff --git a/engines/glk/scott/ti99_4a_terp.h b/engines/glk/scott/ti99_4a_terp.h
new file mode 100644
index 00000000000..6afd1e74a0b
--- /dev/null
+++ b/engines/glk/scott/ti99_4a_terp.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/*
+ * Based on ScottFree interpreter version 1.14 developed by Swansea
+ * University Computer Society without disassembly of any other game
+ * drivers, only of game databases as permitted by EEC law (for purposes
+ * of compatibility).
+ *
+ * Licensed under GPLv2
+ *
+ * https://github.com/angstsmurf/spatterlight/tree/master/terps/scott
+ */
+
+#ifndef GLK_SCOTT_TI99_4A_TERP_H
+#define GLK_SCOTT_TI99_4A_TERP_H
+
+#include "glk/scott/definitions.h"
+
+namespace Glk {
+namespace Scott {
+
+void runImplicitTI99Actions();
+ExplicitResultType runExplicitTI99Actions(int verbNum, int nounNum);
+
+} // End of namespace Scott
+} // End of namespace Glk
+
+#endif


Commit: 49e9f404d2ad8519b854e4bdb97d3245c16a77e7
    https://github.com/scummvm/scummvm/commit/49e9f404d2ad8519b854e4bdb97d3245c16a77e7
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement runImplicitTI99Actions

Changed paths:
    engines/glk/scott/scott.h
    engines/glk/scott/ti99_4a_terp.cpp


diff --git a/engines/glk/scott/scott.h b/engines/glk/scott/scott.h
index 60979248b46..99a1205fbec 100644
--- a/engines/glk/scott/scott.h
+++ b/engines/glk/scott/scott.h
@@ -164,7 +164,6 @@ private:
 
 	void delay(double seconds);
 	void clearScreen(void);
-	bool randomPercent(uint n);
 	int countCarried(void);
 	int matchUpItem(int noun, int loc);
 	Common::String readString(Common::SeekableReadStream *f);
@@ -226,6 +225,7 @@ public:
 	void listInventory();
 	void updateSettings();
 	uint getRandomNumber(uint max);
+	bool randomPercent(uint n);
 
 public:
 	/**
diff --git a/engines/glk/scott/ti99_4a_terp.cpp b/engines/glk/scott/ti99_4a_terp.cpp
index a800c60ad03..605785bac5e 100644
--- a/engines/glk/scott/ti99_4a_terp.cpp
+++ b/engines/glk/scott/ti99_4a_terp.cpp
@@ -31,13 +31,48 @@
  * https://github.com/angstsmurf/spatterlight/tree/master/terps/scott
  */
 
+#include "glk/scott/scott.h"
+#include "glk/scott/types.h"
+#include "glk/scott/globals.h"
 #include "glk/scott/ti99_4a_terp.h"
 
 namespace Glk {
 namespace Scott {
 
+ActionResultType performTI99Line(uint8_t *actionLine) {
+	return ACT_SUCCESS;
+}
+
 void runImplicitTI99Actions() {
+	int probability;
+	uint8_t *ptr;
+	int loopFlag;
+
+	ptr = _G(_ti99ImplicitActions);
+	loopFlag = 0;
+
+	/* bail if no auto acts in the game. */
+	if (*ptr == 0x0)
+		loopFlag = 1;
+
+	while (loopFlag == 0) {
+		/*
+		 p + 0 = chance of happening
+		 p + 1 = size of code chunk
+		 p + 2 = start of code
+		 */
+
+		probability = ptr[0];
+
+		if (g_scott->randomPercent(probability))
+			performTI99Line(ptr + 2);
+
+		if (ptr[1] == 0 || ptr - _G(_ti99ImplicitActions) >= _G(_ti99ImplicitExtent))
+			loopFlag = 1;
 
+		/* skip code chunk */
+		ptr += 1 + ptr[1];
+	}
 }
 
 ExplicitResultType runExplicitTI99Actions(int verbNum, int nounNum) {


Commit: 9e4d5408de8b3e149e508ff4b878aaed35fc151c
    https://github.com/scummvm/scummvm/commit/9e4d5408de8b3e149e508ff4b878aaed35fc151c
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement runExplicitTI99Actions

Changed paths:
    engines/glk/scott/ti99_4a_terp.cpp


diff --git a/engines/glk/scott/ti99_4a_terp.cpp b/engines/glk/scott/ti99_4a_terp.cpp
index 605785bac5e..ca8b1da611e 100644
--- a/engines/glk/scott/ti99_4a_terp.cpp
+++ b/engines/glk/scott/ti99_4a_terp.cpp
@@ -76,7 +76,42 @@ void runImplicitTI99Actions() {
 }
 
 ExplicitResultType runExplicitTI99Actions(int verbNum, int nounNum) {
-	return ER_NO_RESULT;
+	uint8_t *p;
+	ExplicitResultType flag = ER_NO_RESULT;
+	int match = 0;
+	ActionResultType runcode;
+
+	p = _G(_verbActionOffsets)[verbNum];
+
+	/* process all code blocks for this verb
+	 until success or end. */
+
+	while (flag == ER_NO_RESULT) {
+		/* we match VERB NOUN or VERB ANY */
+		if (p != nullptr && (p[0] == nounNum || p[0] == 0)) {
+			match = 1;
+			runcode = performTI99Line(p + 2);
+
+			if (runcode == ACT_SUCCESS) {
+				return ER_SUCCESS;
+			} else { /* failure */
+				if (p[1] == 0)
+					flag = ER_RAN_ALL_LINES;
+				else
+					p += 1 + p[1];
+			}
+		} else {
+			if (p == nullptr || p[1] == 0)
+				flag = ER_RAN_ALL_LINES_NO_MATCH;
+			else
+				p += 1 + p[1];
+		}
+	}
+
+	if (match)
+		flag = ER_RAN_ALL_LINES;
+
+	return flag;
 }
 
 } // End of namespace Scott


Commit: 5aadf6e7e03992332c3e67eadfc7222c7a5a80b7
    https://github.com/scummvm/scummvm/commit/5aadf6e7e03992332c3e67eadfc7222c7a5a80b7
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Implement performTI99Line

Changed paths:
    engines/glk/scott/globals.h
    engines/glk/scott/scott.cpp
    engines/glk/scott/scott.h
    engines/glk/scott/ti99_4a_terp.cpp


diff --git a/engines/glk/scott/globals.h b/engines/glk/scott/globals.h
index aab63fbba59..6d4c6b6d9a8 100644
--- a/engines/glk/scott/globals.h
+++ b/engines/glk/scott/globals.h
@@ -100,6 +100,7 @@ public:
 	const char *_battleMessages[33];
 	int _options = 0; ///< Option flags set
 	Common::String _titleScreen;
+	int _shouldLookInTranscript = 0;
 
 	// sagadraw
 	int _drawToBuffer = 0;
diff --git a/engines/glk/scott/scott.cpp b/engines/glk/scott/scott.cpp
index 813f74aabb6..0930648e291 100644
--- a/engines/glk/scott/scott.cpp
+++ b/engines/glk/scott/scott.cpp
@@ -155,9 +155,9 @@ void Scott::runGame() {
 			break;
 
 		if (!(_G(_currentCommand) && _G(_currentCommand)->_allFlag && !(_G(_currentCommand)->_allFlag & LASTALL))) {
-			_printLookToTranscript = _shouldLookInTranscript;
+			_printLookToTranscript = _G(_shouldLookInTranscript);
 			look();
-			_printLookToTranscript = _shouldLookInTranscript = 0;
+			_printLookToTranscript = _G(_shouldLookInTranscript) = 0;
 			if (!_G(_stopTime) && !_G(_shouldRestart))
 				saveUndo();
 		}
@@ -932,7 +932,7 @@ ActionResultType Scott::performLine(int ct) {
 					  _G(_items)[param[pptr]].Text);
 #endif
 				_G(_items)[param[pptr++]]._location = MY_LOC;
-				_shouldLookInTranscript = 1;
+				_G(_shouldLookInTranscript) = 1;
 				break;
 			case 54:
 #ifdef DEBUG_ACTIONS
@@ -940,7 +940,7 @@ ActionResultType Scott::performLine(int ct) {
 					  _G(_rooms)[param[pptr]].Text);
 #endif
 				MY_LOC = param[pptr++];
-				_shouldLookInTranscript = 1;
+				_G(_shouldLookInTranscript) = 1;
 				look();
 				break;
 			case 55:
@@ -1044,7 +1044,7 @@ ActionResultType Scott::performLine(int ct) {
 #endif
 				if (_splitScreen)
 					look();
-				_shouldLookInTranscript = 1;
+				_G(_shouldLookInTranscript) = 1;
 				break;
 			case 77:
 				if (_G(_currentCounter) >= 1)
@@ -1196,7 +1196,7 @@ ExplicitResultType Scott::performActions(int vb, int no) {
 			if (_G(_options) & (SPECTRUM_STYLE | TI994A_STYLE))
 				output(_G(_sys)[OK]);
 			MY_LOC = nl;
-			_shouldLookInTranscript = 1;
+			_G(_shouldLookInTranscript) = 1;
 			if (_G(_currentCommand) && _G(_currentCommand)->_next) {
 				lookWithPause();
 			}
@@ -1983,7 +1983,7 @@ void Scott::lookWithPause() {
 	char fc = _G(_rooms)[MY_LOC]._text[0];
 	if (_G(_rooms)[MY_LOC]._text.empty() || MY_LOC == 0 || fc == 0 || fc == '.' || fc == ' ')
 		return;
-	_shouldLookInTranscript = 1;
+	_G(_shouldLookInTranscript) = 1;
 	_pauseNextRoomDescription = 1;
 	look();
 }
@@ -2028,7 +2028,7 @@ void Scott::moveItemAToLocOfItemB(int itemA, int itemB) {
 	_G(_items)
 	[itemA]._location = _G(_items)[itemB]._location;
 	if (_G(_items)[itemB]._location == MY_LOC)
-		_shouldLookInTranscript = 1;
+		_G(_shouldLookInTranscript) = 1;
 }
 
 void Scott::goToStoredLoc() {
@@ -2039,7 +2039,7 @@ void Scott::goToStoredLoc() {
 	int t = MY_LOC;
 	MY_LOC = _G(_savedRoom);
 	_G(_savedRoom) = t;
-	_shouldLookInTranscript = 1;
+	_G(_shouldLookInTranscript) = 1;
 }
 
 void Scott::swapLocAndRoomFlag(int index) {
@@ -2049,7 +2049,7 @@ void Scott::swapLocAndRoomFlag(int index) {
 	int temp = MY_LOC;
 	MY_LOC = _G(_roomSaved)[index];
 	_G(_roomSaved)[index] = temp;
-	_shouldLookInTranscript = 1;
+	_G(_shouldLookInTranscript) = 1;
 	look();
 }
 
@@ -2058,7 +2058,7 @@ void Scott::swapItemLocations(int itemA, int itemB) {
 	_G(_items)[itemA]._location = _G(_items)[itemB]._location;
 	_G(_items)[itemB]._location = temp;
 	if (_G(_items)[itemA]._location == MY_LOC || _G(_items)[itemB]._location == MY_LOC)
-		_shouldLookInTranscript = 1;
+		_G(_shouldLookInTranscript) = 1;
 }
 
 void Scott::putItemAInRoomB(int itemA, int roomB) {
diff --git a/engines/glk/scott/scott.h b/engines/glk/scott/scott.h
index 99a1205fbec..7837768150f 100644
--- a/engines/glk/scott/scott.h
+++ b/engines/glk/scott/scott.h
@@ -150,7 +150,6 @@ private:
 	bool _splitScreen = true;
 	int _saveSlot = -1;   ///< Save slot when loading savegame from launcher
 
-	int _shouldLookInTranscript = 0;
 	int _printLookToTranscript = 0;
 	int _pauseNextRoomDescription = 0;
 
@@ -161,10 +160,7 @@ private:
 	 * Initialization code
 	 */
 	void initialize();
-
-	void delay(double seconds);
 	void clearScreen(void);
-	int countCarried(void);
 	int matchUpItem(int noun, int loc);
 	Common::String readString(Common::SeekableReadStream *f);
 	void loadDatabase(Common::SeekableReadStream *f, bool loud);
@@ -192,17 +188,6 @@ private:
 	void transcriptOff();
 	int yesOrNo();
 	void lookWithPause();
-	void doneIt();
-	int printScore();
-	void printNoun();
-	void moveItemAToLocOfItemB(int itemA, int itemB);
-	void goToStoredLoc();
-	void swapLocAndRoomFlag(int index);
-	void swapItemLocations(int itemA, int itemB);
-	void putItemAInRoomB(int itemA, int roomB);
-	void swapCounters(int index);
-	void printMessage(int index);
-	void playerIsDead();
 	void printTakenOrDropped(int index);
 	void printTitleScreenBuffer();
 	void printTitleScreenGrid();
@@ -226,6 +211,19 @@ public:
 	void updateSettings();
 	uint getRandomNumber(uint max);
 	bool randomPercent(uint n);
+	int countCarried(void);
+	void playerIsDead();
+	void doneIt();
+	void putItemAInRoomB(int itemA, int roomB);
+	int printScore();
+	void swapItemLocations(int itemA, int itemB);
+	void moveItemAToLocOfItemB(int itemA, int itemB);
+	void goToStoredLoc();
+	void swapLocAndRoomFlag(int index);
+	void swapCounters(int index);
+	void printNoun();
+	void delay(double seconds);
+	void printMessage(int index);
 
 public:
 	/**
diff --git a/engines/glk/scott/ti99_4a_terp.cpp b/engines/glk/scott/ti99_4a_terp.cpp
index ca8b1da611e..6868190ff86 100644
--- a/engines/glk/scott/ti99_4a_terp.cpp
+++ b/engines/glk/scott/ti99_4a_terp.cpp
@@ -40,7 +40,390 @@ namespace Glk {
 namespace Scott {
 
 ActionResultType performTI99Line(uint8_t *actionLine) {
-	return ACT_SUCCESS;
+	if (actionLine == nullptr)
+        return ACT_FAILURE;
+
+    uint8_t *ptr = actionLine;
+    int runCode = 0;
+    int index = 0;
+    ActionResultType result = ACT_FAILURE;
+    int opcode, param;
+
+    int tryIndex;
+    int tryArr[32];
+
+    tryIndex = 0;
+
+    while (runCode == 0) {
+        opcode = *(ptr++);
+
+        switch (opcode) {
+        case 183: /* is p in inventory? */
+            if (_G(_items)[*(ptr++)]._location != CARRIED) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 184: /* is p in room? */
+            if (_G(_items)[*(ptr++)]._location != MY_LOC) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 185: /* is p available? */
+            if (_G(_items)[*ptr]._location != CARRIED && _G(_items)[*ptr]._location != MY_LOC) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            ptr++;
+            break;
+
+        case 186: /* is p here? */
+            if (_G(_items)[*(ptr++)]._location == MY_LOC) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 187: /* is p NOT in inventory? */
+            if (_G(_items)[*(ptr++)]._location == CARRIED) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 188: /* is p NOT available? */
+            if (_G(_items)[*ptr]._location == CARRIED || _G(_items)[*ptr]._location == MY_LOC) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            ptr++;
+            break;
+
+        case 189: /* is p in play? */
+            if (_G(_items)[*(ptr++)]._location == 0) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 190: /* Is object p NOT in play? */
+            if (_G(_items)[*(ptr++)]._location != 0) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 191: /* Is player is in room p? */
+            if (MY_LOC != *(ptr++)) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 192: /* Is player NOT in room p? */
+            if (MY_LOC == *(ptr++)) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 193: /* Is bitflag p clear? */
+            if ((_G(_bitFlags) & (1 << *(ptr++))) == 0) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 194: /* Is bitflag p set? */
+            if (_G(_bitFlags) & (1 << *(ptr++))) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 195: /* Does the player carry anything? */
+            if (g_scott->countCarried() == 0) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 196: /* Does the player carry nothing? */
+            if (g_scott->countCarried()) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 197: /* Is _G(_currentCounter) <= p? */
+            if (_G(_currentCounter) > *(ptr++)) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 198: /* Is _G(_currentCounter) > p? */
+            if (_G(_currentCounter) <= *(ptr++)) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 199: /* Is _G(_currentCounter) == p? */
+            if (_G(_currentCounter) != *(ptr++)) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            break;
+
+        case 200: /* Is item p still in initial room? */
+            if (_G(_items)[*ptr]._location != _G(_items)[*ptr]._initialLoc) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            ptr++;
+            break;
+
+        case 201: /* Has item p been moved? */
+            if (_G(_items)[*ptr]._location == _G(_items)[*ptr]._initialLoc) {
+                runCode = 1;
+                result = ACT_FAILURE;
+            }
+            ptr++;
+            break;
+
+        case 212: /* clear screen */
+            g_scott->glk_window_clear(_G(_bottomWindow));
+            break;
+
+        case 214: /* inv */
+            _G(_autoInventory) = 1;
+            break;
+
+        case 215: /* !inv */
+            _G(_autoInventory) = 0;
+            break;
+
+        case 216:
+        case 217:
+            break;
+
+        case 218:
+            if (tryIndex >= 32) {
+                g_scott->fatal("ERROR Hit upper limit on try method.");
+            }
+            tryArr[tryIndex++] = ptr - actionLine + *ptr;
+            ptr++;
+            break;
+
+        case 219: /* get item */
+            if (g_scott->countCarried() >= _G(_gameHeader)->_maxCarry) {
+                g_scott->output(_G(_sys)[YOURE_CARRYING_TOO_MUCH]);
+                runCode = 1;
+                result = ACT_FAILURE;
+                break;
+            } else {
+                _G(_items)[*ptr]._location = CARRIED;
+            }
+            ptr++;
+            break;
+
+        case 220: /* drop item */
+            _G(_items)[*(ptr++)]._location = MY_LOC;
+            _G(_shouldLookInTranscript) = 1;
+            break;
+
+        case 221: /* go to room */
+            MY_LOC = *(ptr++);
+            _G(_shouldLookInTranscript) = 1;
+            g_scott->look();
+            break;
+
+        case 222: /* move item p to room 0 */
+            _G(_items)[*(ptr++)]._location = 0;
+            break;
+
+        case 223: /* darkness */
+            _G(_bitFlags) |= 1 << DARKBIT;
+            break;
+
+        case 224: /* light */
+            _G(_bitFlags) &= ~(1 << DARKBIT);
+            break;
+
+        case 225: /* set flag p */
+            _G(_bitFlags) |= (1 << *(ptr++));
+            break;
+
+        case 226: /* clear flag p */
+            _G(_bitFlags) &= ~(1 << *(ptr++));
+            break;
+
+        case 227: /* set flag 0 */
+            _G(_bitFlags) |= (1 << 0);
+            break;
+
+        case 228: /* clear flag 0 */
+            _G(_bitFlags) &= ~(1 << 0);
+            break;
+
+        case 229: /* die */
+            g_scott->playerIsDead();
+			g_scott->doneIt();
+            result = ACT_GAMEOVER;
+            break;
+
+        case 230: /* move item p2 to room p */
+            param = *(ptr++);
+			g_scott->putItemAInRoomB(*(ptr++), param);
+            break;
+
+        case 231: /* quit */
+			g_scott->doneIt();
+            return ACT_GAMEOVER;
+
+        case 232: /* print score */
+			if (g_scott->printScore() == 1)
+                return ACT_GAMEOVER;
+			_G(_stopTime) = 2;
+            break;
+
+        case 233: /* list contents of inventory */
+			g_scott->listInventory();
+			_G(_stopTime) = 2;
+            break;
+
+        case 234: /* refill lightsource */
+            _G(_gameHeader)->_lightTime = _G(_lightRefill);
+            _G(_items)[LIGHT_SOURCE]._location = CARRIED;
+            _G(_bitFlags) &= ~(1 << LIGHTOUTBIT);
+            break;
+
+        case 235: /* save */
+			g_scott->saveGame();
+			_G(_stopTime) = 2;
+            break;
+
+        case 236: /* swap items p and p2 around */
+            param = *(ptr++);
+			g_scott->swapItemLocations(param, *(ptr++));
+            break;
+
+        case 237: /* move item p to the inventory */
+            _G(_items)[*(ptr++)]._location = CARRIED;
+            break;
+
+        case 238: /* make item p same room as item p2 */
+            param = *(ptr++);
+            g_scott->moveItemAToLocOfItemB(param, *(ptr++));
+            break;
+
+        case 239: /* nop */
+            break;
+
+        case 240: /* look at room */
+			g_scott->look();
+            _G(_shouldLookInTranscript) = 1;
+            break;
+
+        case 241: /* unknown */
+            break;
+
+        case 242: /* add 1 to current counter */
+            _G(_currentCounter)++;
+            break;
+
+        case 243: /* sub 1 from current counter */
+            if (_G(_currentCounter) >= 1)
+                _G(_currentCounter)--;
+            break;
+
+        case 244: /* print current counter */
+			g_scott->outputNumber(_G(_currentCounter));
+			g_scott->output(" ");
+            break;
+
+        case 245: /* set current counter to p */
+            _G(_currentCounter) = *(ptr++);
+            break;
+
+        case 246: /*  add to current counter */
+            _G(_currentCounter) += *(ptr++);
+            break;
+
+        case 247: /* sub from current counter */
+            _G(_currentCounter) -= *(ptr++);
+            if (_G(_currentCounter) < -1)
+                _G(_currentCounter) = -1;
+            break;
+
+        case 248: /* go to stored location */
+            g_scott->goToStoredLoc();
+            break;
+
+        case 249: /* swap room and counter */
+            g_scott->swapLocAndRoomFlag(*(ptr++));
+            break;
+
+        case 250: /* swap current counter */
+            g_scott->swapCounters(*(ptr++));
+            break;
+
+        case 251: /* print noun */
+            g_scott->printNoun();
+            break;
+
+        case 252: /* print noun + newline */
+			g_scott->printNoun();
+			g_scott->output("\n");
+            break;
+
+        case 253: /* print newline */
+			g_scott->output("\n");
+            break;
+
+        case 254: /* delay */
+			g_scott->delay(1);
+            break;
+
+        case 255: /* end of code block. */
+            result = ACT_SUCCESS;
+            runCode = 1;
+            tryIndex = 0; /* drop out of all try blocks! */
+            break;
+
+        default:
+            if (opcode <= 182 && opcode <= _G(_gameHeader)->_numMessages + 1) {
+                g_scott->printMessage(opcode);
+            } else {
+                index = ptr - actionLine;
+                error("Unknown action %d [Param begins %d %d]", opcode, actionLine[index], actionLine[index + 1]);
+                break;
+            }
+            break;
+        }
+
+        /* we are on the 0xff opcode, or have fallen through */
+        if (runCode == 1 && tryIndex > 0) {
+            if (opcode == 0xff) {
+                runCode = 1;
+            } else {
+                /* dropped out of TRY block */
+                /* or at end of TRY block */
+                index = tryArr[tryIndex - 1];
+
+                tryIndex -= 1;
+                tryArr[tryIndex] = 0;
+                runCode = 0;
+                ptr = actionLine + index;
+            }
+        }
+    }
+
+    return result;
 }
 
 void runImplicitTI99Actions() {


Commit: 4367c3947247094f04d3ffabd55384298cabdb1a
    https://github.com/scummvm/scummvm/commit/4367c3947247094f04d3ffabd55384298cabdb1a
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Fix bugs in TI99 game loading

Changed paths:
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index 14d80e60253..ca7eb478931 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -161,7 +161,7 @@ char *getTI994AString(uint16_t table, int tableOffset) {
 	return result;
 }
 
-void loadTI994ADict(int vorn, uint16_t table, int numWords, Common::StringArray dict) {
+void loadTI994ADict(int vorn, uint16_t table, int numWords, Common::StringArray &dict) {
 	uint16_t *wtable;
 	int i;
 	int wordLen;
@@ -361,9 +361,8 @@ int tryLoadingTI994A(DataHeader dh, int loud) {
 	rp = &_G(_rooms)[0];
 
 	do {
-		rp->_text = getTI994AString(dh._pRoomDescr, ct);
-		if (rp->_text.size() == 0)
-			rp->_text = ".\0";
+		char *res = getTI994AString(dh._pRoomDescr, ct);
+		rp->_text = res ? res : ".\0";
 		if (loud)
 			debug("Room %d: %s", ct, rp->_text.c_str());
 		rp->_image = 255;
@@ -373,9 +372,8 @@ int tryLoadingTI994A(DataHeader dh, int loud) {
 
 	ct = 0;
 	while (ct < mn + 1) {
-		_G(_messages)[ct] = getTI994AString(dh._pMessage, ct);
-		if (_G(_messages)[ct].size() == 0)
-			_G(_messages)[ct] = ".\0";
+		char *res = getTI994AString(dh._pMessage, ct);
+		_G(_messages)[ct] = res ? res : ".\0";
 		if (loud)
 			debug("Message %d: %s", ct, _G(_messages)[ct].c_str());
 		ct++;
@@ -384,9 +382,8 @@ int tryLoadingTI994A(DataHeader dh, int loud) {
 	ct = 0;
 	ip = &_G(_items)[0];
 	do {
-		ip->_text = getTI994AString(dh._pObjDescr, ct);
-		if (ip->_text.size() == 0)
-			ip->_text = ".\0";
+		char *res = getTI994AString(dh._pObjDescr, ct);
+		ip->_text = res ? res : ".\0";
 		if (ip->_text.size() && ip->_text[0] == '*')
 			tr++;
 		if (loud)


Commit: 4d66e735ba0f9b7dff849f2d90c6bdabf597e79a
    https://github.com/scummvm/scummvm/commit/4d66e735ba0f9b7dff849f2d90c6bdabf597e79a
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
COMMON: Add new platform TI-99/4A

Changed paths:
    common/platform.cpp
    common/platform.h


diff --git a/common/platform.cpp b/common/platform.cpp
index e6639166d13..a110b7e245c 100644
--- a/common/platform.cpp
+++ b/common/platform.cpp
@@ -65,6 +65,7 @@ const PlatformDescription g_platforms[] = {
 	{ "macintosh2", "macintosh2", "mac2", "Macintosh II", kPlatformMacintoshII },
 	{ "shockwave", "shockwave", "shock", "Shockwave", kPlatformShockwave },
 	{ "zx", "zx", "zx", "ZX Spectrum", kPlatformZX },
+	{ "ti", "ti", "ti", "TI-99/4A", kPlatformTI99 },
 
 	{ nullptr, nullptr, nullptr, "Default", kPlatformUnknown }
 };
diff --git a/common/platform.h b/common/platform.h
index d1eb5d16856..7050209fb88 100644
--- a/common/platform.h
+++ b/common/platform.h
@@ -78,6 +78,7 @@ enum Platform {
 	kPlatformMacintoshII,
 	kPlatformShockwave,
 	kPlatformZX,
+	kPlatformTI99,
 
 	kPlatformUnknown = -1
 };


Commit: 28fcbeb2306f3a0d5e29c7d28283f204303502fb
    https://github.com/scummvm/scummvm/commit/28fcbeb2306f3a0d5e29c7d28283f204303502fb
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Add TI-99/4A games to detection

Changed paths:
    engines/glk/scott/detection.cpp
    engines/glk/scott/detection_tables.h


diff --git a/engines/glk/scott/detection.cpp b/engines/glk/scott/detection.cpp
index cf30a321e63..377c8814fdb 100644
--- a/engines/glk/scott/detection.cpp
+++ b/engines/glk/scott/detection.cpp
@@ -55,7 +55,7 @@ GameDescriptor ScottMetaEngine::findGame(const char *gameId) {
 }
 
 bool ScottMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &gameList) {
-	const char *const EXTENSIONS[] = {".z80", ".saga", ".dat", ".D64", ".T64", nullptr};
+	const char *const EXTENSIONS[] = {".z80", ".saga", ".dat", ".D64", ".T64", "fiad", nullptr};
 
 	// Loop through the files of the folder
 	for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
diff --git a/engines/glk/scott/detection_tables.h b/engines/glk/scott/detection_tables.h
index 0e59dd61e0a..e6b2cb98ede 100644
--- a/engines/glk/scott/detection_tables.h
+++ b/engines/glk/scott/detection_tables.h
@@ -232,6 +232,21 @@ const GlkDetectionEntry SCOTT_GAMES[] = {
 	DT_ENTRYP1("perseus",		"C64", "96a1ccb3212808eee03e74cdc1f0d1a4", 20523,	Common::kPlatformC64),
 	DT_ENTRYP1("10indians",		"C64", "79ee3669ccfff7338dfc1810228005dc", 20383,	Common::kPlatformC64),
 	DT_ENTRYP1("waxworks11",	"C64", "facc11aa8b51e88a807236b765203eb0", 18961,	Common::kPlatformC64),
+
+	// TI99 Games
+	// Scott Adams
+	DT_ENTRYP1("adventureland",		"TI99", "c677576bd33a0fe0ff95a9d5c0e3b3ba", 10774, Common::kPlatformTI99),
+	DT_ENTRYP1("pirateadventure",	"TI99", "6f293ad8fcce6b0adf56e98fdfe3eaf4", 10488, Common::kPlatformTI99),
+	DT_ENTRYP1("missionimpossible", "TI99", "ac977babc6d7cce815b05be42deeec55", 10562, Common::kPlatformTI99),
+	DT_ENTRYP1("voodoocastle",		"TI99", "ff8383afe5addf2f302975b0085b5d5e", 10424, Common::kPlatformTI99),
+	DT_ENTRYP1("thecount",			"TI99", "c75701c886bc476e1cbb5321ebd594b2", 10326, Common::kPlatformTI99),
+	DT_ENTRYP1("strangeodyssey",	"TI99", "46dbc05fc0177cfee1e9ccd3ec4a9a4c", 10170, Common::kPlatformTI99),
+	DT_ENTRYP1("mysteryfunhouse",	"TI99", "9f236bd084f5d1fabb7f9591b6ad1c44", 10594, Common::kPlatformTI99),
+	DT_ENTRYP1("pyramidofdoom",		"TI99", "2912111425d87af5b156f95e5766206d", 10242, Common::kPlatformTI99),
+	DT_ENTRYP1("ghosttown",			"TI99", "34feb31e2265fd8721d2192443595a8c", 10170, Common::kPlatformTI99),
+	DT_ENTRYP1("savageisland1",		"TI99", "a59c7841037fce63cf54899e8f562f25", 10170, Common::kPlatformTI99),
+	DT_ENTRYP1("savageisland2",		"TI99", "b40ec602d4c4c442b910b4f109929562", 12616, Common::kPlatformTI99),
+	DT_ENTRYP1("goldenvoyage",		"TI99", "ce4a136b4c2f3d56ce0341d830760bb5", 10346, Common::kPlatformTI99),
 	DT_END_MARKER
 };
 


Commit: 74ccdfe57be8eb5e44b5965c6f412a3095fb681a
    https://github.com/scummvm/scummvm/commit/74ccdfe57be8eb5e44b5965c6f412a3095fb681a
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Fix signed/unsigned mismatch

Changed paths:
    engines/glk/scott/load_ti99_4a.cpp
    engines/glk/scott/ti99_4a_terp.cpp


diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index ca7eb478931..95643814d8a 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -272,13 +272,13 @@ uint8_t *loadTitleScreen() {
 
 	/* title screen offset starts at 0x80 */
 	p = _G(_entireFile) + 0x80 + _G(_fileBaselineOffset);
-	if (p - _G(_entireFile) > _G(_fileLength))
+	if (static_cast<size_t>(p - _G(_entireFile)) > _G(_fileLength))
 		return nullptr;
 	int parens = 0;
 	for (lines = 0; lines < 24; lines++) {
 		for (int i = 0; i < 40; i++) {
 			char c = *(p++);
-			if (p - _G(_entireFile) >= _G(_fileLength))
+			if (static_cast<size_t>(p - _G(_entireFile)) >= _G(_fileLength))
 				return nullptr;
 			if (!((c <= 127) && (c >= 0))) /* isascii() */
 				c = '?';
diff --git a/engines/glk/scott/ti99_4a_terp.cpp b/engines/glk/scott/ti99_4a_terp.cpp
index 6868190ff86..416403cb8b2 100644
--- a/engines/glk/scott/ti99_4a_terp.cpp
+++ b/engines/glk/scott/ti99_4a_terp.cpp
@@ -450,7 +450,7 @@ void runImplicitTI99Actions() {
 		if (g_scott->randomPercent(probability))
 			performTI99Line(ptr + 2);
 
-		if (ptr[1] == 0 || ptr - _G(_ti99ImplicitActions) >= _G(_ti99ImplicitExtent))
+		if (ptr[1] == 0 || static_cast<size_t>(ptr - _G(_ti99ImplicitActions)) >= _G(_ti99ImplicitExtent))
 			loopFlag = 1;
 
 		/* skip code chunk */


Commit: 264c3541c7e908db55516978e50cc42c5a10ba80
    https://github.com/scummvm/scummvm/commit/264c3541c7e908db55516978e50cc42c5a10ba80
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
GLK: SCOTT: Fix incorrect type cast

Changed paths:
    engines/glk/scott/load_ti99_4a.cpp


diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index 95643814d8a..cceff04505b 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -208,7 +208,7 @@ void readTI99ImplicitActions(DataHeader dh) {
 		ptr += 1 + ptr[1];
 	}
 
-	_G(_ti99ImplicitExtent) = MIN(static_cast<long long>(_G(_fileLength)), ptr - _G(_entireFile));
+	_G(_ti99ImplicitExtent) = MIN(_G(_fileLength), static_cast<size_t>(ptr - _G(_entireFile)));
 	if (_G(_ti99ImplicitExtent)) {
 		_G(_ti99ImplicitActions) = new uint8_t[_G(_ti99ImplicitExtent)];
 		memcpy(_G(_ti99ImplicitActions), implicitStart, _G(_ti99ImplicitExtent));


Commit: a662df81c781f8caa5e059b32498507c2ea7ae63
    https://github.com/scummvm/scummvm/commit/a662df81c781f8caa5e059b32498507c2ea7ae63
Author: Avijeet (am388488 at gmail.com)
Date: 2022-07-02T15:17:53+02:00

Commit Message:
COMMON: Rename TI99 platform

Changed paths:
    common/platform.cpp
    common/platform.h
    engines/glk/scott/detection_tables.h


diff --git a/common/platform.cpp b/common/platform.cpp
index a110b7e245c..277bd62fd13 100644
--- a/common/platform.cpp
+++ b/common/platform.cpp
@@ -65,7 +65,7 @@ const PlatformDescription g_platforms[] = {
 	{ "macintosh2", "macintosh2", "mac2", "Macintosh II", kPlatformMacintoshII },
 	{ "shockwave", "shockwave", "shock", "Shockwave", kPlatformShockwave },
 	{ "zx", "zx", "zx", "ZX Spectrum", kPlatformZX },
-	{ "ti", "ti", "ti", "TI-99/4A", kPlatformTI99 },
+	{ "ti994", "ti994", "ti994", "TI-99/4A", kPlatformTI994 },
 
 	{ nullptr, nullptr, nullptr, "Default", kPlatformUnknown }
 };
diff --git a/common/platform.h b/common/platform.h
index 7050209fb88..8bd4ebf834b 100644
--- a/common/platform.h
+++ b/common/platform.h
@@ -78,7 +78,7 @@ enum Platform {
 	kPlatformMacintoshII,
 	kPlatformShockwave,
 	kPlatformZX,
-	kPlatformTI99,
+	kPlatformTI994,
 
 	kPlatformUnknown = -1
 };
diff --git a/engines/glk/scott/detection_tables.h b/engines/glk/scott/detection_tables.h
index e6b2cb98ede..cf2e98a11aa 100644
--- a/engines/glk/scott/detection_tables.h
+++ b/engines/glk/scott/detection_tables.h
@@ -235,18 +235,18 @@ const GlkDetectionEntry SCOTT_GAMES[] = {
 
 	// TI99 Games
 	// Scott Adams
-	DT_ENTRYP1("adventureland",		"TI99", "c677576bd33a0fe0ff95a9d5c0e3b3ba", 10774, Common::kPlatformTI99),
-	DT_ENTRYP1("pirateadventure",	"TI99", "6f293ad8fcce6b0adf56e98fdfe3eaf4", 10488, Common::kPlatformTI99),
-	DT_ENTRYP1("missionimpossible", "TI99", "ac977babc6d7cce815b05be42deeec55", 10562, Common::kPlatformTI99),
-	DT_ENTRYP1("voodoocastle",		"TI99", "ff8383afe5addf2f302975b0085b5d5e", 10424, Common::kPlatformTI99),
-	DT_ENTRYP1("thecount",			"TI99", "c75701c886bc476e1cbb5321ebd594b2", 10326, Common::kPlatformTI99),
-	DT_ENTRYP1("strangeodyssey",	"TI99", "46dbc05fc0177cfee1e9ccd3ec4a9a4c", 10170, Common::kPlatformTI99),
-	DT_ENTRYP1("mysteryfunhouse",	"TI99", "9f236bd084f5d1fabb7f9591b6ad1c44", 10594, Common::kPlatformTI99),
-	DT_ENTRYP1("pyramidofdoom",		"TI99", "2912111425d87af5b156f95e5766206d", 10242, Common::kPlatformTI99),
-	DT_ENTRYP1("ghosttown",			"TI99", "34feb31e2265fd8721d2192443595a8c", 10170, Common::kPlatformTI99),
-	DT_ENTRYP1("savageisland1",		"TI99", "a59c7841037fce63cf54899e8f562f25", 10170, Common::kPlatformTI99),
-	DT_ENTRYP1("savageisland2",		"TI99", "b40ec602d4c4c442b910b4f109929562", 12616, Common::kPlatformTI99),
-	DT_ENTRYP1("goldenvoyage",		"TI99", "ce4a136b4c2f3d56ce0341d830760bb5", 10346, Common::kPlatformTI99),
+	DT_ENTRYP1("adventureland",		"TI99/4A", "c677576bd33a0fe0ff95a9d5c0e3b3ba", 10774, Common::kPlatformTI994),
+	DT_ENTRYP1("pirateadventure",	"TI99/4A", "6f293ad8fcce6b0adf56e98fdfe3eaf4", 10488, Common::kPlatformTI994),
+	DT_ENTRYP1("missionimpossible", "TI99/4A", "ac977babc6d7cce815b05be42deeec55", 10562, Common::kPlatformTI994),
+	DT_ENTRYP1("voodoocastle",		"TI99/4A", "ff8383afe5addf2f302975b0085b5d5e", 10424, Common::kPlatformTI994),
+	DT_ENTRYP1("thecount",			"TI99/4A", "c75701c886bc476e1cbb5321ebd594b2", 10326, Common::kPlatformTI994),
+	DT_ENTRYP1("strangeodyssey",	"TI99/4A", "46dbc05fc0177cfee1e9ccd3ec4a9a4c", 10170, Common::kPlatformTI994),
+	DT_ENTRYP1("mysteryfunhouse",	"TI99/4A", "9f236bd084f5d1fabb7f9591b6ad1c44", 10594, Common::kPlatformTI994),
+	DT_ENTRYP1("pyramidofdoom",		"TI99/4A", "2912111425d87af5b156f95e5766206d", 10242, Common::kPlatformTI994),
+	DT_ENTRYP1("ghosttown",			"TI99/4A", "34feb31e2265fd8721d2192443595a8c", 10170, Common::kPlatformTI994),
+	DT_ENTRYP1("savageisland1",		"TI99/4A", "a59c7841037fce63cf54899e8f562f25", 10170, Common::kPlatformTI994),
+	DT_ENTRYP1("savageisland2",		"TI99/4A", "b40ec602d4c4c442b910b4f109929562", 12616, Common::kPlatformTI994),
+	DT_ENTRYP1("goldenvoyage",		"TI99/4A", "ce4a136b4c2f3d56ce0341d830760bb5", 10346, Common::kPlatformTI994),
 	DT_END_MARKER
 };
 




More information about the Scummvm-git-logs mailing list