[Scummvm-cvs-logs] SF.net SVN: scummvm:[46771] scummvm/trunk/engines/scumm/charset.cpp
sev at users.sourceforge.net
sev at users.sourceforge.net
Wed Dec 30 21:51:49 CET 2009
Revision: 46771
http://scummvm.svn.sourceforge.net/scummvm/?rev=46771&view=rev
Author: sev
Date: 2009-12-30 20:51:49 +0000 (Wed, 30 Dec 2009)
Log Message:
-----------
Patch #2923628: "SOMI: Kanji support for japanese MegaCD version"
Modified Paths:
--------------
scummvm/trunk/engines/scumm/charset.cpp
Modified: scummvm/trunk/engines/scumm/charset.cpp
===================================================================
--- scummvm/trunk/engines/scumm/charset.cpp 2009-12-30 20:25:08 UTC (rev 46770)
+++ scummvm/trunk/engines/scumm/charset.cpp 2009-12-30 20:51:49 UTC (rev 46771)
@@ -84,6 +84,16 @@
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 @@
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));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list