China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 10:17
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Question about Chinese display output View 860 Replies 0
Original Poster Posted 2004-06-29 00:00 ·  中国 福建 厦门 电信
初级用户
Credits 106
Posts 1
Joined 2004-06-28 00:00
22-year member
UID 27508
Gender Male
Status Offline
Experts,

I have a question for all of you experts: how can I display Chinese information only in part of the screen, showing Chinese prompt messages locally without using full-screen graphics? I wrote a full-screen display program, but it cannot meet my project requirements. My program is as follows:
#include
#include
#include
#include
#include
#include
#include
#include
#define ROW 2
#define COL 2
void main(void)
{
int x,y,keyx;
char *tape="Please load the corresponding tape into the tape drive for testing, then press any key to continue";
char *cd="Please insert the test CD into the CD-ROM drive for testing, then press any key to continue";
char *fd="Please insert any floppy disk into the floppy drive for testing, then press any key to continue";
char *cyclops="Please insert the small white loop into the cyclops on the panel for testing, then press any key to continue";
char *fpnllcd="Please check whether the LCD screen on the panel displays normally, whether the characters are normal, and whether there are any error records. After pressing any key, answer yes or no";
char *cmdline=getenv("ITEST";
char *s="ABCD";
FILE *fp;
char buffer;
register m,n,i,j,k;
unsigned char qh,wh;
unsigned long offset;
int gd=DETECT,gm;
registerbgidriver(EGAVGA_driver);
initgraph(&gd,&gm,"";
while(bioskey(1)!=0)
{
keyx=bioskey(0);
if(isalnum(keyx & 0xFF))
printf("%c\n",keyx);
else
printf("%#02x\n",keyx);
}
if ((fp=fopen("hzk16","rb")==NULL)
{
printf("Can't open hzk16,Please add it";
getch();
closegraph();
exit(0);
}
x=20; y=100;
if(strcmp(cmdline,"TAPE"==0) strcpy(s,tape);
if(strcmp(cmdline,"CD"==0) strcpy(s,cd);
if(strcmp(cmdline,"FD"==0) strcpy(s,fd);
if(strcmp(cmdline,"CYCLOPS"==0) strcpy(s,cyclops);
if(strcmp(cmdline,"FPNLLCD"==0) strcpy(s,fpnllcd);
while(*s)
{
qh=*(s)-0xa0;
wh=*(s+1)-0xa0;
offset=(94*(qh-1)+(wh-1))*32L;
fseek(fp,offset,SEEK_SET);
fread(buffer,32,1,fp);
for (i=0;i<16;i++)
for(n=0;n<ROW;n++)
for(j=0;j<2;j++)
for(k=0;k<8;k++)
for(m=0;m>(7-k))&0x1)!=NULL)
putpixel(x+8*j*COL+k*COL+m,y+i*ROW+n,WHITE);
s+=2;
x+=30;
if(x>540){
y+=100;
x=20;
}
}
beep:
sound(800);delay(4000);
if(!getch()) goto beep;
nosound();
fclose(fp);
closegraph();
}

Can any expert help me take a look?

I wonder whether it can be changed into something like a dialog box in Windows programming, or like a message box.

Thanks!
Forum Jump: