aboutsummaryrefslogtreecommitdiff
path: root/sky
diff options
context:
space:
mode:
authorOliver Kiehl2003-04-07 20:44:16 +0000
committerOliver Kiehl2003-04-07 20:44:16 +0000
commit6fc83fa9057a8f4cbb537662433c5b6039c99b67 (patch)
treeabeefaf4f3b8ba18447df1e293848ba29cc54ad2 /sky
parent77e97053d0bace7464e62edee942307937b3e60a (diff)
downloadscummvm-rg350-6fc83fa9057a8f4cbb537662433c5b6039c99b67.tar.gz
scummvm-rg350-6fc83fa9057a8f4cbb537662433c5b6039c99b67.tar.bz2
scummvm-rg350-6fc83fa9057a8f4cbb537662433c5b6039c99b67.zip
new class SkyText
svn-id: r6933
Diffstat (limited to 'sky')
-rw-r--r--sky/text.cpp729
-rw-r--r--sky/text.h89
2 files changed, 437 insertions, 381 deletions
diff --git a/sky/text.cpp b/sky/text.cpp
index 7423462e6e..f8e39eecae 100644
--- a/sky/text.cpp
+++ b/sky/text.cpp
@@ -23,6 +23,7 @@
#include "common/scummsys.h"
#include "sky/skydefs.h"
#include "sky/sky.h"
+#include "sky/text.h"
#define FIRST_TEXT_SEC 77
#define NO_OF_TEXT_SECTIONS 8 // 8 sections per language
@@ -30,76 +31,42 @@
#define SET_FONT_DATA_SIZE 12
#define MAX_SPEECH_SECTION 7
-void SkyState::initialiseText(void) {
+SkyText::SkyText(SkyDisk *skyDisk, uint32 gameVersion) {
+ _skyDisk = skyDisk;
+ _gameVersion = gameVersion;
- _mainCharacterSet.addr = (byte *)loadFile(CHAR_SET_FILE, NULL);
+ _mainCharacterSet.addr = (byte *)_skyDisk->loadFile(CHAR_SET_FILE, NULL);
fnSetFont(0);
- if (!_isDemo) {
- _controlCharacterSet.addr = loadFile(60520, NULL);
- _linkCharacterSet.addr = loadFile(60521, NULL);
+ if (!SkyState::isDemo(_gameVersion)) {
+ _controlCharacterSet.addr = _skyDisk->loadFile(60520, NULL);
+ _linkCharacterSet.addr = _skyDisk->loadFile(60521, NULL);
}
- if (_isCDVersion) {
- _preAfterTableArea = loadFile(60522, NULL);
+ if (SkyState::isCDVersion(_gameVersion)) {
+ _preAfterTableArea = _skyDisk->loadFile(60522, NULL);
}
}
-void SkyState::setupVersionSpecifics(uint32 version) {
-
- switch (version) {
-
- case 267:
- //floppy demo
- getTextChar = &SkyState::getTextChar_v00267;
- break;
-
- case 288:
- //floppy - old version
- getTextChar = &SkyState::getTextChar_v00288;
- break;
-
- case 331:
- //floppy - new version
- //getTextChar = getTextChar_v00331;
- break;
-
- case 365:
- //cd demo, uses a slightly modified version of v00368
- case 368:
- //cd version
- getTextChar = &SkyState::getTextChar_v00368;
- break;
-
- default:
- error("Unknown game version!");
- break;
- }
-
-}
-
-void SkyState::fnSetFont(uint32 fontNr) {
-
+void SkyText::fnSetFont(uint32 fontNr) {
_curCharSet = fontNr;
byte *charSetPtr = _mainCharacterSet.addr + (fontNr * SET_FONT_DATA_SIZE);
_characterSet = READ_LE_UINT32(charSetPtr);
_charHeight = READ_LE_UINT32(charSetPtr + 4);
_dtCharSpacing = READ_LE_UINT32(charSetPtr + 8);
-
}
-void SkyState::getText(uint32 textNr) { //load text #"textNr" to _textBuffer
-
+void SkyText::getText(uint32 textNr, void **itemList, uint16 language) { //load text #"textNr" into textBuffer
uint32 sectionNo = (textNr & 0x0F000) >> 10;
- if (_itemList[FIRST_TEXT_SEC + sectionNo] == (void*)NULL) { //check if already loaded
+ if (itemList[FIRST_TEXT_SEC + sectionNo] == (void*)NULL) { //check if already loaded
debug(5, "Loading Text item(s) for Section %d", (sectionNo>>2));
uint32 fileNo = (sectionNo >> 2);
- fileNo += ((_language * NO_OF_TEXT_SECTIONS) + 60600);
- _itemList[FIRST_TEXT_SEC + sectionNo] = (void *)loadFile((uint16)fileNo, NULL);
+ fileNo += ((language * NO_OF_TEXT_SECTIONS) + 60600);
+ itemList[FIRST_TEXT_SEC + sectionNo] = (void *)_skyDisk->loadFile((uint16)fileNo, NULL);
}
- uint8 *textItemPtr = (uint8 *)_itemList[FIRST_TEXT_SEC + sectionNo];
+ _textItemPtr = (uint8 *)itemList[FIRST_TEXT_SEC + sectionNo];
uint32 offset = 0;
uint32 nr32MsgBlocks = (textNr & 0x0fe0);
@@ -108,7 +75,7 @@ void SkyState::getText(uint32 textNr) { //load text #"textNr" to _textBuffer
bool bitSeven;
if (nr32MsgBlocks) {
- blockPtr = (byte *)(textItemPtr + 4);
+ blockPtr = (byte *)(_textItemPtr + 4);
nr32MsgBlocks >>= 5;
do {
offset += READ_LE_UINT16(blockPtr);
@@ -121,8 +88,8 @@ void SkyState::getText(uint32 textNr) { //load text #"textNr" to _textBuffer
if (textNr) {
remItems &= 0x0fe0;
- remItems += READ_LE_UINT16(textItemPtr);
- blockPtr = textItemPtr + remItems;
+ remItems += READ_LE_UINT16(_textItemPtr);
+ blockPtr = _textItemPtr + remItems;
do {
skipBytes = *blockPtr++;
@@ -139,8 +106,8 @@ void SkyState::getText(uint32 textNr) { //load text #"textNr" to _textBuffer
uint32 numBits = offset;
offset >>= 2;
- offset += READ_LE_UINT16(textItemPtr + 2);
- textItemPtr += offset;
+ offset += READ_LE_UINT16(_textItemPtr + 2);
+ _textItemPtr += offset;
//bit pointer: 0->8, 1->6, 2->4 ...
numBits &= 3;
@@ -148,18 +115,30 @@ void SkyState::getText(uint32 textNr) { //load text #"textNr" to _textBuffer
numBits++;
numBits <<= 1;
- uint8 inputValue = *textItemPtr++;
+ _inputValue = *_textItemPtr++;
char *dest = (char *)_textBuffer;
char textChar;
- uint8 shiftBits = (uint8) numBits;
+ _shiftBits = (uint8) numBits;
do {
- textChar = (this->*getTextChar)(&inputValue, &shiftBits, textItemPtr);
+ textChar = getTextChar();
*dest++ = textChar;
} while(textChar);
}
-char SkyState::getTextChar_v00267(uint8 *inputValue, uint8 *shiftBits, uint8 *&inputStream) {
+bool SkyText::getTBit() {
+
+ if (_shiftBits) {
+ (_shiftBits)--;
+ } else {
+ _inputValue = *_textItemPtr++;
+ _shiftBits = 7;
+ }
+
+ return (bool)(((_inputValue) >> (_shiftBits)) & 1);
+}
+
+char SkyText_v00267::getTextChar() {
//NOTE: The original sources only contained a text decoder that, AFAIK, is not used in
//any commercially sold version, but differs only slightly from the CD (and CD Demo) implementations.
@@ -167,14 +146,14 @@ char SkyState::getTextChar_v00267(uint8 *inputValue, uint8 *shiftBits, uint8 *&i
//This code is based on disassembly of the v0.0267 binary.
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab73;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab34;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab31;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab2e;
return (char)0x20;
@@ -186,11 +165,11 @@ ab31:
return (char)0x73;
ab34:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab5c;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab4f;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab4c;
return (char)0x6d;
@@ -199,7 +178,7 @@ ab4c:
return (char)0x61;
ab4f:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab59;
return (char)0x0;
@@ -208,9 +187,9 @@ ab59:
return (char)0x6e;
ab5c:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab70;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab6d;
return (char)0x69;
@@ -222,15 +201,15 @@ ab70:
return (char)0x75;
ab73:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto abeb;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto abac;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab9f;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab9c;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ab99;
return (char)0x2e;
@@ -242,7 +221,7 @@ ab9c:
return (char)0x45;
ab9f:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto aba9;
return (char)0x6f;
@@ -251,11 +230,11 @@ aba9:
return (char)0x68;
abac:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto abd4;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto abc7;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto abc4;
return (char)0x44;
@@ -264,7 +243,7 @@ abc4:
return (char)0x67;
abc7:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto abd1;
return (char)0x49;
@@ -273,9 +252,9 @@ abd1:
return (char)0x79;
abd4:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto abe8;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto abe5;
return (char)0x53;
@@ -287,13 +266,13 @@ abe8:
return (char)0x6c;
abeb:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac4f;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac1a;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac0d;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac0a;
return (char)0x54;
@@ -302,7 +281,7 @@ ac0a:
return (char)0x4e;
ac0d:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac17;
return (char)0x63;
@@ -311,11 +290,11 @@ ac17:
return (char)0x52;
ac1a:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac38;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac35;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac32;
return (char)0x41;
@@ -327,9 +306,9 @@ ac35:
return (char)0x4c;
ac38:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac4c;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac49;
return (char)0x48;
@@ -341,15 +320,15 @@ ac4c:
return (char)0x55;
ac4f:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto acb3;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac88;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac7b;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac78;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac75;
return (char)0x62;
@@ -361,7 +340,7 @@ ac78:
return (char)0x27;
ac7b:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ac85;
return (char)0x77;
@@ -370,11 +349,11 @@ ac85:
return (char)0x66;
ac88:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto aca6;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto aca3;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto aca0;
return (char)0x47;
@@ -386,7 +365,7 @@ aca3:
return (char)0x2c;
aca6:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto acb0;
return (char)0x57;
@@ -395,13 +374,13 @@ acb0:
return (char)0x42;
acb3:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto acf9;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ace2;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto acd5;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto acd2;
return (char)0x3f;
@@ -410,7 +389,7 @@ acd2:
return (char)0x50;
acd5:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto acdf;
return (char)0x6b;
@@ -419,9 +398,9 @@ acdf:
return (char)0x70;
ace2:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto acf6;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto acf3;
return (char)0x76;
@@ -433,13 +412,13 @@ acf6:
return (char)0x4b;
acf9:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad35;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad1e;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad1b;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad18;
return (char)0x56;
@@ -451,9 +430,9 @@ ad1b:
return (char)0x7a;
ad1e:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad32;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad2f;
return (char)0x2d;
@@ -465,13 +444,13 @@ ad32:
return (char)0x4a;
ad35:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad7b;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad5a;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad57;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad54;
return (char)0x5a;
@@ -483,9 +462,9 @@ ad57:
return (char)0x29;
ad5a:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad6e;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad6b;
return (char)0x6a;
@@ -494,7 +473,7 @@ ad6b:
return (char)0x2b;
ad6e:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad78;
return (char)0x2a;
@@ -503,13 +482,13 @@ ad78:
return (char)0x71;
ad7b:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto adc1;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ada0;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad9d;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ad9a;
return (char)0x7d;
@@ -521,9 +500,9 @@ ad9d:
return (char)0x60;
ada0:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto adb4;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto adb1;
return (char)0x30;
@@ -532,7 +511,7 @@ adb1:
return (char)0x32;
adb4:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto adbe;
return (char)0x31;
@@ -541,13 +520,13 @@ adbe:
return (char)0x51;
adc1:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto adfd;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ade6;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ade3;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ade0;
return (char)0x58;
@@ -559,9 +538,9 @@ ade3:
return (char)0x33;
ade6:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto adfa;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto adf7;
return (char)0x39;
@@ -573,13 +552,13 @@ adfa:
return (char)0x3c;
adfd:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae2f;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae22;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae1f;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae1c;
return (char)0x38;
@@ -591,7 +570,7 @@ ae1f:
return (char)0x3d;
ae22:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae2c;
return (char)0x26;
@@ -600,11 +579,11 @@ ae2c:
return (char)0x35;
ae2f:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae57;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae4a;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae47;
return (char)0x36;
@@ -613,7 +592,7 @@ ae47:
return (char)0x2f;
ae4a:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae54;
return (char)0x37;
@@ -622,11 +601,11 @@ ae54:
return (char)0x24;
ae57:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae75;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae72;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae6f;
return (char)0x3e;
@@ -638,11 +617,11 @@ ae72:
return (char)0x5e;
ae75:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae93;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae90;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto ae8d;
return (char)0x22;
@@ -654,9 +633,9 @@ ae90:
return (char)0x5b;
ae93:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto aea7;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto aea4;
return (char)0x5f;
@@ -665,7 +644,7 @@ aea4:
return (char)0x7b;
aea7:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto aeb1;
return (char)0x5c;
@@ -675,21 +654,21 @@ aeb1:
}
-char SkyState::getTextChar_v00288(uint8 *inputValue, uint8 *shiftBits, uint8 *&inputStream) {
+char SkyText_v00288::getTextChar() {
//This code is based on disassembly of the v0.0288 binary.
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e5b3;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e574;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e567;
return (char)0x20;
e567:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e571;
return (char)0x65;
@@ -698,11 +677,11 @@ e571:
return (char)0x73;
e574:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e59c;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e58f;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e58c;
return (char)0x6e;
@@ -711,7 +690,7 @@ e58c:
return (char)0x69;
e58f:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e599;
return (char)0x74;
@@ -720,9 +699,9 @@ e599:
return (char)0x61;
e59c:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e5b0;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e5ad;
return (char)0x2e;
@@ -734,15 +713,15 @@ e5b0:
return (char)0x45;
e5b3:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e62b;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e5ec;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e5df;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e5dc;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e5d9;
return (char)0x72;
@@ -754,7 +733,7 @@ e5dc:
return (char)0x75;
e5df:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e5e9;
return (char)0x6d;
@@ -763,11 +742,11 @@ e5e9:
return (char)0x68;
e5ec:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e614;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e607;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e604;
return (char)0x49;
@@ -776,7 +755,7 @@ e604:
return (char)0x6c;
e607:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e611;
return (char)0x53;
@@ -785,9 +764,9 @@ e611:
return (char)0x52;
e614:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e628;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e625;
return (char)0x64;
@@ -799,15 +778,15 @@ e628:
return (char)0x54;
e62b:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e6a3;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e664;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e657;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e654;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e651;
return (char)0x63;
@@ -819,7 +798,7 @@ e654:
return (char)0x4f;
e657:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e661;
return (char)0x44;
@@ -828,11 +807,11 @@ e661:
return (char)0x4c;
e664:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e68c;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e67f;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e67c;
return (char)0x43;
@@ -841,7 +820,7 @@ e67c:
return (char)0x67;
e67f:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e689;
return (char)0x55;
@@ -850,9 +829,9 @@ e689:
return (char)0x27;
e68c:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e6a0;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e69d;
return (char)0x79;
@@ -864,15 +843,15 @@ e6a0:
return (char)0x70;
e6a3:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e707;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e6dc;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e6cf;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e6cc;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e6c9;
return (char)0x21;
@@ -884,7 +863,7 @@ e6cc:
return (char)0x62;
e6cf:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e6d9;
return (char)0x76;
@@ -893,11 +872,11 @@ e6d9:
return (char)0x2c;
e6dc:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e6fa;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e6f7;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e6f4;
return (char)0x50;
@@ -909,7 +888,7 @@ e6f7:
return (char)0x3f;
e6fa:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e704;
return (char)0x47;
@@ -918,13 +897,13 @@ e704:
return (char)0x42;
e707:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e757;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e736;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e729;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e726;
return (char)0x77;
@@ -933,7 +912,7 @@ e726:
return (char)0x57;
e729:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e733;
return (char)0x46;
@@ -942,9 +921,9 @@ e733:
return (char)0x56;
e736:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e74a;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e747;
return (char)0x6b;
@@ -953,7 +932,7 @@ e747:
return (char)0x7a;
e74a:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e754;
return (char)0x4b;
@@ -962,13 +941,13 @@ e754:
return (char)0x2d;
e757:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e793;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e77c;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e779;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e776;
return (char)0x4a;
@@ -980,9 +959,9 @@ e779:
return (char)0x71;
e77c:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e790;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e78d;
return (char)0x59;
@@ -994,13 +973,13 @@ e790:
return (char)0x5a;
e793:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e7e3;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e7c2;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e7b5;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e7b2;
return (char)0x23;
@@ -1009,7 +988,7 @@ e7b2:
return (char)0x51;
e7b5:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e7bf;
return (char)0x28;
@@ -1018,9 +997,9 @@ e7bf:
return (char)0x29;
e7c2:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e7d6;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e7d3;
return (char)0x3c;
@@ -1029,7 +1008,7 @@ e7d3:
return (char)0x78;
e7d6:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e7e0;
return (char)0x3a;
@@ -1038,13 +1017,13 @@ e7e0:
return (char)0x2a;
e7e3:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e829;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e812;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e805;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e802;
return (char)0x58;
@@ -1053,7 +1032,7 @@ e802:
return (char)0x7d;
e805:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e80f;
return (char)0x3d;
@@ -1062,9 +1041,9 @@ e80f:
return (char)0x60;
e812:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e826;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e823;
return (char)0x5d;
@@ -1076,13 +1055,13 @@ e826:
return (char)0x32;
e829:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e865;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e84e;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e84b;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e848;
return (char)0x31;
@@ -1094,9 +1073,9 @@ e84b:
return (char)0x39;
e84e:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e862;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e85f;
return (char)0x2f;
@@ -1108,13 +1087,13 @@ e862:
return (char)0x5e;
e865:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e897;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e88a;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e887;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e884;
return (char)0x38;
@@ -1126,7 +1105,7 @@ e887:
return (char)0x26;
e88a:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e894;
return (char)0x35;
@@ -1135,11 +1114,11 @@ e894:
return (char)0x40;
e897:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e8bf;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e8b2;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e8af;
return (char)0x36;
@@ -1148,7 +1127,7 @@ e8af:
return (char)0x5f;
e8b2:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e8bc;
return (char)0x5c;
@@ -1157,11 +1136,11 @@ e8bc:
return (char)0x37;
e8bf:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e8dd;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e8da;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e8d7;
return (char)0x5b;
@@ -1173,9 +1152,9 @@ e8da:
return (char)0x7b;
e8dd:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e8f1;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e8ee;
return (char)0x25;
@@ -1184,7 +1163,7 @@ e8ee:
return (char)0x9;
e8f1:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto e8fb;
return (char)0x22;
@@ -1194,22 +1173,22 @@ e8fb:
}
-char SkyState::getTextChar_v00368(uint8 *inputValue, uint8 *shiftBits, uint8 *&inputStream) {
+char SkyText_v00368::getTextChar() {
//This code is based on the original sources
//Slightly modified to work for both the CD and CD-Demo versions.
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_1;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_2;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_3;
return ' ';
label_3:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_4;
return 'e';
@@ -1218,11 +1197,11 @@ label_4:
return 'a';
label_2:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_5;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_6;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_7;
return 'o';
@@ -1231,7 +1210,7 @@ label_7:
return 's';
label_6:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_8;
return 't';
@@ -1240,9 +1219,9 @@ label_8:
return 'n';
label_5:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_9;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_10;
return '.';
@@ -1254,15 +1233,15 @@ label_9:
return 'r';
label_1:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_11;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_12;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_13;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_14;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_15;
return (char)0; //end of line
@@ -1274,7 +1253,7 @@ label_14:
return 'u';
label_13:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_16;
return 'm';
@@ -1283,11 +1262,11 @@ label_16:
return 'A';
label_12:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_17;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_18;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_19;
return 'l';
@@ -1296,7 +1275,7 @@ label_19:
return 'I';
label_18:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_20;
return 'd';
@@ -1305,9 +1284,9 @@ label_20:
return 'R';
label_17:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_21;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_22;
return 'N';
@@ -1319,15 +1298,15 @@ label_21:
return 'T';
label_11:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_23;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_24;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_25;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_26;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_27;
return 'O';
@@ -1339,7 +1318,7 @@ label_26:
return 'c';
label_25:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_28;
return 'D';
@@ -1348,11 +1327,11 @@ label_28:
return 'g';
label_24:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_29;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_30;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_31;
return 'L';
@@ -1361,7 +1340,7 @@ label_31:
return 'C';
label_30:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_32;
return 'p';
@@ -1370,9 +1349,9 @@ label_32:
return 'U';
label_29:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_33;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_34;
return '!';
@@ -1384,15 +1363,15 @@ label_33:
return 'M';
label_23:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_35;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_36;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_37;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_38;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_39;
return 'P';
@@ -1404,7 +1383,7 @@ label_38:
return 'H';
label_37:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_40;
return '?';
@@ -1413,11 +1392,11 @@ label_40:
return 'b';
label_36:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_41;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_42;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_43;
return (char)39;
@@ -1429,7 +1408,7 @@ label_42:
return ',';
label_41:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_44;
return 'G';
@@ -1438,15 +1417,15 @@ label_44:
return 'B';
label_35:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_45;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_46;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_47;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_48;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_49;
return 'V';
@@ -1458,7 +1437,7 @@ label_48:
return 'F';
label_47:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_50;
return 'q';
@@ -1468,11 +1447,11 @@ label_50:
return 'w';
label_46:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_51;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_52;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_53;
return 'K';
@@ -1484,7 +1463,7 @@ label_52:
return 'W';
label_51:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_54;
return 'J';
@@ -1493,13 +1472,13 @@ label_54:
return '*';
label_45:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_55;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_56;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_57;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_58;
return 'z';
@@ -1508,7 +1487,7 @@ label_58:
return 'Y';
label_57:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_59;
return 'j';
@@ -1517,11 +1496,11 @@ label_59:
return '+';
label_56:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_60;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_61;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_62;
return 'Q';
@@ -1533,9 +1512,9 @@ label_61:
return ')';
label_60:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_63;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_64;
return 'Z';
@@ -1547,15 +1526,15 @@ label_63:
return '<';
label_55:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_65;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_66;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_67;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_68;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_69;
return (char)149;
@@ -1567,7 +1546,7 @@ label_68:
return (char)138;
label_67:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_70;
return (char)135;
@@ -1577,11 +1556,11 @@ label_70:
label_66:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_71;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_72;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_73;
return (char)127;
@@ -1593,9 +1572,9 @@ label_72:
return 'x';
label_71:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_74;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_75;
if (_gameVersion == 365)
@@ -1610,15 +1589,15 @@ label_74:
return (char)145;
label_65:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_76;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_77;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_78;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_79;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_80;
return (char)136;
@@ -1630,9 +1609,9 @@ label_79:
return '2';
label_78:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_81;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_82;
return '0';
@@ -1644,11 +1623,11 @@ label_81:
return '1';
label_77:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_83;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_84;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_85;
return '/';
@@ -1660,7 +1639,7 @@ label_84:
return '=';
label_83:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_86;
return (char)134;
@@ -1669,13 +1648,13 @@ label_86:
return '^';
label_76:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_87;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_88;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_89;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_90;
return '3';
@@ -1684,7 +1663,7 @@ label_90:
return '9';
label_89:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_91;
return (char)152;
@@ -1693,11 +1672,11 @@ label_91:
return '4';
label_88:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_92;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_93;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_94;
return '}';
@@ -1709,7 +1688,7 @@ label_93:
return '\\'; //needs to be escaped
label_92:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_95;
return '"';
@@ -1718,13 +1697,13 @@ label_95:
return (char)144;
label_87:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_96;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_97;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_98;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_99;
@@ -1734,7 +1713,7 @@ label_99:
return (char)141;
label_98:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_100;
return '5';
@@ -1743,9 +1722,9 @@ label_100:
return '6';
label_97:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_101;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_102;
return (char)146;
@@ -1754,7 +1733,7 @@ label_102:
return (char)143;
label_101:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_103;
return (char)142;
@@ -1763,13 +1742,13 @@ label_103:
return (char)147;
label_96:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_104;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_105;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_106;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_107;
return (char)140;
@@ -1781,9 +1760,9 @@ label_106:
return (char)128;
label_105:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_108;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_109;
return (char)129;
@@ -1793,7 +1772,7 @@ label_109:
return (char)153;
label_108:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_110;
return '$';
@@ -1802,13 +1781,13 @@ label_110:
return '@';
label_104:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_111;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_112;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_113;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_114;
return '[';
@@ -1820,7 +1799,7 @@ label_113:
return '_';
label_112:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_115;
return '>';
@@ -1828,11 +1807,11 @@ label_115:
return (char)150;
label_111:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_116;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_117;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_118;
return (char)130;
@@ -1844,9 +1823,9 @@ label_117:
return (char)9;
label_116:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_119;
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_120;
return (char)156;
@@ -1855,13 +1834,13 @@ label_120:
return (char)151;
label_119:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_121;
return '{';
label_121:
- if (getTBit(inputValue, shiftBits, inputStream))
+ if (getTBit())
goto label_122;
return (char)148;
@@ -1873,15 +1852,3 @@ label_122:
return '!'; //should never be reached
}
-bool SkyState::getTBit(uint8 *inputValue, uint8 *shiftBits, byte *&inputStream) {
-
- if (*shiftBits) {
- (*shiftBits)--;
- } else {
- *inputValue = *inputStream++;
- *shiftBits = 7;
- }
-
- return (bool)(((*inputValue) >> (*shiftBits)) & 1);
-}
-
diff --git a/sky/text.h b/sky/text.h
new file mode 100644
index 0000000000..1ebe1b92ee
--- /dev/null
+++ b/sky/text.h
@@ -0,0 +1,89 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2003 The ScummVM project
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ *
+ */
+
+#ifndef SKYTEXT_H
+#define SKYTEXT_H
+
+#include "sky/disk.h"
+
+class SkyText {
+public:
+ SkyText(SkyDisk *skyDisk, uint32 gameVersion);
+ void getText(uint32 textNr, void **itemList, uint16 language);
+
+protected:
+ bool getTBit();
+ void fnSetFont(uint32 fontNr);
+ virtual char getTextChar() = 0;
+
+ SkyDisk *_skyDisk;
+ uint32 _gameVersion;
+ uint8 _inputValue;
+ uint8 _shiftBits;
+ uint8 *_textItemPtr;
+
+ struct charSet {
+ uint8 *addr;
+ uint32 charHeight;
+ uint32 thirdVal;
+ } _mainCharacterSet, _linkCharacterSet, _controlCharacterSet;
+
+ uint32 _curCharSet;
+ uint32 _characterSet;
+ uint32 _charHeight;
+ uint8 *_preAfterTableArea;
+
+ uint8 _textBuffer[1024];
+
+ uint8 *_mouseTextData; //space for the mouse text
+ uint32 _dtLineWidth; //width of line in pixels
+ uint32 _dtLines; //no of lines to do
+ uint32 _dtLineSize; //size of one line in bytes
+ uint8 *_dtData; //address of textdata
+ uint32 _dtLetters; //no of chars in message
+ uint8 *_dtText; //pointer to text
+ uint32 _dtCharSpacing; //character seperation adjustment
+ uint32 _dtWidth; //width of chars in last line (for editing (?))
+ uint32 _dtCentre; //set for centre text
+};
+
+class SkyText_v00267 : public SkyText {
+public:
+ SkyText_v00267(SkyDisk *skyDisk, uint32 gameVersion) : SkyText(skyDisk, gameVersion) {};
+protected:
+ char getTextChar();
+};
+
+class SkyText_v00288 : public SkyText {
+public:
+ SkyText_v00288(SkyDisk *skyDisk, uint32 gameVersion) : SkyText(skyDisk, gameVersion) {};
+protected:
+ char getTextChar();
+};
+
+class SkyText_v00368 : public SkyText {
+public:
+ SkyText_v00368(SkyDisk *skyDisk, uint32 gameVersion) : SkyText(skyDisk, gameVersion) {};
+protected:
+ char getTextChar();
+};
+
+#endif