Keypressed lässt sich aber problemlos reinprogrammieren (für DOS und DOS4GW).
DOS:
char KeyPressed()
{
char Temp=0;
_asm
{
mov ah,1
int 16h
setnz al
mov Temp,al
}
return Temp;
}
(Vielleicht nicht die eleganteste und schnellste Methode, aber funktioniert.
DOS4GW:
typedef _Packed struct
{
long EDI;
long ESI;
long EBP;
long Reserved;
long EBX;
long EDX;
long ECX;
long EAX;
short flags;
short ES,DS,FS,GS,IP,CS,SP,SS;
} RMRegs;
char KeyPressed()
{
RMRegs RealModeRegs;
short Temp=0;
/* Prepare values for interrupt */
RealModeRegs.EAX=0x100;
// mov ah,1
_asm
{
mov ax,300h
mov bl,16h
mov bh,0
// flags, but they aren’t used
mov cx,0
// number of words to copy from protected
// mode to real mode stack ??
lea edi,RealModeRegs
int 31h
//DPMI Interrupt
jnc NoError
mov Temp,0xff
NoError:
}
if (Temp==0xff) return 0;
Temp=RealModeRegs.flags;
_asm
{
mov ax,Temp;
push ax
popf
setnz al
xor ah,ah
mov Temp,ax
}
return ((char)Temp);
}
(Etwas länger und noch ein bisschen komplizierter)
CFox