win/video cleanup

This commit is contained in:
rpahut 2014-01-03 05:33:39 +00:00
parent 0d3ed22d62
commit 8a2a96bd1f
18 changed files with 1029 additions and 1194 deletions

View File

@ -25,6 +25,9 @@ void FCEU_printf(char *format, ...);
#define FCEUI_printf FCEU_printf
//Video interface
// FIXME: these functions are declared in windows video driver header, but not in linux video driver header;
// eventually both platform video drivers should be brought to same set of functions and single shared header,
// which then can be included where access to video driver functions is needed instead of driver.h
void FCEUD_SetPalette(uint8 index, uint8 r, uint8 g, uint8 b);
void FCEUD_GetPalette(uint8 i,uint8 *r, uint8 *g, uint8 *b);
@ -259,6 +262,9 @@ void FCEUI_SetEmulationPaused(int val);
void FCEUI_ToggleEmulationPause();
//indicates whether input aids should be drawn (such as crosshairs, etc; usually in fullscreen mode)
// FIXME: this function is already declared in both platform video driver headers;
// eventually both platform video drivers should be brought to same set of functions and single shared header,
// which then can be included where access to video driver functions is needed instead of driver.h
bool FCEUD_ShouldDrawInputAids();
///called when the emulator closes a game

View File

