Support proper mode switching on RISC OS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523
diff --git a/src/video/riscos/SDL_riscosframebuffer.c b/src/video/riscos/SDL_riscosframebuffer.c
index fe26975..9550ad8 100644
--- a/src/video/riscos/SDL_riscosframebuffer.c
+++ b/src/video/riscos/SDL_riscosframebuffer.c
@@ -97,8 +97,8 @@ int RISCOS_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect *
regs.r[0] = 512+52;
regs.r[1] = (int)driverdata->fb_area;
regs.r[2] = (int)driverdata->fb_sprite;
- regs.r[3] = window->x << 1;
- regs.r[4] = window->y << 1;
+ regs.r[3] = 0; /* window->x << 1; */
+ regs.r[4] = 0; /* window->y << 1; */
regs.r[5] = 0x50;
regs.r[6] = 0;
regs.r[7] = 0;
diff --git a/src/video/riscos/SDL_riscosmodes.c b/src/video/riscos/SDL_riscosmodes.c
new file mode 100644
index 0000000..be72390
--- /dev/null
+++ b/src/video/riscos/SDL_riscosmodes.c
@@ -0,0 +1,255 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+#include "../../SDL_internal.h"
+
+#if SDL_VIDEO_DRIVER_RISCOS
+
+#include "../SDL_sysvideo.h"
+
+#include "SDL_riscosvideo.h"
+#include "SDL_riscosmodes.h"
+
+#include <kernel.h>
+#include <swis.h>
+
+enum {
+ MODE_FLAG_565 = 1 << 7,
+
+ MODE_FLAG_COLOUR_SPACE = 0xF << 12,
+
+ MODE_FLAG_TBGR = 0,
+ MODE_FLAG_TRGB = 1 << 14,
+ MODE_FLAG_ABGR = 1 << 15,
+ MODE_FLAG_ARGB = MODE_FLAG_TRGB | MODE_FLAG_ABGR
+};
+
+static const struct {
+ SDL_PixelFormatEnum pixel_format;
+ int modeflags, ncolour, log2bpp;
+} mode_to_pixelformat[] = {
+ /* { SDL_PIXELFORMAT_INDEX1LSB, 0, 1, 0 }, */
+ /* { SDL_PIXELFORMAT_INDEX2LSB, 0, 3, 1 }, */
+ /* { SDL_PIXELFORMAT_INDEX4LSB, 0, 15, 2 }, */
+ /* { SDL_PIXELFORMAT_INDEX8, MODE_FLAG_565, 255, 3 }, */
+ { SDL_PIXELFORMAT_XBGR1555, MODE_FLAG_TBGR, 65535, 4 },
+ { SDL_PIXELFORMAT_XRGB1555, MODE_FLAG_TRGB, 65535, 4 },
+ { SDL_PIXELFORMAT_ABGR1555, MODE_FLAG_ABGR, 65535, 4 },
+ { SDL_PIXELFORMAT_ARGB1555, MODE_FLAG_ARGB, 65535, 4 },
+ { SDL_PIXELFORMAT_XBGR4444, MODE_FLAG_TBGR, 4095, 4 },
+ { SDL_PIXELFORMAT_XRGB4444, MODE_FLAG_TRGB, 4095, 4 },
+ { SDL_PIXELFORMAT_ABGR4444, MODE_FLAG_ABGR, 4095, 4 },
+ { SDL_PIXELFORMAT_ARGB4444, MODE_FLAG_ARGB, 4095, 4 },
+ { SDL_PIXELFORMAT_BGR565, MODE_FLAG_TBGR | MODE_FLAG_565, 65535, 4 },
+ { SDL_PIXELFORMAT_RGB565, MODE_FLAG_TRGB | MODE_FLAG_565, 65535, 4 },
+ { SDL_PIXELFORMAT_BGR24, MODE_FLAG_TBGR, 16777215, 6 },
+ { SDL_PIXELFORMAT_RGB24, MODE_FLAG_TRGB, 16777215, 6 },
+ { SDL_PIXELFORMAT_XBGR8888, MODE_FLAG_TBGR, -1, 5 },
+ { SDL_PIXELFORMAT_XRGB8888, MODE_FLAG_TRGB, -1, 5 },
+ { SDL_PIXELFORMAT_ABGR8888, MODE_FLAG_ABGR, -1, 5 },
+ { SDL_PIXELFORMAT_ARGB8888, MODE_FLAG_ARGB, -1, 5 }
+};
+
+static SDL_PixelFormatEnum
+RISCOS_ModeToPixelFormat(int ncolour, int modeflags, int log2bpp)
+{
+ int i;
+
+ for (i = 0; i < SDL_arraysize(mode_to_pixelformat); i++) {
+ if (log2bpp == mode_to_pixelformat[i].log2bpp &&
+ (ncolour == mode_to_pixelformat[i].ncolour || ncolour == 0) &&
+ (modeflags & (MODE_FLAG_565 | MODE_FLAG_COLOUR_SPACE)) == mode_to_pixelformat[i].modeflags) {
+ return mode_to_pixelformat[i].pixel_format;
+ }
+ }
+
+ return SDL_PIXELFORMAT_UNKNOWN;
+}
+
+static size_t
+measure_mode_block(const int *block)
+{
+ size_t blockSize = (block[0] == 2) ? 7 : 5;
+ while(block[blockSize] != -1) {
+ blockSize += 2;
+ }
+ blockSize++;
+
+ return blockSize * 4;
+}
+
+static int *
+read_mode_block(int *block, SDL_DisplayMode *mode)
+{
+ int xres, yres, ncolour, modeflags, log2bpp, rate;
+ int *end;
+
+ xres = block[1];
+ yres = block[2];
+ if ((block[0] & 0xFF) == 1) {
+ log2bpp = block[3];
+ rate = block[4];
+ end = block + 5;
+ ncolour = (1 << (1 << log2bpp)) - 1;
+ modeflags = MODE_FLAG_TBGR;
+ } else if ((block[0] & 0xFF) == 3) {
+ ncolour = block[3];
+ modeflags = block[4];
+ log2bpp = block[5];
+ rate = block[6];
+ end = block + 7;
+ } else {
+ return NULL;
+ }
+
+ mode->w = xres;
+ mode->h = yres;
+ mode->format = RISCOS_ModeToPixelFormat(ncolour, modeflags, log2bpp);
+ mode->refresh_rate = rate;
+
+ return end;
+}
+
+static void *
+copy_memory(const void *src, size_t size, size_t alloc)
+{
+ void *dst = SDL_malloc(alloc);
+ if (dst) {
+ SDL_memcpy(dst, src, size);
+ }
+ return dst;
+}
+
+int
+RISCOS_InitModes(_THIS)
+{
+ SDL_DisplayMode mode;
+ int *current_mode;
+ _kernel_swi_regs regs;
+ _kernel_oserror *error;
+ size_t size;
+
+ regs.r[0] = 1;
+ error = _kernel_swi(OS_ScreenMode, ®s, ®s);
+ if (error != NULL) {
+ return SDL_SetError("Unable to retrieve the current screen mode: %s (%i)", error->errmess, error->errnum);
+ }
+
+ current_mode = (int *)regs.r[1];
+ if (!read_mode_block(current_mode, &mode)) {
+ return SDL_SetError("Unsupported mode block format %d", current_mode[0]);
+ }
+
+ size = measure_mode_block(current_mode);
+ mode.driverdata = copy_memory(current_mode, size, size);
+ if (!mode.driverdata) {
+ return SDL_OutOfMemory();
+ }
+
+ return SDL_AddBasicVideoDisplay(&mode);
+}
+
+void
+RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
+{
+ SDL_DisplayMode mode;
+ _kernel_swi_regs regs;
+ _kernel_oserror *error;
+ void *block, *pos;
+
+ regs.r[0] = 2;
+ regs.r[2] = 0;
+ regs.r[6] = 0;
+ regs.r[7] = 0;
+ error = _kernel_swi(OS_ScreenMode, ®s, ®s);
+ if (error != NULL) {
+ SDL_SetError("Unable to enumerate screen modes: %s (%i)", error->errmess, error->errnum);
+ return;
+ }
+
+ block = SDL_malloc(-regs.r[7]);
+ if (!block) {
+ SDL_OutOfMemory();
+ return;
+ }
+
+ regs.r[6] = (int)block;
+ regs.r[7] = -regs.r[7];
+ error = _kernel_swi(OS_ScreenMode, ®s, ®s);
+ if (error != NULL) {
+ SDL_free(block);
+ SDL_SetError("Unable to enumerate screen modes: %s (%i)", error->errmess, error->errnum);
+ return;
+ }
+
+ for (pos = block; pos < (void *)regs.r[6]; pos += *((int *)pos)) {
+ size_t size;
+ void *end;
+
+ end = read_mode_block(pos + 4, &mode);
+ if (!end) {
+ continue;
+ }
+
+ if (mode.format == SDL_PIXELFORMAT_UNKNOWN)
+ continue;
+
+ size = (end - pos) - 4;
+ mode.driverdata = copy_memory(pos + 4, size, size + 4);
+ if (!mode.driverdata) {
+ SDL_OutOfMemory();
+ break;
+ }
+ *((int *)(mode.driverdata + size)) = -1;
+
+ if (!SDL_AddDisplayMode(display, &mode)) {
+ SDL_free(mode.driverdata);
+ }
+ }
+
+ SDL_free(block);
+}
+
+int
+RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
+{
+ const char disable_cursor[] = { 23, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ _kernel_swi_regs regs;
+ _kernel_oserror *error;
+ int i;
+
+ regs.r[0] = 0;
+ regs.r[1] = (int)mode->driverdata;
+ error = _kernel_swi(OS_ScreenMode, ®s, ®s);
+ if (error != NULL) {
+ return SDL_SetError("Unable to set the current screen mode: %s (%i)", error->errmess, error->errnum);
+ }
+
+ /* Turn the text cursor off */
+ for (i = 0; i < SDL_arraysize(disable_cursor); i++) {
+ _kernel_oswrch(disable_cursor[i]);
+ }
+
+ return 0;
+}
+
+#endif /* SDL_VIDEO_DRIVER_RISCOS */
+
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/riscos/SDL_riscosmodes.h b/src/video/riscos/SDL_riscosmodes.h
new file mode 100644
index 0000000..ebb9e22
--- /dev/null
+++ b/src/video/riscos/SDL_riscosmodes.h
@@ -0,0 +1,33 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+#include "../../SDL_internal.h"
+
+#ifndef SDL_riscosmodes_h_
+#define SDL_riscosmodes_h_
+
+extern int RISCOS_InitModes(_THIS);
+extern void RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay * display);
+extern int RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay * display,
+ SDL_DisplayMode * mode);
+
+#endif /* SDL_riscosmodes_h_ */
+
+/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/video/riscos/SDL_riscosvideo.c b/src/video/riscos/SDL_riscosvideo.c
index d2f34f6..5907944 100644
--- a/src/video/riscos/SDL_riscosvideo.c
+++ b/src/video/riscos/SDL_riscosvideo.c
@@ -22,21 +22,6 @@
#if SDL_VIDEO_DRIVER_RISCOS
-/* Dummy SDL video driver implementation; this is just enough to make an
- * SDL-based application THINK it's got a working video driver, for
- * applications that call SDL_Init(SDL_INIT_VIDEO) when they don't need it,
- * and also for use as a collection of stubs when porting SDL to a new
- * platform for which you haven't yet written a valid video driver.
- *
- * This is also a great way to determine bottlenecks: if you think that SDL
- * is a performance problem for a given platform, enable this driver, and
- * then see if your application runs faster without video overhead.
- *
- * Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion
- * of this was cut-and-pasted from Stephane Peter's work in the AAlib
- * SDL video driver. Renamed to "DUMMY" by Sam Lantinga.
- */
-
#include "SDL_video.h"
#include "SDL_mouse.h"
#include "../SDL_sysvideo.h"
@@ -46,16 +31,13 @@
#include "SDL_riscosvideo.h"
#include "SDL_riscosevents_c.h"
#include "SDL_riscosframebuffer_c.h"
+#include "SDL_riscosmodes.h"
#include "SDL_riscoswindow.h"
-#include <kernel.h>
-#include <swis.h>
-
#define RISCOSVID_DRIVER_NAME "riscos"
/* Initialization/Query functions */
static int RISCOS_VideoInit(_THIS);
-static int RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
static void RISCOS_VideoQuit(_THIS);
/* RISC OS driver bootstrap functions */
@@ -81,9 +63,11 @@ RISCOS_CreateDevice(int devindex)
/* Set the function pointers */
device->VideoInit = RISCOS_VideoInit;
device->VideoQuit = RISCOS_VideoQuit;
- device->SetDisplayMode = RISCOS_SetDisplayMode;
device->PumpEvents = RISCOS_PumpEvents;
+ device->GetDisplayModes = RISCOS_GetDisplayModes;
+ device->SetDisplayMode = RISCOS_SetDisplayMode;
+
device->CreateSDLWindow = RISCOS_CreateWindow;
device->DestroyWindow = RISCOS_DestroyWindow;
device->GetWindowWMInfo = RISCOS_GetWindowWMInfo;
@@ -102,134 +86,18 @@ VideoBootStrap RISCOS_bootstrap = {
RISCOS_CreateDevice
};
-enum {
- MODE_FLAG_565 = 1 << 7,
-
- MODE_FLAG_COLOUR_SPACE = 0xF << 12,
-
- MODE_FLAG_TBGR = 0,
- MODE_FLAG_TRGB = 1 << 14,
- MODE_FLAG_ABGR = 1 << 15,
- MODE_FLAG_ARGB = MODE_FLAG_TRGB | MODE_FLAG_ABGR
-};
-
-#define MODE_350(type, xdpi, ydpi) \
- (1 | (xdpi << 1) | (ydpi << 14) | (type << 27))
-#define MODE_521(type, xeig, yeig, flags) \
- (0x78000001 | (xeig << 4) | (yeig << 6) | (flags & 0xFF00) | (type << 20))
-
-static const struct {
- SDL_PixelFormatEnum pixel_format;
- int modeflags, ncolour, log2bpp, sprite_type;
-} mode_to_pixelformat[] = {
- { SDL_PIXELFORMAT_INDEX1LSB, 0, 1, 0, 1 },
- /* { SDL_PIXELFORMAT_INDEX2LSB, 0, 3, 1, 2 }, */
- { SDL_PIXELFORMAT_INDEX4LSB, 0, 15, 2, 3 },
- { SDL_PIXELFORMAT_INDEX8, MODE_FLAG_565, 255, 3, 4 },
- { SDL_PIXELFORMAT_BGR555, MODE_FLAG_TBGR, 65535, 4, 5 },
- { SDL_PIXELFORMAT_RGB555, MODE_FLAG_TRGB, 65535, 4, 5 },
- { SDL_PIXELFORMAT_ABGR1555, MODE_FLAG_ABGR, 65535, 4, 5 },
- { SDL_PIXELFORMAT_ARGB1555, MODE_FLAG_ARGB, 65535, 4, 5 },
- { SDL_PIXELFORMAT_BGR444, MODE_FLAG_TBGR, 4095, 4, 16 },
- { SDL_PIXELFORMAT_RGB444, MODE_FLAG_TRGB, 4095, 4, 16 },
- { SDL_PIXELFORMAT_ABGR4444, MODE_FLAG_ABGR, 4095, 4, 16 },
- { SDL_PIXELFORMAT_ARGB4444, MODE_FLAG_ARGB, 4095, 4, 16 },
- { SDL_PIXELFORMAT_BGR565, MODE_FLAG_TBGR | MODE_FLAG_565, 65535, 4, 10 },
- { SDL_PIXELFORMAT_RGB565, MODE_FLAG_TRGB | MODE_FLAG_565, 65535, 4, 10 },
- { SDL_PIXELFORMAT_BGR24, MODE_FLAG_TBGR, 16777215, 6, 8 },
- { SDL_PIXELFORMAT_RGB24, MODE_FLAG_TRGB, 16777215, 6, 8 },
- { SDL_PIXELFORMAT_BGR888, MODE_FLAG_TBGR, -1, 5, 6 },
- { SDL_PIXELFORMAT_RGB888, MODE_FLAG_TRGB, -1, 5, 6 },
- { SDL_PIXELFORMAT_ABGR8888, MODE_FLAG_ABGR, -1, 5, 6 },
- { SDL_PIXELFORMAT_ARGB8888, MODE_FLAG_ARGB, -1, 5, 6 }
-};
-
-static int ReadModeVariable(int mode, int variable) {
- _kernel_swi_regs regs;
- regs.r[0] = mode;
- regs.r[1] = variable;
- _kernel_swi(OS_ReadModeVariable, ®s, ®s);
- return regs.r[2];
-}
-
-SDL_PixelFormatEnum RISCOS_ModeToPixelFormat(int *mode) {
- int i, log2bpp, ncolour, modeflags;
- log2bpp = ReadModeVariable((int)mode, 9);
- ncolour = ReadModeVariable((int)mode, 3);
- modeflags = ReadModeVariable((int)mode, 0);
-
- for (i = 0; i < SDL_arraysize(mode_to_pixelformat); i++) {
- if (log2bpp == mode_to_pixelformat[i].log2bpp &&
- (ncolour == mode_to_pixelformat[i].ncolour || ncolour == 0) &&
- (modeflags & (MODE_FLAG_565 | MODE_FLAG_COLOUR_SPACE)) == mode_to_pixelformat[i].modeflags) {
- return mode_to_pixelformat[i].pixel_format;
- }
- }
-
- return SDL_PIXELFORMAT_UNKNOWN;
-}
-
-static void *copy_mode_block(int *storeBlock)
-{
- int *outBlock;
- int blockSize = (storeBlock[0] == 2) ? 7 : 5;
- while(storeBlock[blockSize] != -1) {
- blockSize += 2;
- }
- blockSize++;
-
- outBlock = SDL_calloc(sizeof(int), blockSize);
- SDL_memcpy(outBlock, storeBlock, sizeof(int) * blockSize);
- return outBlock;
-}
-
-int
+static int
RISCOS_VideoInit(_THIS)
{
- SDL_DisplayMode mode;
- int *current_mode;
- _kernel_swi_regs regs;
- _kernel_oserror *error;
-
- regs.r[0] = 1;
- error = _kernel_swi(OS_ScreenMode, ®s, ®s);
- if (error != NULL) {
- SDL_SetError("Unable to retrieve the current screen mode: %s (%i)", error->errmess, error->errnum);
+ if (RISCOS_InitModes(_this) < 0) {
return -1;
}
- current_mode = (int *)regs.r[1];
-
- /* Use a fake 32-bpp desktop mode */
- mode.w = current_mode[1];
- mode.h = current_mode[2];
- if ((current_mode[0] & 0x7F) == 1) {
- mode.format = RISCOS_ModeToPixelFormat(current_mode);
- mode.refresh_rate = current_mode[4];
- } else if ((current_mode[0] & 0x7F) == 3) {
- mode.format = RISCOS_ModeToPixelFormat(current_mode);
- mode.refresh_rate = current_mode[6];
- } else {
- return -1;
- }
- mode.driverdata = copy_mode_block(current_mode);
-
- if (SDL_AddBasicVideoDisplay(&mode) < 0) {
- return -1;
- }
-
- SDL_AddDisplayMode(&_this->displays[0], &mode);
/* We're done! */
return 0;
}
-static int
-RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
-{
- return 0;
-}
-
-void
+static void
RISCOS_VideoQuit(_THIS)
{
}
diff --git a/src/video/riscos/SDL_riscoswindow.c b/src/video/riscos/SDL_riscoswindow.c
index 37ec8c6..ac3d6c0 100644
--- a/src/video/riscos/SDL_riscoswindow.c
+++ b/src/video/riscos/SDL_riscoswindow.c
@@ -40,6 +40,8 @@ RISCOS_CreateWindow(_THIS, SDL_Window * window)
}
driverdata->window = window;
+ window->flags |= SDL_WINDOW_FULLSCREEN;
+
/* All done! */
window->driverdata = driverdata;
return 0;