From b0b3c6c83686cbe79d4764136bc576c0fa33dd9d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 30 Dec 2009 20:51:49 +0000 Subject: Patch #2923628: "SOMI: Kanji support for japanese MegaCD version" svn-id: r46771 --- engines/scumm/charset.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'engines/scumm/charset.cpp') 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)); } -- cgit v1.2.3