* total revamp of Video config stuff, now current screen resolution is always suggested by default
* Best Fit also works for fullscreen mode * "Hide mouse cursor" and "Use console BG color for empty areas" options * "Switch fullscreen by double-click" option in GUI config * Fixed "Reload ROM" hotkey in fullscreen * updated docs [[Split portion of a mixed commit.]]
This commit is contained in:
parent
b8594bf3d8
commit
7c0d95d8a9
|
@ -1,3 +1,6 @@
|
||||||
|
20-Aug-2012 - AnS - "Switch fullscreen by double-click" option in GUI config
|
||||||
|
20-Aug-2012 - AnS - "Hide mouse cursor" and "Use console BG color for empty areas" options
|
||||||
|
20-Aug-2012 - AnS - total revamp of Video config stuff, Best Fit also works for fullscreen mode
|
||||||
19-Aug-2012 - AnS - win32: "Maintain aspect ratio (best fit)" option in Video config
|
19-Aug-2012 - AnS - win32: "Maintain aspect ratio (best fit)" option in Video config
|
||||||
12-Aug-2012 - AnS - Debugger: "Display ROM offsets" option
|
12-Aug-2012 - AnS - Debugger: "Display ROM offsets" option
|
||||||
12-Aug-2012 - AnS - Debugger: double-click breakpoint also adds current bank number to breakpoint condition
|
12-Aug-2012 - AnS - Debugger: double-click breakpoint also adds current bank number to breakpoint condition
|
||||||
|
|
|
@ -47,6 +47,8 @@ extern int eoptions;
|
||||||
#define EO_FORCEISCALE 16384
|
#define EO_FORCEISCALE 16384
|
||||||
#define EO_FOURSCORE 32768
|
#define EO_FOURSCORE 32768
|
||||||
#define EO_BESTFIT 65536
|
#define EO_BESTFIT 65536
|
||||||
|
#define EO_BGCOLOR 131072
|
||||||
|
#define EO_HIDEMOUSE 262144
|
||||||
|
|
||||||
bool directoryExists(const char* dirname);
|
bool directoryExists(const char* dirname);
|
||||||
void WindowBoundsCheckResize(int &windowPosX, int &windowPosY, int windowSizeX, long windowRight);
|
void WindowBoundsCheckResize(int &windowPosX, int &windowPosY, int windowSizeX, long windowRight);
|
||||||
|
|
|
@ -60,6 +60,7 @@ extern int PPUViewRefresh;
|
||||||
extern int NTViewRefresh;
|
extern int NTViewRefresh;
|
||||||
extern uint8 gNoBGFillColor;
|
extern uint8 gNoBGFillColor;
|
||||||
extern bool rightClickEnabled;
|
extern bool rightClickEnabled;
|
||||||
|
extern bool fullscreenByDoubleclick;
|
||||||
extern int CurrentState;
|
extern int CurrentState;
|
||||||
extern bool pauseWhileActive; //adelikat: Cheats dialog
|
extern bool pauseWhileActive; //adelikat: Cheats dialog
|
||||||
extern bool enableHUDrecording;
|
extern bool enableHUDrecording;
|
||||||
|
@ -370,6 +371,7 @@ static CFGSTRUCT fceuconfig[] = {
|
||||||
AC(PPUViewRefresh),
|
AC(PPUViewRefresh),
|
||||||
AC(NTViewRefresh),
|
AC(NTViewRefresh),
|
||||||
AC(rightClickEnabled),
|
AC(rightClickEnabled),
|
||||||
|
AC(fullscreenByDoubleclick),
|
||||||
AC(CurrentState),
|
AC(CurrentState),
|
||||||
AC(HexRowHeightBorder),
|
AC(HexRowHeightBorder),
|
||||||
AC(HexBackColorR),
|
AC(HexBackColorR),
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
|
||||||
extern bool rightClickEnabled; //Declared in window.cpp and only an extern here
|
extern bool rightClickEnabled; //Declared in window.cpp and only an extern here
|
||||||
|
extern bool fullscreenByDoubleclick;
|
||||||
extern bool SingleInstanceOnly;
|
extern bool SingleInstanceOnly;
|
||||||
char ManifestFilePath[2048];
|
char ManifestFilePath[2048];
|
||||||
|
|
||||||
|
@ -59,24 +60,19 @@ void CloseGuiDialog(HWND hwndDlg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsDlgButtonChecked(hwndDlg, CB_ENABLECONTEXTMENU)==BST_CHECKED)
|
if(IsDlgButtonChecked(hwndDlg, CB_ENABLECONTEXTMENU)==BST_CHECKED)
|
||||||
{
|
|
||||||
rightClickEnabled = true;
|
rightClickEnabled = true;
|
||||||
}
|
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
rightClickEnabled = false;
|
rightClickEnabled = false;
|
||||||
}
|
|
||||||
|
if(IsDlgButtonChecked(hwndDlg, CB_FS_BY_DOUBLECLICK)==BST_CHECKED)
|
||||||
|
fullscreenByDoubleclick = true;
|
||||||
|
else
|
||||||
|
fullscreenByDoubleclick = false;
|
||||||
|
|
||||||
if(IsDlgButtonChecked(hwndDlg, IDC_SINGLEINSTANCE)==BST_CHECKED)
|
if(IsDlgButtonChecked(hwndDlg, IDC_SINGLEINSTANCE)==BST_CHECKED)
|
||||||
{
|
|
||||||
SingleInstanceOnly = true;
|
SingleInstanceOnly = true;
|
||||||
}
|
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
SingleInstanceOnly = false;
|
SingleInstanceOnly = false;
|
||||||
}
|
|
||||||
|
|
||||||
if(IsDlgButtonChecked(hwndDlg, CB_PARTIALVISUALTHEME)==BST_CHECKED)
|
if(IsDlgButtonChecked(hwndDlg, CB_PARTIALVISUALTHEME)==BST_CHECKED)
|
||||||
{
|
{
|
||||||
|
@ -126,9 +122,10 @@ BOOL CALLBACK GUIConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rightClickEnabled)
|
if(rightClickEnabled)
|
||||||
{
|
|
||||||
CheckDlgButton(hwndDlg, CB_ENABLECONTEXTMENU, BST_CHECKED);
|
CheckDlgButton(hwndDlg, CB_ENABLECONTEXTMENU, BST_CHECKED);
|
||||||
}
|
|
||||||
|
if(fullscreenByDoubleclick)
|
||||||
|
CheckDlgButton(hwndDlg, CB_FS_BY_DOUBLECLICK, BST_CHECKED);
|
||||||
|
|
||||||
GetModuleFileName(0, ManifestFilePath, 2048);
|
GetModuleFileName(0, ManifestFilePath, 2048);
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -121,7 +121,7 @@ void ApplyDefaultCommandMapping(void);
|
||||||
// Internal variables
|
// Internal variables
|
||||||
int frameSkipAmt = 18;
|
int frameSkipAmt = 18;
|
||||||
uint8 *xbsave = NULL;
|
uint8 *xbsave = NULL;
|
||||||
int eoptions = EO_BGRUN | EO_NOSPRLIM | EO_FORCEISCALE | EO_BESTFIT;
|
int eoptions = EO_BGRUN | EO_NOSPRLIM | EO_FORCEISCALE | EO_BESTFIT | EO_BGCOLOR;
|
||||||
|
|
||||||
//global variables
|
//global variables
|
||||||
int soundoptions = SO_SECONDARY | SO_GFOCUS;
|
int soundoptions = SO_SECONDARY | SO_GFOCUS;
|
||||||
|
@ -383,17 +383,13 @@ void FCEUD_PrintError(const char *errormsg)
|
||||||
{
|
{
|
||||||
AddLogText(errormsg, 1);
|
AddLogText(errormsg, 1);
|
||||||
|
|
||||||
if(fullscreen)
|
if (fullscreen && (eoptions & EO_HIDEMOUSE))
|
||||||
{
|
|
||||||
ShowCursorAbs(1);
|
ShowCursorAbs(1);
|
||||||
}
|
|
||||||
|
|
||||||
MessageBox(0, errormsg, FCEU_NAME" Error", MB_ICONERROR | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);
|
MessageBox(0, errormsg, FCEU_NAME" Error", MB_ICONERROR | MB_OK | MB_SETFOREGROUND | MB_TOPMOST);
|
||||||
|
|
||||||
if(fullscreen)
|
if (fullscreen && (eoptions & EO_HIDEMOUSE))
|
||||||
{
|
|
||||||
ShowCursorAbs(0);
|
ShowCursorAbs(0);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///Generates a compiler identification string.
|
///Generates a compiler identification string.
|
||||||
|
@ -481,9 +477,11 @@ void DoPriority()
|
||||||
int DriverInitialize()
|
int DriverInitialize()
|
||||||
{
|
{
|
||||||
if(soundo)
|
if(soundo)
|
||||||
{
|
|
||||||
soundo = InitSound();
|
soundo = InitSound();
|
||||||
}
|
|
||||||
|
// AnS: forcing the resolution of fullscreen to be the same as current display resolution
|
||||||
|
vmod = 0;
|
||||||
|
ResetCustomMode();
|
||||||
|
|
||||||
SetVideoMode(fullscreen);
|
SetVideoMode(fullscreen);
|
||||||
InitInputStuff(); /* Initialize DInput interfaces. */
|
InitInputStuff(); /* Initialize DInput interfaces. */
|
||||||
|
|
|
@ -692,19 +692,21 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTIO
|
||||||
CAPTION "GUI Configuration"
|
CAPTION "GUI Configuration"
|
||||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Close",BUTTON_CLOSE,65,121,56,14
|
DEFPUSHBUTTON "Close",BUTTON_CLOSE,65,136,56,14
|
||||||
CONTROL "Load ""File Open"" dialog when FCEUX starts.",CB_LOAD_FILE_OPEN,
|
CONTROL "Load ""File Open"" dialog when FCEUX starts.",CB_LOAD_FILE_OPEN,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,8,168,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,8,168,12
|
||||||
CONTROL "Automatically hide menu on game load.",CB_AUTO_HIDE_MENU,
|
CONTROL "Automatically hide menu on game load.",CB_AUTO_HIDE_MENU,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,23,168,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,23,168,12
|
||||||
CONTROL "Ask confirmation on exit attempt.",CB_ASK_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,38,168,12
|
CONTROL "Ask confirmation on exit attempt.",CB_ASK_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,38,168,12
|
||||||
CONTROL "Disable screen saver while game is loaded.",CB_DISABLE_SCREEN_SAVER,
|
CONTROL "Disable screen saver while game is loaded.",CB_DISABLE_SCREEN_SAVER,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,53,168,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,53,168,12
|
||||||
CONTROL "Enable right-click context menu",CB_ENABLECONTEXTMENU,
|
CONTROL "Enable right-click context menu",CB_ENABLECONTEXTMENU,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,68,168,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,68,168,12
|
||||||
|
CONTROL "Switch fullscreen by double-click",CB_FS_BY_DOUBLECLICK,
|
||||||
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,84,168,12
|
||||||
CONTROL "Partially disable Visual Themes (Requires restart)",CB_PARTIALVISUALTHEME,
|
CONTROL "Partially disable Visual Themes (Requires restart)",CB_PARTIALVISUALTHEME,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,83,168,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,100,168,12
|
||||||
CONTROL "Single Instance Mode",IDC_SINGLEINSTANCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,100,85,10
|
CONTROL "Single Instance Mode",IDC_SINGLEINSTANCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,117,167,10
|
||||||
END
|
END
|
||||||
|
|
||||||
INPUTCONFIG DIALOGEX 122, 105, 349, 199
|
INPUTCONFIG DIALOGEX 122, 105, 349, 199
|
||||||
|
@ -1705,75 +1707,79 @@ BEGIN
|
||||||
PUSHBUTTON "Edit",IDC_BUTTON_LUAEDIT,58,31,46,16
|
PUSHBUTTON "Edit",IDC_BUTTON_LUAEDIT,58,31,46,16
|
||||||
END
|
END
|
||||||
|
|
||||||
VIDEOCONFIG DIALOGEX 65520, 76, 384, 292
|
VIDEOCONFIG DIALOGEX 65520, 76, 371, 297
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Video Configuration"
|
CAPTION "Video Configuration"
|
||||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
GROUPBOX "Full Screen Settings",65453,10,7,364,115,WS_GROUP
|
GROUPBOX "Full Screen Settings",65453,5,3,360,115,WS_GROUP
|
||||||
CONTROL "Full Screen",IDC_VIDEOCONFIG_FS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,22,145,12
|
CONTROL "Full Screen",IDC_VIDEOCONFIG_FS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,15,60,12
|
||||||
CONTROL "Enter full screen mode after game is loaded.",IDC_VIDEOCONFIG_AUTO_FS,
|
CONTROL "Enter full screen mode after game is loaded",IDC_VIDEOCONFIG_AUTO_FS,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,38,151,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,29,151,12
|
||||||
LTEXT "Sync Method:",65452,20,81,48,10
|
LTEXT "Sync Method:",65452,13,85,48,10
|
||||||
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_FS,72,78,93,50,CBS_DROPDOWNLIST | WS_TABSTOP
|
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_FS,65,82,93,50,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||||
LTEXT "Video Mode:",65451,20,61,42,10
|
LTEXT "Video Mode:",65451,13,65,42,10
|
||||||
COMBOBOX IDC_VIDEOCONFIG_MODE,72,58,93,52,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_VIDEOCONFIG_MODE,65,62,93,52,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
CONTROL "Disable hardware acceleration.",IDC_DISABLE_HW_ACCEL_FS,
|
CONTROL "Disable hardware acceleration",IDC_DISABLE_HW_ACCEL_FS,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,102,145,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,101,145,12
|
||||||
GROUPBOX "Custom Video Mode",65450,177,17,186,97,WS_GROUP
|
GROUPBOX "Custom Video Mode",65450,172,13,186,97,WS_GROUP
|
||||||
LTEXT "Mode:",13,186,31,25,8
|
LTEXT "Mode:",13,181,27,25,8
|
||||||
EDITTEXT IDC_VIDEOCONFIG_XRES,214,29,27,12,ES_RIGHT
|
EDITTEXT IDC_VIDEOCONFIG_XRES,209,25,27,12,ES_RIGHT
|
||||||
LTEXT "by",12,244,31,11,8
|
LTEXT "by",12,239,27,11,8
|
||||||
EDITTEXT IDC_VIDEOCONFIG_YRES,258,29,27,12,ES_RIGHT
|
EDITTEXT IDC_VIDEOCONFIG_YRES,253,25,27,12,ES_RIGHT
|
||||||
LTEXT "@",11,289,31,12,8
|
LTEXT "@",11,284,27,12,8
|
||||||
COMBOBOX IDC_VIDEOCONFIG_BPP,302,29,35,60,CBS_DROPDOWNLIST | WS_TABSTOP
|
COMBOBOX IDC_VIDEOCONFIG_BPP,297,25,35,60,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||||
LTEXT "bpp",10,341,31,17,8
|
LTEXT "bpp",10,336,27,17,8
|
||||||
GROUPBOX "Image Size Transform",65445,185,46,170,61,WS_GROUP
|
GROUPBOX "Image Size Transform",65445,180,42,170,61,WS_GROUP
|
||||||
LTEXT "Special scaler:",65444,192,60,60,8
|
LTEXT "Special scaler:",65444,187,56,60,8
|
||||||
COMBOBOX IDC_VIDEOCONFIG_SCALER_FS,281,57,65,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_VIDEOCONFIG_SCALER_FS,276,53,65,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
CONTROL "Scale dimensions by:",IDC_RADIO_SCALE,"Button",BS_AUTORADIOBUTTON,192,75,85,12
|
CONTROL "Scale dimensions by:",IDC_RADIO_SCALE,"Button",BS_AUTORADIOBUTTON,187,85,80,12
|
||||||
CONTROL "Stretch to Fill Screen",IDC_RADIO_STRETCH,"Button",BS_AUTORADIOBUTTON,192,90,88,12
|
CONTROL "Stretch to Fill Screen",IDC_RADIO_STRETCH,"Button",BS_AUTORADIOBUTTON,187,70,76,12
|
||||||
LTEXT "X:",65443,282,77,10,8
|
LTEXT "X:",65443,277,87,10,8
|
||||||
EDITTEXT IDC_VIDEOCONFIG_XSCALE,292,75,20,12
|
EDITTEXT IDC_VIDEOCONFIG_XSCALE,287,84,20,12
|
||||||
LTEXT "Y:",65442,316,77,11,8
|
LTEXT "Y:",65442,311,86,11,8
|
||||||
EDITTEXT IDC_VIDEOCONFIG_YSCALE,326,75,20,12
|
EDITTEXT IDC_VIDEOCONFIG_YSCALE,321,84,20,12
|
||||||
GROUPBOX "Windowed Settings",65441,10,126,179,158,WS_GROUP
|
GROUPBOX "Windowed Settings",65441,5,122,179,149,WS_GROUP
|
||||||
LTEXT "Size Multiplier:",65440,20,148,50,8
|
LTEXT "Size Multiplier:",65440,15,144,50,8
|
||||||
CTEXT "X:",65439,83,136,42,8
|
CTEXT "X:",65439,78,131,42,8
|
||||||
CTEXT "Y:",65438,134,136,42,8
|
CTEXT "Y:",65438,129,131,42,8
|
||||||
EDITTEXT IDC_WINSIZE_MUL_X,83,147,42,12,ES_AUTOHSCROLL
|
EDITTEXT IDC_WINSIZE_MUL_X,78,143,42,12,ES_AUTOHSCROLL
|
||||||
EDITTEXT IDC_WINSIZE_MUL_Y,134,147,42,12,ES_AUTOHSCROLL
|
EDITTEXT IDC_WINSIZE_MUL_Y,129,143,42,12,ES_AUTOHSCROLL
|
||||||
CONTROL "Force integral scaling factors.",IDC_FORCE_INT_VIDEO_SCALARS,
|
CONTROL "Force integral scaling factors",IDC_FORCE_INT_VIDEO_SCALARS,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,163,145,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,159,145,12
|
||||||
CONTROL "Force aspect ratio correction.",IDC_FORCE_ASPECT_CORRECTION,
|
CONTROL "Force aspect ratio correction",IDC_FORCE_ASPECT_CORRECTION,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,178,145,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,174,145,12
|
||||||
LTEXT "Special scaler:",65429,20,229,51,8
|
LTEXT "Special scaler:",65429,15,215,51,8
|
||||||
COMBOBOX IDC_VIDEOCONFIG_SCALER_WIN,83,227,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_VIDEOCONFIG_SCALER_WIN,78,213,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
LTEXT "Sync Method:",65437,20,249,51,8
|
LTEXT "Sync Method:",65437,15,235,51,8
|
||||||
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_WIN,83,247,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_WIN,78,233,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||||
CONTROL "Disable hardware acceleration.",IDC_DISABLE_HW_ACCEL_WIN,
|
CONTROL "Disable hardware acceleration",IDC_DISABLE_HW_ACCEL_WIN,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,266,145,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,252,145,12
|
||||||
GROUPBOX "Drawing Area",65494,196,126,178,83,WS_GROUP
|
GROUPBOX "Drawing Area",65494,191,168,174,71,WS_GROUP
|
||||||
LTEXT "First Line:",65436,218,152,39,8
|
LTEXT "First Line:",65436,213,189,39,8
|
||||||
LTEXT "Last Line:",65435,218,172,43,8
|
LTEXT "Last Line:",65435,213,207,43,8
|
||||||
CTEXT "NTSC",65434,262,139,27,8
|
CTEXT "NTSC",65434,257,177,27,8
|
||||||
CTEXT "PAL",65433,313,139,27,8
|
CTEXT "PAL",65433,312,177,27,8
|
||||||
EDITTEXT IDC_SCANLINE_FIRST_NTSC,263,151,27,12,ES_RIGHT
|
EDITTEXT IDC_SCANLINE_FIRST_NTSC,258,188,27,12,ES_RIGHT
|
||||||
EDITTEXT IDC_SCANLINE_LAST_NTSC,263,170,27,12,ES_RIGHT
|
EDITTEXT IDC_SCANLINE_LAST_NTSC,258,205,27,12,ES_RIGHT
|
||||||
EDITTEXT IDC_SCANLINE_FIRST_PAL,313,151,27,12,ES_RIGHT
|
EDITTEXT IDC_SCANLINE_FIRST_PAL,312,188,27,12,ES_RIGHT
|
||||||
EDITTEXT IDC_SCANLINE_LAST_PAL,313,170,27,12,ES_RIGHT
|
EDITTEXT IDC_SCANLINE_LAST_PAL,312,205,27,12,ES_RIGHT
|
||||||
CONTROL "Clip left and right sides (8 columns on each)",IDC_VIDEOCONFIG_CLIPSIDES,
|
CONTROL "Clip left and right sides (8 columns on each)",IDC_VIDEOCONFIG_CLIPSIDES,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,206,191,157,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,222,157,12
|
||||||
DEFPUSHBUTTON "Close",BTN_CLOSE,318,269,56,14
|
DEFPUSHBUTTON "Close",ID_CANCEL,309,276,56,14
|
||||||
LTEXT "Current Pixel Aspect Ratio:",65432,20,211,88,8
|
LTEXT "Current Pixel Aspect Ratio:",65432,15,195,87,8
|
||||||
EDITTEXT IDC_VIDEOCONFIG_ASPECT_X,110,209,28,12,ES_AUTOHSCROLL
|
EDITTEXT IDC_VIDEOCONFIG_ASPECT_X,105,193,28,12,ES_AUTOHSCROLL
|
||||||
CTEXT ":",65431,139,196,8,8
|
CTEXT ":",65431,134,194,8,8
|
||||||
EDITTEXT IDC_VIDEOCONFIG_ASPECT_Y,148,209,28,12,ES_AUTOHSCROLL
|
EDITTEXT IDC_VIDEOCONFIG_ASPECT_Y,143,193,28,12,ES_AUTOHSCROLL
|
||||||
CONTROL "Allow more than 8 sprites per scanline.",IDC_VIDEOCONFIG_NO8LIM,
|
CONTROL "Allow more than 8 sprites per scanline",IDC_VIDEOCONFIG_NO8LIM,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,206,230,157,11
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,254,157,11
|
||||||
GROUPBOX "Emulation",65430,196,215,178,32,WS_GROUP
|
GROUPBOX "Emulation",65430,191,242,174,29,WS_GROUP
|
||||||
CONTROL "Maintain aspect ratio (best fit)",IDC_VIDEOCONFIG_BESTFIT,
|
CONTROL "Always maintain correct aspect ratio",IDC_VIDEOCONFIG_BESTFIT,
|
||||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,193,146,12
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,133,136,12
|
||||||
|
CONTROL "Hide mouse cursor",IDC_VIDEOCONFIG_HIDEMOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,43,87,12
|
||||||
|
GROUPBOX "Best Fit",65495,191,122,174,43,WS_GROUP
|
||||||
|
CONTROL "Use console BG color for empty areas",IDC_VIDEOCONFIG_CONSOLE_BGCOLOR,
|
||||||
|
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,147,136,12
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_RAMSEARCH DIALOGEX 0, 0, 287, 292
|
IDD_RAMSEARCH DIALOGEX 0, 0, 287, 292
|
||||||
|
@ -1895,10 +1901,6 @@ BEGIN
|
||||||
|
|
||||||
"GUICONFIG", DIALOG
|
"GUICONFIG", DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 10
|
|
||||||
RIGHTMARGIN, 174
|
|
||||||
TOPMARGIN, 8
|
|
||||||
BOTTOMMARGIN, 135
|
|
||||||
END
|
END
|
||||||
|
|
||||||
"INPUTCONFIG", DIALOG
|
"INPUTCONFIG", DIALOG
|
||||||
|
@ -2104,9 +2106,6 @@ BEGIN
|
||||||
|
|
||||||
"VIDEOCONFIG", DIALOG
|
"VIDEOCONFIG", DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
LEFTMARGIN, 10
|
|
||||||
RIGHTMARGIN, 374
|
|
||||||
TOPMARGIN, 8
|
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_PROMPT, DIALOG
|
IDD_PROMPT, DIALOG
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
#define IDC_ADDBP_MODE_W 103
|
#define IDC_ADDBP_MODE_W 103
|
||||||
#define IDC_ROMPATCHER_BTN_EDIT 103
|
#define IDC_ROMPATCHER_BTN_EDIT 103
|
||||||
#define IDC_NTVIEW_PROPERTIES_LINE_1 103
|
#define IDC_NTVIEW_PROPERTIES_LINE_1 103
|
||||||
|
#define IDC_VIDEOCONFIG_HIDEMOUSE 103
|
||||||
#define CB_AUTO_HIDE_MENU 104
|
#define CB_AUTO_HIDE_MENU 104
|
||||||
#define COMBO_PAD1 104
|
#define COMBO_PAD1 104
|
||||||
#define BTN_CDLOGGER_LOAD 104
|
#define BTN_CDLOGGER_LOAD 104
|
||||||
|
@ -94,13 +95,13 @@
|
||||||
#define IDC_DEBUGGER_STEP_OVER 107
|
#define IDC_DEBUGGER_STEP_OVER 107
|
||||||
#define IDC_ADDBP_MEM_SPR 107
|
#define IDC_ADDBP_MEM_SPR 107
|
||||||
#define IDC_ROMPATCHER_DISASSEMBLY 107
|
#define IDC_ROMPATCHER_DISASSEMBLY 107
|
||||||
#define IDC_VIDEOCONFIG_MAINTAIN_ASPECT_RATIO 107
|
|
||||||
#define IDC_VIDEOCONFIG_BESTFIT 107
|
#define IDC_VIDEOCONFIG_BESTFIT 107
|
||||||
#define IDR_ACCELERATOR1 108
|
#define IDR_ACCELERATOR1 108
|
||||||
#define BTN_CDLOGGER_SAVE_STRIPPED 108
|
#define BTN_CDLOGGER_SAVE_STRIPPED 108
|
||||||
#define IDC_CHEAT_VAL_NE_BY 108
|
#define IDC_CHEAT_VAL_NE_BY 108
|
||||||
#define IDC_DEBUGGER_SEEK_PC 108
|
#define IDC_DEBUGGER_SEEK_PC 108
|
||||||
#define IDR_TASEDITOR_ACCELERATORS 108
|
#define IDR_TASEDITOR_ACCELERATORS 108
|
||||||
|
#define IDC_VIDEOCONFIG_CONSOLE_BGCOLOR 108
|
||||||
#define IDC_CHEAT_VAL_GT_BY 109
|
#define IDC_CHEAT_VAL_GT_BY 109
|
||||||
#define IDC_DEBUGGER_SEEK_TO 109
|
#define IDC_DEBUGGER_SEEK_TO 109
|
||||||
#define IDC_ROMPATCHER_PATCH_DATA 109
|
#define IDC_ROMPATCHER_PATCH_DATA 109
|
||||||
|
@ -669,6 +670,7 @@
|
||||||
#define IDC_C_WATCH_SEPARATE 1259
|
#define IDC_C_WATCH_SEPARATE 1259
|
||||||
#define IDC_TWEAKCOUNT 1260
|
#define IDC_TWEAKCOUNT 1260
|
||||||
#define CHECK_AUTORESTORE_PLAYBACK 1261
|
#define CHECK_AUTORESTORE_PLAYBACK 1261
|
||||||
|
#define CB_FS_BY_DOUBLECLICK 1261
|
||||||
#define IDC_PROGRESS1 1262
|
#define IDC_PROGRESS1 1262
|
||||||
#define CHECK_FOLLOW_CURSOR 1263
|
#define CHECK_FOLLOW_CURSOR 1263
|
||||||
#define IDC_BOOKMARKS_BOX 1264
|
#define IDC_BOOKMARKS_BOX 1264
|
||||||
|
@ -693,6 +695,7 @@
|
||||||
#define IDC_LUA_BOX 1278
|
#define IDC_LUA_BOX 1278
|
||||||
#define IDC_HISTORY_BOX 1279
|
#define IDC_HISTORY_BOX 1279
|
||||||
#define IDC_TASEDITOR_NAME 1280
|
#define IDC_TASEDITOR_NAME 1280
|
||||||
|
#define ID_CANCEL 1281
|
||||||
#define MENU_NETWORK 40040
|
#define MENU_NETWORK 40040
|
||||||
#define MENU_PALETTE 40041
|
#define MENU_PALETTE 40041
|
||||||
#define MENU_SOUND 40042
|
#define MENU_SOUND 40042
|
||||||
|
@ -1128,7 +1131,7 @@
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 289
|
#define _APS_NEXT_RESOURCE_VALUE 289
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40566
|
#define _APS_NEXT_COMMAND_VALUE 40566
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1281
|
#define _APS_NEXT_CONTROL_VALUE 1282
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -46,7 +46,7 @@ int NTSCwinspecial = 0;
|
||||||
int vmod = 0;
|
int vmod = 0;
|
||||||
|
|
||||||
vmdef vmodes[11]={
|
vmdef vmodes[11]={
|
||||||
{320,240,8,0,1,1,0}, //0
|
{0,0,0,VMDF_DXBLT|VMDF_STRFS,1,1,0}, // Custom - set to current resolution at first run
|
||||||
{320,240,8,0,1,1,0}, //1
|
{320,240,8,0,1,1,0}, //1
|
||||||
{512,384,8,0,1,1,0}, //2
|
{512,384,8,0,1,1,0}, //2
|
||||||
{640,480,8,0,1,1,0}, //3
|
{640,480,8,0,1,1,0}, //3
|
||||||
|
@ -59,6 +59,8 @@ vmdef vmodes[11]={
|
||||||
{800,600,8,VMDF_DXBLT|VMDF_STRFS,0,0} //10
|
{800,600,8,VMDF_DXBLT|VMDF_STRFS,0,0} //10
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern uint8 PALRAM[0x20];
|
||||||
|
|
||||||
PALETTEENTRY *color_palette;
|
PALETTEENTRY *color_palette;
|
||||||
|
|
||||||
static int PaletteChanged=0;
|
static int PaletteChanged=0;
|
||||||
|
@ -226,14 +228,10 @@ static int InitBPPStuff(int fs)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RecreateResizableSurface()
|
void RecreateResizableSurface(int width, int height)
|
||||||
{
|
{
|
||||||
if (!lpDD7)
|
if (!lpDD7)
|
||||||
return 1; // DirectDraw isn't initialized yet
|
return; // DirectDraw isn't initialized yet
|
||||||
|
|
||||||
// check if new size is the same as old
|
|
||||||
|
|
||||||
|
|
||||||
// delete old surface
|
// delete old surface
|
||||||
RELEASE(lpDDSResizable);
|
RELEASE(lpDDSResizable);
|
||||||
// create new surface
|
// create new surface
|
||||||
|
@ -241,10 +239,6 @@ int RecreateResizableSurface()
|
||||||
ddsd_Resizable.dwSize = sizeof(ddsd_Resizable);
|
ddsd_Resizable.dwSize = sizeof(ddsd_Resizable);
|
||||||
ddsd_Resizable.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
|
ddsd_Resizable.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
|
||||||
ddsd_Resizable.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
|
ddsd_Resizable.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
|
||||||
RECT client_recr;
|
|
||||||
GetClientRect(hAppWnd, &client_recr);
|
|
||||||
int width = client_recr.right - client_recr.left;
|
|
||||||
int height = client_recr.bottom - client_recr.top;
|
|
||||||
ddsd_Resizable.dwWidth = width;
|
ddsd_Resizable.dwWidth = width;
|
||||||
ddsd_Resizable.dwHeight = height;
|
ddsd_Resizable.dwHeight = height;
|
||||||
ddrval = IDirectDraw7_CreateSurface(lpDD7, &ddsd_Resizable, &lpDDSResizable, (IUnknown FAR*)NULL);
|
ddrval = IDirectDraw7_CreateSurface(lpDD7, &ddsd_Resizable, &lpDDSResizable, (IUnknown FAR*)NULL);
|
||||||
|
@ -253,11 +247,9 @@ int RecreateResizableSurface()
|
||||||
void FCEU_PrintError(char *format, ...);
|
void FCEU_PrintError(char *format, ...);
|
||||||
FCEU_PrintError("%08x, %d\n", ddrval, lpDD7);
|
FCEU_PrintError("%08x, %d\n", ddrval, lpDD7);
|
||||||
ShowDDErr("Error creating resizable surface.");
|
ShowDDErr("Error creating resizable surface.");
|
||||||
return 1;
|
return;
|
||||||
}
|
}
|
||||||
// fill the surface with black color
|
RecolorResizableSurface();
|
||||||
blitfx.dwFillColor = 0;
|
|
||||||
ddrval = IDirectDrawSurface7_Blt(lpDDSResizable, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &blitfx);
|
|
||||||
// calculate resizable_surface_rect
|
// calculate resizable_surface_rect
|
||||||
double current_aspectratio = (double)width / (double)height;
|
double current_aspectratio = (double)width / (double)height;
|
||||||
double needed_aspectratio = (double)(VNSWID) / (double)(FSettings.TotalScanlines());
|
double needed_aspectratio = (double)(VNSWID) / (double)(FSettings.TotalScanlines());
|
||||||
|
@ -286,7 +278,23 @@ int RecreateResizableSurface()
|
||||||
resizable_surface_rect.top = center_y - (height / 2);
|
resizable_surface_rect.top = center_y - (height / 2);
|
||||||
resizable_surface_rect.bottom = center_y + (height / 2);
|
resizable_surface_rect.bottom = center_y + (height / 2);
|
||||||
}
|
}
|
||||||
return 1; // all ok
|
}
|
||||||
|
|
||||||
|
void RecolorResizableSurface()
|
||||||
|
{
|
||||||
|
if (eoptions & EO_BGCOLOR)
|
||||||
|
{
|
||||||
|
// fill the surface using BG color from PPU
|
||||||
|
unsigned char r, g, b;
|
||||||
|
FCEUD_GetPalette(0x80 + PALRAM[0], &r, &g, &b);
|
||||||
|
blitfx.dwFillColor = (r << 16) + (g << 8) + b;
|
||||||
|
ddrval = IDirectDrawSurface7_Blt(lpDDSResizable, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_ASYNC, &blitfx);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
// fill the surface with black color
|
||||||
|
blitfx.dwFillColor = 0;
|
||||||
|
ddrval = IDirectDrawSurface7_Blt(lpDDSResizable, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &blitfx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int SetVideoMode(int fs)
|
int SetVideoMode(int fs)
|
||||||
|
@ -399,10 +407,10 @@ int SetVideoMode(int fs)
|
||||||
|
|
||||||
windowedfailed=0;
|
windowedfailed=0;
|
||||||
SetMainWindowStuff();
|
SetMainWindowStuff();
|
||||||
}
|
} else
|
||||||
else //Following is full-screen
|
|
||||||
{
|
{
|
||||||
if(vmod == 0)
|
//Following is full-screen
|
||||||
|
if(vmod == 0) // Custom mode
|
||||||
{
|
{
|
||||||
// -Video Modes Tag-
|
// -Video Modes Tag-
|
||||||
if(vmodes[0].special <= 3 && vmodes[0].special >= 1)
|
if(vmodes[0].special <= 3 && vmodes[0].special >= 1)
|
||||||
|
@ -414,6 +422,17 @@ int SetVideoMode(int fs)
|
||||||
}
|
}
|
||||||
HideFWindow(1);
|
HideFWindow(1);
|
||||||
|
|
||||||
|
if ((vmodes[vmod].flags & VMDF_DXBLT) && (eoptions & EO_BESTFIT))
|
||||||
|
{
|
||||||
|
ddrval = IDirectDraw7_SetCooperativeLevel ( lpDD7, hAppWnd, DDSCL_NORMAL);
|
||||||
|
if (ddrval != DD_OK)
|
||||||
|
{
|
||||||
|
ShowDDErr("Error setting cooperative level.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
RecreateResizableSurface(vmodes[vmod].x, vmodes[vmod].y);
|
||||||
|
}
|
||||||
|
|
||||||
ddrval = IDirectDraw7_SetCooperativeLevel ( lpDD7, hAppWnd,DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT);
|
ddrval = IDirectDraw7_SetCooperativeLevel ( lpDD7, hAppWnd,DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT);
|
||||||
if (ddrval != DD_OK)
|
if (ddrval != DD_OK)
|
||||||
{
|
{
|
||||||
|
@ -490,6 +509,8 @@ int SetVideoMode(int fs)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
mustrestore=1;
|
mustrestore=1;
|
||||||
|
|
||||||
|
if (eoptions & EO_HIDEMOUSE)
|
||||||
ShowCursorAbs(0);
|
ShowCursorAbs(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -598,6 +619,9 @@ static void BlitScreenWindow(unsigned char *XBuf)
|
||||||
|
|
||||||
if (eoptions & EO_BESTFIT && (resizable_surface_rect.top || resizable_surface_rect.left))
|
if (eoptions & EO_BESTFIT && (resizable_surface_rect.top || resizable_surface_rect.left))
|
||||||
{
|
{
|
||||||
|
// clear lpDDSResizable surface
|
||||||
|
if (eoptions & EO_BGCOLOR)
|
||||||
|
RecolorResizableSurface();
|
||||||
// blit from lpDDSBack to lpDDSResizable using best fit
|
// blit from lpDDSBack to lpDDSResizable using best fit
|
||||||
if (IDirectDrawSurface7_Blt(lpDDSResizable, &resizable_surface_rect, lpDDSBack, &srect, DDBLT_ASYNC, 0) != DD_OK)
|
if (IDirectDrawSurface7_Blt(lpDDSResizable, &resizable_surface_rect, lpDDSBack, &srect, DDBLT_ASYNC, 0) != DD_OK)
|
||||||
{
|
{
|
||||||
|
@ -700,11 +724,9 @@ static void BlitScreenFull(uint8 *XBuf)
|
||||||
PaletteChanged=0;
|
PaletteChanged=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//aquanull 2011-11-28 fix tearing
|
|
||||||
FCEUD_VerticalSync();
|
|
||||||
|
|
||||||
if(vmodes[vmod].flags&VMDF_DXBLT)
|
if(vmodes[vmod].flags&VMDF_DXBLT)
|
||||||
{
|
{
|
||||||
|
// start rendering into backbuffer
|
||||||
ddrval=IDirectDrawSurface7_Lock(lpDDSBack,NULL,&ddsdback, 0, NULL);
|
ddrval=IDirectDrawSurface7_Lock(lpDDSBack,NULL,&ddsdback, 0, NULL);
|
||||||
if(ddrval!=DD_OK)
|
if(ddrval!=DD_OK)
|
||||||
{
|
{
|
||||||
|
@ -753,9 +775,10 @@ static void BlitScreenFull(uint8 *XBuf)
|
||||||
DD_FillRect(lpDDSVPrimary,left,bottom,right,fullScreen.bottom,RGB(255,0,255)); //bottomcenter
|
DD_FillRect(lpDDSVPrimary,left,bottom,right,fullScreen.bottom,RGB(255,0,255)); //bottomcenter
|
||||||
DD_FillRect(lpDDSVPrimary,right,bottom,fullScreen.right,fullScreen.bottom,RGB(0,255,255)); //bottomright
|
DD_FillRect(lpDDSVPrimary,right,bottom,fullScreen.right,fullScreen.bottom,RGB(0,255,255)); //bottomright
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
// start rendering directly to screen
|
||||||
|
FCEUD_VerticalSync();
|
||||||
ddrval=IDirectDrawSurface7_Lock(lpDDSVPrimary,NULL,&ddsd, 0, NULL);
|
ddrval=IDirectDrawSurface7_Lock(lpDDSVPrimary,NULL,&ddsd, 0, NULL);
|
||||||
if(ddrval!=DD_OK)
|
if(ddrval!=DD_OK)
|
||||||
{
|
{
|
||||||
|
@ -914,8 +937,50 @@ static void BlitScreenFull(uint8 *XBuf)
|
||||||
{
|
{
|
||||||
IDirectDrawSurface7_Unlock(lpDDSBack, NULL);
|
IDirectDrawSurface7_Unlock(lpDDSBack, NULL);
|
||||||
|
|
||||||
|
if (eoptions & EO_BESTFIT && (resizable_surface_rect.top || resizable_surface_rect.left) && !vmod)
|
||||||
|
{
|
||||||
|
// clear lpDDSResizable surface
|
||||||
|
RecolorResizableSurface();
|
||||||
|
// blit from lpDDSBack to lpDDSResizable using best fit
|
||||||
|
if (IDirectDrawSurface7_Blt(lpDDSResizable, &resizable_surface_rect, lpDDSBack, &srect, DDBLT_ASYNC, 0) != DD_OK)
|
||||||
|
{
|
||||||
|
ddrval = IDirectDrawSurface7_Blt(lpDDSResizable, &resizable_surface_rect, lpDDSBack, &srect, DDBLT_WAIT, 0);
|
||||||
|
if(ddrval != DD_OK)
|
||||||
|
{
|
||||||
|
if(ddrval == DDERR_SURFACELOST)
|
||||||
|
{
|
||||||
|
RestoreDD(2);
|
||||||
|
RestoreDD(1);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// blit from lpDDSResizable to screen
|
||||||
|
RECT fullScreen;
|
||||||
|
fullScreen.left = fullScreen.top = 0;
|
||||||
|
fullScreen.right = vmodes[vmod].x;
|
||||||
|
fullScreen.bottom = vmodes[vmod].y;
|
||||||
|
FCEUD_VerticalSync();
|
||||||
|
if (IDirectDrawSurface7_Blt(lpDDSVPrimary, &fullScreen, lpDDSResizable, &fullScreen, DDBLT_ASYNC, 0) != DD_OK)
|
||||||
|
{
|
||||||
|
ddrval = IDirectDrawSurface7_Blt(lpDDSVPrimary, &fullScreen, lpDDSResizable, &fullScreen, DDBLT_WAIT, 0);
|
||||||
|
if(ddrval != DD_OK)
|
||||||
|
{
|
||||||
|
if(ddrval == DDERR_SURFACELOST)
|
||||||
|
{
|
||||||
|
RestoreDD(2);
|
||||||
|
RestoreDD(0);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
// blit directly from lpDDSBack to screen
|
||||||
|
FCEUD_VerticalSync();
|
||||||
if(veflags&2)
|
if(veflags&2)
|
||||||
{
|
{
|
||||||
|
// clear screen surface (is that really necessary?)
|
||||||
if(IDirectDrawSurface7_Lock(lpDDSVPrimary,NULL,&ddsd, 0, NULL)==DD_OK)
|
if(IDirectDrawSurface7_Lock(lpDDSVPrimary,NULL,&ddsd, 0, NULL)==DD_OK)
|
||||||
{
|
{
|
||||||
memset(ddsd.lpSurface,0,ddsd.lPitch*vmodes[vmod].y); //mbg merge 7/17/06 removing dummyunion stuff
|
memset(ddsd.lpSurface,0,ddsd.lPitch*vmodes[vmod].y); //mbg merge 7/17/06 removing dummyunion stuff
|
||||||
|
@ -923,7 +988,6 @@ static void BlitScreenFull(uint8 *XBuf)
|
||||||
veflags&=~2;
|
veflags&=~2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IDirectDrawSurface7_Blt(lpDDSVPrimary, &drect,lpDDSBack,&srect,DDBLT_ASYNC,0)!=DD_OK)
|
if(IDirectDrawSurface7_Blt(lpDDSVPrimary, &drect,lpDDSBack,&srect,DDBLT_ASYNC,0)!=DD_OK)
|
||||||
{
|
{
|
||||||
ddrval=IDirectDrawSurface7_Blt(lpDDSVPrimary, &drect,lpDDSBack,&srect,DDBLT_WAIT,0);
|
ddrval=IDirectDrawSurface7_Blt(lpDDSVPrimary, &drect,lpDDSBack,&srect,DDBLT_WAIT,0);
|
||||||
|
@ -936,11 +1000,12 @@ static void BlitScreenFull(uint8 *XBuf)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
} else
|
||||||
|
{
|
||||||
IDirectDrawSurface7_Unlock(lpDDSVPrimary, NULL);
|
IDirectDrawSurface7_Unlock(lpDDSVPrimary, NULL);
|
||||||
|
}
|
||||||
if(fssync==3)
|
if(fssync==3)
|
||||||
{
|
{
|
||||||
IDirectDrawSurface7_Flip(lpDDSPrimary,0,0);
|
IDirectDrawSurface7_Flip(lpDDSPrimary,0,0);
|
||||||
|
@ -969,18 +1034,39 @@ void ResetVideo(void)
|
||||||
|
|
||||||
int specialmlut[5] = {1,2,2,3,3};
|
int specialmlut[5] = {1,2,2,3,3};
|
||||||
|
|
||||||
|
void ResetCustomMode()
|
||||||
|
{
|
||||||
|
// use current display settings
|
||||||
|
if (!lpDD7)
|
||||||
|
return;
|
||||||
|
|
||||||
|
vmdef *cmode = &vmodes[0];
|
||||||
|
|
||||||
|
DDSURFACEDESC2 temp_ddsd;
|
||||||
|
temp_ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
||||||
|
IDirectDraw7_GetDisplayMode(lpDD7, &temp_ddsd);
|
||||||
|
if (FAILED(ddrval))
|
||||||
|
return;
|
||||||
|
cmode->x = temp_ddsd.dwWidth;
|
||||||
|
cmode->y = temp_ddsd.dwHeight;
|
||||||
|
cmode->bpp = temp_ddsd.ddpfPixelFormat.dwRGBBitCount;
|
||||||
|
cmode->xscale = cmode->yscale = 1;
|
||||||
|
cmode->flags = VMDF_DXBLT|VMDF_STRFS;
|
||||||
|
}
|
||||||
|
|
||||||
static int RecalcCustom(void)
|
static int RecalcCustom(void)
|
||||||
{
|
{
|
||||||
vmdef *cmode = &vmodes[0];
|
vmdef *cmode = &vmodes[0];
|
||||||
|
|
||||||
cmode->flags&=~VMDF_DXBLT;
|
if ((cmode->x <= 0) || (cmode->y <= 0))
|
||||||
|
ResetCustomMode();
|
||||||
|
|
||||||
if(cmode->flags&VMDF_STRFS)
|
if(cmode->flags&VMDF_STRFS)
|
||||||
{
|
{
|
||||||
cmode->flags|=VMDF_DXBLT;
|
cmode->flags |= VMDF_DXBLT;
|
||||||
}
|
} else if(cmode->xscale!=1 || cmode->yscale!=1 || cmode->special)
|
||||||
else if(cmode->xscale!=1 || cmode->yscale!=1 || cmode->special)
|
|
||||||
{
|
{
|
||||||
|
cmode->flags &= ~VMDF_DXBLT;
|
||||||
if(cmode->special)
|
if(cmode->special)
|
||||||
{
|
{
|
||||||
int mult = specialmlut[cmode->special];
|
int mult = specialmlut[cmode->special];
|
||||||
|
@ -1128,12 +1214,18 @@ BOOL CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
if(eoptions&EO_FSAFTERLOAD)
|
if(eoptions&EO_FSAFTERLOAD)
|
||||||
CheckDlgButton(hwndDlg,IDC_VIDEOCONFIG_AUTO_FS,BST_CHECKED);
|
CheckDlgButton(hwndDlg,IDC_VIDEOCONFIG_AUTO_FS,BST_CHECKED);
|
||||||
|
|
||||||
|
if(eoptions&EO_HIDEMOUSE)
|
||||||
|
CheckDlgButton(hwndDlg,IDC_VIDEOCONFIG_HIDEMOUSE,BST_CHECKED);
|
||||||
|
|
||||||
if(eoptions&EO_CLIPSIDES)
|
if(eoptions&EO_CLIPSIDES)
|
||||||
CheckDlgButton(hwndDlg,IDC_VIDEOCONFIG_CLIPSIDES,BST_CHECKED);
|
CheckDlgButton(hwndDlg,IDC_VIDEOCONFIG_CLIPSIDES,BST_CHECKED);
|
||||||
|
|
||||||
if(eoptions&EO_BESTFIT)
|
if(eoptions&EO_BESTFIT)
|
||||||
CheckDlgButton(hwndDlg, IDC_VIDEOCONFIG_BESTFIT, BST_CHECKED);
|
CheckDlgButton(hwndDlg, IDC_VIDEOCONFIG_BESTFIT, BST_CHECKED);
|
||||||
|
|
||||||
|
if(eoptions&EO_BGCOLOR)
|
||||||
|
CheckDlgButton(hwndDlg,IDC_VIDEOCONFIG_CONSOLE_BGCOLOR,BST_CHECKED);
|
||||||
|
|
||||||
if(disvaccel&1)
|
if(disvaccel&1)
|
||||||
CheckDlgButton(hwndDlg,IDC_DISABLE_HW_ACCEL_WIN,BST_CHECKED);
|
CheckDlgButton(hwndDlg,IDC_DISABLE_HW_ACCEL_WIN,BST_CHECKED);
|
||||||
|
|
||||||
|
@ -1181,7 +1273,7 @@ BOOL CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||||
if(!(wParam>>16))
|
if(!(wParam>>16))
|
||||||
switch(wParam&0xFFFF)
|
switch(wParam&0xFFFF)
|
||||||
{
|
{
|
||||||
case BTN_CLOSE:
|
case ID_CANCEL:
|
||||||
gornk:
|
gornk:
|
||||||
|
|
||||||
if(IsDlgButtonChecked(hwndDlg,IDC_VIDEOCONFIG_CLIPSIDES)==BST_CHECKED)
|
if(IsDlgButtonChecked(hwndDlg,IDC_VIDEOCONFIG_CLIPSIDES)==BST_CHECKED)
|
||||||
|
@ -1200,6 +1292,11 @@ gornk:
|
||||||
else
|
else
|
||||||
eoptions &= ~EO_BESTFIT;
|
eoptions &= ~EO_BESTFIT;
|
||||||
|
|
||||||
|
if (IsDlgButtonChecked(hwndDlg, IDC_VIDEOCONFIG_CONSOLE_BGCOLOR) == BST_CHECKED)
|
||||||
|
eoptions |= EO_BGCOLOR;
|
||||||
|
else
|
||||||
|
eoptions &= ~EO_BGCOLOR;
|
||||||
|
|
||||||
if(IsDlgButtonChecked(hwndDlg,IDC_VIDEOCONFIG_NO8LIM)==BST_CHECKED)
|
if(IsDlgButtonChecked(hwndDlg,IDC_VIDEOCONFIG_NO8LIM)==BST_CHECKED)
|
||||||
eoptions|=EO_NOSPRLIM;
|
eoptions|=EO_NOSPRLIM;
|
||||||
else
|
else
|
||||||
|
@ -1246,18 +1343,23 @@ gornk:
|
||||||
fullscreen=1;
|
fullscreen=1;
|
||||||
else
|
else
|
||||||
fullscreen=0;
|
fullscreen=0;
|
||||||
|
|
||||||
if(IsDlgButtonChecked(hwndDlg,IDC_VIDEOCONFIG_AUTO_FS)==BST_CHECKED)
|
if(IsDlgButtonChecked(hwndDlg,IDC_VIDEOCONFIG_AUTO_FS)==BST_CHECKED)
|
||||||
eoptions|=EO_FSAFTERLOAD;
|
eoptions|=EO_FSAFTERLOAD;
|
||||||
else
|
else
|
||||||
eoptions&=~EO_FSAFTERLOAD;
|
eoptions&=~EO_FSAFTERLOAD;
|
||||||
|
|
||||||
|
if(IsDlgButtonChecked(hwndDlg,IDC_VIDEOCONFIG_HIDEMOUSE)==BST_CHECKED)
|
||||||
|
eoptions|=EO_HIDEMOUSE;
|
||||||
|
else
|
||||||
|
eoptions&=~EO_HIDEMOUSE;
|
||||||
|
|
||||||
eoptions &= ~(EO_FORCEISCALE | EO_FORCEASPECT);
|
eoptions &= ~(EO_FORCEISCALE | EO_FORCEASPECT);
|
||||||
if(IsDlgButtonChecked(hwndDlg,IDC_FORCE_INT_VIDEO_SCALARS)==BST_CHECKED)
|
if(IsDlgButtonChecked(hwndDlg,IDC_FORCE_INT_VIDEO_SCALARS)==BST_CHECKED)
|
||||||
eoptions|=EO_FORCEISCALE;
|
eoptions|=EO_FORCEISCALE;
|
||||||
if(IsDlgButtonChecked(hwndDlg,IDC_FORCE_ASPECT_CORRECTION)==BST_CHECKED)
|
if(IsDlgButtonChecked(hwndDlg,IDC_FORCE_ASPECT_CORRECTION)==BST_CHECKED)
|
||||||
eoptions|=EO_FORCEASPECT;
|
eoptions|=EO_FORCEASPECT;
|
||||||
|
|
||||||
|
|
||||||
winsizemulx=GetDlgItemDouble(hwndDlg, IDC_WINSIZE_MUL_X);
|
winsizemulx=GetDlgItemDouble(hwndDlg, IDC_WINSIZE_MUL_X);
|
||||||
winsizemuly=GetDlgItemDouble(hwndDlg, IDC_WINSIZE_MUL_Y);
|
winsizemuly=GetDlgItemDouble(hwndDlg, IDC_WINSIZE_MUL_Y);
|
||||||
saspectw=GetDlgItemDouble(hwndDlg, IDC_VIDEOCONFIG_ASPECT_X);
|
saspectw=GetDlgItemDouble(hwndDlg, IDC_VIDEOCONFIG_ASPECT_X);
|
||||||
|
@ -1299,22 +1401,19 @@ void PushCurrentVideoSettings()
|
||||||
changerecursive = 1;
|
changerecursive = 1;
|
||||||
SetVideoMode(0);
|
SetVideoMode(0);
|
||||||
changerecursive = 0;
|
changerecursive = 0;
|
||||||
|
//SetMainWindowStuff(); // it's already called inside SetVideoMode()
|
||||||
}
|
}
|
||||||
|
|
||||||
SetMainWindowStuff();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Shows the Video configuration dialog.
|
//Shows the Video configuration dialog.
|
||||||
void ConfigVideo(void)
|
void ConfigVideo(void)
|
||||||
{
|
{
|
||||||
DialogBox(fceu_hInstance, "VIDEOCONFIG", hAppWnd, VideoConCallB);
|
DialogBox(fceu_hInstance, "VIDEOCONFIG", hAppWnd, VideoConCallB);
|
||||||
DoVideoConfigFix();
|
DoVideoConfigFix();
|
||||||
|
|
||||||
PushCurrentVideoSettings();
|
PushCurrentVideoSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FCEUD_VideoChanged()
|
||||||
void FCEUD_VideoChanged() {
|
{
|
||||||
PushCurrentVideoSettings();
|
PushCurrentVideoSettings();
|
||||||
}
|
}
|
|
@ -49,11 +49,13 @@ extern int winsync;
|
||||||
void SetFSVideoMode();
|
void SetFSVideoMode();
|
||||||
void FCEUD_BlitScreen(uint8 *XBuf);
|
void FCEUD_BlitScreen(uint8 *XBuf);
|
||||||
void ConfigVideo();
|
void ConfigVideo();
|
||||||
int RecreateResizableSurface();
|
void RecreateResizableSurface(int width, int height);
|
||||||
|
void RecolorResizableSurface();
|
||||||
int SetVideoMode(int fs);
|
int SetVideoMode(int fs);
|
||||||
void DoVideoConfigFix();
|
void DoVideoConfigFix();
|
||||||
void FCEUD_BlitScreen(uint8 *XBuf);
|
void FCEUD_BlitScreen(uint8 *XBuf);
|
||||||
void ResetVideo();
|
void ResetVideo();
|
||||||
void SetFSVideoMode();
|
void SetFSVideoMode();
|
||||||
void PushCurrentVideoSettings();
|
void PushCurrentVideoSettings();
|
||||||
|
void ResetCustomMode();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -80,6 +80,8 @@
|
||||||
extern TASEDITOR_WINDOW taseditor_window;
|
extern TASEDITOR_WINDOW taseditor_window;
|
||||||
extern PLAYBACK playback;
|
extern PLAYBACK playback;
|
||||||
|
|
||||||
|
//extern void ToggleFullscreen();
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
//----Context Menu - Some dynamically added menu items
|
//----Context Menu - Some dynamically added menu items
|
||||||
|
@ -140,6 +142,7 @@ static int vchanged = 0;
|
||||||
int menuYoffset = 0;
|
int menuYoffset = 0;
|
||||||
bool wasPausedByCheats = false; //For unpausing the emulator if paused by the cheats dialog
|
bool wasPausedByCheats = false; //For unpausing the emulator if paused by the cheats dialog
|
||||||
bool rightClickEnabled = true; //If set to false, the right click context menu will be disabled.
|
bool rightClickEnabled = true; //If set to false, the right click context menu will be disabled.
|
||||||
|
bool fullscreenByDoubleclick = true;
|
||||||
|
|
||||||
//Function Prototypes
|
//Function Prototypes
|
||||||
void ChangeMenuItemText(int menuitem, string text); //Alters a menu item name
|
void ChangeMenuItemText(int menuitem, string text); //Alters a menu item name
|
||||||
|
@ -1225,6 +1228,21 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_LBUTTONDBLCLK:
|
||||||
|
{
|
||||||
|
if (fullscreenByDoubleclick)
|
||||||
|
{
|
||||||
|
extern void ToggleFullscreen();
|
||||||
|
ToggleFullscreen();
|
||||||
|
return 0;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
mouseb=wParam;
|
||||||
|
goto proco;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
case WM_RBUTTONDOWN:
|
case WM_RBUTTONDOWN:
|
||||||
|
@ -2426,7 +2444,7 @@ int CreateMainWindow()
|
||||||
|
|
||||||
memset(&winclass, 0, sizeof(winclass));
|
memset(&winclass, 0, sizeof(winclass));
|
||||||
winclass.cbSize = sizeof(WNDCLASSEX);
|
winclass.cbSize = sizeof(WNDCLASSEX);
|
||||||
winclass.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW | CS_SAVEBITS;
|
winclass.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW | CS_SAVEBITS | CS_DBLCLKS;
|
||||||
winclass.lpfnWndProc = AppWndProc;
|
winclass.lpfnWndProc = AppWndProc;
|
||||||
winclass.cbClsExtra = 0;
|
winclass.cbClsExtra = 0;
|
||||||
winclass.cbWndExtra = 0;
|
winclass.cbWndExtra = 0;
|
||||||
|
@ -2529,9 +2547,11 @@ void SetMainWindowStuff()
|
||||||
|
|
||||||
ShowWindow(hAppWnd, SW_SHOWNORMAL);
|
ShowWindow(hAppWnd, SW_SHOWNORMAL);
|
||||||
}
|
}
|
||||||
if (eoptions & EO_BESTFIT)
|
if (eoptions & EO_BESTFIT && !windowedfailed)
|
||||||
{
|
{
|
||||||
RecreateResizableSurface();
|
RECT client_recr;
|
||||||
|
GetClientRect(hAppWnd, &client_recr);
|
||||||
|
RecreateResizableSurface(client_recr.right - client_recr.left, client_recr.bottom - client_recr.top);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -658,7 +658,7 @@ static void ReloadRom(void);
|
||||||
static void MovieSubtitleToggle(void);
|
static void MovieSubtitleToggle(void);
|
||||||
static void UndoRedoSavestate(void);
|
static void UndoRedoSavestate(void);
|
||||||
static void FCEUI_DoExit(void);
|
static void FCEUI_DoExit(void);
|
||||||
static void ToggleFullscreen(void);
|
void ToggleFullscreen();
|
||||||
static void TaseditorRewindOn(void);
|
static void TaseditorRewindOn(void);
|
||||||
static void TaseditorRewindOff(void);
|
static void TaseditorRewindOff(void);
|
||||||
static void TaseditorCommand(void);
|
static void TaseditorCommand(void);
|
||||||
|
@ -1159,7 +1159,7 @@ static void FCEUI_DoExit(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ToggleFullscreen(void)
|
void ToggleFullscreen()
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
extern int SetVideoMode(int fs); //adelikat: Yeah, I know, hacky
|
extern int SetVideoMode(int fs); //adelikat: Yeah, I know, hacky
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue