sprintf(p, "@PAL(%03x", wrd_args[0]); for(i = 1; i < 17; i++) sprintf(p + strlen(p), ",%03x", wrd_args[i]); strcat(p, ")"); 
snprintf(p, MIN_MBLOCK_SIZE, "@PAL(%03x", wrd_args[0]); for(i = 1; i < 17; i++) { char q[5]; snprintf(q, sizeof(q)-1, ",%03x", wrd_args[i]); strncat(p, q, MIN_MBLOCK_SIZE - strlen(p) - 1); } strncat(p, ")", MIN_MBLOCK_SIZE - strlen(p) - 1); 
static void wrdt_apply(int cmd, int wrd_argc, int wrd_args[]){    char *p;    char *text;    int i, len;    static txtclr_preserve=0;	if ( !w32g_wrd_wnd.active ) return;    switch(cmd)    {      case WRD_LYRIC:	p = wrd_event2string(wrd_args[0]);	len = strlen(p);	text = (char *)new_segment(&tmpbuffer, SAFE_CONVERT_LENGTH(len));	/*This must be not good thing,but as far as I know no wrd file 	  written in EUC-JP code found*/	strcpy(text,p);#ifdef WRD_VERBOSE//	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,//		  "[WRD_LYRIC]\n%s", text );#endif	putstring_with_esc(text);	reuse_mblock(&tmpbuffer);	break;      case WRD_NL: /* Newline (Ignored) */		esc_nextline();//			 putchar('\n');	break;      case WRD_COLOR:/*Compatibility Hack,This remaps color(17-29 color seems to be ignored in kterm)*/	esc_characterattribute(wrd_args[0]);	break;      case WRD_END: /* Never call */	break;      case WRD_ESC:	borlandc_esc(wrd_event2string(wrd_args[0]));	break;      case WRD_EXEC:	/*I don't spaun another program*/	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@EXEC(%s)", wrd_event2string(wrd_args[0]));	break;      case WRD_FADE:		  wrd_graphic_fade ( wrd_args[0], wrd_args[1], wrd_args[2] );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@FADE(%d,%d,%d)", wrd_args[0], wrd_args[1], wrd_args[2]);#endif	break;      case WRD_FADESTEP:		 wrd_graphic_fadestep ( wrd_args[0] );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@FADESTEP(%d/%d)", wrd_args[0], WRD_MAXFADESTEP);#endif	break;      case WRD_GCIRCLE:		wrd_graphic_gcircle ( wrd_args[0], wrd_args[1], wrd_args[2], wrd_args[3],		  wrd_args[4], wrd_args[5] );	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@GCIRCLE(%d,%d,%d,%d,%d,%d)",		  wrd_args[0], wrd_args[1], wrd_args[2], wrd_args[3],		  wrd_args[4], wrd_args[5]);	break;      case WRD_GCLS:		wrd_graphic_gcls ( wrd_args[0] );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@GCLS(%d)", wrd_args[0]);#endif	break;      case WRD_GINIT:		wrd_graphic_ginit ();#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "@GINIT()");#endif	break;      case WRD_GLINE:		wrd_graphic_gline ( wrd_args[0], wrd_args[1], wrd_args[2], wrd_args[3], wrd_args[4],	       wrd_args[5], wrd_args[6] );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@GLINE(%d,%d,%d,%d,%d,%d,%d)",	       wrd_args[0], wrd_args[1], wrd_args[2], wrd_args[3], wrd_args[4],	       wrd_args[5], wrd_args[6]);#endif	break;      case WRD_GMODE:		  wrd_graphic_gmode ( wrd_args[0] );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@GMODE(%d)", wrd_args[0]);#endif	break;      case WRD_GMOVE:		  wrd_graphic_gmove ( wrd_args[0], wrd_args[1], wrd_args[2], wrd_args[3], wrd_args[4],	       wrd_args[5], wrd_args[6], wrd_args[7], wrd_args[8] );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@GMOVE(%d,%d,%d,%d,%d,%d,%d)",	       wrd_args[0], wrd_args[1], wrd_args[2], wrd_args[3], wrd_args[4],	       wrd_args[5], wrd_args[6], wrd_args[7], wrd_args[8]);#endif	break;      case WRD_GON:		wrd_graphic_gon ( wrd_args[0] );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@GON(%d)", wrd_args[0]);#endif	break;      case WRD_GSCREEN:		wrd_graphic_gscreen ( wrd_args[0], wrd_args[1] );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@GSCREEN(%d,%d)", wrd_args[0], wrd_args[1]);#endif	break;      case WRD_INKEY:	inkey_flag = 1;	ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "@INKEY - begin");	break;      case WRD_OUTKEY:	inkey_flag = 0;	ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "@INKEY - end");	break;      case WRD_LOCATE:	{	int x = wrd_args[0], y = wrd_args[1];	WrdWndGoto(x-1, y-1);	}	break;      case WRD_LOOP: /* Never call */	break;      case WRD_MAG:		wrd_graphic_mag ( wrd_event2string(wrd_args[0]), wrd_args[1], wrd_args[2], wrd_args[3], wrd_args[4]);#ifdef WRD_VERBOSE	p = (char *)new_segment(&tmpbuffer, MIN_MBLOCK_SIZE);	strcpy(p, "@MAG(");	strcat(p, wrd_event2string(wrd_args[0]));	strcat(p, ",");	for(i = 1; i < 3; i++)	{	    if(wrd_args[i] == WRD_NOARG)		strcat(p, "*,");	    else		sprintf(p + strlen(p), "%d,", wrd_args[i]);	}	sprintf(p + strlen(p), "%d,%d)", wrd_args[3], wrd_args[4]);	ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "%s", p);	reuse_mblock(&tmpbuffer);#endif	break;      case WRD_MIDI: /* Never call */	break;      case WRD_OFFSET: /* Never call */	break;      case WRD_PAL:		wrd_graphic_pal_g4r4b4 (wrd_args[0], wrd_args + 1, 16 );#ifdef WRD_VERBOSE	p = (char *)new_segment(&tmpbuffer, MIN_MBLOCK_SIZE);	sprintf(p, "@PAL(%03x", wrd_args[0]);	for(i = 1; i < 17; i++)	    sprintf(p + strlen(p), ",%03x", wrd_args[i]);	strcat(p, ")");	ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "%s", p);	reuse_mblock(&tmpbuffer);#endif	break;      case WRD_PALCHG:		wrd_graphic_apply_pal ( wrd_args[0] );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@PALCHG(%s)", wrd_event2string(wrd_args[0]));#endif	break;      case WRD_PALREV:		wrd_graphic_palrev ( wrd_args[0] );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@PALREV(%d)", wrd_args[0]);#endif	break;      case WRD_PATH:	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@PATH(%s)", wrd_event2string(wrd_args[0]));	break;      case WRD_PLOAD:		wrd_graphic_pload ( wrd_event2string(wrd_args[0]) );#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@PLOAD(%s)", wrd_event2string(wrd_args[0]));#endif	break;      case WRD_REM:	p = wrd_event2string(wrd_args[0]);	len = strlen(p);	text = (char *)new_segment(&tmpbuffer, SAFE_CONVERT_LENGTH(len));	code_convert(p, text, SAFE_CONVERT_LENGTH(len), NULL, NULL);	ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "@REM %s", text);	reuse_mblock(&tmpbuffer);	break;      case WRD_REMARK:	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@REMARK(%s)", wrd_event2string(wrd_args[0]));	break;      case WRD_REST: /* Never call */	break;      case WRD_SCREEN: /* Not supported */	break;      case WRD_SCROLL:		wrd_text_scroll (wrd_args[0], wrd_args[1], wrd_args[2], wrd_args[3],		  wrd_args[4], wrd_args[5], wrd_args[6]);#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@SCROLL(%d,%d,%d,%d,%d,%d,%d)",		  wrd_args[0], wrd_args[1], wrd_args[2], wrd_args[3],		  wrd_args[4], wrd_args[5], wrd_args[6]);#endif	break;      case WRD_STARTUP:		  WrdWndReset ();	inkey_flag = 0;#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@STARTUP(%d)", wrd_args[0]);#endif	esc_clearscreen();	break;      case WRD_STOP: /* Never call */	break;      case WRD_TCLS:	{	  char fillbuf[1024];	{	int left = wrd_args[0], right = wrd_args[2];	int top = wrd_args[1], bottom = wrd_args[3];	SEIKIX(left);	SEIKIX(right);	SEIKIY(top);	SEIKIY(bottom);	if(left>right) right = left;	if(top>bottom) bottom = top;	memset(fillbuf,wrd_args[5],right-left);/*X2-X1*/	fillbuf[right-left]=0;//	borlandc_con_save_attr();	esc_characterattribute(wrd_args[4]);	for(i=top;i<=bottom;i++)/*Y1 to Y2*/ {	  WrdWndGoto(left-1,i-1);	  putstring(fillbuf);	}//	borlandc_con_restore_attr();	}	}	break;      case WRD_TON:		wrd_text_ton ( wrd_args[0] );	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "@TON(%d)", wrd_args[0]);	break;      case WRD_WAIT: /* Never call */	break;      case WRD_WMODE: /* Never call */	break;	/* Ensyutsukun */      case WRD_eFONTM:	print_ecmd("FONTM", wrd_args, 1);	break;      case WRD_eFONTP:	print_ecmd("FONTP", wrd_args, 4);	break;      case WRD_eFONTR:	print_ecmd("FONTR", wrd_args, 17);	break;      case WRD_eGSC:	print_ecmd("GSC", wrd_args, 1);	break;      case WRD_eLINE:	print_ecmd("LINE", wrd_args, 1);	break;      case WRD_ePAL:	print_ecmd("PAL", wrd_args, 2);	break;      case WRD_eREGSAVE:	print_ecmd("REGSAVE", wrd_args, 17);	break;      case WRD_eSCROLL:	print_ecmd("SCROLL",wrd_args, 2);	break;      case WRD_eTEXTDOT:	print_ecmd("TEXTDOT", wrd_args, 1);	break;      case WRD_eTMODE:	print_ecmd("TMODE", wrd_args, 1);	break;      case WRD_eTSCRL:	print_ecmd("TSCRL", wrd_args, 0);	break;      case WRD_eVCOPY:	print_ecmd("VCOPY", wrd_args, 9);	break;      case WRD_eVSGET:	print_ecmd("VSGE", wrd_args, 4);	break;      case WRD_eVSRES:	print_ecmd("VSRES", wrd_args, 0);	break;      case WRD_eXCOPY:		wrd_graphic_xcopy ( wrd_args[0], wrd_args[1], wrd_args[2], wrd_args[3], wrd_args[4], wrd_args[5], wrd_args[6],			 wrd_args[7], wrd_args[8], wrd_args[9], wrd_args[10], wrd_args[11], wrd_args[12], wrd_args[13] );	print_ecmd("XCOPY", wrd_args, 14);	break;	case WRD_START_SKIP:		wrd_start_skip ();#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "WRD_START_SKIP");#endif		break;	case WRD_END_SKIP:		wrd_end_skip ();#ifdef WRD_VERBOSE	ctl->cmsg(CMSG_INFO, VERB_VERBOSE,		  "WRD_END_SKIP");#endif		break;	/* Extensionals */    }}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/361cc5df1e14516b0a3eef7766539860da9a9721/wrdt_w32g.c/clean/interface/wrdt_w32g.c