aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/charset.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2009-12-30 20:51:49 +0000
committerEugene Sandulenko2009-12-30 20:51:49 +0000
commitb0b3c6c83686cbe79d4764136bc576c0fa33dd9d (patch)
treed2829792f7a7441829adbfabe984503ad9c099e2 /engines/scumm/charset.cpp
parentce88f5fb017be22b994a8ac4747d53133a585b4f (diff)
downloadscummvm-rg350-b0b3c6c83686cbe79d4764136bc576c0fa33dd9d.tar.gz
scummvm-rg350-b0b3c6c83686cbe79d4764136bc576c0fa33dd9d.tar.bz2
scummvm-rg350-b0b3c6c83686cbe79d4764136bc576c0fa33dd9d.zip
Patch #2923628: "SOMI: Kanji support for japanese MegaCD version"
svn-id: r46771
Diffstat (limited to 'engines/scumm/charset.cpp')
-rw-r--r--engines/scumm/charset.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index c708b09291..8a1a27b333 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -84,6 +84,16 @@ void ScummEngine::loadCJKFont() {
fp.read(_2byteFontPtr, _2byteWidth * _2byteHeight * numChar / 8);
fp.close();
}
+ } else if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD && _language == Common::JA_JPN) {
+ int numChar = 1413;
+ _2byteWidth = 16;
+ _2byteHeight = 16;
+ _useCJKMode = true;
+ _newLineCharacter = 0x5F;
+ // charset resources are not inited yet, load charset later
+ _2byteFontPtr = new byte[_2byteWidth * _2byteHeight * numChar / 8];
+ // set byte 0 to 0xFF (0x00 when loaded) to indicate that the font was not loaded
+ _2byteFontPtr[0] = 0xFF;
} else if (_game.version >= 7 && (_language == Common::KO_KOR || _language == Common::JA_JPN || _language == Common::ZH_TWN)) {
int numChar = 0;
const char *fontFile = NULL;
@@ -292,6 +302,18 @@ byte *ScummEngine::get2byteCharPtr(int idx) {
if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) {
idx = SJIStoPCEChunk((idx % 256), (idx / 256));
return _2byteFontPtr + (_2byteWidth * _2byteHeight / 8) * idx;
+ } else if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD && _language == Common::JA_JPN) {
+ // init pointer to charset resource
+ if (_2byteFontPtr[0] == 0xFF) {
+ int charsetId = 5;
+ int numChar = 1413;
+ byte *charsetPtr = getResourceAddress(rtCharset, charsetId);
+ if (charsetPtr == 0)
+ error("ScummEngine::get2byteCharPtr: charset %d not found", charsetId);
+ memcpy(_2byteFontPtr, charsetPtr + 46, _2byteWidth * _2byteHeight * numChar / 8);
+ }
+
+ idx = ((idx & 0x7F) << 8) | ((idx >> 8) & 0xFF) - 1;
} else {
idx = SJIStoFMTChunk((idx % 256), (idx / 256));
}