#include"del_prn.h"

enum PRNERR	prn_halfpack(char c1,char c2)
{
	enum PRNERR	temp;

	if	(Prn_istategaki==0)	/* そもそも縦書きでない → エラー */
		return PRNERR_BADDATA;

	if	(Prn_mode==PRNMODE_ESCP)
	{
		static	char	code[] = {0x1c,'D',0,0,0,0};

		code[2] = Prn_chartable[c1] & 255;
		code[3] = Prn_chartable[c1] >>8;
		code[4] = Prn_chartable[c2] & 255;
		code[5] = Prn_chartable[c2] >>8;

		temp = prn_putcode(6,code);
		if	(temp)
			return temp;

		Prn_carridge += (12+Prn_leftspace+Prn_rightspace)
						*Prn_ishdouble*2;
	}
	else if	(Prn_mode==PRNMODE_MSX || Prn_mode==PRNMODE_PCPR)
	{
		static	char	code[]={0x1b,'h','1',	/* 半角文字の縦印字 */
					0x1b,'q',	/* 半角組文字の指定 */
					0,0,0,0,	/* 文字             */
					0x1b,'h','0'};	/* 半角縦印字解除   */
		code[6] = c1;
		code[8] = c2;

		temp = prn_putcode(9,code);
		if	(temp)
			return temp;

		Prn_carridge += (12+Prn_leftspace+Prn_rightspace)
						*Prn_ishdouble*2;
	}

	return PRNERR_OK;
}
