Sindbad~EG File Manager
/* prototypes of functions in screen.c */
void cls(void); /* clear the entire screen */
void tmove(int row,int col); /* locate the cursor */
void tget(int *rowp, int *colp); /* where is the cursor? */
void wa(int n, char attr); /* change the attribute for n characters */
void mode43(short mode);
#define TEXT43 0x1112 /* for use in mode43 */
#define GRAPHICS43 0x1123
int kbhit(void);
void keyb(int *, int *);
void keyboard_status(int *, int *, int *, int *);
void numlock_off(void);
void bios_putch(char,char);
typedef short coord;
void wwrite(char *writethis, coord x,coord y,char attr);
/* write a string at specified location in specified attribute */
void wputch(unsigned char writethis, coord x, coord y, char attr);
/* write a single char at specified location in specified attribute */
/*_____________________________________________________________________*/
/* macro CH converts 'coord' units to rows and columns; it is used
by the display function in DOS text mode */
#define CH(x) ((x & 0x000f) ? (((x)+( ((((x) & 0x000f)-1)&0x0008) << 1)) >> 4) : x >> 4)
/* divide x by 16, but round up if the remainder is more than 8,
and round down (truncate) if less than or equal to 8. This works
because (x) & 0x000f is the lower-order four bits. Then
subtract 1, and mask with 0x0008 to test bit 3.
Bit 3 is 1 iff the original four bits formed
a number > 8. Shift this bit (be it 0 or 1) left to the bit-4
position (actually the fifth bit, since they start with bit 0),
and add it to x. This rounds x up if the original four bits were more
than 8. Now divide by 16 by right-shifting 4. The outer ?: operator
catches the case x divisible by 16,
which otherwise comes out wrong thanks to subtracting 1. */
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists