notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
frontend: add touchscreen-as-buttons input code
[pcsx_rearmed.git]
/
frontend
/
pl_gun_ts.c
diff --git
a/frontend/pl_gun_ts.c
b/frontend/pl_gun_ts.c
index
3ee9c25
..
2c02251
100644
(file)
--- a/
frontend/pl_gun_ts.c
+++ b/
frontend/pl_gun_ts.c
@@
-19,7
+19,8
@@
static int gun_x, gun_y, gun_in;
static int ts_multiplier_x, ts_multiplier_y, ts_offs_x, ts_offs_y;
static int gun_x, gun_y, gun_in;
static int ts_multiplier_x, ts_multiplier_y, ts_offs_x, ts_offs_y;
-static int (*pts_read)(struct tsdev *dev, struct ts_sample *sample, int nr);
+int (*pts_read)(struct tsdev *dev, struct ts_sample *sample, int nr);
+int (*pts_fd)(struct tsdev *dev);
#define limit(v, min, max) \
if (v < min) v = min; \
#define limit(v, min, max) \
if (v < min) v = min; \
@@
-77,9
+78,9
@@
struct tsdev *pl_gun_ts_init(void)
tsdevname = "/dev/input/touchscreen0";
// avoid hard dep on tslib
tsdevname = "/dev/input/touchscreen0";
// avoid hard dep on tslib
- ltsh = dlopen("/usr/lib/libts-1.0.so.0", RTLD_
LAZY
);
+ ltsh = dlopen("/usr/lib/libts-1.0.so.0", RTLD_
NOW|RTLD_GLOBAL
);
if (ltsh == NULL)
if (ltsh == NULL)
- ltsh = dlopen("/usr/lib/libts-0.0.so.0", RTLD_
LAZY
);
+ ltsh = dlopen("/usr/lib/libts-0.0.so.0", RTLD_
NOW|RTLD_GLOBAL
);
if (ltsh == NULL) {
fprintf(stderr, "%s\n", dlerror());
goto fail;
if (ltsh == NULL) {
fprintf(stderr, "%s\n", dlerror());
goto fail;
@@
-88,8
+89,10
@@
struct tsdev *pl_gun_ts_init(void)
pts_open = dlsym(ltsh, "ts_open");
pts_config = dlsym(ltsh, "ts_config");
pts_read = dlsym(ltsh, "ts_read");
pts_open = dlsym(ltsh, "ts_open");
pts_config = dlsym(ltsh, "ts_config");
pts_read = dlsym(ltsh, "ts_read");
+ pts_fd = dlsym(ltsh, "ts_fd");
pts_close = dlsym(ltsh, "ts_close");
pts_close = dlsym(ltsh, "ts_close");
- if (pts_open == NULL || pts_config == NULL || pts_read == NULL || pts_close == NULL) {
+ if (pts_open == NULL || pts_config == NULL || pts_read == NULL
+ || pts_fd == NULL || pts_close == NULL) {
fprintf(stderr, "%s\n", dlerror());
goto fail_dlsym;
}
fprintf(stderr, "%s\n", dlerror());
goto fail_dlsym;
}
@@
-102,7
+105,11
@@
struct tsdev *pl_gun_ts_init(void)
// FIXME: we should be able to get this somewhere
// the problem is this doesn't always match resolution due to different display modes
// FIXME: we should be able to get this somewhere
// the problem is this doesn't always match resolution due to different display modes
+#ifdef __ARM_ARCH_7A__
pl_set_gun_rect(0, 0, 800, 480);
pl_set_gun_rect(0, 0, 800, 480);
+#else
+ pl_set_gun_rect(0, 0, 320, 240);
+#endif
return ts;
fail_config:
return ts;
fail_config: