diff --git a/stella/src/win32/ConfigPage.cxx b/stella/src/win32/ConfigPage.cxx index 3bc271ef5..cd8a618b4 100644 --- a/stella/src/win32/ConfigPage.cxx +++ b/stella/src/win32/ConfigPage.cxx @@ -14,7 +14,7 @@ // 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.2 2004-05-27 22:02:35 stephena Exp $ +// $Id: ConfigPage.cxx,v 1.3 2004-05-28 23:16:26 stephena Exp $ //============================================================================ #include "pch.hxx" @@ -22,8 +22,12 @@ #include "resource.h" #include "BrowseForFolder.hxx" +#include "bspf.hxx" +#include "Settings.hxx" + + CConfigPage::CConfigPage( CGlobalData& rGlobalData ) - : m_rGlobalData( rGlobalData ), + : myGlobalData( rGlobalData ), CPropertyPage( IDD_CONFIG_PAGE ) { } @@ -34,14 +38,17 @@ BOOL CConfigPage::OnInitDialog( HWND hwnd ) 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, m_rGlobalData.RomDir() ); + ::SetWindowText( hwndCtrl, + myGlobalData.settings().getString("romdir").c_str() ); // Set up PADDLE hwndCtrl = ::GetDlgItem( hwnd, IDC_PADDLE ); - TCHAR psz[4] = _T("0"); TCHAR i; for ( i = 0; i < 4; ++i ) @@ -49,12 +56,31 @@ BOOL CConfigPage::OnInitDialog( HWND hwnd ) psz[0] = _T('0') + i; ::SendMessage( hwndCtrl, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)psz ); } + ::SendMessage( hwndCtrl, CB_SETCURSEL, + myGlobalData.settings().getInt("paddle"), 0 ); - ::SendMessage( hwndCtrl, CB_SETCURSEL, m_rGlobalData.PaddleMode(), 0 ); + // Set up Video mode + int videomode = 0; + 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 ); + + // 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() ); // Set up SOUND hwndCtrl = ::GetDlgItem( hwnd, IDC_SOUND ); - ::SendMessage( hwndCtrl, BM_SETCHECK, m_rGlobalData.NoSound() ? BST_CHECKED : BST_UNCHECKED, 0 ); + ::SendMessage( hwndCtrl, BM_SETCHECK, + myGlobalData.settings().getBool("sound") + ? BST_UNCHECKED : BST_CHECKED, 0 ); return TRUE; } @@ -71,20 +97,52 @@ LONG CConfigPage::OnApply( LPPSHNOTIFY lppsn ) // 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 ); ASSERT( hwndCtrl ); - ::GetWindowText( hwndCtrl, m_rGlobalData.m_pszRomDir, MAX_PATH ); + ::GetWindowText( hwndCtrl, buffer, MAX_PATH ); + myGlobalData.settings().setString( "romdir", buffer ); + // Paddle hwndCtrl = ::GetDlgItem( m_hwnd, IDC_PADDLE ); ASSERT( hwndCtrl ); - m_rGlobalData.m_nPaddleMode = ::SendMessage( hwndCtrl, CB_GETCURSEL, 0, 0 ); + myGlobalData.settings().setInt( "paddle", + ::SendMessage( hwndCtrl, CB_GETCURSEL, 0, 0 ) ); + // VideoMode + hwndCtrl = ::GetDlgItem( m_hwnd, IDC_VIDEO ); + ASSERT( hwndCtrl ); + i = ::SendMessage( hwndCtrl, CB_GETCURSEL, 0, 0 ); + if( i == 0 ) + str = "soft"; + else if( i == 1 ) + str = "gl"; + else + str = "soft"; + myGlobalData.settings().setString( "video", str ); + + // AspectRatio + hwndCtrl = ::GetDlgItem( m_hwnd, IDC_ASPECT ); + ASSERT( hwndCtrl ); + ::GetWindowText( hwndCtrl, buffer, MAX_PATH ); + myGlobalData.settings().setString( "gl_aspect", buffer ); + + // Sound hwndCtrl = ::GetDlgItem( m_hwnd, IDC_SOUND ); ASSERT( hwndCtrl ); - m_rGlobalData.m_fNoSound = ( ::SendMessage( hwndCtrl, BM_GETCHECK, 0, 0 ) == BST_CHECKED ); + if( ::SendMessage( hwndCtrl, BM_GETCHECK, 0, 0 ) == BST_CHECKED ) + b = false; + else + b = true; + myGlobalData.settings().setBool( "sound", b ); - m_rGlobalData.SetModified(); + // Finally, save the config file + myGlobalData.settings().saveConfig(); return PSNRET_NOERROR; } diff --git a/stella/src/win32/ConfigPage.hxx b/stella/src/win32/ConfigPage.hxx index c8a0d7b36..cfb1d0c64 100644 --- a/stella/src/win32/ConfigPage.hxx +++ b/stella/src/win32/ConfigPage.hxx @@ -14,12 +14,11 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: ConfigPage.hxx,v 1.2 2004-05-27 22:02:35 stephena Exp $ +// $Id: ConfigPage.hxx,v 1.3 2004-05-28 23:16:26 stephena Exp $ //============================================================================ #ifndef CONFIGPG_H #define CONFIGPG_H -//FIXME #pragma once #include "PropertySheet.hxx" #include "GlobalData.hxx" @@ -37,10 +36,10 @@ class CConfigPage : public CPropertyPage virtual BOOL OnCommand( WORD /* wNotifyCode */, WORD /* wID */, HWND /* hwndCtl */ ); private: - CGlobalData& m_rGlobalData; + CGlobalData& myGlobalData; HWND m_hwnd; - CConfigPage( const CConfigPage& ); // no implementation + CConfigPage( const CConfigPage& ); // no implementation void operator=( const CConfigPage& ); // no implementation }; diff --git a/stella/src/win32/GlobalData.cxx b/stella/src/win32/GlobalData.cxx index 836fb72c4..de6157572 100644 --- a/stella/src/win32/GlobalData.cxx +++ b/stella/src/win32/GlobalData.cxx @@ -14,126 +14,26 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: GlobalData.cxx,v 1.2 2004-05-27 22:02:35 stephena Exp $ +// $Id: GlobalData.cxx,v 1.3 2004-05-28 23:16:26 stephena Exp $ //============================================================================ #include "pch.hxx" -#include "GlobalData.hxx" #include "resource.h" -static LPCTSTR g_pszIniFile = _T(".\\stellax.ini"); -static LPCTSTR g_pszIniSection = _T("Options"); +#include "Settings.hxx" +#include "SettingsWin32.hxx" +#include "GlobalData.hxx" -static LPCTSTR g_pszKeyNameRomPath = _T("RomPath"); -static LPCTSTR g_pszKeyNameFrameRate = _T("FrameRate"); -static LPCTSTR g_pszKeyNameMute = _T("Mute"); -static LPCTSTR g_pszKeyNamePaddle = _T("Paddle"); - -BOOL WritePrivateProfileInt( - LPCTSTR lpAppName, // section name - LPCTSTR lpKeyName, // key name - int nValue, - LPCTSTR lpFileName // initialization file - ) -{ - TCHAR psz[ 50 ]; - - _itoa( nValue, psz, 10 ); - - return ::WritePrivateProfileString( lpAppName, lpKeyName, psz, lpFileName ); -} CGlobalData::CGlobalData( HINSTANCE hInstance ) - : m_hInstance(hInstance), - m_fIsModified( FALSE ) + : myInstance(hInstance) { - m_pszPathName[0] = _T('\0'); - - // Read the ROM directory from the stella.ini file - // default to "ROMS" directory for compatibility with older StellaX - ::GetPrivateProfileString( g_pszIniSection, - g_pszKeyNameRomPath, - _T("ROMS"), - m_pszRomDir, _MAX_PATH, - g_pszIniFile); - - // Read the desired frame rate - m_nDesiredFrameRate = (int)::GetPrivateProfileInt( g_pszIniSection, - g_pszKeyNameFrameRate, - 60, - g_pszIniFile ); - if (m_nDesiredFrameRate < 1 || m_nDesiredFrameRate > 300) - m_nDesiredFrameRate = 60; - - // Read Mute - m_fNoSound = (BOOL)::GetPrivateProfileInt( g_pszIniSection, - g_pszKeyNameMute, - FALSE, - g_pszIniFile ); - - // Read the Paddle mode - m_nPaddleMode = (int)::GetPrivateProfileInt( g_pszIniSection, - g_pszKeyNamePaddle, - 0, - g_pszIniFile); - if ( m_nPaddleMode < 0 || m_nPaddleMode > 3 ) - m_nPaddleMode = 0; - + myPathName[0] = _T('\0'); + mySettings = new SettingsWin32(); } CGlobalData::~CGlobalData() { - // Write out settings (if changed) - if ( m_fIsModified ) - { - // RomPath - ::WritePrivateProfileString( g_pszIniSection, - g_pszKeyNameRomPath, - m_pszRomDir, - g_pszIniFile ); - - // FrameRate - ::WritePrivateProfileInt( g_pszIniSection, - g_pszKeyNameFrameRate, - m_nDesiredFrameRate, - g_pszIniFile ); - - // Mute - ::WritePrivateProfileInt( g_pszIniSection, - g_pszKeyNameMute, - m_fNoSound, - g_pszIniFile ); - - // Paddle - ::WritePrivateProfileInt( g_pszIniSection, - g_pszKeyNamePaddle, - m_nPaddleMode, - g_pszIniFile ); - } + if(mySettings) + delete mySettings; } - -BOOL CGlobalData::ParseCommandLine( - int argc, - TCHAR** argv - ) -{ - // parse arguments - - for (int i = 1; i < argc; ++i) - { - LPCTSTR ctszArg = argv[i]; - - if (ctszArg && (ctszArg[0] != _T('-'))) - { - // assume this is the start rom name - - lstrcpy( m_pszPathName, ctszArg ); - } - else - { - return FALSE; - } - } - - return TRUE; -} \ No newline at end of file diff --git a/stella/src/win32/GlobalData.hxx b/stella/src/win32/GlobalData.hxx index 9f6424075..5b9e4bbb3 100644 --- a/stella/src/win32/GlobalData.hxx +++ b/stella/src/win32/GlobalData.hxx @@ -1,28 +1,30 @@ -//============================================================================ -// -// SSSS tt lll lll -// SS SS tt ll ll -// SS tttttt eeee ll ll aaaa -// SSSS tt ee ee ll ll aa -// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" -// SS SS tt ee ll ll aa aa -// SSSS ttt eeeee llll llll aaaaa -// -// Copyright (c) 1995-2000 by Jeff Miller -// Copyright (c) 2004 by Stephen Anthony -// -// See the file "license" for information on usage and redistribution of -// this file, and for a DISCLAIMER OF ALL WARRANTIES. -// -// $Id: GlobalData.hxx,v 1.2 2004-05-27 22:02:35 stephena Exp $ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2000 by Jeff Miller +// Copyright (c) 2004 by Stephen Anthony +// +// See the file "license" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: GlobalData.hxx,v 1.3 2004-05-28 23:16:26 stephena Exp $ //============================================================================ -#ifndef GLOBALS_H -#define GLOBALS_H +#ifndef GLOBAL_DATA_HXX +#define GLOBAL_DATA_HXX #include "pch.hxx" +#include "bspf.hxx" class CConfigPage; +class Settings; class CGlobalData { @@ -30,70 +32,35 @@ class CGlobalData public: CGlobalData( HINSTANCE hInstance ); - ~CGlobalData( ); + ~CGlobalData( void ); - BOOL ParseCommandLine( int argc, TCHAR* argv[] ); - - int DesiredFrameRate( void ) const - { - return m_nDesiredFrameRate; - } - - // Booleans - BOOL NoSound() const - { - return m_fNoSound; - } - - int PaddleMode( void ) const - { - return m_nPaddleMode; - } - LPCTSTR PathName( void ) const { - if ( m_pszPathName[0] == _T('\0') ) + if ( myPathName[0] == _T('\0') ) return NULL; - return m_pszPathName; + return myPathName; } - LPCTSTR RomDir( void ) const - { - return m_pszRomDir; - } - HINSTANCE ModuleInstance( void ) const { - return m_hInstance; + return myInstance; } - // Modified flags - void SetModified( void ) + Settings& settings( void ) { - m_fIsModified = TRUE; - } - - BOOL IsModified( void ) const - { - return m_fIsModified; + return *mySettings; } private: - // Basic options - TCHAR m_pszRomDir[ MAX_PATH ]; - int m_nPaddleMode; - BOOL m_fNoSound; + Settings* mySettings; - // Advanced options - int m_nDesiredFrameRate; + string myArgumentList; - HINSTANCE m_hInstance; - TCHAR m_pszPathName[ MAX_PATH ]; + HINSTANCE myInstance; + TCHAR myPathName[ MAX_PATH ]; - BOOL m_fIsModified; - - CGlobalData( const CGlobalData& ); // no implementation + CGlobalData( const CGlobalData& ); // no implementation void operator=( const CGlobalData& ); // no implementation }; diff --git a/stella/src/win32/MainDlg.cxx b/stella/src/win32/MainDlg.cxx index 781b1ef62..dbedb72b7 100644 --- a/stella/src/win32/MainDlg.cxx +++ b/stella/src/win32/MainDlg.cxx @@ -1,20 +1,20 @@ -//============================================================================ -// -// SSSS tt lll lll -// SS SS tt ll ll -// SS tttttt eeee ll ll aaaa -// SSSS tt ee ee ll ll aa -// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" -// SS SS tt ee ll ll aa aa -// SSSS ttt eeeee llll llll aaaaa -// -// Copyright (c) 1995-2000 by Jeff Miller -// Copyright (c) 2004 by Stephen Anthony -// -// See the file "license" for information on usage and redistribution of -// this file, and for a DISCLAIMER OF ALL WARRANTIES. -// -// $Id: MainDlg.cxx,v 1.2 2004-05-27 22:02:35 stephena Exp $ +//============================================================================ +// +// SSSS tt lll lll +// SS SS tt ll ll +// SS tttttt eeee ll ll aaaa +// SSSS tt ee ee ll ll aa +// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" +// SS SS tt ee ll ll aa aa +// SSSS ttt eeeee llll llll aaaaa +// +// Copyright (c) 1995-2000 by Jeff Miller +// Copyright (c) 2004 by Stephen Anthony +// +// See the file "license" for information on usage and redistribution of +// this file, and for a DISCLAIMER OF ALL WARRANTIES. +// +// $Id: MainDlg.cxx,v 1.3 2004-05-28 23:16:26 stephena Exp $ //============================================================================ #include "pch.hxx" @@ -25,6 +25,7 @@ #include "DocPage.hxx" #include "ConfigPage.hxx" #include "resource.h" +#include "Settings.hxx" #define BKGND_BITMAP_TOP 64 #define BKGND_BITMAP_BOTTOM 355 @@ -46,7 +47,7 @@ inline LPARAM ListView_GetItemData( HWND hwndList, int iItem ) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CMainDlg::CMainDlg( CGlobalData& rGlobalData, HINSTANCE hInstance ) - : m_rGlobalData(rGlobalData), + : myGlobalData(rGlobalData), m_hInstance(hInstance) { } @@ -271,7 +272,8 @@ BOOL CMainDlg::OnInitDialog( void ) SetDlgItemText( hwnd, IDC_ROMCOUNT, psz ); // Show rom path - SetDlgItemText( hwnd, IDC_ROMPATH, m_rGlobalData.RomDir() ); + SetDlgItemText( hwnd, IDC_ROMPATH, + myGlobalData.settings().getString("romdir").c_str() ); // Set default button ::SendMessage( hwnd, DM_SETDEFID, IDC_PLAY, 0 ); @@ -306,7 +308,7 @@ BOOL CMainDlg::OnCommand( int id, HWND hwndCtl, UINT codeNotify ) pListData = (CListData*)ListView_GetItemData( m_hwndList, nItem ); TCHAR pszPathName[ MAX_PATH + 1 ]; - lstrcpy( pszPathName, m_rGlobalData.RomDir() ); + lstrcpy( pszPathName, myGlobalData.settings().getString("romdir").c_str() ); lstrcat( pszPathName, _T("\\") ); lstrcat( pszPathName, pListData->GetTextForColumn( CListData::FILENAME_COLUMN ) ); @@ -316,7 +318,7 @@ BOOL CMainDlg::OnCommand( int id, HWND hwndCtl, UINT codeNotify ) (void)m_stella.PlayROM( hwnd, pszPathName, pListData->GetTextForColumn( CListData::NAME_COLUMN ), - m_rGlobalData ); + myGlobalData ); ::EnableWindow( hwnd, TRUE ); @@ -336,7 +338,7 @@ BOOL CMainDlg::OnCommand( int id, HWND hwndCtl, UINT codeNotify ) { CPropertySheet ps( _T("Configure"), hwnd ); - CConfigPage pgConfig( m_rGlobalData ); + CConfigPage pgConfig( myGlobalData ); ps.AddPage( &pgConfig ); (void)ps.DoModal(); @@ -490,7 +492,7 @@ DWORD CMainDlg::PopulateRomList( void ) TCHAR pszPath[ MAX_PATH ]; - lstrcpy( pszPath, m_rGlobalData.RomDir() ); + lstrcpy( pszPath, myGlobalData.settings().getString("romdir").c_str() ); lstrcat( pszPath, _T("\\*.bin") ); WIN32_FIND_DATA ffd; @@ -580,7 +582,7 @@ DWORD CMainDlg::ReadRomData( TCHAR pszPath[MAX_PATH + 1]; - lstrcpy( pszPath, m_rGlobalData.RomDir() ); + lstrcpy( pszPath, myGlobalData.RomDir() ); lstrcat( pszPath, _T("\\") ); lstrcat( pszPath, pListData->GetTextForColumn( CListData::FILENAME_COLUMN ) ); diff --git a/stella/src/win32/MainDlg.hxx b/stella/src/win32/MainDlg.hxx index 5504cb553..5b9718bb5 100644 --- a/stella/src/win32/MainDlg.hxx +++ b/stella/src/win32/MainDlg.hxx @@ -248,7 +248,7 @@ private: // Stella stuff - CGlobalData& m_rGlobalData; + CGlobalData& myGlobalData; CStellaXMain m_stella; CMainDlg( const CMainDlg& ); // no implementation diff --git a/stella/src/win32/SettingsWin32.cxx b/stella/src/win32/SettingsWin32.cxx index d6e5b38e5..8d6360fe0 100644 --- a/stella/src/win32/SettingsWin32.cxx +++ b/stella/src/win32/SettingsWin32.cxx @@ -13,16 +13,16 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: SettingsWin32.cxx,v 1.2 2004-05-28 22:07:57 stephena Exp $ +// $Id: SettingsWin32.cxx,v 1.3 2004-05-28 23:16:26 stephena Exp $ //============================================================================ -#include +//#include #include #include -#include -#include -#include +//#include +//#include +//#include #include "bspf.hxx" #include "Settings.hxx" @@ -44,8 +44,8 @@ SettingsWin32::SettingsWin32() myUserPropertiesFile = stelladir + "stella.pro"; mySystemPropertiesFile = stelladir + "stella.pro"; - myUserConfigFile = stelladir + "stellarc"; - mySystemConfigFile = stelladir + "stellarc"; + myUserConfigFile = stelladir + "stella.ini"; + mySystemConfigFile = stelladir + "stella.ini"; // Set up the names of the input and output config files mySettingsOutputFilename = myUserConfigFile; @@ -58,6 +58,7 @@ SettingsWin32::SettingsWin32() myStateFile = ""; // Now create Win32 specific settings + set("romdir", "roms"); set("accurate", "false"); // Don't change this, or the sound will skip #ifdef SNAPSHOT_SUPPORT set("ssdir", ".\\"); diff --git a/stella/src/win32/SettingsWin32.hxx b/stella/src/win32/SettingsWin32.hxx index 4b7fbbd0f..7ca46adfb 100644 --- a/stella/src/win32/SettingsWin32.hxx +++ b/stella/src/win32/SettingsWin32.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: SettingsWin32.hxx,v 1.2 2004-05-28 22:07:57 stephena Exp $ +// $Id: SettingsWin32.hxx,v 1.3 2004-05-28 23:16:26 stephena Exp $ //============================================================================ #ifndef SETTINGS_WIN32_HXX @@ -26,7 +26,7 @@ This class defines Windows system specific settings. @author Stephen Anthony - @version $Id: SettingsWin32.hxx,v 1.2 2004-05-28 22:07:57 stephena Exp $ + @version $Id: SettingsWin32.hxx,v 1.3 2004-05-28 23:16:26 stephena Exp $ */ class SettingsWin32 : public Settings { @@ -51,7 +51,7 @@ class SettingsWin32 : public Settings @return String representing the full path of the state filename. */ - virtual string stateFilename(const string& md5, uInt32 state) = 0; + virtual string stateFilename(const string& md5, uInt32 state); /** This method should be called to test whether the given file exists. @@ -60,7 +60,7 @@ class SettingsWin32 : public Settings @return boolean representing whether or not the file exists */ - virtual bool fileExists(const string& filename) = 0; + virtual bool fileExists(const string& filename); /** Display the commandline settings for this UNIX version of Stella. diff --git a/stella/src/win32/Stella.vcproj b/stella/src/win32/Stella.vcproj index 5e0928032..9d3315d19 100755 --- a/stella/src/win32/Stella.vcproj +++ b/stella/src/win32/Stella.vcproj @@ -20,8 +20,8 @@ + + + + @@ -604,6 +610,18 @@ RelativePath="Wnd.hxx"> + + + + + + + diff --git a/stella/src/win32/main.cxx b/stella/src/win32/main.cxx index add04e9a2..fa16d4e87 100644 --- a/stella/src/win32/main.cxx +++ b/stella/src/win32/main.cxx @@ -14,7 +14,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: main.cxx,v 1.2 2004-05-27 22:02:35 stephena Exp $ +// $Id: main.cxx,v 1.3 2004-05-28 23:16:26 stephena Exp $ //============================================================================ #include "pch.hxx" @@ -66,8 +66,6 @@ int WINAPI _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, UNUSED_ALWAYS( lpCmdLine ); UNUSED_ALWAYS( nCmdShow ); - DWORD dwRet; - (void)::DeleteFile(g_ctszDebugLog); CSingleInstance mutex( _T("StellaXMutex") ); @@ -83,36 +81,11 @@ int WINAPI _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, ::InitCommonControls(); - BOOL fOk = FALSE; CGlobalData globaldata( hInstance ); - fOk = globaldata.ParseCommandLine( __argc, __argv ); - if (!fOk) - { - MessageBox( hInstance, NULL, IDS_BADARGUMENT ); - } - else - { - LPCTSTR ctszPathName = globaldata.PathName(); - if (ctszPathName != NULL) - { - // a filename was given on the commandline, skip the UI - CStellaXMain stellax; - - dwRet = stellax.Initialize(); - if ( dwRet != ERROR_SUCCESS ) - MessageBoxFromWinError( dwRet, _T("CStellaX::Initialize") ); - else - dwRet = stellax.PlayROM( GetDesktopWindow(), ctszPathName, - _T("StellaX"), globaldata ); - } - else - { - // show the ui - CMainDlg dlg( globaldata, hInstance ); - dlg.DoModal( NULL ); - } - } + // show the ui + CMainDlg dlg( globaldata, hInstance ); + dlg.DoModal( NULL ); if ( hrCoInit == S_OK ) ::CoUninitialize(); diff --git a/stella/src/win32/resource.h b/stella/src/win32/resource.h index 70646b877..d6f44d6db 100644 --- a/stella/src/win32/resource.h +++ b/stella/src/win32/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by Stella.rc +// Microsoft Visual C++ generated include file. +// Used by stella.rc // #define IDB_TILE 101 #define IDI_APP 102 @@ -66,9 +66,11 @@ #define IDC_CONFIG 1015 #define IDC_PADDLE 1017 #define IDC_SOUND 1018 -#define IDC_JOYSTICK 1019 -#define IDC_AUTO_SELECT_VIDEOMODE 1020 -#define IDC_BROWSE 1021 +#define IDC_VOLUME 1019 +#define IDC_VIDEO 1020 +#define IDC_ASPECT 1021 +#define IDC_BROWSE 1022 +#define IDC_EDIT2 1027 #define IDC_INSTRUCTIONS 2000 #define IDC_ADOBE 2001 #define ID_FILE_EXIT 32771 @@ -79,7 +81,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 296 #define _APS_NEXT_COMMAND_VALUE 32772 -#define _APS_NEXT_CONTROL_VALUE 1022 +#define _APS_NEXT_CONTROL_VALUE 1028 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/stella/src/win32/stella.aps b/stella/src/win32/stella.aps index 1aef85e82..5136fefc9 100755 Binary files a/stella/src/win32/stella.aps and b/stella/src/win32/stella.aps differ diff --git a/stella/src/win32/stella.rc b/stella/src/win32/stella.rc index 1126aafff..43facee09 100755 --- a/stella/src/win32/stella.rc +++ b/stella/src/win32/stella.rc @@ -75,12 +75,12 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "This version of StellaX is not to be sold without written permission of the author" - VALUE "CompanyName", "Jeff Miller (miller@zipcon.net)" + VALUE "Comments", "This version of StellaX is released under the GPL." + VALUE "CompanyName", "Stephen Anthony (stephena@users.sourceforge.net)" VALUE "FileDescription", "StellaX" VALUE "FileVersion", "1, 4, 0, 0" VALUE "InternalName", "StellaX" - VALUE "LegalCopyright", "Copyright (C) 2004 Stephen Anthony" + VALUE "LegalCopyright", "Copyright (C) 2004 Jeff Miller, Copyright (C) 2004 Stephen Anthony" VALUE "LegalTrademarks", "n/a" VALUE "OriginalFilename", "StellaX.exe" VALUE "PrivateBuild", "n/a" @@ -176,32 +176,31 @@ BEGIN LTEXT "Dedicated To:",-1,7,94,46,8 END -IDD_CONFIG_PAGE DIALOG 0, 0, 390, 196 -STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +IDD_CONFIG_PAGE DIALOGEX 0, 0, 306, 199 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Options" -FONT 8, "MS Shell Dlg" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN LTEXT "&ROM (.bin) file path:",-1,7,10,64,8 - EDITTEXT IDC_ROMPATH,82,7,246,14,ES_AUTOHSCROLL - PUSHBUTTON "&Browse...",IDC_BROWSE,333,7,50,14 + 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,376,8 - CONTROL "",-1,"Static",SS_ETCHEDHORZ,7,39,376,1 - LTEXT "Mouse should emulate &paddle:",-1,7,49,97,8 - COMBOBOX IDC_PADDLE,109,46,48,82,CBS_DROPDOWNLIST | WS_VSCROLL | + -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 | 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,65,333,8 - CONTROL "",-1,"Static",SS_ETCHEDHORZ,8,82,375,1 - CONTROL "&Auto select video mode",IDC_AUTO_SELECT_VIDEOMODE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,90,10 - LTEXT "If this is not checked, then a standard video mode (640x480) will be used. Otherwise, StellaX will use the video mode which it believes will work best. You should only uncheck this if you are having video problems while running StellaX.", - -1,7,105,376,18 - CONTROL "",-1,"Static",SS_ETCHEDHORZ,7,129,374,1 + -1,7,66,198,18 CONTROL "Disable &Sound",IDC_SOUND,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,141,62,10 - CONTROL "Disable &Joysticks",IDC_JOYSTICK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,155,70,10 + 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 | + 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 END @@ -240,9 +239,9 @@ BEGIN IDD_CONFIG_PAGE, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 383 + RIGHTMARGIN, 299 TOPMARGIN, 7 - BOTTOMMARGIN, 189 + BOTTOMMARGIN, 192 END END #endif // APSTUDIO_INVOKED diff --git a/stella/src/win32/stellax.ini b/stella/src/win32/stellax.ini deleted file mode 100644 index d67762434..000000000 --- a/stella/src/win32/stellax.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Options] -RomPath=C:\Dell -FrameRate=60 -Mute=1 -Paddle=3