2 * (C) GraÅžvydas "notaz" Ignotas, 2011
4 * This work is licensed under the terms of any of these licenses
6 * - GNU GPL, version 2 or later.
7 * - GNU LGPL, version 2.1 or later.
8 * See the COPYING file in the top-level directory.
13 #include <SDL_syswm.h>
16 static SDL_Surface *screen;
17 static Display *x11_display;
24 ret = SDL_Init(SDL_INIT_VIDEO);
26 fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
30 screen = SDL_SetVideoMode(1024, 512, 32, 0);
32 fprintf(stderr, "SDL_SetVideoMode failed: %s\n", SDL_GetError());
37 SDL_VERSION(&wminfo.version);
38 ret = SDL_GetWMInfo(&wminfo);
40 x11_display = wminfo.info.x11.display;
51 void vout_update(void)
56 SDL_LockSurface(screen);
57 if (gpu.status & PSX_GPU_STATUS_RGB24)
61 for (y = 0; y < 512; y++) {
62 s = (uint8_t *)gpu.vram + y * 2*1024;
63 d = (uint32_t *)screen->pixels + y * 1024;
64 for (i = 0; i < 1024 * 2 / 3; i++, s += 3)
65 d[i] = (s[0] << 16) | (s[1] << 8) | s[2];
70 uint16_t *s = gpu.vram;
71 d = (uint32_t *)screen->pixels;
72 for (i = 0; i < 1024 * 512; i++)
73 d[i] = (((uint32_t)s[i] << 19) & 0xf80000) | ((s[i] << 6) & 0xf800) |
76 SDL_UnlockSurface(screen);
77 SDL_UpdateRect(screen, 0, 0, 1024, 512);
84 long GPUopen(void **dpy)
95 void vout_set_config(const struct rearmed_cbs *cbs)
99 // vim:shiftwidth=2:expandtab