Skip to content

Commit

Permalink
get rid of the old var "g_fullscreen" which was not allowed to be
Browse files Browse the repository at this point in the history
changed anyway...
  • Loading branch information
ivanovic committed Dec 13, 2011
1 parent d55d34f commit 7cd09c8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
1 change: 0 additions & 1 deletion unix/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 5 additions & 4 deletions unix/svga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ extern bool8_32 Scale;
#include <iostream>
extern blit_scaler_option_t blit_scalers[];
extern blit_scaler_e g_scale;
extern unsigned char g_fullscreen;
#endif

#ifndef _ZAURUS
Expand Down Expand Up @@ -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) )
Expand All @@ -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
Expand Down
25 changes: 14 additions & 11 deletions unix/unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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*/,
Expand All @@ -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...
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 7cd09c8

Please sign in to comment.