mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-06 07:38:05 -04:00
arm_linux.S for cache ops and random fixes
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@587 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
1cfc5cc4ce
commit
16b0afd029
12 changed files with 51 additions and 36 deletions
|
@ -57,8 +57,8 @@ struct usbjoy *joy_open(int joynumber)
|
|||
char path [128];
|
||||
struct usbjoy * joy = NULL;
|
||||
struct js_event event;
|
||||
#ifdef __GP2X__
|
||||
static char insmod_done = 0;
|
||||
|
||||
// notaz: on my system I get unresolved input_* symbols, so have to 'insmod input' too
|
||||
// also we should insmod only once, not on every joy_open() call.
|
||||
if (!insmod_done) {
|
||||
|
@ -66,13 +66,18 @@ struct usbjoy *joy_open(int joynumber)
|
|||
system ("insmod joydev"); // Loads joydev module
|
||||
insmod_done = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (joynumber == 0) {
|
||||
}
|
||||
else if (joynumber > 0) {
|
||||
sprintf (path, "/dev/input/js%d", joynumber-1);
|
||||
fd = open(path, O_RDONLY, 0);
|
||||
if (fd > 0) {
|
||||
if (fd == -1) {
|
||||
sprintf (path, "/dev/js%d", joynumber-1);
|
||||
fd = open(path, O_RDONLY, 0);
|
||||
}
|
||||
if (fd != -1) {
|
||||
joy = (struct usbjoy *) malloc(sizeof(*joy));
|
||||
if (joy == NULL) { close(fd); return NULL; }
|
||||
memset(joy, 0, sizeof(*joy));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue