/* csf1.c */
/* Programed by AZO */
/* This code is free. At Your Own Risk. */

#include "csf1.h"

void CSF1CharToItem(CSF1_Item_t* o_ptItem, const unsigned char i_ucChar) {
	switch(i_ucChar) {
		case 0x20:
			o_ptItem->Action = CSF1_TERM;
			o_ptItem->Val = 0;
			break;
		case 0x21:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 0;
			break;
		case 0x22:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 1;
			break;
		case 0x23:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 2;
			break;
		case 0x24:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 3;
			break;
		case 0x25:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 4;
			break;
		case 0x26:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 5;
			break;
		case 0x28:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 6;
			break;
		case 0x29:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 7;
			break;
		case 0x2A:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 8;
			break;
		case 0x2B:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 9;
			break;
		case 0x2C:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 10;
			break;
		case 0x2D:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 11;
			break;
		case 0x2E:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 12;
			break;
		case 0x2F:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 13;
			break;
		case 0x30:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 14;
			break;
		case 0x31:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 15;
			break;
		case 0x32:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 16;
			break;
		case 0x33:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 17;
			break;
		case 0x34:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 18;
			break;
		case 0x35:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 19;
			break;
		case 0x36:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 20;
			break;
		case 0x37:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 21;
			break;
		case 0x38:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 22;
			break;
		case 0x39:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 23;
			break;
		case 0x3A:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 24;
			break;
		case 0x3B:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 25;
			break;
		case 0x3C:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 26;
			break;
		case 0x3D:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 27;
			break;
		case 0x3E:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 28;
			break;
		case 0x3F:
			o_ptItem->Action = CSF1_MOVE_X;
			o_ptItem->Val = 29;
			break;
		case 0x40:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 0;
			break;
		case 0x41:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 1;
			break;
		case 0x42:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 2;
			break;
		case 0x43:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 3;
			break;
		case 0x44:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 4;
			break;
		case 0x45:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 5;
			break;
		case 0x46:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 6;
			break;
		case 0x47:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 7;
			break;
		case 0x48:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 8;
			break;
		case 0x49:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 9;
			break;
		case 0x4A:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 10;
			break;
		case 0x4B:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 11;
			break;
		case 0x4C:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 12;
			break;
		case 0x4D:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 13;
			break;
		case 0x4E:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 14;
			break;
		case 0x4F:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 15;
			break;
		case 0x50:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 16;
			break;
		case 0x51:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 17;
			break;
		case 0x52:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 18;
			break;
		case 0x53:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 19;
			break;
		case 0x54:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 20;
			break;
		case 0x55:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 21;
			break;
		case 0x56:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 22;
			break;
		case 0x57:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 23;
			break;
		case 0x58:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 24;
			break;
		case 0x59:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 25;
			break;
		case 0x5A:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 26;
			break;
		case 0x5B:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 27;
			break;
		case 0x5E:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 28;
			break;
		case 0x5F:
			o_ptItem->Action = CSF1_DRAW_X;
			o_ptItem->Val = 29;
			break;
		case 0x60:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 0;
			break;
		case 0x61:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 1;
			break;
		case 0x62:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 2;
			break;
		case 0x63:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 3;
			break;
		case 0x64:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 4;
			break;
		case 0x65:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 5;
			break;
		case 0x66:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 6;
			break;
		case 0x67:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 7;
			break;
		case 0x68:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 8;
			break;
		case 0x69:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 9;
			break;
		case 0x6A:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 10;
			break;
		case 0x6B:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 11;
			break;
		case 0x6C:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 12;
			break;
		case 0x6D:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 13;
			break;
		case 0x6E:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 14;
			break;
		case 0x6F:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 15;
			break;
		case 0x70:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 16;
			break;
		case 0x71:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 17;
			break;
		case 0x72:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 18;
			break;
		case 0x73:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 19;
			break;
		case 0x74:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 20;
			break;
		case 0x75:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 21;
			break;
		case 0x76:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 22;
			break;
		case 0x77:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 23;
			break;
		case 0x78:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 24;
			break;
		case 0x79:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 25;
			break;
		case 0x7A:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 26;
			break;
		case 0x7B:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 27;
			break;
		case 0x7C:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 28;
			break;
		case 0x7D:
			o_ptItem->Action = CSF1_NEXT_X;
			o_ptItem->Val = 29;
			break;
		case 0x7E:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 0;
			break;
		case 0xA1:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 1;
			break;
		case 0xA2:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 2;
			break;
		case 0xA3:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 3;
			break;
		case 0xA4:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 4;
			break;
		case 0xA5:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 5;
			break;
		case 0xA6:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 6;
			break;
		case 0xA7:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 7;
			break;
		case 0xA8:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 8;
			break;
		case 0xA9:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 9;
			break;
		case 0xAA:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 10;
			break;
		case 0xAB:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 11;
			break;
		case 0xAC:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 12;
			break;
		case 0xAD:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 13;
			break;
		case 0xAE:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 14;
			break;
		case 0xAF:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 15;
			break;
		case 0xB0:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 16;
			break;
		case 0xB1:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 17;
			break;
		case 0xB2:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 18;
			break;
		case 0xB3:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 19;
			break;
		case 0xB4:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 20;
			break;
		case 0xB5:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 21;
			break;
		case 0xB6:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 22;
			break;
		case 0xB7:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 23;
			break;
		case 0xB8:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 24;
			break;
		case 0xB9:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 25;
			break;
		case 0xBA:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 26;
			break;
		case 0xBB:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 27;
			break;
		case 0xBC:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 28;
			break;
		case 0xBD:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 29;
			break;
		case 0xBE:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 30;
			break;
		case 0xBF:
			o_ptItem->Action = CSF1_MOVE_Y;
			o_ptItem->Val = 31;
			break;
		case 0xC0:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 0;
			break;
		case 0xC1:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 1;
			break;
		case 0xC2:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 2;
			break;
		case 0xC3:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 3;
			break;
		case 0xC4:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 4;
			break;
		case 0xC5:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 5;
			break;
		case 0xC6:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 6;
			break;
		case 0xC7:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 7;
			break;
		case 0xC8:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 8;
			break;
		case 0xC9:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 9;
			break;
		case 0xCA:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 10;
			break;
		case 0xCB:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 11;
			break;
		case 0xCC:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 12;
			break;
		case 0xCD:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 13;
			break;
		case 0xCE:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 14;
			break;
		case 0xCF:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 15;
			break;
		case 0xD0:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 16;
			break;
		case 0xD1:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 17;
			break;
		case 0xD2:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 18;
			break;
		case 0xD3:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 19;
			break;
		case 0xD4:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 20;
			break;
		case 0xD5:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 21;
			break;
		case 0xD6:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 22;
			break;
		case 0xD7:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 23;
			break;
		case 0xD8:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 24;
			break;
		case 0xD9:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 25;
			break;
		case 0xDA:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 26;
			break;
		case 0xDB:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 27;
			break;
		case 0xDC:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 28;
			break;
		case 0xDD:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 29;
			break;
		case 0xDE:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 30;
			break;
		case 0xDF:
			o_ptItem->Action = CSF1_DRAW_Y;
			o_ptItem->Val = 31;
			break;
		default:
			o_ptItem->Action = CSF1_INIT;
			o_ptItem->Val = 0;
			break;
	}
}

