Video config: changed "Create surface in memory" to an actual drop-down list with 3 options: a) No hardware acceleration; b) Create surface in RAM; c) Hardware acceleration. Because it appears that some video cards still blur textures even when stored in RAM.

This commit is contained in:
ansstuff 2013-05-09 13:26:47 +00:00
parent 95b120fcf4
commit dad4e753f6
5 changed files with 60 additions and 38 deletions

View File

@ -237,7 +237,8 @@ static CFGSTRUCT fceuconfig[] =
NAC("srendlinep",srendlinep),
NAC("erendlinep",erendlinep),
AC(disvaccel),
AC(directDrawModeWindowed),
AC(directDrawModeFullscreen),
AC(winsync),
NAC("988fssync",fssync),

View File

@ -1756,10 +1756,8 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,15,157,12
CONTROL "Enter full screen mode after game is loaded",IDC_VIDEOCONFIG_AUTO_FS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,29,154,12
LTEXT "Sync method:",65452,11,112,51,10
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_FS,66,110,95,50,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "Create surface in system memory",IDC_DISABLE_HW_ACCEL_FS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,127,147,12
LTEXT "Sync method:",65452,11,108,46,10
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_FS,59,106,105,50,CBS_DROPDOWNLIST | WS_TABSTOP
LTEXT "Mode:",13,11,67,23,9
EDITTEXT IDC_VIDEOCONFIG_XRES,36,65,27,13,ES_RIGHT
LTEXT "by",12,67,67,11,9
@ -1767,8 +1765,8 @@ BEGIN
LTEXT "@",11,110,67,11,9
COMBOBOX IDC_VIDEOCONFIG_BPP,122,65,32,12,CBS_DROPDOWNLIST | WS_TABSTOP
LTEXT "bpp",10,157,67,14,9
LTEXT "Special scaler:",65444,11,95,52,9
COMBOBOX IDC_VIDEOCONFIG_SCALER_FS,66,93,95,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Special Filter:",65444,11,91,46,9
COMBOBOX IDC_VIDEOCONFIG_SCALER_FS,59,89,105,46,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Windowed Settings",65441,182,3,164,141,WS_GROUP
LTEXT "Size Multiplier:",65440,190,22,50,8
CTEXT "X:",65439,253,10,26,8
@ -1779,12 +1777,10 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,195,50,136,12
CONTROL "Force aspect ratio correction",IDC_FORCE_ASPECT_CORRECTION,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,195,64,136,12
LTEXT "Special scaler:",65429,188,95,51,9
COMBOBOX IDC_VIDEOCONFIG_SCALER_WIN,243,93,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Sync method:",65437,188,112,51,9
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_WIN,243,110,93,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Create surface in system memory",IDC_DISABLE_HW_ACCEL_WIN,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,188,127,146,12
LTEXT "Special Filter:",65429,188,91,46,9
COMBOBOX IDC_VIDEOCONFIG_SCALER_WIN,236,89,103,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Sync method:",65437,188,108,46,9
COMBOBOX IDC_VIDEOCONFIG_SYNC_METHOD_WIN,236,106,103,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Drawing Area",65494,351,50,154,65,WS_GROUP
LTEXT "First line:",65436,367,68,40,9
LTEXT "Last line:",65435,367,84,40,9
@ -1810,6 +1806,10 @@ BEGIN
EDITTEXT IDC_TVASPECT_X,407,28,41,12,ES_AUTOHSCROLL
EDITTEXT IDC_TVASPECT_Y,458,28,41,12,ES_AUTOHSCROLL
CTEXT "/",IDC_STATIC_SLASHTEXT,449,31,8,8
LTEXT "DirectDraw:",65454,11,126,46,10
LTEXT "DirectDraw:",65455,188,125,46,10
COMBOBOX IDC_VIDEOCONFIG_DIRECTDRAW_FS,59,123,105,50,CBS_DROPDOWNLIST | WS_TABSTOP
COMBOBOX IDC_VIDEOCONFIG_DIRECTDRAW_WIN,236,123,103,47,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_RAMSEARCH DIALOGEX 0, 0, 287, 292

View File

