From 1aa0e17df7c325a41de8cf8a57f52ed853f08bf3 Mon Sep 17 00:00:00 2001 From: "John Wilbert M. Villamor" Date: Fri, 24 Apr 2020 19:01:28 +0800 Subject: Refined toolchain instructions, organized examples, added automatic retry for CdRead(), added FIOCSCAN ioctl in psxsio TTY driver, added tty and console examples. --- libpsn00b/psxsio/siocons.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'libpsn00b/psxsio/siocons.c') diff --git a/libpsn00b/psxsio/siocons.c b/libpsn00b/psxsio/siocons.c index 76bf8be..703504f 100644 --- a/libpsn00b/psxsio/siocons.c +++ b/libpsn00b/psxsio/siocons.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -74,6 +75,19 @@ static int _sio_inout(FCB *fcb, int cmd) { } +static int _sio_ioctl(FCB *fcb, int cmd, int arg) +{ + if( cmd == FIOCSCAN ) + { + if( _sio_key_pending ) + { + return 0; + } + } + + return -1; +} + static int _sio_close(int h) { return h; @@ -112,7 +126,7 @@ static DCB _sio_dcb = { (void*)_sio_open, // open (void*)_sio_inout, // inout _sio_close, // close - NULL, // ioctl + _sio_ioctl, // ioctl NULL, // read NULL, // write NULL, // erase -- cgit v1.2.3