void CSF1LineToGlyph(CSF1_Glyph_t* o_ptGlyph, const char i_strLine[]) {
	unsigned int uiLocate = 5;
	unsigned int uiItemCount = 0;

	if(strlen(i_strLine) >= 6) {
		if(i_strLine[0] != '*') {
			/* JIS */
			if(i_strLine[0] >= '0' && i_strLine[0] <= '9') {
				o_ptGlyph->JIS = (unsigned int)(i_strLine[0]) - '0';
			} else if(i_strLine[0] >= 'A' && i_strLine[0] <= 'F') {
				o_ptGlyph->JIS = (unsigned int)(i_strLine[0]) - 'A' + 10;
			} else if(i_strLine[0] >= 'a' && i_strLine[0] <= 'f') {
				o_ptGlyph->JIS = (unsigned int)(i_strLine[0]) - 'a' + 10;
			} else {
				o_ptGlyph->JIS = 0;
			}
			o_ptGlyph->JIS <<= 4;
			if(i_strLine[1] >= '0' && i_strLine[1] <= '9') {
				o_ptGlyph->JIS += (unsigned int)(i_strLine[1]) - '0';
			} else if(i_strLine[1] >= 'A' && i_strLine[1] <= 'F') {
				o_ptGlyph->JIS += (unsigned int)(i_strLine[1]) - 'A' + 10;
			} else if(i_strLine[1] >= 'a' && i_strLine[1] <= 'f') {
				o_ptGlyph->JIS += (unsigned int)(i_strLine[1]) - 'a' + 10;
			} else {
				o_ptGlyph->JIS += 0;
			}
			o_ptGlyph->JIS <<= 4;
			if(i_strLine[2] >= '0' && i_strLine[2] <= '9') {
				o_ptGlyph->JIS += (unsigned int)(i_strLine[2]) - '0';
			} else if(i_strLine[2] >= 'A' && i_strLine[2] <= 'F') {
				o_ptGlyph->JIS += (unsigned int)(i_strLine[2]) - 'A' + 10;
			} else if(i_strLine[2] >= 'a' && i_strLine[2] <= 'f') {
				o_ptGlyph->JIS += (unsigned int)(i_strLine[2]) - 'a' + 10;
			} else {
				o_ptGlyph->JIS += 0;
			}
			o_ptGlyph->JIS <<= 4;
			if(i_strLine[3] >= '0' && i_strLine[3] <= '9') {
				o_ptGlyph->JIS += (unsigned int)(i_strLine[3]) - '0';
			} else if(i_strLine[3] >= 'A' && i_strLine[3] <= 'F') {
				o_ptGlyph->JIS += (unsigned int)(i_strLine[3]) - 'A' + 10;
			} else if(i_strLine[3] >= 'a' && i_strLine[3] <= 'f') {
				o_ptGlyph->JIS += (unsigned int)(i_strLine[3]) - 'a' + 10;
			} else {
				o_ptGlyph->JIS += 0;
			}

			/* Items */
			while(1) {
				CSF1CharToItem(&(o_ptGlyph->Items[uiItemCount]), (unsigned char)(i_strLine[uiLocate]));
				uiItemCount++;
				uiLocate++;
				if(o_ptGlyph->Items[uiItemCount - 1].Action == CSF1_TERM) {
					o_ptGlyph->ItemCount = uiItemCount;
					break;
				}
			}
		}
	}
}

