📄 hzkxms.h
字号:
unsigned hzhandle;
xmm xmove;
char Load_Hzk16_Xms(void)
{
int e,hzk;
char flag;
unsigned a,pageaddr;
unsigned char far *tmp,buffer[4096];
unsigned max_block,total;
hzk=open("hzk16",O_RDONLY|O_BINARY);
if (hzk!=-1)
{
if (test_xms())
{
get_driver_address();
query_free_xms(&max_block,&total);
if (max_block>300)
{
if (!allocate_xms(300,&hzhandle))
{
unsigned long s=0;
xmove.byte_count=4096;
xmove.source_handle=0;
xmove.source_offset=(unsigned long)buffer;
xmove.destination_handle=hzhandle;
for (;e>0;)
{
e=read(hzk,buffer,4096);
xmove.destination_offset=s;
s+=e;
move_xms(&xmove);
}
close(hzk);
xmove.byte_count=32;
xmove.source_handle=hzhandle;
xmove.destination_handle=0;
return(0);
}
}
}
}
return(1);
}
void Read_Hzk16_Xms(int ch0,int ch1,unsigned char *buffer)
{
unsigned p1,p2;
p1=ch0-161;
p1=p1*94+ch1-161;
xmove.source_offset=p1;
xmove.source_offset*=32;
xmove.destination_offset=(unsigned long)buffer;
move_xms(&xmove);
}
void Free_Hzk16_Xms(void)
{
free_xms(hzhandle);
}
void Write_Hzk_Xms(char ch0,char ch1,int x,int y,int color)
{
register int i,j,k;
unsigned vpos;
char bitdata[32];
Read_Hzk16_Xms(ch0,ch1,bitdata);
for(i=0;i<16;i++)
for(j=0;j<8;j++){
if(bitdata[2*i]&bit[j])
Plot_Pixel_Fast(x+j,i+y,color);
if(bitdata[2*i+1]&bit[j])
Plot_Pixel_Fast(x+8+j,i+y,color);
}
}
void Write_Hzk_String_Xms(char *str,int x,int y,int color)
{
int num,i,j,xx;
unsigned char s0,s1;
num=strlen(str);
xx=x;
for(i=0;i<num;i+=2){
Write_Hzk_Xms(str[i],str[i+1],xx,y,color);
xx+=16;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -