From 7cd09c857048cd5459425a71d424d4576466030f Mon Sep 17 00:00:00 2001 From: Nils Kneuper Date: Tue, 13 Dec 2011 16:26:00 +0100 Subject: [PATCH] get rid of the old var "g_fullscreen" which was not allowed to be changed anyway... --- unix/menu.cpp | 1 - unix/svga.cpp | 9 +++++---- unix/unix.cpp | 25 ++++++++++++++----------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/unix/menu.cpp b/unix/menu.cpp index d10f212..b640eef 100644 --- a/unix/menu.cpp +++ b/unix/menu.cpp @@ -21,7 +21,6 @@ extern blit_scaler_option_t blit_scalers[]; extern blit_scaler_e g_scale; extern SDL_Surface *screen,*gfxscreen; - extern unsigned char g_fullscreen; extern int cut_top, cut_bottom, cut_left, cut_right; #endif diff --git a/unix/svga.cpp b/unix/svga.cpp index b07c514..e3bccf5 100644 --- a/unix/svga.cpp +++ b/unix/svga.cpp @@ -77,7 +77,6 @@ extern bool8_32 Scale; #include extern blit_scaler_option_t blit_scalers[]; extern blit_scaler_e g_scale; - extern unsigned char g_fullscreen; #endif #ifndef _ZAURUS @@ -114,9 +113,9 @@ void S9xInitDisplay (int /*argc*/, char ** /*argv*/) #ifdef PANDORA //screen = SDL_SetVideoMode(xs * blit_scalers [ g_scale ].scale_x, ys * blit_scalers [ g_scale ].scale_y, 16, - // g_fullscreen ? SDL_SWSURFACE|SDL_FULLSCREEN : SDL_SWSURFACE); + // SDL_SWSURFACE|SDL_FULLSCREEN); //screen = SDL_SetVideoMode( 800 /* pandora horiz */, 480 /* pandora vert */, 16, - // g_fullscreen ? SDL_SWSURFACE|SDL_FULLSCREEN : SDL_SWSURFACE); + // SDL_SWSURFACE|SDL_FULLSCREEN); std::cerr << "setting video mode in S9xInitDisplay, selected mode: " << (std::string) blit_scalers [ g_scale ].desc_en << std::endl; //NOTE: the following block should not be required but is left for "safety reasons" if ( Settings.SupportHiRes && !(blit_scalers [ g_scale ].support_hires) ) @@ -126,8 +125,10 @@ void S9xInitDisplay (int /*argc*/, char ** /*argv*/) } setenv("SDL_OMAP_LAYER_SIZE",blit_scalers [ g_scale ].layersize,1); +// screen = SDL_SetVideoMode( blit_scalers [ g_scale ].res_x , blit_scalers [ g_scale ].res_y, 16, +// SDL_DOUBLEBUF|SDL_FULLSCREEN); screen = SDL_SetVideoMode( blit_scalers [ g_scale ].res_x , blit_scalers [ g_scale ].res_y, 16, - g_fullscreen ? SDL_SWSURFACE|SDL_FULLSCREEN : SDL_SWSURFACE); + SDL_SWSURFACE|SDL_FULLSCREEN); // for vsync // WARNING! this is used as framelimiter, too! The emulator will run by far diff --git a/unix/unix.cpp b/unix/unix.cpp index 9a542ec..4a06c89 100644 --- a/unix/unix.cpp +++ b/unix/unix.cpp @@ -134,7 +134,6 @@ pthread_mutex_t mutex; blit_scaler_e g_scale = bs_fs_4to3; //blit_scaler_e g_scale = bs_1to32_multiplied; - unsigned char g_fullscreen = 1; unsigned char g_scanline = 0; // pixel doubling, but skipping the vertical alternate lines unsigned char g_vsync = 1; // if >0, do vsync int g_fb = -1; // fb for framebuffer @@ -1066,8 +1065,11 @@ bool8_32 S9xDeinitUpdate ( int Width, int Height ) { sprintf(cutborders, "%d,%d,%d,%d", cut_left, cut_right, cut_top, cut_bottom); setenv("SDL_OMAP_BORDER_CUT",cutborders,1); +// screen = SDL_SetVideoMode( Width , Height, 16, +// SDL_DOUBLEBUF|SDL_FULLSCREEN); + screen = SDL_SetVideoMode( Width , Height, 16, - g_fullscreen ? SDL_SWSURFACE|SDL_FULLSCREEN : SDL_SWSURFACE); + SDL_SWSURFACE|SDL_FULLSCREEN); } render_x_single_xy((uint16*)(screen -> pixels) /*destination_pointer_address*/, @@ -1083,7 +1085,7 @@ bool8_32 S9xDeinitUpdate ( int Width, int Height ) { // std::cerr << "resetting video mode in S9xDeinitUpdate:v3"<< std::endl; // setenv("SDL_OMAP_LAYER_SIZE",blit_scalers [ g_scale ].layersize,1); // screen = SDL_SetVideoMode( blit_scalers [ g_scale ].res_x , blit_scalers [ g_scale ].res_y, 16, - // g_fullscreen ? SDL_SWSURFACE|SDL_FULLSCREEN : SDL_SWSURFACE); + // SDL_SWSURFACE|SDL_FULLSCREEN); //} // get the pitch only once... @@ -1214,16 +1216,17 @@ bool8_32 S9xDeinitUpdate ( int Width, int Height ) { screen->h + font_height * 3 - 2 - widescreen_center_y); // "font_height * 3 - 2" to place it in the line above the framerate counter } - SDL_UnlockSurface(screen); + SDL_UnlockSurface(screen); - // vsync - if ( g_vsync && g_fb >= 0 ) { - int arg = 0; - ioctl ( g_fb, FBIO_WAITFORVSYNC, &arg ); - } + // vsync + if ( g_vsync && g_fb >= 0 ) { + int arg = 0; + ioctl ( g_fb, FBIO_WAITFORVSYNC, &arg ); + } - // update the actual screen - SDL_UpdateRect(screen,0,0,0,0); + // update the actual screen + //SDL_UpdateRect(screen,0,0,0,0); + SDL_Flip(screen); return(TRUE); }