MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / inputdevice_mh_abs

Function inputdevice_mh_abs

src/inputdevice.cpp:3002–3129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3000}
3001
3002static void inputdevice_mh_abs (int x, int y, uae_u32 buttonbits)
3003{
3004 x -= mouseoffset_x + 1;
3005 y -= mouseoffset_y + 2;
3006
3007 mousehack_enable ();
3008 if (mousehack_address) {
3009 uae_u8 tmp1[4], tmp2[4];
3010 uae_u8 *p = mousehack_address;
3011
3012 memcpy (tmp1, p + MH_ABSX, sizeof tmp1);
3013 memcpy (tmp2, p + MH_BUTTONBITS, sizeof tmp2);
3014
3015 //write_log (_T("%04dx%04d %08x\n"), x, y, buttonbits);
3016
3017 p[MH_ABSX] = x >> 8;
3018 p[MH_ABSX + 1] = x;
3019 p[MH_ABSY] = y >> 8;
3020 p[MH_ABSY + 1] = y;
3021
3022 p[MH_BUTTONBITS + 0] = buttonbits >> 24;
3023 p[MH_BUTTONBITS + 1] = buttonbits >> 16;
3024 p[MH_BUTTONBITS + 2] = buttonbits >> 8;
3025 p[MH_BUTTONBITS + 3] = buttonbits >> 0;
3026
3027 if (!memcmp (tmp1, p + MH_ABSX, sizeof tmp1) && !memcmp (tmp2, p + MH_BUTTONBITS, sizeof tmp2))
3028 return;
3029 p[MH_E] = 0xc0 | 1;
3030 p[MH_CNT]++;
3031 tablet_data = 1;
3032#if 0
3033 if (inputdevice_is_tablet () <= 0) {
3034 tabletlib_tablet_info (1000, 1000, 0, 0, 0, 0, 1000, 1000);
3035 tabletlib_tablet (x, y, 0, 0, buttonbits, -1, 0, 0, 0);
3036 }
3037#endif
3038 }
3039#if 0
3040 if (uaeboard_bank.baseaddr) {
3041 uae_u8 tmp[16];
3042
3043/*
3044
3045 00 W Misc bit flags
3046 - Bit 0 = mouse is currently out of Amiga window bounds
3047 (Below mouse X / Y value can be out of bounds, negative or too large)
3048 - Bit 1 = mouse coordinate / button state changed
3049 - Bit 2 = window size changed
3050 - Bit 15 = bit set = activated
3051 02 W PC Mouse absolute X position relative to emulation top / left corner
3052 04 W PC Mouse absolute Y position relative to emulation top / left corner
3053 06 W PC Mouse relative wheel (counter that counts up or down)
3054 08 W PC Mouse relative horizontal wheel (same as above)
3055 0A W PC Mouse button flags (bit 0 set: left button pressed, bit 1 = right, and so on)
3056
3057 10 W PC emulation window width (Host OS pixels)
3058 12 W PC emulation window height (Host OS pixels)
3059 14 W RTG hardware emulation width (Amiga pixels)

Callers 1

mousehack_helperFunction · 0.85

Calls 4

mousehack_enableFunction · 0.85
inputdevice_is_tabletFunction · 0.85
tabletlib_tablet_infoFunction · 0.85
tabletlib_tabletFunction · 0.85

Tested by

no test coverage detected