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
Merge pull request #248 from retro-wertz/patch-2
[pcsx_rearmed.git]
/
frontend
/
in_tsbutton.c
diff --git
a/frontend/in_tsbutton.c
b/frontend/in_tsbutton.c
index
4e2cef0
..
b3e4158
100644
(file)
--- a/
frontend/in_tsbutton.c
+++ b/
frontend/in_tsbutton.c
@@
-11,7
+11,8
@@
#include <stdio.h>
#include <tslib.h>
#include <stdio.h>
#include <tslib.h>
-#include "common/input.h"
+#include "libpicofe/input.h"
+#include "pl_gun_ts.h"
#include "in_tsbutton.h"
#define IN_TSBUTTON_PREFIX "tsbutton:"
#include "in_tsbutton.h"
#define IN_TSBUTTON_PREFIX "tsbutton:"
@@
-24,14
+25,12
@@
static int last_tsbutton_id;
// HACK: stealing this from plugin_lib
extern void *tsdev;
// HACK: stealing this from plugin_lib
extern void *tsdev;
-extern int (*pts_read)(struct tsdev *dev, struct ts_sample *sample, int nr);
-extern int (*pts_fd)(struct tsdev *dev);
static const char * const in_tsbutton_keys[IN_TSBUTTON_COUNT] = {
"TS1", "TS2", "TS3", "TS4",
};
static const char * const in_tsbutton_keys[IN_TSBUTTON_COUNT] = {
"TS1", "TS2", "TS3", "TS4",
};
-static void in_tsbutton_probe(
void
)
+static void in_tsbutton_probe(
const in_drv_t *drv
)
{
struct tsdev *dev = tsdev;
if (dev == NULL) {
{
struct tsdev *dev = tsdev;
if (dev == NULL) {
@@
-40,11
+39,11
@@
static void in_tsbutton_probe(void)
}
in_register(IN_TSBUTTON_PREFIX "touchscreen as buttons",
}
in_register(IN_TSBUTTON_PREFIX "touchscreen as buttons",
- p
ts
_fd(dev), NULL, IN_TSBUTTON_COUNT, in_tsbutton_keys, 0);
+ p
l_gun_ts_get
_fd(dev), NULL, IN_TSBUTTON_COUNT, in_tsbutton_keys, 0);
}
static const char * const *
}
static const char * const *
-in_tsbutton_get_key_names(int *count)
+in_tsbutton_get_key_names(
const in_drv_t *drv,
int *count)
{
*count = IN_TSBUTTON_COUNT;
return in_tsbutton_keys;
{
*count = IN_TSBUTTON_COUNT;
return in_tsbutton_keys;
@@
-53,20
+52,12
@@
in_tsbutton_get_key_names(int *count)
static int update_button(void)
{
struct tsdev *dev = tsdev;
static int update_button(void)
{
struct tsdev *dev = tsdev;
- struct ts_sample sample;
- int sx = 0, sy = 0, sp = 0, updated = 0;
+ int sx = 0, sy = 0, sp = 0;
if (dev == NULL)
return -1;
if (dev == NULL)
return -1;
- while (pts_read(dev, &sample, 1) > 0) {
- sx = sample.x;
- sy = sample.y;
- sp = sample.pressure;
- updated = 1;
- }
-
- if (updated) {
+ if (pl_gun_ts_update_raw(dev, &sx, &sy, &sp)) {
if (sp == 0)
tsbutton_down_id = -1;
else {
if (sp == 0)
tsbutton_down_id = -1;
else {
@@
-142,6
+133,6
@@
static const in_drv_t in_tsbutton_drv = {
void in_tsbutton_init(void)
{
tsbutton_down_id = last_tsbutton_id = -1;
void in_tsbutton_init(void)
{
tsbutton_down_id = last_tsbutton_id = -1;
- in_register_driver(&in_tsbutton_drv);
+ in_register_driver(&in_tsbutton_drv
, NULL, NULL
);
}
}