void LoadKST32B(CSF1_GlyphsData_t* o_ptGlyphsData) {
	FILE* fp = NULL;
	unsigned int uiGlyphsCount = 0;
	char strLine[256];

	/* Open KST32B File */
	fp = fopen("kst32b.txt", "r");

	/* Read whole lines */
	memset(o_ptGlyphsData, 0, sizeof(CSF1_GlyphsData_t));
	while(fgets(strLine, sizeof(strLine), fp)) {
		CSF1LineToGlyph(&(o_ptGlyphsData->Glyphs[uiGlyphsCount]), strLine);
		if(o_ptGlyphsData->Glyphs[uiGlyphsCount].JIS != 0) {
			uiGlyphsCount++;
		}
	}
	o_ptGlyphsData->GlyphsCount = uiGlyphsCount;
	
	/* File close */
	fclose(fp);
}

void PrintCSF1Glyphs(const CSF1_GlyphsData_t* i_ptGlyphsData) {
	unsigned int uiCount1, uiCount2;
	CSF1_Glyph_t* ptGlyph;
	CSF1_Item_t* ptItem;

	/* Print output */
	for(uiCount1 = 0; uiCount1 < i_ptGlyphsData->GlyphsCount; uiCount1++) {
		ptGlyph = (CSF1_Glyph_t*)&(i_ptGlyphsData->Glyphs[uiCount1]);
		printf("JIS : 0x%04X / Items : %d\n", ptGlyph->JIS, ptGlyph->ItemCount);
		for(uiCount2 = 0; uiCount2 < ptGlyph->ItemCount; uiCount2++) {
			ptItem = (CSF1_Item_t*)&(ptGlyph->Items[uiCount2]);
			switch(ptItem->Action) {
				case CSF1_INIT:
					printf("INIT\n");
					break;
				case CSF1_MOVE_X:
					printf("MOVX : %d\n", ptItem->Val);
					break;
				case CSF1_DRAW_X:
					printf("DRWX : %d\n", ptItem->Val);
					break;
				case CSF1_NEXT_X:
					printf("NXTX : %d\n", ptItem->Val);
					break;
				case CSF1_MOVE_Y:
					printf("MOVY : %d\n", ptItem->Val);
					break;
				case CSF1_DRAW_Y:
					printf("DRWY : %d\n", ptItem->Val);
					break;
				case CSF1_TERM:
					printf("TERM\n");
					break;
				default:
					printf("*Unknown Action*\n");
					break;
			}
		}
		printf("\n");
	}
	printf("%d glyphs. done.\n", i_ptGlyphsData->GlyphsCount);
}