@ -4,8 +4,8 @@
#include "common.h"
#include "fceu.h"
#include "drivers/win/video.h"
extern PALETTEENTRY *color_palette;
//extern WAVEFORMATEX wf;
//extern int soundo;
@ -292,6 +292,7 @@ static void do_video_conversion(const unsigned char* buffer)
// memset(avi_file->convert_buffer, 0, VIDEO_WIDTH*(avi_file->end_scanline-avi_file->start_scanline)*3);
buffer += avi_file->start_scanline * VIDEO_WIDTH;
PALETTEENTRY* color_palette = GetPalette();
for(int y=avi_file->start_scanline; y<avi_file->end_scanline; ++y)
{

View File

@ -185,8 +185,8 @@ static CFGSTRUCT fceuconfig[] =
NAC("palyo",pal_emulation),
NAC("genie",genie),
NAC("fs",fullscreen),
NAC("vgamode",vmod),
NAC("fs",_FIXME_getFullscreenVar()),
NAC("vgamode",_FIXME_getVModeIdxVar()),
NAC("sound",soundo),
NAC("sicon",status_icon),
@ -206,8 +206,8 @@ static CFGSTRUCT fceuconfig[] =
NACS("odavi",directory_names[12]),
NACS("odbase",directory_names[13]),
AC(winspecial),
AC(NTSCwinspecial),
NAC("winspecial", _FIXME_getFilterModeWindowedIdxVar()),
NAC("NTSCwinspecial", _FIXME_getFilterOptionVar()),
AC(winsizemulx),
AC(winsizemuly),
AC(tvAspectX),
@ -231,23 +231,23 @@ static CFGSTRUCT fceuconfig[] =
NACA("InputType",InputType),
NAC("vmcx",vmodes[0].x),
NAC("vmcy",vmodes[0].y),
NAC("vmcb",vmodes[0].bpp),
NAC("vmcf",vmodes[0].flags),
NAC("vmcxs",vmodes[0].xscale),
NAC("vmcys",vmodes[0].yscale),
NAC("vmspecial",vmodes[0].special),
NAC("vmcx",_FIXME_getCustomVideoModeVar().width),
NAC("vmcy",_FIXME_getCustomVideoModeVar().height),
NAC("vmcb",_FIXME_getCustomVideoModeVar().bpp),
NAC("vmcf",_FIXME_getCustomVideoModeVar().flags),
NAC("vmcxs",_FIXME_getCustomVideoModeVar().xscale),
NAC("vmcys",_FIXME_getCustomVideoModeVar().yscale),
NAC("vmspecial",_FIXME_getCustomVideoModeVar().filter),
NAC("srendline",srendlinen),
NAC("erendline",erendlinen),
NAC("srendlinep",srendlinep),
NAC("erendlinep",erendlinep),
AC(directDrawModeWindowed),
AC(directDrawModeFullscreen),
AC(winsync),
NAC("988fssync",fssync),
NAC("directDrawModeWindowed", _FIXME_getDDrawModeWindowedVar()),
NAC("directDrawModeFullscreen", _FIXME_getDDrawModeFullscreenVar()),
NAC("winsync", _FIXME_getWindowedSyncModeIdxVar()),
NAC("988fssync",_FIXME_getFullscreenSyncModeIdxVar()),
AC(ismaximized),
AC(maxconbskip),

View File

@ -1,3 +1,7 @@
// FIXME for Windows, make use of Config class the way linux version does
// old config registers variables by placing their addresses into static array, which makes
// many modules expose their internal vars and pollute globals; there is also no way to know when a
// setting was changed by it, which spawns auxillary functions intended to push new values through
void SaveConfig(const char *filename);
void LoadConfig(const char *filename);

View File

@ -28,6 +28,7 @@
#include <windows.h>
#include <commctrl.h>
#include "video.h"
#include "input.h"
#include "keyboard.h"
#include "joystick.h"
@ -42,9 +43,8 @@ LPDIRECTINPUT7 lpDI=0;
void InitInputPorts(bool fourscore);
int tempwinsync = 0; //Temp variable used by turbo to turn of sync settings
VSYNCMODE tempwinsync = SYNCMODE_NONE; //Temp variable used by turbo to turn of sync settings
int tempsoundquality = 0; //Temp variable used by turbo to turn of sound quality settings
extern int winsync;
extern int soundquality;
extern bool replaceP2StartWithMicrophone;
//UsrInputType[] is user-specified. InputType[] is current
@ -1571,8 +1571,8 @@ int FCEUD_TestCommandState(int c)
void FCEUD_TurboOn (void)
{
tempwinsync = winsync; //Store winsync setting
winsync = 0; //turn off winsync for turbo (so that turbo can function even with VBlank sync methods
tempwinsync = GetWindowedSyncModeIdx(); //Store wndSyncMode setting
SetWindowedSyncModeIdx(SYNCMODE_NONE); //turn off wndSyncMode for turbo (so that turbo can function even with VBlank sync methods
tempsoundquality = soundquality; //Store sound quality settings
FCEUI_SetSoundQuality(0); //Turn sound quality to low
turbo = true;
@ -1580,7 +1580,7 @@ void FCEUD_TurboOn (void)
}
void FCEUD_TurboOff (void)
{
winsync = tempwinsync; //Restore winsync setting
SetWindowedSyncModeIdx(tempwinsync); //Restore wndSyncMode setting
soundquality = tempsoundquality; //Restore sound quality settings
FCEUI_SetSoundQuality(soundquality);
turbo = false;
@ -1589,15 +1589,15 @@ void FCEUD_TurboOff (void)
void FCEUD_TurboToggle(void)
{
if (turbo) {
winsync = tempwinsync; //If turbo was on, restore winsync
SetWindowedSyncModeIdx(tempwinsync); //If turbo was on, restore wndSyncMode
soundquality = tempsoundquality; //and restore sound quality setting
FCEUI_SetSoundQuality(soundquality);
}
else
{
tempwinsync = winsync; //Store video sync settings
tempwinsync = GetWindowedSyncModeIdx(); //Store video sync settings
tempsoundquality = soundquality; //Store sound quality settings
winsync = 0; //If turbo was off, turn off winsync (so that turbo can function even with VBlank sync methods
SetWindowedSyncModeIdx(SYNCMODE_NONE); //If turbo was off, turn off wndSyncMode (so that turbo can function even with VBlank sync methods
FCEUI_SetSoundQuality(0); //Set sound quality to low
}

View File

@ -19,7 +19,7 @@ int InitDInput(void);
void CreateInputStuff(void);
void InitInputStuff(void);
void DestroyInput(void);
void InputScreenChanged(int fs);
void InputScreenChanged(int fs); // FIXME defined nowhere used nowhere
void SetAutoFireDesynch(int DesynchOn);
int GetAutoFireDesynch();
uint32 GetGamepadPressedImmediate();

View File

@ -43,6 +43,7 @@
#include "../../movie.h"
#include "../../fceulua.h"
#include "window.h"
#include "archive.h"
#include "input.h"
#include "netplay.h"
@ -109,7 +110,6 @@ extern bool taseditorEnableAcceleratorKeys;
// External functions
extern std::string cfgFile; //Contains the filename of the config file used.
extern bool turbo; //Is game in turbo mode?
void ResetVideo(void);
void ShowCursorAbs(int w);
void HideFWindow(int h);
void FixWXY(int pref, bool shift_held);
@ -167,15 +167,12 @@ int ffbskip = 32; //Blit skips per blit when FF-ing
HINSTANCE fceu_hInstance;
HACCEL fceu_hAccel;
HRESULT ddrval;
static char TempArray[2048];
static int exiting = 0;
static volatile int moocow = 0;
int windowedfailed = 0;
int fullscreen = 0; //Windows files only, variable that keeps track of fullscreen status
static volatile int _userpause = 0; //mbg merge 7/18/06 changed tasbuild was using this only in a couple of places
@ -390,12 +387,12 @@ void FCEUD_PrintError(const char *errormsg)
{
AddLogText(errormsg, 1);
if (fullscreen && (eoptions & EO_HIDEMOUSE))
if (GetIsFullscreen() && (eoptions & EO_HIDEMOUSE))
ShowCursorAbs(1);
MessageBox(0, errormsg, FCEU_NAME" Error", MB_ICONERROR | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);
if (fullscreen && (eoptions & EO_HIDEMOUSE))
if (GetIsFullscreen() && (eoptions & EO_HIDEMOUSE))
ShowCursorAbs(0);
}
@ -491,7 +488,7 @@ int DriverInitialize()
if(soundo)
soundo = InitSound();
SetVideoMode(fullscreen);
InitVideoDriver();
InitInputStuff(); /* Initialize DInput interfaces. */
return 1;
@ -506,7 +503,7 @@ static void DriverKill(void)
DestroyInput();
ResetVideo();
ShutdownVideoDriver();
if(soundo)
{
@ -649,7 +646,6 @@ int main(int argc,char *argv[])
{
FCEUI_SetGameGenie(genie!=0);
fullscreen = !!fullscreen;
soundo = !!soundo;
frame_display = !!frame_display;
allowUDLR = !!allowUDLR;
@ -687,7 +683,7 @@ int main(int argc,char *argv[])
if(!t)
{
fullscreen=0;
SetIsFullscreen(false);
}
CreateMainWindow();
@ -919,8 +915,10 @@ void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count)
}
//blit the framebuffer
if(XBuf)
if(XBuf) {
xbsave = XBuf;
FCEUD_BlitScreen(XBuf);
}
//update debugging displays
_updateWindow();

View File

@ -34,7 +34,6 @@ extern int maxconbskip;
extern int ffbskip;
extern void LoadNewGamey(HWND hParent, const char *initialdir);
extern void CloseGame();
extern int fullscreen; //Windows files only, keeps track of fullscreen status
// Flag that indicates whether Game Genie is enabled or not.
extern int genie;
@ -55,8 +54,6 @@ extern int AFon;
extern int AFoff;
extern int AutoFireOffset;
extern int vmod;
extern char* directory_names[14];
char *GetRomName(); //Checks if rom is loaded, if so, outputs the Rom name with no directory path or file extension
@ -123,13 +120,13 @@ extern int soundo;
extern int eoptions;
extern int soundoptions;
extern uint8 *xbsave;
extern HRESULT ddrval;
extern int windowedfailed;
extern uint32 goptions;
void DoFCEUExit();
void ShowAboutBox();
int BlockingCheck();
void UpdateRendBounds(void);
void DoPriority();
void RemoveDirs();
void CreateDirs();

View File

@ -22,6 +22,7 @@ Main - Main gate between emulator and Taseditor
#include "main.h" // for GetRomName
#include "taseditor.h"
#include "window.h"
#include "video.h"
#include "../../input.h"
#include "../keyboard.h"
#include "../joystick.h"
@ -56,7 +57,6 @@ extern int joysticksPerFrame[INPUT_TYPES_TOTAL];
extern bool turbo;
extern int pal_emulation;
extern int newppu;
extern void PushCurrentVideoSettings();
extern void RefreshThrottleFPS();
extern bool LoadFM2(MovieData& movieData, EMUFILE* fp, int size, bool stopAfterHeader);
// temporarily saved FCEUX config
@ -883,7 +883,6 @@ void applyMovieInputConfig()
pal_emulation = currMovieData.palFlag;
FCEUI_SetVidSystem(pal_emulation);
RefreshThrottleFPS();
PushCurrentVideoSettings();
// update PPU type
newppu = currMovieData.PPUflag;
SetMainWindowText();

View File

@ -19,6 +19,8 @@ Popup display - Manager of popup windows
#include "taseditor_project.h"
#include "zlib.h"
#include "drivers/win/video.h"
extern TASEDITOR_CONFIG taseditorConfig;
extern TASEDITOR_WINDOW taseditorWindow;
extern BOOKMARKS bookmarks;
@ -91,7 +93,7 @@ void POPUP_DISPLAY::init()
{
free();
// fill scr_bmp palette with current palette colors
extern PALETTEENTRY *color_palette;
PALETTEENTRY* color_palette = GetPalette();
for (int i = 0; i < 256; ++i)
{
screenshotBmi->bmiColors[i].rgbRed = color_palette[i].peRed;

View File

@ -46,7 +46,6 @@
char *textToTrans; // buffer to hold the text that needs translating
char *transText; //holds the translated text
extern void FCEUD_BlitScreen(uint8 *XBuf); //needed for pause, not sure where this is defined...
//adelikat merge 7/1/08 - had to add these extern variables
//------------------------------
extern uint8 PALRAM[0x20];

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +1,96 @@
#ifndef WIN_VIDEO_H
#define WIN_VIDEO_H
#include "common.h"
#include <Windows.h>
#include "types.h"
// I like hacks.
#define uint8 __UNO492032
#include <winsock.h>
#include "ddraw.h"
#undef LPCWAVEFORMATEX
#include "dsound.h"
#include "dinput.h"
#include <commctrl.h>
#include <shlobj.h> // For directories configuration dialog.
#undef uint8
#include "main.h"
#include "window.h"
enum DIRECTDRAW_MODES
typedef enum
{
DIRECTDRAW_MODE_SOFTWARE,
DIRECTDRAW_MODE_SURFACE_IN_RAM,
DIRECTDRAW_MODE_FULL,
DIRECTDRAW_MODE_SOFTWARE = 0, // all features are emulated in software
DIRECTDRAW_MODE_SURFACE_IN_RAM, // place offscreen surface in RAM rather than in VRAM; may or may not use hardware acceleration
DIRECTDRAW_MODE_FULL, // use available hardware features, emulate the rest
// ...
DIRECTDRAW_MODES_TOTAL
};
} DIRECTDRAW_MODE;
#define VF_DDSTRETCHED 1
#define VIDEOMODEFLAG_DXBLT 1
#define VIDEOMODEFLAG_STRFS 2
#define VEF_LOSTSURFACE 1
#define VEF____INTERNAL 2
#define VMDF_DXBLT 1
#define VMDF_STRFS 2
typedef enum
{
FILTER_NONE = 0,
FILTER_HQ2X,
FILTER_SCALE2X,
FILTER_NTSC2X,
FILTER_HQ3X,
FILTER_SCALE3X
} VFILTER;
typedef struct {
int x;
int y;
int width;
int height;
int bpp;
int flags;
int xscale;
int yscale;
RECT srect;
RECT drect;
int special;
} vmdef;
RECT srcRect;
RECT dstRect;
VFILTER filter;
} VideoMode;
// left, top, right, bottom
extern vmdef vmodes[11];
extern int winspecial;
extern int NTSCwinspecial;
typedef enum {
SYNCMODE_NONE = 0,
SYNCMODE_WAIT,
SYNCMODE_LAZYWAIT,
SYNCMODE_DOUBLEBUF
} VSYNCMODE;
extern int directDrawModeWindowed;
extern int directDrawModeFullscreen;
void InitVideoDriver(void);
void ShutdownVideoDriver();
extern int fssync;
extern int winsync;
// Recalculate blit rectangle within window of given size
void OnWindowSizeChange(int width, int height);
void SetFSVideoMode();
void FCEUD_BlitScreen(uint8 *XBuf);
void ConfigVideo();
void recalculateBestFitRect(int width, int height);
int SetVideoMode(int fs);
// Get current blit rectangle
RECT GetActiveRect(void);
// Get driver palette
PALETTEENTRY* GetPalette(void);
// Returns true when in fullscreen mode, false when in windowed
bool GetIsFullscreen(void);
// Set fullscreen mode flag
// FCEUD_VideoChanged() must be called in order to make value take effect
void SetIsFullscreen(bool f);
VSYNCMODE GetWindowedSyncModeIdx(void);
void SetWindowedSyncModeIdx(VSYNCMODE idx);
// Bring up the Video configuration dialog
void ShowConfigVideoDialog();
// (Re)apply render lines and sprite limitation to FCE
void DoVideoConfigFix();
// Implements FCEUD requirements
bool FCEUD_ShouldDrawInputAids(void);
void FCEUD_BlitScreen(uint8 *XBuf);
void ResetVideo();
void SetFSVideoMode();
void PushCurrentVideoSettings();
void ResetCustomMode();
void FCEUD_VideoChanged(void); // this one should be declared here
void FCEUD_SetPalette(unsigned char index, unsigned char r, unsigned char g, unsigned char b);
void FCEUD_GetPalette(unsigned char i, unsigned char *r, unsigned char *g, unsigned char *b);
// see win/config.h
bool& _FIXME_getFullscreenVar(void);
int& _FIXME_getVModeIdxVar(void);
VSYNCMODE& _FIXME_getFullscreenSyncModeIdxVar(void);
VSYNCMODE& _FIXME_getWindowedSyncModeIdxVar(void);
VFILTER& _FIXME_getFilterModeWindowedIdxVar(void);
int& _FIXME_getFilterOptionVar(void);
DIRECTDRAW_MODE& _FIXME_getDDrawModeWindowedVar(void);
DIRECTDRAW_MODE& _FIXME_getDDrawModeFullscreenVar(void);
VideoMode& _FIXME_getCustomVideoModeVar(void);
#endif

View File

@ -83,8 +83,6 @@ extern PLAYBACK playback;
#include "Win32InputBox.h"
extern int32 fps_scale_unpaused;
//extern void ToggleFullscreen();
using namespace std;
//----Context Menu - Some dynamically added menu items
@ -995,7 +993,7 @@ void HideFWindow(int h)
//Toggles the display status of the main menu.
void ToggleHideMenu(void)
{
if(!fullscreen && !nofocus && (GameInfo || tog))
if(!GetIsFullscreen() && !nofocus && (GameInfo || tog))
{
tog ^= 1;
HideMenu(tog);
@ -1034,7 +1032,7 @@ bool ALoad(const char *nameo, char* innerFilename, bool silent)
UpdateCheckedMenuItems();
PushCurrentVideoSettings();
FCEUD_VideoChanged();
std::string recentFileName = nameo;
if(GameInfo->archiveFilename && GameInfo->archiveCount>1)
@ -1053,7 +1051,10 @@ bool ALoad(const char *nameo, char* innerFilename, bool silent)
if(eoptions & EO_FSAFTERLOAD)
{
SetFSVideoMode();
changerecursive=1;
SetIsFullscreen(true);
FCEUD_VideoChanged();
changerecursive=0;
}
@ -1119,7 +1120,7 @@ void LoadNewGamey(HWND hParent, const char *initialdir)
void GetMouseData(uint32 (&md)[3])
{
extern RECT bestfitRect;
RECT bestfitRect = GetActiveRect();
double screen_width = VNSWID;
double screen_height = FSettings.TotalScanlines();
@ -1271,8 +1272,10 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
if (fullscreenByDoubleclick)
{
extern void ToggleFullscreen();
ToggleFullscreen();
changerecursive=1;
SetIsFullscreen(!GetIsFullscreen());
FCEUD_VideoChanged();
changerecursive=0;
return 0;
} else
{
@ -1379,7 +1382,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
goto proco;
case WM_SIZE:
if (!fullscreen && !changerecursive && !windowedfailed)
if (!GetIsFullscreen() && !changerecursive && !windowedfailed)
{
switch(wParam)
{
@ -1439,7 +1442,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
//break;
goto proco;
case WM_DISPLAYCHANGE:
if(!fullscreen && !changerecursive)
if(!GetIsFullscreen() && !changerecursive)
vchanged=1;
goto proco;
case WM_DROPFILES:
@ -1970,7 +1973,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
FCEUI_SetVidSystem(pal_emulation);
RefreshThrottleFPS();
UpdateCheckedMenuItems();
PushCurrentVideoSettings();
FCEUD_VideoChanged();
break;
case MENU_DIRECTORIES:
ConfigDirectories();
@ -1994,7 +1997,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
ConfigTiming();
break;
case MENU_VIDEO:
ConfigVideo();
ShowConfigVideoDialog();
break;
case MENU_HOTKEYS:
MapInput();
@ -2292,14 +2295,14 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
if(GameInfo && ((InputType[2]==SIFC_FKB) || (InputType[2]==SIFC_SUBORKB)) && cidisabled)
break;
if(lParam == VK_RETURN || fullscreen || tog) break;
if(lParam == VK_RETURN || GetIsFullscreen() || tog) break;
}
goto proco;
case WM_SYSKEYDOWN:
if(GameInfo && ((InputType[2]==SIFC_FKB) || (InputType[2]==SIFC_SUBORKB)) && cidisabled)
break; // Hopefully this won't break DInput...
if(fullscreen || tog)
if(GetIsFullscreen() || tog)
{
if(wParam==VK_MENU)
break;
@ -2472,9 +2475,10 @@ void FixWXY(int pref, bool shift_held)
void UpdateFCEUWindow(void)
{
if(vchanged && !fullscreen && !changerecursive && !nofocus)
if(vchanged && !GetIsFullscreen() && !changerecursive && !nofocus)
{
SetVideoMode(0);
SetIsFullscreen(false);
FCEUD_VideoChanged();
vchanged = 0;
}
@ -2615,11 +2619,13 @@ void SetMainWindowStuff()
ShowWindow(hAppWnd, SW_SHOWNORMAL);
}
if (eoptions & EO_BESTFIT && !windowedfailed)
// removed check for EO_BESTFIT flag
// OnWindowSizeChange() now is a general purpose window resize handler on video driver side
if (!windowedfailed)
{
RECT client_recr;
GetClientRect(hAppWnd, &client_recr);
recalculateBestFitRect(client_recr.right - client_recr.left, client_recr.bottom - client_recr.top);
OnWindowSizeChange(client_recr.right - client_recr.left, client_recr.bottom - client_recr.top);
}
}
@ -2987,6 +2993,10 @@ void UpdateMenuHotkeys()
ChangeMenuItemText(MENU_CDLOGGER, combined);
}
bool GetIsFullscreenOnDoubleclick() {
return fullscreenByDoubleclick;
}
//This function is for the context menu item Save Movie As...
//It gets a filename from the user then calls CreateMovie()
void SaveMovieAs()

View File

@ -40,6 +40,10 @@ void GetMouseData(uint32 (&md)[3]);
//void ChangeMenuItemText(int menuitem, string text);
void UpdateMenuHotkeys();
// Returns true if fullscreen via double click is enabled
// TODO: replace fullscreenByDoubleclick references with a call to this
bool GetIsFullscreenOnDoubleclick(void);
template<int BUFSIZE>
inline std::string GetDlgItemText(HWND hDlg, int nIDDlgItem) {
char buf[BUFSIZE];

View File

@ -38,6 +38,7 @@
#ifdef WIN32
#include "drivers/win/main.h"
#include "drivers/win/video.h"
#include "drivers/win/memwatch.h"
#include "drivers/win/cheat.h"
#include "drivers/win/debugger.h"
@ -1175,15 +1176,13 @@ static void FCEUI_DoExit(void)
void ToggleFullscreen()
{
#ifdef WIN32
extern int SetVideoMode(int fs); //adelikat: Yeah, I know, hacky
extern void UpdateCheckedMenuItems();
UpdateCheckedMenuItems();
changerecursive=1;
int oldmode = fullscreen;
if(!SetVideoMode(oldmode ^ 1))
SetVideoMode(oldmode);
changerecursive=1;
SetIsFullscreen(!GetIsFullscreen());
FCEUD_VideoChanged();
changerecursive=0;
#endif
}

View File

@ -47,6 +47,7 @@
#include "drivers/win/main.h"
#include "drivers/win/ram_search.h"
#include "drivers/win/ramwatch.h"
#include "drivers/win/video.h"
#endif
#include <string>
@ -243,7 +244,11 @@ static bool ReadStateChunk(EMUFILE* is, SFORMAT *sf, int size)
static int read_sfcpuc=0, read_snd=0;
#ifndef WIN32
// included corresponding header on Windows, no longer needed
// TODO do the same for SDL and remove declaration completely
void FCEUD_BlitScreen(uint8 *XBuf); //mbg merge 7/17/06 YUCKY had to add
#endif
void UpdateFCEUWindow(void); //mbg merge 7/17/06 YUCKY had to add
static bool ReadStateChunks(EMUFILE* is, int32 totalsize)
{

View File

@ -0,0 +1,10 @@
#ifndef BITFLAGS_H
#define BITFLAGS_H
// Flag test / set / clear macros for convenience and clarity
#define FL_TEST(var, mask) (var & mask)
#define FL_SET(var, mask) (var |= mask)
#define FL_CLEAR(var, mask) (var &= ~mask)
#define FL_FROMBOOL(var, mask, b) (var = (b)? var|mask:var&(~mask))
#endif // BITFLAGS_H