From a97f6729ab45d0717cac8a44534847864e13a052 Mon Sep 17 00:00:00 2001 From: theoddone33 <> Date: Sun, 7 Jul 2002 03:45:40 +0000 Subject: [PATCH] Patch from Diablo-D3 to inform folks about bit depth stuff --- zsnes/src/linux/sdllink.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/zsnes/src/linux/sdllink.c b/zsnes/src/linux/sdllink.c index 4014cd32..31b2c7a1 100644 --- a/zsnes/src/linux/sdllink.c +++ b/zsnes/src/linux/sdllink.c @@ -580,6 +580,22 @@ BOOL InitInput() return TRUE; } +int saybitdepth() +{ + int MyBitsPerPixel; + const SDL_VideoInfo *info; + SDL_Init(SDL_INIT_VIDEO); + info = SDL_GetVideoInfo(); + MyBitsPerPixel = info->vfmt->BitsPerPixel; + switch (MyBitsPerPixel) + { + case 0: printf("Cannot detect bitdepth. On fbcon and svgalib this is normal.\nTrying to force 16 bpp.\n\n"); break; + case 16: break; + default: printf("You are running in %d bpp, but ZSNES is forcing 16 bpp.\nYou may experience poor performance and/or crashing.\n\n", MyBitsPerPixel); break; + } + return 0; +} + int startgame(void) { int status; @@ -598,7 +614,7 @@ int startgame(void) if (sdl_state == vid_soft) sw_end(); #ifdef __OPENGL__ else if (sdl_state == vid_gl) gl_end(); - + saybitdepth(); if (UseOpenGL) { status = gl_start(WindowWidth, WindowHeight, BitDepth, FullScreen);