////////////////////////////////////////////////////////////////////////////////
//  CQ出版社 インターフェース 2008年7月号
//
//  初音ミク（はちゅねみく）・アニメーション
//  画像変換ツール	Copyright(c)2008 Sumio Morioka
//  morioka@fb3.so-net.ne.jp,  http://www002.upp.so-net.ne.jp/morioka/
//
//  本プログラムコードの商業利用，および改変ファイルの二次配布を禁じます．それ以外の
//  利用はとくに制限しませんが，利用によって生じた被害・不利益などに対しては，一切
//  責任を負いませんのでご了承ください．
//
//  また，本プログラムのサンプルとして同梱される初音ミク，はちゅねミク，鏡音リン・レンの
//  画像（フォント・データも含む）は，クリプトン・フューチャー・メディア株式会社
// （http://www.crypton.co.jp）の著作物です．商業利用等については同社へ問い合わせてください．
//
//
// History:
// 1. Original coding by Sumio Morioka, 2008/04/18
//
////////////////////////////////////////////////////////////////////////////////

{
	int	val, dummy;

	// load pal file
	fgets(linebuf, 1023, fp);		// cut
	fgets(linebuf, 1023, fp);		// cut
	fgets(linebuf, 1023, fp);		// cut
	fgets(linebuf, 1023, fp);		// cut

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%d=%d\n", &dummy, &val);
	m_r0	= bmp2FRfont_v8to3(val & 0xFF);
	m_g0	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b0	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r1	= bmp2FRfont_v8to3(val & 0xFF);
	m_g1	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b1	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r2	= bmp2FRfont_v8to3(val & 0xFF);
	m_g2	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b2	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r3	= bmp2FRfont_v8to3(val & 0xFF);
	m_g3	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b3	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r4	= bmp2FRfont_v8to3(val & 0xFF);
	m_g4	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b4	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r5	= bmp2FRfont_v8to3(val & 0xFF);
	m_g5	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b5	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r6	= bmp2FRfont_v8to3(val & 0xFF);
	m_g6	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b6	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r7	= bmp2FRfont_v8to3(val & 0xFF);
	m_g7	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b7	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r8	= bmp2FRfont_v8to3(val & 0xFF);
	m_g8	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b8	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r9	= bmp2FRfont_v8to3(val & 0xFF);
	m_g9	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b9	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r10	= bmp2FRfont_v8to3(val & 0xFF);
	m_g10	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b10	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r11	= bmp2FRfont_v8to3(val & 0xFF);
	m_g11	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b11	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r12	= bmp2FRfont_v8to3(val & 0xFF);
	m_g12	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b12	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r13	= bmp2FRfont_v8to3(val & 0xFF);
	m_g13	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b13	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r14	= bmp2FRfont_v8to3(val & 0xFF);
	m_g14	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b14	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	fgets(linebuf, 1023, fp);
	sscanf(linebuf, "Color%02d=%d\n", &dummy, &val);
	m_r15	= bmp2FRfont_v8to3(val & 0xFF);
	m_g15	= bmp2FRfont_v8to3((val >> 8) & 0xFF);
	m_b15	= bmp2FRfont_v8to3((val >> 16) & 0xFF);

	m_pltsw0  = FALSE;
	m_pltsw1  = FALSE;
	m_pltsw2  = FALSE;
	m_pltsw3  = FALSE;
	m_pltsw4  = FALSE;
	m_pltsw5  = FALSE;
	m_pltsw6  = FALSE;
	m_pltsw7  = FALSE;
	m_pltsw8  = FALSE;
	m_pltsw9  = FALSE;
	m_pltsw10 = FALSE;
	m_pltsw11 = FALSE;
	m_pltsw12 = FALSE;
	m_pltsw13 = FALSE;
	m_pltsw14 = FALSE;
	m_pltsw15 = FALSE;
}
