diff --git a/stella/src/win32/StellaX/ConfigPage.cxx b/stella/src/win32/StellaX/ConfigPage.cxx index 0b229c07b..2f075ef4a 100644 --- a/stella/src/win32/StellaX/ConfigPage.cxx +++ b/stella/src/win32/StellaX/ConfigPage.cxx @@ -14,9 +14,12 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: ConfigPage.cxx,v 1.3 2004-07-06 22:51:58 stephena Exp $ +// $Id: ConfigPage.cxx,v 1.4 2004-07-11 03:13:24 stephena Exp $ //============================================================================ +//#define WINVER 0x0501 +//#include + #include "pch.hxx" #include "ConfigPage.hxx" #include "resource.h" @@ -34,53 +37,97 @@ CConfigPage::CConfigPage( CGlobalData& rGlobalData ) BOOL CConfigPage::OnInitDialog( HWND hwnd ) { - // return FALSE if SetFocus is called m_hwnd = hwnd; HWND hwndCtrl; // Reload settings just in case the emulation changed them myGlobalData.settings().loadConfig(); - // Set up ROMPATH - hwndCtrl = ::GetDlgItem( hwnd, IDC_ROMPATH ); - ::SendMessage( hwndCtrl, EM_LIMITTEXT, MAX_PATH, 0 ); - ::SetWindowText( hwndCtrl, - myGlobalData.settings().getString("romdir").c_str() ); + // Get romdir + hwndCtrl = GetDlgItem( hwnd, IDC_ROMPATH ); + SendMessage( hwndCtrl, EM_LIMITTEXT, MAX_PATH, 0 ); + SetWindowText( hwndCtrl, myGlobalData.settings().getString("romdir").c_str() ); - // Set up PADDLE - hwndCtrl = ::GetDlgItem( hwnd, IDC_PADDLE ); + // Get ssname + int ssname = 0; + hwndCtrl = GetDlgItem( hwnd, IDC_SNAPSHOT_TYPE ); + SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)"ROM Name" ); + SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)"ROM MD5" ); + if(myGlobalData.settings().getString("ssname") == "romname") + ssname = 0; + else if(myGlobalData.settings().getString("ssname") == "md5sum") + ssname = 1; + SendMessage( hwndCtrl, CB_SETCURSEL, ssname, 0 ); + + // Get sssingle + hwndCtrl = GetDlgItem( hwnd, IDC_SNAPSHOT_MULTIPLE ); + SendMessage( hwndCtrl, BM_SETCHECK, + myGlobalData.settings().getBool("sssingle") + ? BST_UNCHECKED : BST_CHECKED, 0 ); + + // Get paddle + hwndCtrl = GetDlgItem( hwnd, IDC_PADDLE ); TCHAR psz[4] = _T("0"); TCHAR i; for ( i = 0; i < 4; ++i ) { psz[0] = _T('0') + i; - ::SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)psz ); + SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)psz ); } - ::SendMessage( hwndCtrl, CB_SETCURSEL, - myGlobalData.settings().getInt("paddle"), 0 ); + SendMessage( hwndCtrl, CB_SETCURSEL, myGlobalData.settings().getInt("paddle"), 0 ); - // Set up Video mode + // Get video int videomode = 0; - hwndCtrl = ::GetDlgItem( hwnd, IDC_VIDEO ); - ::SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)"Software" ); - ::SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)"OpenGL" ); + hwndCtrl = GetDlgItem( hwnd, IDC_VIDEO ); + SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)"Software" ); + SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)"OpenGL" ); if(myGlobalData.settings().getString("video") == "soft") videomode = 0; else if(myGlobalData.settings().getString("video") == "gl") videomode = 1; - ::SendMessage( hwndCtrl, CB_SETCURSEL, videomode, 0 ); + SendMessage( hwndCtrl, CB_SETCURSEL, videomode, 0 ); - // Set up Aspect Ratio - hwndCtrl = ::GetDlgItem( hwnd, IDC_ASPECT ); - ::SendMessage( hwndCtrl, EM_LIMITTEXT, MAX_PATH, 0 ); - ::SetWindowText( hwndCtrl, - myGlobalData.settings().getString("gl_aspect").c_str() ); + // Get gl_aspect + hwndCtrl = GetDlgItem( hwnd, IDC_GL_ASPECT ); + SendMessage( hwndCtrl, EM_LIMITTEXT, MAX_PATH, 0 ); + SetWindowText( hwndCtrl, myGlobalData.settings().getString("gl_aspect").c_str() ); - // Set up SOUND - hwndCtrl = ::GetDlgItem( hwnd, IDC_SOUND ); - ::SendMessage( hwndCtrl, BM_SETCHECK, - myGlobalData.settings().getBool("sound") - ? BST_UNCHECKED : BST_CHECKED, 0 ); + // Get gl_fsmax + hwndCtrl = GetDlgItem( hwnd, IDC_GL_FSMAX ); + SendMessage( hwndCtrl, BM_SETCHECK, + myGlobalData.settings().getBool("gl_fsmax") + ? BST_CHECKED : BST_UNCHECKED, 0 ); + + // Get volume +// hwndCtrl = GetDlgItem( hwnd, IDC_SOUND_VOLUME_SPIN ); +// CSpinButtonCtrl spin = (CSpinButtonCtrl) hwndCtrl; + hwndCtrl = GetDlgItem( hwnd, IDC_SOUND_VOLUME ); + SendMessage( hwndCtrl, EM_LIMITTEXT, MAX_PATH, 0 ); + SetWindowText( hwndCtrl, myGlobalData.settings().getString("volume").c_str() ); + + // Get fragsize + int fragindex = 2, fragsize = 2048; + hwndCtrl = GetDlgItem( hwnd, IDC_SOUND_FRAGSIZE ); + SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)"512" ); + SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)"1024" ); + SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)"2048" ); + SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)"4096" ); + fragsize = myGlobalData.settings().getInt("fragsize"); + if(fragsize == 512) + fragindex = 0; + else if(fragsize == 1024) + fragindex = 1; + else if(fragsize == 2048) + fragindex = 2; + else if(fragsize == 4096) + fragindex = 3; + SendMessage( hwndCtrl, CB_SETCURSEL, fragindex, 0 ); + + // Get sound + hwndCtrl = GetDlgItem( hwnd, IDC_SOUND_ENABLE ); + SendMessage( hwndCtrl, BM_SETCHECK, + myGlobalData.settings().getBool("sound") + ? BST_UNCHECKED : BST_CHECKED, 0 ); return TRUE; } @@ -93,29 +140,47 @@ LONG CConfigPage::OnApply( LPPSHNOTIFY lppsn ) { UNUSED_ALWAYS( lppsn ); - // Apply the changes - // HWND hwnd = lppsn->hdr.hwndFrom; <<-- points to the sheet! - HWND hwndCtrl; TCHAR buffer[ MAX_PATH ]; string str; int i; bool b; - // RomPath - hwndCtrl = ::GetDlgItem( m_hwnd, IDC_ROMPATH ); + // Set romdir + hwndCtrl = GetDlgItem( m_hwnd, IDC_ROMPATH ); ASSERT( hwndCtrl ); - ::GetWindowText( hwndCtrl, buffer, MAX_PATH ); + GetWindowText( hwndCtrl, buffer, MAX_PATH ); myGlobalData.settings().setString( "romdir", buffer ); - // Paddle - hwndCtrl = ::GetDlgItem( m_hwnd, IDC_PADDLE ); + // Set ssname + hwndCtrl = GetDlgItem( m_hwnd, IDC_SNAPSHOT_TYPE ); + ASSERT( hwndCtrl ); + i = SendMessage( hwndCtrl, CB_GETCURSEL, 0, 0 ); + if( i == 0 ) + str = "romname"; + else if( i == 1 ) + str = "md5sum"; + else + str = "romname"; + myGlobalData.settings().setString( "ssname", str ); + + // Set sssingle + hwndCtrl = GetDlgItem( m_hwnd, IDC_SNAPSHOT_MULTIPLE ); + ASSERT( hwndCtrl ); + if( SendMessage( hwndCtrl, BM_GETCHECK, 0, 0 ) == BST_CHECKED ) + b = false; + else + b = true; + myGlobalData.settings().setBool( "sssingle", b ); + + // Set paddle + hwndCtrl = GetDlgItem( m_hwnd, IDC_PADDLE ); ASSERT( hwndCtrl ); myGlobalData.settings().setInt( "paddle", - ::SendMessage( hwndCtrl, CB_GETCURSEL, 0, 0 ) ); + SendMessage( hwndCtrl, CB_GETCURSEL, 0, 0 ) ); - // VideoMode - hwndCtrl = ::GetDlgItem( m_hwnd, IDC_VIDEO ); + // Set video + hwndCtrl = GetDlgItem( m_hwnd, IDC_VIDEO ); ASSERT( hwndCtrl ); i = ::SendMessage( hwndCtrl, CB_GETCURSEL, 0, 0 ); if( i == 0 ) @@ -126,16 +191,47 @@ LONG CConfigPage::OnApply( LPPSHNOTIFY lppsn ) str = "soft"; myGlobalData.settings().setString( "video", str ); - // AspectRatio - hwndCtrl = ::GetDlgItem( m_hwnd, IDC_ASPECT ); + // Set gl_aspect + hwndCtrl = GetDlgItem( m_hwnd, IDC_GL_ASPECT ); ASSERT( hwndCtrl ); - ::GetWindowText( hwndCtrl, buffer, MAX_PATH ); + GetWindowText( hwndCtrl, buffer, MAX_PATH ); myGlobalData.settings().setString( "gl_aspect", buffer ); - // Sound - hwndCtrl = ::GetDlgItem( m_hwnd, IDC_SOUND ); + // Set gl_fsmax + hwndCtrl = GetDlgItem( m_hwnd, IDC_GL_FSMAX ); ASSERT( hwndCtrl ); - if( ::SendMessage( hwndCtrl, BM_GETCHECK, 0, 0 ) == BST_CHECKED ) + if( SendMessage( hwndCtrl, BM_GETCHECK, 0, 0 ) == BST_CHECKED ) + b = true; + else + b = false; + myGlobalData.settings().setBool( "gl_fsmax", b ); + + // Set volume + hwndCtrl = GetDlgItem( m_hwnd, IDC_SOUND_VOLUME ); + ASSERT( hwndCtrl ); + GetWindowText( hwndCtrl, buffer, MAX_PATH ); + myGlobalData.settings().setString( "volume", buffer ); + + // Set fragsize + hwndCtrl = GetDlgItem( m_hwnd, IDC_SOUND_FRAGSIZE ); + ASSERT( hwndCtrl ); + i = SendMessage( hwndCtrl, CB_GETCURSEL, 0, 0 ); + if( i == 0 ) + str = "512"; + else if( i == 1 ) + str = "1024"; + else if( i == 2 ) + str = "2048"; + else if( i == 3 ) + str = "4096"; + else + str = "2048"; + myGlobalData.settings().setString( "fragsize", str ); + + // Set sound + hwndCtrl = GetDlgItem( m_hwnd, IDC_SOUND_ENABLE ); + ASSERT( hwndCtrl ); + if( SendMessage( hwndCtrl, BM_GETCHECK, 0, 0 ) == BST_CHECKED ) b = false; else b = true; diff --git a/stella/src/win32/StellaX/StellaX.aps b/stella/src/win32/StellaX/StellaX.aps index 3487aa81e..fe3ac7577 100644 Binary files a/stella/src/win32/StellaX/StellaX.aps and b/stella/src/win32/StellaX/StellaX.aps differ diff --git a/stella/src/win32/StellaX/StellaX.rc b/stella/src/win32/StellaX/StellaX.rc index fe5655c1b..033fee433 100644 --- a/stella/src/win32/StellaX/StellaX.rc +++ b/stella/src/win32/StellaX/StellaX.rc @@ -121,7 +121,7 @@ BEGIN CONTROL "E&xit",IDC_EXIT,"Button",BS_OWNERDRAW | WS_TABSTOP,348, 226,54,16 CTEXT "Written by Jeff Miller (miller@zipcon.net)\nUpdated by Stephen Anthony (sa666_666@hotmail.com)\nStella core by Bradford W. Mott (bwmott@acm.org)", - IDC_STATIC,175,7,227,28,SS_NOPREFIX + IDC_STATIC_TEXT,175,7,227,28,SS_NOPREFIX RTEXT "",IDC_ROMCOUNT,322,45,80,8,SS_NOPREFIX CONTROL "",-1,"Static",SS_ETCHEDHORZ,0,39,411,1 CONTROL "",-1,"Static",SS_ETCHEDHORZ,0,218,411,1 @@ -158,31 +158,44 @@ BEGIN CONTROL "",-1,"Static",SS_ETCHEDHORZ,7,37,284,1 END -IDD_CONFIG_PAGE DIALOGEX 0, 0, 306, 199 +IDD_CONFIG_PAGE DIALOGEX 0, 0, 269, 158 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Options" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - LTEXT "&ROM (.bin) file path:",-1,7,10,64,8 - EDITTEXT IDC_ROMPATH,82,7,152,14,ES_AUTOHSCROLL - PUSHBUTTON "&Browse...",IDC_BROWSE,241,7,50,14 - LTEXT "Set this to the path where your .bin rom files are located.", - -1,7,25,292,8 - CONTROL "",-1,"Static",SS_ETCHEDHORZ,7,39,292,1 - LTEXT "Mouse should emulate &paddle:",-1,7,49,111,8 - COMBOBOX IDC_PADDLE,122,47,48,82,CBS_DROPDOWNLIST | WS_VSCROLL | + GROUPBOX "File Locations",-1,7,7,254,39 + LTEXT "ROM Directory:",-1,14,25,55,8 + EDITTEXT IDC_ROMPATH,67,23,171,13,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BROWSE,241,23,13,12 + GROUPBOX "Snapshot Settings",-1,7,49,148,43 + LTEXT "Save Snapshot as:",-1,14,61,67,10 + COMBOBOX IDC_SNAPSHOT_TYPE,86,60,60,37,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "Generate multiple snapshots",IDC_SNAPSHOT_MULTIPLE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,27,75,109,11 + GROUPBOX "Paddle Emulation",-1,161,49,100,43 + LTEXT "Mouse is paddle:",-1,167,61,65,8 + COMBOBOX IDC_PADDLE,225,60,30,82,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Set this to specify which paddle the mouse should emulate. This can be any number from 0 to 3 inclusive.", - -1,7,66,198,18 - CONTROL "Disable &Sound",IDC_SOUND,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,164,62,10 - CONTROL "",-1,"Static",SS_ETCHEDHORZ,7,91,291,1 - LTEXT "Video Driver:",-1,7,101,67,10 - COMBOBOX IDC_VIDEO,67,99,51,35,CBS_DROPDOWN | CBS_SORT | + GROUPBOX "Video Settings",-1,7,95,118,57 + LTEXT "Driver:",-1,14,108,28,10 + COMBOBOX IDC_VIDEO,62,106,52,35,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Aspect Ratio:",-1,7,120,55,10 - CONTROL "",-1,"Static",SS_ETCHEDHORZ,7,136,290,1 - EDITTEXT IDC_ASPECT,66,118,50,12,ES_AUTOHSCROLL + LTEXT "Aspect Ratio:",-1,14,122,50,10 + EDITTEXT IDC_GL_ASPECT,62,120,51,12,ES_AUTOHSCROLL + CONTROL "Maximize FS OpenGL",IDC_GL_FSMAX,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,25,135,86,12 + GROUPBOX "Sound Settings",-1,132,95,96,57 + LTEXT "Volume:",-1,140,108,28,8 + EDITTEXT IDC_SOUND_VOLUME,176,106,29,12,ES_AUTOHSCROLL + CONTROL "",IDC_SOUND_VOLUME_SPIN,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS,205,106,11,12 + LTEXT "Frag Size:",-1,140,122,36,8 + COMBOBOX IDC_SOUND_FRAGSIZE,176,120,41,51,CBS_DROPDOWNLIST | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "Disable &Sound",IDC_SOUND_ENABLE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,147,135,62,10 END @@ -213,9 +226,9 @@ BEGIN IDD_CONFIG_PAGE, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 299 + RIGHTMARGIN, 262 TOPMARGIN, 7 - BOTTOMMARGIN, 192 + BOTTOMMARGIN, 152 END END #endif // APSTUDIO_INVOKED diff --git a/stella/src/win32/StellaX/resource.h b/stella/src/win32/StellaX/resource.h index 9d6371f95..9e9646905 100644 --- a/stella/src/win32/StellaX/resource.h +++ b/stella/src/win32/StellaX/resource.h @@ -32,7 +32,7 @@ #define IDC_PLAY 1005 #define IDC_ROMCOUNT 1006 #define IDC_ROMLIST 1007 -#define IDC_STATIC 1008 +#define IDC_STATIC_TEXT 1008 #define IDC_TITLE 1009 #define IDC_WEB_MAINTAINER 1010 #define IDC_WEB_STELLA 1011 @@ -42,14 +42,22 @@ #define IDC_CONFIG 1015 #define IDC_CONFIG2 1016 #define IDC_PADDLE 1017 -#define IDC_SOUND 1018 #define IDC_VOLUME 1019 -#define IDC_VIDEO 1020 -#define IDC_ASPECT 1021 #define IDC_BROWSE 1022 #define IDC_EDIT2 1027 #define IDC_RELOAD 1028 -#define IDC_INSTRUCTIONS 2000 +#define IDC_SNAPSHOT_TYPE 1029 +#define IDC_SNAPSHOT_LOCATION 1030 +#define IDC_SNAPSHOT_MULTIPLE 1031 +#define IDC_SOUND_ENABLE 1032 +#define IDC_SOUND_VOLUME 1033 +#define IDC_LIST1 1033 +#define IDC_VIDEO 1034 +#define IDC_GL_ASPECT 1035 +#define IDC_GL_FSMAX 1036 +#define IDC_SOUND_VOLUME_SPIN 1044 +#define IDC_SOUND_FRAGSIZE 1045 +#define IDC_TAB1 1046 #define ID_FILE_EXIT 32771 // Next default values for new objects @@ -58,7 +66,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 296 #define _APS_NEXT_COMMAND_VALUE 32772 -#define _APS_NEXT_CONTROL_VALUE 1028 +#define _APS_NEXT_CONTROL_VALUE 1047 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/stella/src/win32/Stella_Emulator.ncb b/stella/src/win32/Stella_Emulator.ncb index f2ba98d66..64db0712e 100644 Binary files a/stella/src/win32/Stella_Emulator.ncb and b/stella/src/win32/Stella_Emulator.ncb differ diff --git a/stella/src/win32/Stella_Emulator.suo b/stella/src/win32/Stella_Emulator.suo index ba8cc046e..4a6827bf4 100644 Binary files a/stella/src/win32/Stella_Emulator.suo and b/stella/src/win32/Stella_Emulator.suo differ