mirror of
https://github.com/stevenhowes/CTheEscape.git
synced 2026-05-27 00:03:27 +01:00
31 lines
508 B
C
31 lines
508 B
C
#include <stdio.h>
|
|
#include "swis.h"
|
|
#include <kernel.h>
|
|
|
|
// SWI Registers
|
|
extern _kernel_swi_regs inreg;
|
|
extern _kernel_swi_regs outreg;
|
|
|
|
int input_readkey(int key)
|
|
{
|
|
inreg.r[0] = 129;
|
|
inreg.r[1] = key ^ 255;
|
|
inreg.r[2] = 255;
|
|
_kernel_swi(OS_Byte,&inreg,&outreg);
|
|
|
|
if(outreg.r[1] == 255)
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|
|
|
|
int input_readanykey()
|
|
{
|
|
inreg.r[0] = 129;
|
|
inreg.r[1] = 123 + 255;
|
|
inreg.r[2] = 255;
|
|
_kernel_swi(OS_Byte,&inreg,&outreg);
|
|
|
|
return outreg.r[1];
|
|
}
|