diff options
| author | John Wilbert M. Villamor <lameguy64@gmail.com> | 2020-04-24 19:01:28 +0800 |
|---|---|---|
| committer | John Wilbert M. Villamor <lameguy64@gmail.com> | 2020-04-24 19:01:28 +0800 |
| commit | 1aa0e17df7c325a41de8cf8a57f52ed853f08bf3 (patch) | |
| tree | 5ec7f69ca0104f2b0a41e2ee7d3cb0cf0c9c54c5 /libpsn00b/psxsio | |
| parent | e82da2abe4c264d4b48a48d79cf9b8e4c4fb8ab6 (diff) | |
| download | psn00bsdk-1aa0e17df7c325a41de8cf8a57f52ed853f08bf3.tar.gz | |
Refined toolchain instructions, organized examples, added automatic retry for CdRead(), added FIOCSCAN ioctl in psxsio TTY driver, added tty and console examples.
Diffstat (limited to 'libpsn00b/psxsio')
| -rw-r--r-- | libpsn00b/psxsio/siocons.c | 16 |
1 files changed, 15 insertions, 1 deletions
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 <stdio.h> #include <string.h> +#include <ioctl.h> #include <psxapi.h> #include <psxgpu.h> #include <psxsio.h> @@ -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 |
