Ticket #9128: monkey_segacd_kanji.patch
File monkey_segacd_kanji.patch, 1.7 KB (added by , 15 years ago) |
---|
-
charset.cpp
84 84 fp.read(_2byteFontPtr, _2byteWidth * _2byteHeight * numChar / 8); 85 85 fp.close(); 86 86 } 87 } else if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD && _language == Common::JA_JPN) { 88 int numChar = 1413; 89 _2byteWidth = 16; 90 _2byteHeight = 16; 91 _useCJKMode = true; 92 _newLineCharacter = 0x5F; 93 // charset resources are not inited yet, load charset later 94 _2byteFontPtr = new byte[_2byteWidth * _2byteHeight * numChar / 8]; 95 // set byte 0 to 0xFF (0x00 when loaded) to indicate that the font was not loaded 96 _2byteFontPtr[0] = 0xFF; 87 97 } else if (_game.version >= 7 && (_language == Common::KO_KOR || _language == Common::JA_JPN || _language == Common::ZH_TWN)) { 88 98 int numChar = 0; 89 99 const char *fontFile = NULL; … … 292 302 if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) { 293 303 idx = SJIStoPCEChunk((idx % 256), (idx / 256)); 294 304 return _2byteFontPtr + (_2byteWidth * _2byteHeight / 8) * idx; 305 } else if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD && _language == Common::JA_JPN) { 306 // init pointer to charset resource 307 if (_2byteFontPtr[0] == 0xFF) { 308 int charsetId = 5; 309 int numChar = 1413; 310 byte *charsetPtr = getResourceAddress(rtCharset, charsetId); 311 if (charsetPtr == 0) 312 error("ScummEngine::get2byteCharPtr: charset %d not found", charsetId); 313 memcpy(_2byteFontPtr, charsetPtr + 46, _2byteWidth * _2byteHeight * numChar / 8); 314 } 315 316 idx = ((idx & 0x7F) << 8) | ((idx >> 8) & 0xFF) - 1; 295 317 } else { 296 318 idx = SJIStoFMTChunk((idx % 256), (idx / 256)); 297 319 }