Mercurial > sdl-ios-xcode
annotate src/video/riscos/SDL_riscosmouse.c @ 1358:c71e05b4dc2e
More header massaging... works great on Windows. ;-)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 10 Feb 2006 06:48:43 +0000 |
parents | 604d73db6802 |
children | 19418e4422cb |
rev | line source |
---|---|
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 /* |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
769
b8d311d90021
Updated copyright information for 2004 (Happy New Year!)
Sam Lantinga <slouken@libsdl.org>
parents:
630
diff
changeset
|
3 Copyright (C) 1997-2004 Sam Lantinga |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Library General Public |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
8 version 2 of the License, or (at your option) any later version. |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
9 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
13 Library General Public License for more details. |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
14 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Library General Public |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
18 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
19 Sam Lantinga |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1208
diff
changeset
|
20 slouken@libsdl.org |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
21 */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
22 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
23 /* |
1035
974ba6ae0fa3
Date: Wed, 26 Jan 2005 13:37:09 GMT
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
24 File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
25 27 March 2003 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
26 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
27 Implements mouse cursor shape definitions and positioning |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
28 */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
29 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
30 #include "SDL_mouse.h" |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
31 #include "SDL_events_c.h" |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
32 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
33 #include "SDL_riscosmouse_c.h" |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
34 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
35 #include "kernel.h" |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
36 #include "swis.h" |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
37 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
38 static WMcursor *current_cursor = NULL; |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
39 static WMcursor *defined_cursor = NULL; |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
40 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
41 extern int mouseInWindow; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
42 |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
43 /* Area to save cursor palette colours changed by SDL. |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
44 Actual values will be read before we change to the SDL cursor */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
45 static Uint8 wimp_cursor_palette[2][5] = { |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
46 {1, 25, 255, 255, 255}, |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
47 {3, 25, 255, 255, 255} |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
48 }; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
49 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
50 static int cursor_palette_saved = 0; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
51 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
52 void WIMP_SaveCursorPalette(); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
53 void WIMP_RestoreWimpCursor(); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
54 void WIMP_SetSDLCursorPalette(); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
55 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
56 |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
57 void RISCOS_FreeWMCursor(_THIS, WMcursor *cursor) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
58 { |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
59 SDL_free(cursor->data); |
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
60 SDL_free(cursor); |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
61 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
62 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
63 WMcursor *RISCOS_CreateWMCursor(_THIS, |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
64 Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
65 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
66 WMcursor *cursor; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
67 Uint8 *cursor_data; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
68 Uint8 *ptr; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
69 int i,j,k; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
70 int data_byte, mask_byte; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
71 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
72 /* Check to make sure the cursor size is okay */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
73 if ( (w > 32) || (h > 32) ) { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
74 SDL_SetError("Only with width and height <= 32 pixels are allowed"); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
75 return(NULL); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
76 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
77 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
78 /* Allocate the cursor */ |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
79 cursor = (WMcursor *)SDL_malloc(sizeof(*cursor)); |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
80 if ( cursor == NULL ) { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
81 SDL_SetError("Out of memory"); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
82 return(NULL); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
83 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
84 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
85 /* Note: SDL says width must be a multiple of 8 */ |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
86 cursor_data = SDL_malloc(w/4 * h); |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
87 if (cursor_data == NULL) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
88 { |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
89 SDL_free(cursor); |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
90 SDL_SetError("Out of memory"); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
91 return(NULL); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
92 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
93 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
94 cursor->w = w; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
95 cursor->h = h; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
96 cursor->hot_x = hot_x; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
97 cursor->hot_y = hot_y; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
98 cursor->data = cursor_data; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
99 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
100 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
101 /* Data / Mask Resulting pixel on screen |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
102 0 / 1 White |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
103 1 / 1 Black |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
104 0 / 0 Transparent |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
105 1 / 0 Inverted color if possible, black if not. |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
106 */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
107 ptr = cursor_data; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
108 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
109 for ( i=0; i<h; ++i ) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
110 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
111 for (j = 0; j < w/8; ++j) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
112 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
113 data_byte = *data; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
114 mask_byte = *mask; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
115 *ptr++ = 0; /* Sets whole byte transparent */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
116 *ptr = 0; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
117 for (k = 0; k < 8; k++) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
118 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
119 (*ptr) <<= 2; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
120 if (data_byte & 1) *ptr |= 3; /* Black or inverted */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
121 else if(mask_byte & 1) *ptr |= 1; /* White */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
122 if ((k&3) == 3) ptr--; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
123 data_byte >>= 1; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
124 mask_byte >>= 1; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
125 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
126 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
127 ptr+=3; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
128 data++; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
129 mask++; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
130 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
131 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
132 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
133 return(cursor); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
134 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
135 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
136 int RISCOS_ShowWMCursor(_THIS, WMcursor *cursor) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
137 { |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
138 current_cursor = cursor; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
139 |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
140 if (cursor == NULL) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
141 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
142 _kernel_osbyte(106,0,0); |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
143 defined_cursor = NULL; |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
144 } else |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
145 { |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
146 WMcursor *old_cursor = defined_cursor; |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
147 |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
148 if (cursor != defined_cursor) |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
149 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
150 Uint8 cursor_def[10]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
151 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
152 cursor_def[0] = 0; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
153 cursor_def[1] = 2; /* Use shape number 2 */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
154 cursor_def[2] = cursor->w/4; /* Width in bytes */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
155 cursor_def[3] = cursor->h; /* Height (h) in pixels */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
156 cursor_def[4] = cursor->hot_x; /* ActiveX in pixels from left */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
157 cursor_def[5] = cursor->hot_y; /* ActiveY in pixels from top */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
158 cursor_def[6] = ((int)(cursor->data) & 0xFF); /* Least significant byte of pointer to data */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
159 cursor_def[7] = ((int)(cursor->data) >> 8) & 0xFF; /* ... */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
160 cursor_def[8] = ((int)(cursor->data) >> 16) & 0xFF; /* ... */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
161 cursor_def[9] = ((int)(cursor->data) >> 24) & 0xFF; /* Most significant byte of pointer to data */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
162 |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
163 if (_kernel_osword(21, (int *)cursor_def) != 0) |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
164 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
165 SDL_SetError("RISCOS couldn't create the cursor to show"); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
166 return(0); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
167 } |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
168 defined_cursor = cursor; |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
169 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
170 |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
171 if (old_cursor == NULL) |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
172 { |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
173 /* First time or reshow in window, so save/setup palette */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
174 if (!cursor_palette_saved) |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
175 { |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
176 WIMP_SaveCursorPalette(); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
177 } |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
178 WIMP_SetSDLCursorPalette(); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
179 } |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
180 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
181 _kernel_osbyte(106, 2, 0); |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
182 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
183 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
184 return(1); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
185 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
186 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
187 void FULLSCREEN_WarpWMCursor(_THIS, Uint16 x, Uint16 y) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
188 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
189 Uint8 move_block[5]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
190 int eig_block[3]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
191 _kernel_swi_regs regs; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
192 int os_x, os_y; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
193 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
194 eig_block[0] = 4; /* X eig factor */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
195 eig_block[1] = 5; /* Y eig factor */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
196 eig_block[2] = -1; /* End of list of variables to request */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
197 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
198 regs.r[0] = (int)eig_block; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
199 regs.r[1] = (int)eig_block; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
200 _kernel_swi(OS_ReadVduVariables, ®s, ®s); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
201 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
202 os_x = x << eig_block[0]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
203 os_y = y << eig_block[1]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
204 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
205 move_block[0] = 3; /* Move cursor */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
206 move_block[1] = os_x & 0xFF; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
207 move_block[2] = (os_x >> 8) & 0xFF; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
208 move_block[3] = os_y & 0xFF; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
209 move_block[4] = (os_y >> 8) & 0xFF; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
210 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
211 _kernel_osword(21, (int *)move_block); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
212 SDL_PrivateMouseMotion(0, 0, x, y); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
213 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
214 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
215 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
216 /* Reshow cursor when mouse re-enters the window */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
217 void WIMP_ReshowCursor(_THIS) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
218 { |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
219 defined_cursor = NULL; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
220 cursor_palette_saved = 0; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
221 RISCOS_ShowWMCursor(this, current_cursor); |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
222 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
223 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
224 void WIMP_WarpWMCursor(_THIS, Uint16 x, Uint16 y) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
225 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
226 _kernel_swi_regs regs; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
227 int window_state[9]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
228 char block[5]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
229 int osX, osY; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
230 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
231 window_state[0] = this->hidden->window_handle; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
232 regs.r[1] = (unsigned int)window_state; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
233 _kernel_swi(Wimp_GetWindowState, ®s, ®s); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
234 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
235 osX = (x << this->hidden->xeig) + window_state[1]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
236 osY = window_state[4] - (y << this->hidden->yeig); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
237 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
238 block[0] = 3; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
239 block[1] = osX & 0xFF; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
240 block[2] = (osX >> 8) & 0xFF; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
241 block[3] = osY & 0xFF; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
242 block[4] = (osY >> 8) & 0xFF; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
243 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
244 regs.r[0] = 21; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
245 regs.r[1] = (int)block; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
246 _kernel_swi(OS_Word, ®s, ®s); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
247 SDL_PrivateMouseMotion(0, 0, x, y); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
248 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
249 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
250 int WIMP_ShowWMCursor(_THIS, WMcursor *cursor) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
251 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
252 if (mouseInWindow) return RISCOS_ShowWMCursor(this, cursor); |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
253 else current_cursor = cursor; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
254 |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
255 return 1; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
256 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
257 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
258 SDL_GrabMode RISCOS_GrabInput(_THIS, SDL_GrabMode mode) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
259 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
260 /* In fullscreen mode we don't need to do anything */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
261 if (mode < SDL_GRAB_FULLSCREEN) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
262 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
263 _kernel_swi_regs regs; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
264 unsigned char block[9]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
265 block[0] = 1; /* Define mouse cursor bounding block */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
266 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
267 if ( mode == SDL_GRAB_OFF ) |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
268 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
269 /* Clip to whole screen */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
270 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
271 int r = (this->hidden->screen_width << this->hidden->xeig) - 1; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
272 int t = (this->hidden->screen_height << this->hidden->yeig) - 1; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
273 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
274 block[1] = 0; block[2] = 0; /* Left*/ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
275 block[3] = 0; block[4] = 0; /* Bottom */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
276 block[5] = r & 0xFF; block[6] = (r >> 8) & 0xFF; /* Right */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
277 block[7] = t & 0xFF; block[8] = (t >> 8) & 0xFF; /* Top */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
278 } else |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
279 { |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
280 /* Clip to window */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
281 unsigned char window_state[36]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
282 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
283 *((int *)window_state) = this->hidden->window_handle; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
284 regs.r[1] = (unsigned int)window_state; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
285 _kernel_swi(Wimp_GetWindowState, ®s, ®s); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
286 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
287 block[1] = window_state[4]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
288 block[2] = window_state[5]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
289 block[3] = window_state[8]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
290 block[4] = window_state[9]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
291 block[5] = window_state[12]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
292 block[6] = window_state[13]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
293 block[7] = window_state[16]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
294 block[8] = window_state[17]; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
295 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
296 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
297 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
298 regs.r[0] = 21; /* OS word code */ |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
299 regs.r[1] = (int)block; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
300 _kernel_swi(OS_Word, ®s, ®s); |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
301 } |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
302 |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
303 return mode; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
304 } |
1208
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
305 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
306 /* Save mouse cursor palette to be restore when we are no longer |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
307 defining a cursor */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
308 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
309 void WIMP_SaveCursorPalette() |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
310 { |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
311 _kernel_swi_regs regs; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
312 int colour; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
313 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
314 for (colour = 0; colour < 2; colour++) |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
315 { |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
316 regs.r[0] = (int)wimp_cursor_palette[colour][0]; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
317 regs.r[1] = 25; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
318 /* Read settings with OS_ReadPalette */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
319 if (_kernel_swi(0x2f, ®s, ®s) == NULL) |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
320 { |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
321 wimp_cursor_palette[colour][2] = (unsigned char)((regs.r[2] >> 8) & 0xFF); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
322 wimp_cursor_palette[colour][3] = (unsigned char)((regs.r[2] >> 16) & 0xFF); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
323 wimp_cursor_palette[colour][4] = (unsigned char)((regs.r[2] >> 24) & 0xFF); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
324 } |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
325 } |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
326 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
327 cursor_palette_saved = 1; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
328 } |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
329 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
330 /* Restore the WIMP's cursor when we leave the SDL window */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
331 void WIMP_RestoreWimpCursor() |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
332 { |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
333 int colour; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
334 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
335 /* Reset to pointer shape 1 */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
336 _kernel_osbyte(106, 1, 0); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
337 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
338 /* Reset pointer colours */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
339 if (cursor_palette_saved) |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
340 { |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
341 for (colour = 0; colour < 2; colour++) |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
342 { |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
343 _kernel_osword(12, (int *)wimp_cursor_palette[colour]); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
344 } |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
345 } |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
346 cursor_palette_saved = 0; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
347 } |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
348 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
349 /* Set palette used for SDL mouse cursors */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
350 void WIMP_SetSDLCursorPalette() |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
351 { |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
352 /* First time set up the mouse colours */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
353 Uint8 block[5]; |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
354 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
355 /* Set up colour 1 as white */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
356 block[0] = 1; /* Colour to change 1 - 3 */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
357 block[1] = 25; /* Set pointer colour */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
358 block[2] = 255; /* red component*/ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
359 block[3] = 255; /* green component */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
360 block[4] = 255; /* blue component*/ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
361 _kernel_osword(12, (int *)block); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
362 |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
363 /* Set colour 3 to back */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
364 block[0] = 3; /* Colour to change 1 - 3 */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
365 block[1] = 25; /* Set pointer colour*/ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
366 block[2] = 0; /* red component*/ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
367 block[3] = 0; /* green component */ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
368 block[4] = 0; /* blue component*/ |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
369 _kernel_osword(12, (int *)block); |
d90b362628ea
From: "alan buckley" <alan_baa@hotmail.com>
Sam Lantinga <slouken@libsdl.org>
parents:
1035
diff
changeset
|
370 } |