📄 philips.c
字号:
#include <bios.h>
#include <dos.h>
void pwait(unsigned int delay)
{
unsigned int d_cnt=0;
unsigned int m_cnt;
do
{
d_cnt++;
do
{
m_cnt++;
}
while(m_cnt<delay);
m_cnt=0;
}
while(d_cnt<delay);
}
unsigned long timer(void)
{
unsigned long longtime;
struct time t;
gettime(&t);
longtime=(((((t.ti_hour*60)+t.ti_min)*60)+t.ti_sec)*100)+t.ti_hund;
return(longtime);
}
unsigned char get16_bit(unsigned int position,unsigned int int_data)
{
unsigned int temp;
unsigned int result;
temp=0x0001;
temp=temp<<position;
result=temp&int_data;
// printf("\nData:%4X, Position=%1d Mask=%4X, Product=%4X",int_data,position,temp,result);
if(result!=0) {return(1);}
else { return(0);}
}
char read_key(unsigned char mode)
{
char key_buff;
unsigned int temp;
if(mode==2)
{
while(bioskey(1) == 0);
{
temp=bioskey(0);
if(temp==0x4800) { key_buff='u'; }
else if(temp==0x5000) { key_buff='d'; }
else if(temp==0x4B00) { key_buff='l'; }
else if(temp==0x4D00) { key_buff='r'; }
else {key_buff=(char)(temp&0x00FF);}
}
}
if(mode==1) //wait for key input
{
while (bioskey(1) == 0);
key_buff = bioskey(0);
}
if(mode==0) //don't wait
{
key_buff=0;
if(bioskey(1)!=0)
{
key_buff = bioskey(0);
}
}
return(key_buff);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -