comparison src/video/riscos/SDL_riscosevents.c @ 1035:974ba6ae0fa3

Date: Wed, 26 Jan 2005 13:37:09 GMT From: Peter Naulls Subject: RISC OS SDL Patches Sam, I've attached a diff of the latest changes to libSDL for RISC OS support. These changes are by Alan Buckley and myself. The most significant of these are: Optimised assembler blit rountines - I've attached the file src/video/riscos/SDL_riscosASM.s which is needed for this. Move to using /dev/dsp instead of its own audio implementation. This means that src/audio/riscos/SDL_drenderer.c should be removed Typo fixes. Mainly correct spelling of "RISC OS", but some from elsewhere too.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 12 Feb 2005 18:01:31 +0000
parents d74fbf56f2f6
children c9b51268668f
comparison
equal deleted inserted replaced
1034:2eca15c3f609 1035:974ba6ae0fa3
19 Sam Lantinga 19 Sam Lantinga
20 slouken@devolution.com 20 slouken@devolution.com
21 */ 21 */
22 22
23 /* 23 /*
24 File added by Alan Buckley (alan_baa@hotmail.com) for RISCOS compatability 24 File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
25 27 March 2003 25 27 March 2003
26 26
27 Implements keyboard setup, event pump and keyboard and mouse polling 27 Implements keyboard setup, event pump and keyboard and mouse polling
28 */ 28 */
29 29
41 #include "ctype.h" 41 #include "ctype.h"
42 42
43 #include "kernel.h" 43 #include "kernel.h"
44 #include "swis.h" 44 #include "swis.h"
45 45
46 /* The translation table from a RISCOS internal key numbers to a SDL keysym */ 46 /* The translation table from a RISC OS internal key numbers to a SDL keysym */
47 static SDLKey RO_keymap[SDLK_LAST]; 47 static SDLKey RO_keymap[SDLK_LAST];
48 48
49 /* RISCOS Key codes */ 49 /* RISC OS Key codes */
50 #define ROKEY_SHIFT 0 50 #define ROKEY_SHIFT 0
51 #define ROKEY_CTRL 1 51 #define ROKEY_CTRL 1
52 #define ROKEY_ALT 2 52 #define ROKEY_ALT 2
53 /* Left shift is first key we will check for */ 53 /* Left shift is first key we will check for */
54 #define ROKEY_LEFT_SHIFT 3 54 #define ROKEY_LEFT_SHIFT 3
88 { 88 {
89 /* Current implementation requires keyboard and mouse polling */ 89 /* Current implementation requires keyboard and mouse polling */
90 RISCOS_PollKeyboard(); 90 RISCOS_PollKeyboard();
91 RISCOS_PollMouse(this); 91 RISCOS_PollMouse(this);
92 #ifdef DISABLE_THREADS 92 #ifdef DISABLE_THREADS
93 DRenderer_FillBuffers(); 93 // DRenderer_FillBuffers();
94 if (SDL_timer_running) RISCOS_CheckTimer(); 94 if (SDL_timer_running) RISCOS_CheckTimer();
95 #endif 95 #endif
96 } 96 }
97 97
98 98
260 if (_kernel_swi(OS_Mouse, &regs, &regs) == NULL) 260 if (_kernel_swi(OS_Mouse, &regs, &regs) == NULL)
261 { 261 {
262 Sint16 new_x = regs.r[0]; /* Initialy get as OS units */ 262 Sint16 new_x = regs.r[0]; /* Initialy get as OS units */
263 Sint16 new_y = regs.r[1]; 263 Sint16 new_y = regs.r[1];
264 264
265 /* Discard mouse events until the let go of the mouse after starting */ 265 /* Discard mouse events until they let go of the mouse after starting */
266 if (starting && regs.r[2] != 0) return; 266 if (starting && regs.r[2] != 0)
267 else starting = 0; 267 return;
268 else
269 starting = 0;
268 270
269 if (new_x != last_x || new_y != last_y || last_buttons != regs.r[2]) 271 if (new_x != last_x || new_y != last_y || last_buttons != regs.r[2])
270 { 272 {
271 /* Something changed so generate appropriate events */ 273 /* Something changed so generate appropriate events */
272 int topLeftX, topLeftY; /* Top left OS units */ 274 int topLeftX, topLeftY; /* Top left OS units */