| 2722 | } |
| 2723 | |
| 2724 | int input_mousehack_status(TrapContext *ctx, int mode, uaecptr diminfo, uaecptr dispinfo, uaecptr vp, uae_u32 moffset) |
| 2725 | { |
| 2726 | if (mode == 4) { |
| 2727 | return mousehack_enable () ? 1 : 0; |
| 2728 | } else if (mode == 5) { |
| 2729 | mousehack_address = (trap_get_dreg(ctx, 0) & 0xffff) + rtarea_bank.baseaddr; |
| 2730 | mousehack_enable (); |
| 2731 | inputdevice_update_tablet_params (); |
| 2732 | } else if (mode == 0) { |
| 2733 | if (mousehack_address) { |
| 2734 | uae_u8 v = get_byte_host(mousehack_address + MH_E); |
| 2735 | v |= 0x40; |
| 2736 | put_byte_host(mousehack_address + MH_E, v); |
| 2737 | write_log (_T("Tablet driver running (%p,%02x)\n"), mousehack_address, v); |
| 2738 | } |
| 2739 | } else if (mode == 1) { |
| 2740 | int x1 = -1, y1 = -1, x2 = -1, y2 = -1; |
| 2741 | uae_u32 props = 0; |
| 2742 | dimensioninfo_width = -1; |
| 2743 | dimensioninfo_height = -1; |
| 2744 | vp_xoffset = 0; |
| 2745 | vp_yoffset = 0; |
| 2746 | if (diminfo) { |
| 2747 | x1 = trap_get_word(ctx, diminfo + 50); |
| 2748 | y1 = trap_get_word(ctx, diminfo + 52); |
| 2749 | x2 = trap_get_word(ctx, diminfo + 54); |
| 2750 | y2 = trap_get_word(ctx, diminfo + 56); |
| 2751 | dimensioninfo_width = x2 - x1 + 1; |
| 2752 | dimensioninfo_height = y2 - y1 + 1; |
| 2753 | } |
| 2754 | if (vp) { |
| 2755 | vp_xoffset = trap_get_word(ctx, vp + 28); |
| 2756 | vp_yoffset = trap_get_word(ctx, vp + 30); |
| 2757 | } |
| 2758 | if (dispinfo) |
| 2759 | props = trap_get_long(ctx, dispinfo + 18); |
| 2760 | dimensioninfo_dbl = (props & 0x00020000) ? 1 : 0; |
| 2761 | write_log (_T("%08x %08x %08x (%dx%d)-(%dx%d) d=%dx%d %s\n"), |
| 2762 | diminfo, props, vp, x1, y1, x2, y2, vp_xoffset, vp_yoffset, |
| 2763 | (props & 0x00020000) ? _T("dbl") : _T("")); |
| 2764 | } |
| 2765 | return 1; |
| 2766 | } |
| 2767 | |
| 2768 | void inputdevice_tablet_strobe (void) |
| 2769 | { |
no test coverage detected