NetBSD wscons support by wiz SDL-1.2
authorSam Lantinga
Tue, 25 Sep 2012 20:51:31 -0700
branchSDL-1.2
changeset 64602a971ffe1fad
parent 6455 15c8ee21197b
child 6561 ea34ef329509
NetBSD wscons support by wiz
src/video/wscons/SDL_wsconsevents.c
src/video/wscons/SDL_wsconsvideo.c
     1.1 --- a/src/video/wscons/SDL_wsconsevents.c	Tue Sep 25 20:45:31 2012 -0700
     1.2 +++ b/src/video/wscons/SDL_wsconsevents.c	Tue Sep 25 20:51:31 2012 -0700
     1.3 @@ -146,8 +146,11 @@
     1.4    }
     1.5  
     1.6    switch (private->kbdType) {
     1.7 -#ifdef WSKBD_TYPE_ZAURUS
     1.8 +#if defined(__NetBSD__) || !defined(WSKBD_TYPE_ZAURUS)
     1.9 +  default:
    1.10 +#else
    1.11    case WSKBD_TYPE_ZAURUS:
    1.12 +#endif
    1.13      /* top row */
    1.14      keymap[2] = SDLK_1;
    1.15      keymap[3] = SDLK_2;
    1.16 @@ -220,12 +223,13 @@
    1.17      keymap[77] = SDLK_RIGHT;
    1.18      keymap[80] = SDLK_DOWN;
    1.19      break;
    1.20 -#endif /* WSKBD_TYPE_ZAURUS */
    1.21  
    1.22 +#if !defined(__NetBSD__) && defined(WSKBD_TYPE_ZAURUS)
    1.23    default:
    1.24      WSCONS_ReportError("Unable to map keys for keyboard type %u", 
    1.25  		       private->kbdType);
    1.26      break;
    1.27 +#endif
    1.28    }
    1.29  }
    1.30  
     2.1 --- a/src/video/wscons/SDL_wsconsvideo.c	Tue Sep 25 20:45:31 2012 -0700
     2.2 +++ b/src/video/wscons/SDL_wsconsvideo.c	Tue Sep 25 20:51:31 2012 -0700
     2.3 @@ -141,7 +141,13 @@
     2.4    WSCONS_CreateDevice
     2.5  };
     2.6  
     2.7 +#ifdef __NetBSD__
     2.8 +#define WSCONSDEV_FORMAT "/dev/ttyE%01x"
     2.9 +#endif
    2.10 +
    2.11 +#ifdef __OpenBSD__
    2.12  #define WSCONSDEV_FORMAT "/dev/ttyC%01x"
    2.13 +#endif
    2.14  
    2.15  int WSCONS_VideoInit(_THIS, SDL_PixelFormat *vformat)
    2.16  {
    2.17 @@ -184,6 +190,11 @@
    2.18      return -1;
    2.19    }
    2.20    if (private->info.depth > 8) {
    2.21 +#ifdef __NetBSD__
    2.22 +    private->greenMask = 0x00ff00;
    2.23 +    private->blueMask = 0x0000ff;
    2.24 +    private->redMask = 0xff0000;
    2.25 +#else
    2.26      if (wstype == WSDISPLAY_TYPE_SUN24 ||
    2.27  	wstype == WSDISPLAY_TYPE_SUNCG12 ||
    2.28  	wstype == WSDISPLAY_TYPE_SUNCG14 ||
    2.29 @@ -202,6 +213,7 @@
    2.30        WSCONS_ReportError("Unknown video hardware");
    2.31        return -1;
    2.32      }
    2.33 +#endif
    2.34    } else {
    2.35      WSCONS_ReportError("Displays with 8 bpp or less are not supported");
    2.36      return -1;