#include	"compiler.h"
#include	"makesub.h"
const UINT8 x2left[256] = {
				0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
				0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
				0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
				0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
				0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,
				0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,
				0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,
				0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,
				0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
				0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
				0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
				0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
				0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
				0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,
				0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
				0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
				0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
				0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,
				0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,
				0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,
				0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,
				0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,
				0xcf,0xcf,0xcf,0xcf,0xcf,0xcf,0xcf,0xcf,
				0xcf,0xcf,0xcf,0xcf,0xcf,0xcf,0xcf,0xcf,
				0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,
				0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,
				0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,
				0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,
				0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,
				0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,
				0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
				0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
const UINT8 x2right[256] = {
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff,
				0x00,0x03,0x0c,0x0f,0x30,0x33,0x3c,0x3f,
				0xc0,0xc3,0xcc,0xcf,0xf0,0xf3,0xfc,0xff};
typedef union {
	UINT32	d;
	UINT8	b[4];
} PAT32;
#if (!defined(MEMOPTIMIZE)) || (MEMOPTIMIZE == 0)		// x86
	UINT32	to256col0[8][512];
void makesub_initialize(void) {
	UINT	i;
	REG8	j;
	PAT32	pat;
	for (i=0; i<256; i++) {
		for (j=0; j<4; j++) {
			pat.b[j] = (i & (0x80 >> j))?1:0;
		}
		for (j=0; j<8; j++) {
			to256col0[j][i*2+0] = pat.d << j;
		}
		for (j=0; j<4; j++) {
			pat.b[j] = (i & (0x08 >> j))?1:0;
		}
		for (j=0; j<8; j++) {
			to256col0[j][i*2+1] = pat.d << j;
		}
	}
}
#elif (MEMOPTIMIZE == 1)								// for Mac
	UINT32	to256col1[512];
void makesub_initialize(void) {
	UINT	i;
	REG8	j;
	PAT32	pat;
	for (i=0; i<256; i++) {
		for (j=0; j<4; j++) {
			pat.b[j] = (i & (0x80 >> j))?1:0;
		}
		to256col1[i*2+0] = pat.d;
		for (j=0; j<4; j++) {
			pat.b[j] = (i & (0x08 >> j))?1:0;
		}
		to256col1[i*2+1] = pat.d;
	}
}
#else													// other
#if defined(BYTESEX_LITTLE)
const UINT32 to256col2[16] = {
	0x00000000, 0x01000000, 0x00010000, 0x01010000,
	0x00000100, 0x01000100, 0x00010100, 0x01010100,
	0x00000001, 0x01000001, 0x00010001, 0x01010001,
	0x00000101, 0x01000101, 0x00010101, 0x01010101};
#else
const UINT32 to256col2[16] = {
	0x00000000, 0x00000001, 0x00000100, 0x00000101,
	0x00010000, 0x00010001, 0x00010100, 0x00010101,
	0x01000000, 0x01000001, 0x01000100, 0x01000101,
	0x01010000, 0x01010001, 0x01010100, 0x01010101};
#endif
void makesub_initialize(void) { }
#endif
RetroPC.NET-CVS <cvs@retropc.net>