aboutsummaryrefslogtreecommitdiff
path: root/sky
diff options
context:
space:
mode:
authorJoost Peters2003-04-08 12:19:15 +0000
committerJoost Peters2003-04-08 12:19:15 +0000
commitb93b9dc6a0528e538ebf47f00ba1926bf4e68027 (patch)
treecf7ae0245c58cdd427ac3af3119be8c1665095c0 /sky
parenta3a47bcb80925765911a269b9d19c2e6003b32e9 (diff)
downloadscummvm-rg350-b93b9dc6a0528e538ebf47f00ba1926bf4e68027.tar.gz
scummvm-rg350-b93b9dc6a0528e538ebf47f00ba1926bf4e68027.tar.bz2
scummvm-rg350-b93b9dc6a0528e538ebf47f00ba1926bf4e68027.zip
applied eriktorbjorn's patch, removed unnecessary cast and renamed CD text decoder
svn-id: r6939
Diffstat (limited to 'sky')
-rw-r--r--sky/disk.cpp3
-rw-r--r--sky/sky.cpp10
-rw-r--r--sky/text.cpp21
-rw-r--r--sky/text.h4
4 files changed, 24 insertions, 14 deletions
diff --git a/sky/disk.cpp b/sky/disk.cpp
index b7b50e1da9..19fcddb8df 100644
--- a/sky/disk.cpp
+++ b/sky/disk.cpp
@@ -225,6 +225,9 @@ uint32 SkyDisk::determineGameVersion() {
case 5099:
//cd (v0.0368)
return 368;
+ case 5097:
+ //cd (v0.0372)
+ return 372;
default:
//unknown version
error("Unknown game version!");
diff --git a/sky/sky.cpp b/sky/sky.cpp
index a7eabc49fc..f7fb099986 100644
--- a/sky/sky.cpp
+++ b/sky/sky.cpp
@@ -202,10 +202,12 @@ SkyText *SkyState::getSkyText() {
//floppy - new version
//return new SkyText_v00331(_skyDisk, _gameVersion);
case 365:
- //cd demo, uses a slightly modified version of v00368
+ //cd demo, uses a slightly modified version of v00372
case 368:
+ //cd version, uses a slightly modified version of v00372
+ case 372:
//cd version
- return new SkyText_v00368(_skyDisk, _gameVersion);
+ return new SkyText_v00372(_skyDisk, _gameVersion);
default:
error("Unknown game version!");
}
@@ -223,6 +225,8 @@ bool SkyState::isDemo(uint32 version) {
return true;
case 368:
return false;
+ case 372:
+ return false;
default:
error("Unknown game version!");
}
@@ -240,6 +244,8 @@ bool SkyState::isCDVersion(uint32 version) {
return true;
case 368:
return true;
+ case 372:
+ return true;
default:
error("Unknown game version!");
}
diff --git a/sky/text.cpp b/sky/text.cpp
index f8e39eecae..6f289ba64d 100644
--- a/sky/text.cpp
+++ b/sky/text.cpp
@@ -35,7 +35,7 @@ SkyText::SkyText(SkyDisk *skyDisk, uint32 gameVersion) {
_skyDisk = skyDisk;
_gameVersion = gameVersion;
- _mainCharacterSet.addr = (byte *)_skyDisk->loadFile(CHAR_SET_FILE, NULL);
+ _mainCharacterSet.addr = _skyDisk->loadFile(CHAR_SET_FILE, NULL);
fnSetFont(0);
if (!SkyState::isDemo(_gameVersion)) {
@@ -140,9 +140,7 @@ bool SkyText::getTBit() {
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.
- //The decoding code for the floppy versions (both demo and full version) is _completely_ different.
+ //NOTE: The decoding code for the floppy versions (both demo and full version) is _completely_ different.
//This code is based on disassembly of the v0.0267 binary.
@@ -1173,10 +1171,10 @@ e8fb:
}
-char SkyText_v00368::getTextChar() {
+char SkyText_v00372::getTextChar() {
//This code is based on the original sources
- //Slightly modified to work for both the CD and CD-Demo versions.
+ //Should work for all (known) cd versions.
if (getTBit())
goto label_1;
@@ -1569,7 +1567,10 @@ label_73:
return ']';
label_72:
- return 'x';
+ if (_gameVersion == 372)
+ return '#';
+ else
+ return 'x';
label_71:
if (getTBit())
@@ -1577,10 +1578,10 @@ label_71:
if (getTBit())
goto label_75;
- if (_gameVersion == 365)
- return 'x';
- else
+ if (_gameVersion == 368)
return 'X';
+ else
+ return 'x';
label_75:
return 'X';
diff --git a/sky/text.h b/sky/text.h
index 1ebe1b92ee..ebd1ab0cd1 100644
--- a/sky/text.h
+++ b/sky/text.h
@@ -79,9 +79,9 @@ protected:
char getTextChar();
};
-class SkyText_v00368 : public SkyText {
+class SkyText_v00372 : public SkyText {
public:
- SkyText_v00368(SkyDisk *skyDisk, uint32 gameVersion) : SkyText(skyDisk, gameVersion) {};
+ SkyText_v00372(SkyDisk *skyDisk, uint32 gameVersion) : SkyText(skyDisk, gameVersion) {};
protected:
char getTextChar();
};