我在include的目录里找了半天也没发现,但是我看见一源代码
中有这两个头文件,当中还引用了它们的函数,不知道是何故?
可能这两文件是copy的,如果是麻烦各位告之小弟从何处copy.
谢谢了.
5 个解决方案
#1
TC里本没有此两函数,其为自编也。mouse的工作原理很简单,不懂可问我,而screen函数,我想
你的是直接写屏吧,是比较有点麻烦的,但在DOS下,在不要求动画质量很高的情况下,它可被TC
的内部函数所代替,TC里有很较完全的图形和文本方式下的画图函数。
你的是直接写屏吧,是比较有点麻烦的,但在DOS下,在不要求动画质量很高的情况下,它可被TC
的内部函数所代替,TC里有很较完全的图形和文本方式下的画图函数。
#2
没有。我也想要。
#3
kongmin
我发现mouse用int86x调用很麻烦,大侠可否告之如何在tc中方便运用mouse,mouse的函数如
何去编辑.感激不禁.
我发现mouse用int86x调用很麻烦,大侠可否告之如何在tc中方便运用mouse,mouse的函数如
何去编辑.感激不禁.
#4
gz
#5
#include "dos.h"
/*Mouse Class*/
enum mouse
{NOKEY_MOUSE,
LEFT_MOUSE,
RIGHT_MOUSE,
BOTH_MOUSE,
MIDDLE_MOUSE
};
union REGS reg;
struct SREGS segs;
/*Test mouse install*/
int MouseSet()
{
reg.x.ax=0;
int86(0x33,®,®);
if(reg.x.ax==0)
return (0); /*no mouse.*/
else
return(1);/*mouse has installed.*/
}
/*Turn on mouse cursor.*/
void MouseShow()
{
reg.x.ax=1;
int86(0x33,®,®);
}
/*Turn off mouse cursor.*/
void MouseHidde()
{
reg.x.ax=2;
int86(0x33,®,®);
}
/*read status of mouse key.*/
/*LEFT=1 RIGHT=2 BOTH=3 MIDDLE=4 NOKEY=0*/
int GetMouseKey()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.bx);
}
/*Get mouse X position.*/
int GetMouseX()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.cx);
}
/*Get mouse Y position.*/
int GetMouseY()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.dx);
}
/*Move mouse cursor to X,Y*/
void MouseMove(int x,int y)
{
reg.x.ax=4;
reg.x.cx=x;
reg.x.dx=y;
int86(0x33,®,®);
}
/*Get mouse cursor horizen X position when pressed mouse key.*/
int GetMousePressX(int x)
{
/*x=0 is LEFT mouse key.*/
/*x=1 is RIGHT mouse key.*/
reg.x.ax=5;
reg.x.bx=x;
int86(0x33,®,®);
return(reg.x.cx);
}
int GetMousePressY(int y)
{
reg.x.ax=5;
reg.x.bx=y;
int86(0x33,®,®);
return(reg.x.dx);
}
int GetMouseOpenX(int x)
{
reg.x.ax=6;
reg.x.bx=x;
int86(0x33,®,®);
return(reg.x.cx);
}
int GetMouseOpenY(int y)
{
reg.x.ax=6;
reg.x.bx=y;
int86(0x33,®,®);
return(reg.x.dx);
}
/*Set X horizen rang.*/
void MouseSethor(int xmin,int xmax)
{
reg.x.ax=7;
reg.x.cx=xmin;
reg.x.dx=xmax;
int86(0x33,®,®);
}
/*Set Y vert rang.*/
void MouseSetver(int ymin,int ymax)
{
reg.x.ax=8;
reg.x.cx=ymin;
reg.x.dx=ymax;
int86(0x33,®,®);
}
/*Set mouse cursor activity rangs.*/
void MouseWin(int x,int y,int x1,int y1)
{
MouseSethor(x,x1);
MouseSetver(y,y1);
}
/*Change shape of mouse on the Text Mode.*/
void MouseText(unsigned char color,unsigned char form)
{
reg.x.ax=0x0a;
reg.x.bx=0x00;
reg.x.cx=0xFF00;
reg.h.dh=color;
reg.h.dl=form;
/* form Charactor is for mouse cursor interface.*/
int86(0x33,®,®);
}
/*Change shape of mouse on the Graphics Mode.*/
void MouseFinger()
{
unsigned mask[]={
0xf3ff,0xe1ff,0xe1ff,0xe1ff,
0xe001,0xe000,0xe000,0xe000,
0x8000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x8001,0xc003,
0x0000,0x0c00,0x0c00,0x0c00,
0x0c00,0x0db6,0x0db6,0x0db6,
0x0db6,0x6ffe,0x6ffe,0x6ffe,
0x7ffe,0x7ffe,0x3ffc,0x0000};
reg.x.ax=0x09;
reg.x.bx=0x04;
reg.x.cx=0x00;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
void MouseHand()
{
unsigned mask[]={
0xFF3F,0xE21F,0xE20F,0xE003,
0xE003,0xE003,0x9000,0x8000,
0x8001,0xC001,0xE003,0xE003,
0xE003,0xE007,0xF00F,0xFFFF,
0x00C0,0x1D20,0x1320,0x133C,
0x1334,0x1324,0x6327,0x5809,
0x480A,0x2006,0x100C,0x1004,
0x1004,0x1808,0x0FF0,0x0000};
reg.x.ax=0x09;
reg.x.bx=0x09;
reg.x.cx=0x09;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
void MouseArrow()
{
unsigned mask[]={
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0x0000,0x4000,0x6000,0x7000,
0x7800,0x7c00,0x7e00,0x7f00,
0x7f80,0x7e00,0x7c00,0x4600,
0x0600,0x0300,0x0300,0x0180};
reg.x.ax=0x09;
reg.x.bx=0x00;
reg.x.cx=0x00;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
在程序中#include"mouse.h"
这些函数只要在主函数中调用就可以使用了。
/*Mouse Class*/
enum mouse
{NOKEY_MOUSE,
LEFT_MOUSE,
RIGHT_MOUSE,
BOTH_MOUSE,
MIDDLE_MOUSE
};
union REGS reg;
struct SREGS segs;
/*Test mouse install*/
int MouseSet()
{
reg.x.ax=0;
int86(0x33,®,®);
if(reg.x.ax==0)
return (0); /*no mouse.*/
else
return(1);/*mouse has installed.*/
}
/*Turn on mouse cursor.*/
void MouseShow()
{
reg.x.ax=1;
int86(0x33,®,®);
}
/*Turn off mouse cursor.*/
void MouseHidde()
{
reg.x.ax=2;
int86(0x33,®,®);
}
/*read status of mouse key.*/
/*LEFT=1 RIGHT=2 BOTH=3 MIDDLE=4 NOKEY=0*/
int GetMouseKey()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.bx);
}
/*Get mouse X position.*/
int GetMouseX()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.cx);
}
/*Get mouse Y position.*/
int GetMouseY()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.dx);
}
/*Move mouse cursor to X,Y*/
void MouseMove(int x,int y)
{
reg.x.ax=4;
reg.x.cx=x;
reg.x.dx=y;
int86(0x33,®,®);
}
/*Get mouse cursor horizen X position when pressed mouse key.*/
int GetMousePressX(int x)
{
/*x=0 is LEFT mouse key.*/
/*x=1 is RIGHT mouse key.*/
reg.x.ax=5;
reg.x.bx=x;
int86(0x33,®,®);
return(reg.x.cx);
}
int GetMousePressY(int y)
{
reg.x.ax=5;
reg.x.bx=y;
int86(0x33,®,®);
return(reg.x.dx);
}
int GetMouseOpenX(int x)
{
reg.x.ax=6;
reg.x.bx=x;
int86(0x33,®,®);
return(reg.x.cx);
}
int GetMouseOpenY(int y)
{
reg.x.ax=6;
reg.x.bx=y;
int86(0x33,®,®);
return(reg.x.dx);
}
/*Set X horizen rang.*/
void MouseSethor(int xmin,int xmax)
{
reg.x.ax=7;
reg.x.cx=xmin;
reg.x.dx=xmax;
int86(0x33,®,®);
}
/*Set Y vert rang.*/
void MouseSetver(int ymin,int ymax)
{
reg.x.ax=8;
reg.x.cx=ymin;
reg.x.dx=ymax;
int86(0x33,®,®);
}
/*Set mouse cursor activity rangs.*/
void MouseWin(int x,int y,int x1,int y1)
{
MouseSethor(x,x1);
MouseSetver(y,y1);
}
/*Change shape of mouse on the Text Mode.*/
void MouseText(unsigned char color,unsigned char form)
{
reg.x.ax=0x0a;
reg.x.bx=0x00;
reg.x.cx=0xFF00;
reg.h.dh=color;
reg.h.dl=form;
/* form Charactor is for mouse cursor interface.*/
int86(0x33,®,®);
}
/*Change shape of mouse on the Graphics Mode.*/
void MouseFinger()
{
unsigned mask[]={
0xf3ff,0xe1ff,0xe1ff,0xe1ff,
0xe001,0xe000,0xe000,0xe000,
0x8000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x8001,0xc003,
0x0000,0x0c00,0x0c00,0x0c00,
0x0c00,0x0db6,0x0db6,0x0db6,
0x0db6,0x6ffe,0x6ffe,0x6ffe,
0x7ffe,0x7ffe,0x3ffc,0x0000};
reg.x.ax=0x09;
reg.x.bx=0x04;
reg.x.cx=0x00;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
void MouseHand()
{
unsigned mask[]={
0xFF3F,0xE21F,0xE20F,0xE003,
0xE003,0xE003,0x9000,0x8000,
0x8001,0xC001,0xE003,0xE003,
0xE003,0xE007,0xF00F,0xFFFF,
0x00C0,0x1D20,0x1320,0x133C,
0x1334,0x1324,0x6327,0x5809,
0x480A,0x2006,0x100C,0x1004,
0x1004,0x1808,0x0FF0,0x0000};
reg.x.ax=0x09;
reg.x.bx=0x09;
reg.x.cx=0x09;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
void MouseArrow()
{
unsigned mask[]={
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0x0000,0x4000,0x6000,0x7000,
0x7800,0x7c00,0x7e00,0x7f00,
0x7f80,0x7e00,0x7c00,0x4600,
0x0600,0x0300,0x0300,0x0180};
reg.x.ax=0x09;
reg.x.bx=0x00;
reg.x.cx=0x00;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
在程序中#include"mouse.h"
这些函数只要在主函数中调用就可以使用了。
#1
TC里本没有此两函数,其为自编也。mouse的工作原理很简单,不懂可问我,而screen函数,我想
你的是直接写屏吧,是比较有点麻烦的,但在DOS下,在不要求动画质量很高的情况下,它可被TC
的内部函数所代替,TC里有很较完全的图形和文本方式下的画图函数。
你的是直接写屏吧,是比较有点麻烦的,但在DOS下,在不要求动画质量很高的情况下,它可被TC
的内部函数所代替,TC里有很较完全的图形和文本方式下的画图函数。
#2
没有。我也想要。
#3
kongmin
我发现mouse用int86x调用很麻烦,大侠可否告之如何在tc中方便运用mouse,mouse的函数如
何去编辑.感激不禁.
我发现mouse用int86x调用很麻烦,大侠可否告之如何在tc中方便运用mouse,mouse的函数如
何去编辑.感激不禁.
#4
gz
#5
#include "dos.h"
/*Mouse Class*/
enum mouse
{NOKEY_MOUSE,
LEFT_MOUSE,
RIGHT_MOUSE,
BOTH_MOUSE,
MIDDLE_MOUSE
};
union REGS reg;
struct SREGS segs;
/*Test mouse install*/
int MouseSet()
{
reg.x.ax=0;
int86(0x33,®,®);
if(reg.x.ax==0)
return (0); /*no mouse.*/
else
return(1);/*mouse has installed.*/
}
/*Turn on mouse cursor.*/
void MouseShow()
{
reg.x.ax=1;
int86(0x33,®,®);
}
/*Turn off mouse cursor.*/
void MouseHidde()
{
reg.x.ax=2;
int86(0x33,®,®);
}
/*read status of mouse key.*/
/*LEFT=1 RIGHT=2 BOTH=3 MIDDLE=4 NOKEY=0*/
int GetMouseKey()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.bx);
}
/*Get mouse X position.*/
int GetMouseX()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.cx);
}
/*Get mouse Y position.*/
int GetMouseY()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.dx);
}
/*Move mouse cursor to X,Y*/
void MouseMove(int x,int y)
{
reg.x.ax=4;
reg.x.cx=x;
reg.x.dx=y;
int86(0x33,®,®);
}
/*Get mouse cursor horizen X position when pressed mouse key.*/
int GetMousePressX(int x)
{
/*x=0 is LEFT mouse key.*/
/*x=1 is RIGHT mouse key.*/
reg.x.ax=5;
reg.x.bx=x;
int86(0x33,®,®);
return(reg.x.cx);
}
int GetMousePressY(int y)
{
reg.x.ax=5;
reg.x.bx=y;
int86(0x33,®,®);
return(reg.x.dx);
}
int GetMouseOpenX(int x)
{
reg.x.ax=6;
reg.x.bx=x;
int86(0x33,®,®);
return(reg.x.cx);
}
int GetMouseOpenY(int y)
{
reg.x.ax=6;
reg.x.bx=y;
int86(0x33,®,®);
return(reg.x.dx);
}
/*Set X horizen rang.*/
void MouseSethor(int xmin,int xmax)
{
reg.x.ax=7;
reg.x.cx=xmin;
reg.x.dx=xmax;
int86(0x33,®,®);
}
/*Set Y vert rang.*/
void MouseSetver(int ymin,int ymax)
{
reg.x.ax=8;
reg.x.cx=ymin;
reg.x.dx=ymax;
int86(0x33,®,®);
}
/*Set mouse cursor activity rangs.*/
void MouseWin(int x,int y,int x1,int y1)
{
MouseSethor(x,x1);
MouseSetver(y,y1);
}
/*Change shape of mouse on the Text Mode.*/
void MouseText(unsigned char color,unsigned char form)
{
reg.x.ax=0x0a;
reg.x.bx=0x00;
reg.x.cx=0xFF00;
reg.h.dh=color;
reg.h.dl=form;
/* form Charactor is for mouse cursor interface.*/
int86(0x33,®,®);
}
/*Change shape of mouse on the Graphics Mode.*/
void MouseFinger()
{
unsigned mask[]={
0xf3ff,0xe1ff,0xe1ff,0xe1ff,
0xe001,0xe000,0xe000,0xe000,
0x8000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x8001,0xc003,
0x0000,0x0c00,0x0c00,0x0c00,
0x0c00,0x0db6,0x0db6,0x0db6,
0x0db6,0x6ffe,0x6ffe,0x6ffe,
0x7ffe,0x7ffe,0x3ffc,0x0000};
reg.x.ax=0x09;
reg.x.bx=0x04;
reg.x.cx=0x00;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
void MouseHand()
{
unsigned mask[]={
0xFF3F,0xE21F,0xE20F,0xE003,
0xE003,0xE003,0x9000,0x8000,
0x8001,0xC001,0xE003,0xE003,
0xE003,0xE007,0xF00F,0xFFFF,
0x00C0,0x1D20,0x1320,0x133C,
0x1334,0x1324,0x6327,0x5809,
0x480A,0x2006,0x100C,0x1004,
0x1004,0x1808,0x0FF0,0x0000};
reg.x.ax=0x09;
reg.x.bx=0x09;
reg.x.cx=0x09;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
void MouseArrow()
{
unsigned mask[]={
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0x0000,0x4000,0x6000,0x7000,
0x7800,0x7c00,0x7e00,0x7f00,
0x7f80,0x7e00,0x7c00,0x4600,
0x0600,0x0300,0x0300,0x0180};
reg.x.ax=0x09;
reg.x.bx=0x00;
reg.x.cx=0x00;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
在程序中#include"mouse.h"
这些函数只要在主函数中调用就可以使用了。
/*Mouse Class*/
enum mouse
{NOKEY_MOUSE,
LEFT_MOUSE,
RIGHT_MOUSE,
BOTH_MOUSE,
MIDDLE_MOUSE
};
union REGS reg;
struct SREGS segs;
/*Test mouse install*/
int MouseSet()
{
reg.x.ax=0;
int86(0x33,®,®);
if(reg.x.ax==0)
return (0); /*no mouse.*/
else
return(1);/*mouse has installed.*/
}
/*Turn on mouse cursor.*/
void MouseShow()
{
reg.x.ax=1;
int86(0x33,®,®);
}
/*Turn off mouse cursor.*/
void MouseHidde()
{
reg.x.ax=2;
int86(0x33,®,®);
}
/*read status of mouse key.*/
/*LEFT=1 RIGHT=2 BOTH=3 MIDDLE=4 NOKEY=0*/
int GetMouseKey()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.bx);
}
/*Get mouse X position.*/
int GetMouseX()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.cx);
}
/*Get mouse Y position.*/
int GetMouseY()
{
reg.x.ax=3;
int86(0x33,®,®);
return(reg.x.dx);
}
/*Move mouse cursor to X,Y*/
void MouseMove(int x,int y)
{
reg.x.ax=4;
reg.x.cx=x;
reg.x.dx=y;
int86(0x33,®,®);
}
/*Get mouse cursor horizen X position when pressed mouse key.*/
int GetMousePressX(int x)
{
/*x=0 is LEFT mouse key.*/
/*x=1 is RIGHT mouse key.*/
reg.x.ax=5;
reg.x.bx=x;
int86(0x33,®,®);
return(reg.x.cx);
}
int GetMousePressY(int y)
{
reg.x.ax=5;
reg.x.bx=y;
int86(0x33,®,®);
return(reg.x.dx);
}
int GetMouseOpenX(int x)
{
reg.x.ax=6;
reg.x.bx=x;
int86(0x33,®,®);
return(reg.x.cx);
}
int GetMouseOpenY(int y)
{
reg.x.ax=6;
reg.x.bx=y;
int86(0x33,®,®);
return(reg.x.dx);
}
/*Set X horizen rang.*/
void MouseSethor(int xmin,int xmax)
{
reg.x.ax=7;
reg.x.cx=xmin;
reg.x.dx=xmax;
int86(0x33,®,®);
}
/*Set Y vert rang.*/
void MouseSetver(int ymin,int ymax)
{
reg.x.ax=8;
reg.x.cx=ymin;
reg.x.dx=ymax;
int86(0x33,®,®);
}
/*Set mouse cursor activity rangs.*/
void MouseWin(int x,int y,int x1,int y1)
{
MouseSethor(x,x1);
MouseSetver(y,y1);
}
/*Change shape of mouse on the Text Mode.*/
void MouseText(unsigned char color,unsigned char form)
{
reg.x.ax=0x0a;
reg.x.bx=0x00;
reg.x.cx=0xFF00;
reg.h.dh=color;
reg.h.dl=form;
/* form Charactor is for mouse cursor interface.*/
int86(0x33,®,®);
}
/*Change shape of mouse on the Graphics Mode.*/
void MouseFinger()
{
unsigned mask[]={
0xf3ff,0xe1ff,0xe1ff,0xe1ff,
0xe001,0xe000,0xe000,0xe000,
0x8000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x8001,0xc003,
0x0000,0x0c00,0x0c00,0x0c00,
0x0c00,0x0db6,0x0db6,0x0db6,
0x0db6,0x6ffe,0x6ffe,0x6ffe,
0x7ffe,0x7ffe,0x3ffc,0x0000};
reg.x.ax=0x09;
reg.x.bx=0x04;
reg.x.cx=0x00;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
void MouseHand()
{
unsigned mask[]={
0xFF3F,0xE21F,0xE20F,0xE003,
0xE003,0xE003,0x9000,0x8000,
0x8001,0xC001,0xE003,0xE003,
0xE003,0xE007,0xF00F,0xFFFF,
0x00C0,0x1D20,0x1320,0x133C,
0x1334,0x1324,0x6327,0x5809,
0x480A,0x2006,0x100C,0x1004,
0x1004,0x1808,0x0FF0,0x0000};
reg.x.ax=0x09;
reg.x.bx=0x09;
reg.x.cx=0x09;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
void MouseArrow()
{
unsigned mask[]={
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0xffff,0xffff,0xffff,0xffff,
0x0000,0x4000,0x6000,0x7000,
0x7800,0x7c00,0x7e00,0x7f00,
0x7f80,0x7e00,0x7c00,0x4600,
0x0600,0x0300,0x0300,0x0180};
reg.x.ax=0x09;
reg.x.bx=0x00;
reg.x.cx=0x00;
reg.x.dx=FP_OFF(mask);
segs.es=FP_SEG(mask);
int86x(0x33,®,®,&segs);
}
在程序中#include"mouse.h"
这些函数只要在主函数中调用就可以使用了。