File:  [RetroPC.NET] / mkfont32 / common / parts.c
Revision 1.1: download - view: text, annotated - select for diffs
Mon Jun 7 00:33:09 2004 JST (21 years, 4 months ago) by yui
Branches: MAIN
CVS tags: HEAD
initialize version (T.Yui)

#include	"compiler.h"
#include	"parts.h"


UINT sjis2jis(UINT sjis) {

	UINT	ret;

	ret = sjis & 0xff;
	ret -= (ret >> 7);
	ret += 0x62;
	if (ret < 256) {
		ret = (ret - 0xa2) & 0x1ff;
	}
	ret += 0x1f21;
	ret += (sjis & 0x3f00) << 1;
	return(ret);
}

UINT jis2sjis(UINT jis) {

	UINT	high;
	UINT	low;

	low = jis & 0x7f;
	high = (jis >> 8) & 0x7f;
	low += ((high & 1) - 1) & 0x5e;
	if (low >= 0x60) {
		low++;
	}
	high += 0x121;
	low += 0x1f;
	high >>= 1;
	high ^= 0x20;
	return((high << 8) | low);
}


RetroPC.NET-CVS <cvs@retropc.net>