2 Copyright 1999, Be Incorporated. All Rights Reserved.
3 This file may be used under the terms of the Be Sample Code License.
7 Rudolf Cornelissen 4/2003-11/2004
10 #define MODULE_BIT 0x20000000
13 No hardware cursor possible on the secondary head :(
15 CRTC1 has a cursor, can be displayed on DAC or MAVEN
17 Can not switch CRTC in one vblank (has to resync)
18 CRTC2 does not support split screen
19 app_server does not support some modes with and some without cursor
20 virtual not supported, because of MAVEN blanking issues
25 status_t
SET_CURSOR_SHAPE(uint16 width
, uint16 height
, uint16 hot_x
, uint16 hot_y
, uint8
*andMask
, uint8
*xorMask
)
27 LOG(4,("SET_CURSOR_SHAPE: width %d, height %d\n", width
, height
));
28 if ((width
!= 16) || (height
!= 16))
32 else if ((hot_x
>= width
) || (hot_y
>= height
))
38 gx00_crtc_cursor_define(andMask
,xorMask
);
40 /* Update cursor variables appropriately. */
41 si
->cursor
.width
= width
;
42 si
->cursor
.height
= height
;
43 si
->cursor
.hot_x
= hot_x
;
44 si
->cursor
.hot_y
= hot_y
;
50 /* Move the cursor to the specified position on the desktop, taking account of virtual/dual issues */
51 void MOVE_CURSOR(uint16 x
, uint16 y
)
53 uint16 hds
= si
->dm
.h_display_start
; /* the current horizontal starting pixel */
54 uint16 vds
= si
->dm
.v_display_start
; /* the current vertical starting line */
57 /* clamp cursor to display */
58 if (x
>= si
->dm
.virtual_width
) x
= si
->dm
.virtual_width
- 1;
59 if (y
>= si
->dm
.virtual_height
) y
= si
->dm
.virtual_height
- 1;
61 /* store, for our info */
65 /*set up minimum amount to scroll*/
66 if (si
->dm
.flags
& DUALHEAD_BITS
)
88 case B_RGB15_LITTLE
:case B_RGB16_LITTLE
:
100 /* adjust h/v_display_start to move cursor onto screen */
101 switch (si
->dm
.flags
& DUALHEAD_BITS
)
104 case DUALHEAD_SWITCH
:
105 if (x
>= ((si
->dm
.timing
.h_display
* 2) + hds
))
107 hds
= ((x
- (si
->dm
.timing
.h_display
* 2)) + 1 + h_adjust
) & ~h_adjust
;
108 /* make sure we stay within the display! */
109 if ((hds
+ (si
->dm
.timing
.h_display
* 2)) > si
->dm
.virtual_width
)
110 hds
-= (h_adjust
+ 1);
116 if (x
>= (si
->dm
.timing
.h_display
+ hds
))
118 hds
= ((x
- si
->dm
.timing
.h_display
) + 1 + h_adjust
) & ~h_adjust
;
119 /* make sure we stay within the display! */
120 if ((hds
+ si
->dm
.timing
.h_display
) > si
->dm
.virtual_width
)
121 hds
-= (h_adjust
+ 1);
128 if (y
>= (si
->dm
.timing
.v_display
+ vds
))
129 vds
= y
- si
->dm
.timing
.v_display
+ 1;
133 /* reposition the desktop _and_ the overlay on the display if required */
134 if ((hds
!=si
->dm
.h_display_start
) || (vds
!=si
->dm
.v_display_start
))
136 MOVE_DISPLAY(hds
,vds
);
137 gx00_bes_move_overlay();
140 /* put cursor in correct physical position */
141 x
-= hds
+ si
->cursor
.hot_x
;
142 y
-= vds
+ si
->cursor
.hot_y
;
144 /* account for switched CRTC's */
145 if (si
->switched_crtcs
) x
-= si
->dm
.timing
.h_display
;
147 /* position the cursor on the display */
148 gx00_crtc_cursor_position(x
,y
);
151 void SHOW_CURSOR(bool is_visible
)
153 /* record for our info */
154 si
->cursor
.is_visible
= is_visible
;
157 gx00_crtc_cursor_show();
159 gx00_crtc_cursor_hide();