FreeBASIC  0.91.0
io_readxy.c
Go to the documentation of this file.
1 /* console SCREEN() function (cursor position query) */
2 
3 #include "../fb.h"
4 #include "fb_private_console.h"
5 #include <go32.h>
6 #include <dpmi.h>
7 #include <sys/farptr.h>
8 
9 unsigned int fb_ConsoleReadXY_BIOS( int col, int row, int colorflag )
10 {
11  unsigned short usPosOld = fb_hSetCursorPos( col, row );
12 
13  __dpmi_regs regs;
14  regs.x.ax = 0x0800;
15  regs.x.bx = __fb_con.active;
16  __dpmi_int(0x10, &regs);
17 
18  fb_hSetCursorPos( usPosOld, -1 );
19 
20  if( colorflag )
21  return (unsigned int)regs.h.ah;
22  else
23  return (unsigned int)regs.h.al;
24 }
25 
26 FBCALL unsigned int fb_ConsoleReadXY( int col, int row, int colorflag )
27 {
28  return fb_ConsoleReadXY_BIOS( col - 1, row - 1, colorflag );
29 }