Skip to content

Commit

Permalink
NetBSD wscons support by wiz
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 26, 2012
1 parent d5a23c3 commit 0645d80
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/video/wscons/SDL_wsconsevents.c
Expand Up @@ -146,8 +146,11 @@ void WSCONS_InitOSKeymap(_THIS)
}

switch (private->kbdType) {
#ifdef WSKBD_TYPE_ZAURUS
#if defined(__NetBSD__) || !defined(WSKBD_TYPE_ZAURUS)
default:
#else
case WSKBD_TYPE_ZAURUS:
#endif
/* top row */
keymap[2] = SDLK_1;
keymap[3] = SDLK_2;
Expand Down Expand Up @@ -220,12 +223,13 @@ void WSCONS_InitOSKeymap(_THIS)
keymap[77] = SDLK_RIGHT;
keymap[80] = SDLK_DOWN;
break;
#endif /* WSKBD_TYPE_ZAURUS */

#if !defined(__NetBSD__) && defined(WSKBD_TYPE_ZAURUS)
default:
WSCONS_ReportError("Unable to map keys for keyboard type %u",
private->kbdType);
break;
#endif
}
}

Expand Down
12 changes: 12 additions & 0 deletions src/video/wscons/SDL_wsconsvideo.c
Expand Up @@ -141,7 +141,13 @@ VideoBootStrap WSCONS_bootstrap = {
WSCONS_CreateDevice
};

#ifdef __NetBSD__
#define WSCONSDEV_FORMAT "/dev/ttyE%01x"
#endif

#ifdef __OpenBSD__
#define WSCONSDEV_FORMAT "/dev/ttyC%01x"
#endif

int WSCONS_VideoInit(_THIS, SDL_PixelFormat *vformat)
{
Expand Down Expand Up @@ -184,6 +190,11 @@ int WSCONS_VideoInit(_THIS, SDL_PixelFormat *vformat)
return -1;
}
if (private->info.depth > 8) {
#ifdef __NetBSD__
private->greenMask = 0x00ff00;
private->blueMask = 0x0000ff;
private->redMask = 0xff0000;
#else
if (wstype == WSDISPLAY_TYPE_SUN24 ||
wstype == WSDISPLAY_TYPE_SUNCG12 ||
wstype == WSDISPLAY_TYPE_SUNCG14 ||
Expand All @@ -202,6 +213,7 @@ int WSCONS_VideoInit(_THIS, SDL_PixelFormat *vformat)
WSCONS_ReportError("Unknown video hardware");
return -1;
}
#endif
} else {
WSCONS_ReportError("Displays with 8 bpp or less are not supported");
return -1;
Expand Down

0 comments on commit 0645d80

Please sign in to comment.