Ticket #8362: cjkcode.h

File cjkcode.h, 1.3 KB (added by SF/wonst719, 20 years ago)

CJK character code check...

Line 
1/* ScummVM - Scumm Interpreter
2 * Copyright (C) 2004 The ScummVM Kor. Project
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * $Header: /cvsroot/scummkor/scummvm-kor/scumm/ks_check.h,v 1.4 2004/08/18 09:51:55 wonst719 Exp $
19 */
20
21#ifndef CJKCODE_H
22#define CJKCODE_H
23
24#include "common/scummsys.h"
25
26namespace Scumm {
27
28inline int checkKSCode(byte hi, byte lo)
29{
30 //hi : xx
31 //lo : yy
32 if((0xA1 > lo) || (0xFE < lo)) {
33 return 0;
34 }
35 if((hi >= 0xB0) && (hi <= 0xC8)) {
36 return 1;
37 }
38 return 0;
39}
40
41inline int checkSJISCode(byte c)
42{
43 if(((c > 0x84 && c < 0x88) || (c > 0x9f && c < 0xe0) || (c > 0xea && c <= 0xff))
44 return 0;
45 return 1;
46}
47
48} // End of namespace Scumm
49
50#endif
51