I've been playing around with a few functions that you *might* be able to use. These are good only for real dos. They will not (at least not yet) work in a 32bit win32 console program. These are used in MSVC ver 1 and the target is a dos exe.
Code:
/* curosr funcs.c */
typedef unsigned char tiny;
tiny getCursorX(void)
{
tiny xpos;
_asm
{
xor bh,bh
mov ah,0x03
int 0x10
mov xpos,dh
int 0x10
}
return xpos;
}
tiny getCursorY(void)
{
tiny ypos;
_asm
{
xor bh,bh
mov ah,0x03
int 0x10
mov ypos,dl
int 0x10
}
return ypos;
}
void exitDOS(void)
{
_asm
{
mov ah,0x02
mov bh,0
mov dx,0
int 0x10
mov ah,0x09
xor bh,bh
mov cx,2000
mov bl,0x07
mov al,' '
int 0x10
}
}
/* a fun one to use */
void centerText(tiny sxpos, tiny expos, tiny sypos, tiny eypos, tiny color, char message[])
{
tiny center;
center = (79 - strlen(message)) / 2;
_asm
{
mov ah,6
xor al,al
mov bh,color
mov ch,sxpos
mov cl,sypos
mov dh,expos
mov dl,eypos
int 0x10
}
setCursor(sxpos,center), printf("%s", message);
}
Put the prototypes in a single header. Probably buggy code, but it does what I want for now.