X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=hw%2Fadb.c;h=5c0d6d5fd978c4b749b587afe2c258ca157a844c;hb=d66846a14e191c75f4aa373623dd9a7aaa843ade;hp=756c0790628cb11c1268ca91de0bff123dfeed2b;hpb=5fafdf24ef2c090c164d4dc89684b3f379dbdd87;p=qemu diff --git a/hw/adb.c b/hw/adb.c index 756c079..5c0d6d5 100644 --- a/hw/adb.c +++ b/hw/adb.c @@ -21,7 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "vl.h" +#include "hw.h" +#include "ppc_mac.h" +#include "console.h" /* ADB commands */ #define ADB_BUSRESET 0x00 @@ -299,31 +301,31 @@ static int adb_mouse_poll(ADBDevice *d, uint8_t *obuf) if (s->last_buttons_state == s->buttons_state && s->dx == 0 && s->dy == 0) return 0; - + dx = s->dx; if (dx < -63) dx = -63; else if (dx > 63) dx = 63; - + dy = s->dy; if (dy < -63) dy = -63; else if (dy > 63) dy = 63; - + s->dx -= dx; s->dy -= dy; s->last_buttons_state = s->buttons_state; - + dx &= 0x7f; dy &= 0x7f; - + if (!(s->buttons_state & MOUSE_EVENT_LBUTTON)) dy |= 0x80; if (!(s->buttons_state & MOUSE_EVENT_RBUTTON)) dx |= 0x80; - + obuf[0] = dy; obuf[1] = dx; return 2; @@ -334,7 +336,7 @@ static int adb_mouse_request(ADBDevice *d, uint8_t *obuf, { MouseState *s = d->opaque; int cmd, reg, olen; - + if ((buf[0] & 0x0f) == ADB_FLUSH) { /* flush mouse fifo */ s->buttons_state = s->last_buttons_state;