@ -131,9 +131,12 @@
#define IDC_ROMPATCHER_BTN_SAVE 111
#define IDC_CHEAT_VAL2 111
#define IDC_CHEAT_COM 111
#define IDC_VIDEOCONFIG_DIRECTDRAW_FS 111
#define BTN_AUTO_HOLD 112
#define IDC_BTN_LOG_BROWSE 112
#define IDC_DEBUGGER_BOOKMARK_ADD 112
#define IDC_VIDEOCONFIG_SYNC_METHOD_WIN2 112
#define IDC_VIDEOCONFIG_DIRECTDRAW_WIN 112
#define IDC_DEBUGGER_BOOKMARK_DEL 113
#define BTN_CLEAR_AH 114
#define IDC_CHECK_LOG_NEW_INSTRUCTIONS 114
@ -434,7 +437,6 @@
#define IDC_TVASPECT_X 404
#define IDC_VIDEOCONFIG_ASPECT_Y 405
#define IDC_DEBUGGER_VAL_S2 405
#define IDC_TVASPECT_HEIGHT 405
#define IDC_TVASPECT_Y 405
#define IDC_VIDEOCONFIG_SCALER_WIN 406
#define CHECK_ENABLE_MICROPHONE 407

View File

@ -40,7 +40,8 @@ static int bpp;
static int vflags;
static int veflags;
int disvaccel = 0; // "Create surface in system memory". By default it's off in both windowed and Fullscreen mode
int directDrawModeWindowed = DIRECTDRAW_MODE_SOFTWARE;
int directDrawModeFullscreen = DIRECTDRAW_MODE_FULL;
int fssync=0;
int winsync=0;
@ -139,12 +140,17 @@ static bool firstInitialize = true;
static int InitializeDDraw(int fs)
{
//only init the palette the first time through
if(firstInitialize) {
if (firstInitialize)
{
firstInitialize = false;
color_palette = (PALETTEENTRY*)malloc(256 * sizeof(PALETTEENTRY));
color_palette = (PALETTEENTRY*)malloc(256 * sizeof(PALETTEENTRY));
}
ddrval = DirectDrawCreate(NULL, &lpDD, NULL);
if ((fs && directDrawModeFullscreen == DIRECTDRAW_MODE_SOFTWARE) || (!fs && directDrawModeWindowed == DIRECTDRAW_MODE_SOFTWARE))
ddrval = DirectDrawCreate((GUID FAR *)DDCREATE_EMULATIONONLY, &lpDD, NULL);
else
ddrval = DirectDrawCreate(NULL, &lpDD, NULL);
if (ddrval != DD_OK)
{
//ShowDDErr("Error creating DirectDraw object.");
@ -367,11 +373,11 @@ int SetVideoMode(int fs)
ddsdback.dwWidth=256 * specmul;
ddsdback.dwHeight=FSettings.TotalScanlines() * specmul;
if (disvaccel & 1)
if (directDrawModeWindowed == DIRECTDRAW_MODE_SURFACE_IN_RAM)
// create the buffer in system memory
ddsdback.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
ddrval = IDirectDraw7_CreateSurface ( lpDD7, &ddsdback, &lpDDSBack, (IUnknown FAR*)NULL);
ddrval = IDirectDraw7_CreateSurface(lpDD7, &ddsdback, &lpDDSBack, (IUnknown FAR*)NULL);
if (ddrval != DD_OK)
{
//ShowDDErr("Error creating secondary surface.");
@ -457,7 +463,7 @@ int SetVideoMode(int fs)
ddsdback.dwWidth=256 * specmul; //vmodes[vmod].srect.right;
ddsdback.dwHeight=FSettings.TotalScanlines() * specmul; //vmodes[vmod].srect.bottom;
if (disvaccel & 2)
if (directDrawModeFullscreen == DIRECTDRAW_MODE_SURFACE_IN_RAM)
// create the buffer in system memory
ddsdback.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
@ -1258,8 +1264,21 @@ BOOL CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_WIN,CB_ADDSTRING,0,(LPARAM)(LPSTR)str[x]);
}
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_FS,CB_SETCURSEL,vmodes[0].special,(LPARAM)(LPSTR)0);
SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_WIN,CB_SETCURSEL,winspecial,(LPARAM)(LPSTR)0);
SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_SCALER_FS, CB_SETCURSEL, vmodes[0].special, (LPARAM)(LPSTR)0);
SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_SCALER_WIN, CB_SETCURSEL, winspecial, (LPARAM)(LPSTR)0);
// Direct Draw modes
SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_DIRECTDRAW_WIN, CB_ADDSTRING, 0, (LPARAM)(LPSTR)"No hardware acceleration");
SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_DIRECTDRAW_WIN, CB_ADDSTRING, 0, (LPARAM)(LPSTR)"Create Surface in RAM");
SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_DIRECTDRAW_WIN, CB_ADDSTRING, 0, (LPARAM)(LPSTR)"Hardware acceleration");
SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_DIRECTDRAW_WIN, CB_SETCURSEL, directDrawModeWindowed, (LPARAM)(LPSTR)0);
SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_DIRECTDRAW_FS, CB_ADDSTRING, 0, (LPARAM)(LPSTR)"No hardware acceleration");
SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_DIRECTDRAW_FS, CB_ADDSTRING, 0, (LPARAM)(LPSTR)"Create Surface in RAM");
SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_DIRECTDRAW_FS, CB_ADDSTRING, 0, (LPARAM)(LPSTR)"Hardware acceleration");
SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_DIRECTDRAW_FS, CB_SETCURSEL, directDrawModeFullscreen, (LPARAM)(LPSTR)0);
if(eoptions&EO_FSAFTERLOAD)
CheckDlgButton(hwndDlg,IDC_VIDEOCONFIG_AUTO_FS,BST_CHECKED);
@ -1282,12 +1301,6 @@ BOOL CALLBACK VideoConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
if(eoptions&EO_TVASPECT)
CheckDlgButton(hwndDlg, IDC_VIDEOCONFIG_TVASPECT, BST_CHECKED);
if(disvaccel&1)
CheckDlgButton(hwndDlg,IDC_DISABLE_HW_ACCEL_WIN,BST_CHECKED);
if(disvaccel&2)
CheckDlgButton(hwndDlg,IDC_DISABLE_HW_ACCEL_FS,BST_CHECKED);
if(eoptions&EO_FORCEISCALE)
CheckDlgButton(hwndDlg,IDC_FORCE_INT_VIDEO_SCALARS,BST_CHECKED);
@ -1413,14 +1426,9 @@ gornk:
//vmodes[0].yscale=GetDlgItemInt(hwndDlg,IDC_VIDEOCONFIG_YSCALE,0,0);
vmodes[0].special=SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_FS,CB_GETCURSEL,0,(LPARAM)(LPSTR)0);
winspecial = SendDlgItemMessage(hwndDlg,IDC_VIDEOCONFIG_SCALER_WIN,CB_GETCURSEL,0,(LPARAM)(LPSTR)0);
disvaccel = 0;
if(IsDlgButtonChecked(hwndDlg,IDC_DISABLE_HW_ACCEL_WIN)==BST_CHECKED)
disvaccel |= 1;
if(IsDlgButtonChecked(hwndDlg,IDC_DISABLE_HW_ACCEL_FS)==BST_CHECKED)
disvaccel |= 2;
winspecial = SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_SCALER_WIN, CB_GETCURSEL, 0, (LPARAM)(LPSTR)0);
directDrawModeWindowed = SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_DIRECTDRAW_WIN, CB_GETCURSEL, 0, (LPARAM)(LPSTR)0) % DIRECTDRAW_MODES_TOTAL;
directDrawModeFullscreen = SendDlgItemMessage(hwndDlg, IDC_VIDEOCONFIG_DIRECTDRAW_FS, CB_GETCURSEL, 0, (LPARAM)(LPSTR)0) % DIRECTDRAW_MODES_TOTAL;
if(IsDlgButtonChecked(hwndDlg,IDC_VIDEOCONFIG_FS)==BST_CHECKED)
fullscreen=1;

View File

@ -17,6 +17,15 @@
#include "main.h"
#include "window.h"
enum DIRECTDRAW_MODES
{
DIRECTDRAW_MODE_SOFTWARE,
DIRECTDRAW_MODE_SURFACE_IN_RAM,
DIRECTDRAW_MODE_FULL,
// ...
DIRECTDRAW_MODES_TOTAL
};
#define VF_DDSTRETCHED 1
#define VEF_LOSTSURFACE 1
@ -42,7 +51,9 @@ extern vmdef vmodes[11];
extern int winspecial;
extern int NTSCwinspecial;
extern int disvaccel;
extern int directDrawModeWindowed;
extern int directDrawModeFullscreen;
extern int fssync;
extern int winsync;