NUKED DDraw even more

FIXED here and there
This commit is contained in:
spacy51 2008-01-17 12:47:36 +00:00
parent 3cfe0250a5
commit c1d8e1f9e4
18 changed files with 175 additions and 1073 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="8,00"
Name="VisualBoyAdvance"
ProjectGUID="{6D4C5EC8-933F-4C05-A1BF-498E658576DF}"
RootNamespace="VBA"
@ -129,6 +129,115 @@
ExcludedFromBuild="true"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
ConfigurationType="1"
UseOfMFC="1"
CharacterSet="2"
BuildLogFile="$(IntDir)\$(ProjectName)_BuildLog.htm"
>
<Tool
Name="VCPreBuildEventTool"
ExcludedFromBuild="true"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="MASM"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP"
Optimization="0"
AdditionalIncludeDirectories="..\dependencies\zlib;..\dependencies\libpng\src;&quot;..\dependencies\File_Extractor-0.4.3\fex&quot;;..\dependencies\cximage;..\dependencies\msvc"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;BKPT_SUPPORT;GBA_LOGGING;C_CORE;NO_ASM"
StringPooling="false"
MinimalRebuild="true"
BasicRuntimeChecks="3"
SmallerTypeCheck="false"
RuntimeLibrary="1"
StructMemberAlignment="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="false"
EnableEnhancedInstructionSet="0"
TreatWChar_tAsBuiltInType="false"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories=""
/>
<Tool
Name="VCPreLinkEventTool"
ExcludedFromBuild="true"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="nafxcwd.lib LIBCMTD.lib dinput8.lib dxguid.lib ddraw.lib winmm.lib Dsound.lib"
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
Version=""
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateManifest="true"
AdditionalManifestDependencies="type=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;amd64&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
IgnoreDefaultLibraryNames="nafxcwd.lib;LIBCMTD.lib"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="1"
EnableCOMDATFolding="1"
OptimizeForWindows98="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
ExcludedFromBuild="true"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
@ -251,115 +360,6 @@
ExcludedFromBuild="true"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
ConfigurationType="1"
UseOfMFC="1"
CharacterSet="2"
BuildLogFile="$(IntDir)\$(ProjectName)_BuildLog.htm"
>
<Tool
Name="VCPreBuildEventTool"
ExcludedFromBuild="true"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="MASM"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP"
Optimization="0"
AdditionalIncludeDirectories="..\dependencies\zlib;..\dependencies\libpng\src;&quot;..\dependencies\File_Extractor-0.4.3\fex&quot;;..\dependencies\cximage;..\dependencies\msvc"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;BKPT_SUPPORT;GBA_LOGGING;C_CORE;NO_ASM"
StringPooling="false"
MinimalRebuild="true"
BasicRuntimeChecks="3"
SmallerTypeCheck="false"
RuntimeLibrary="1"
StructMemberAlignment="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="false"
EnableEnhancedInstructionSet="0"
TreatWChar_tAsBuiltInType="false"
UsePrecompiledHeader="0"
ProgramDataBaseFileName="$(IntDir)\$(ProjectName).pdb"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories=""
/>
<Tool
Name="VCPreLinkEventTool"
ExcludedFromBuild="true"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="nafxcwd.lib LIBCMTD.lib dinput8.lib dxguid.lib ddraw.lib winmm.lib Dsound.lib"
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
Version=""
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateManifest="true"
AdditionalManifestDependencies="type=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;amd64&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
IgnoreDefaultLibraryNames="nafxcwd.lib;LIBCMTD.lib"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="1"
EnableCOMDATFolding="1"
OptimizeForWindows98="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
ExcludedFromBuild="true"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
@ -528,16 +528,6 @@
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -d__DJGPP__ -O1 -fwin32 -Xvc -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
@ -549,6 +539,16 @@
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -d__DJGPP__ -O1 -fwin32 -Xvc -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
@ -965,10 +965,6 @@
RelativePath=".\src\win32\MemoryViewerDlg.cpp"
>
</File>
<File
RelativePath=".\src\win32\ModeConfirm.cpp"
>
</File>
<File
RelativePath=".\src\win32\OALConfig.cpp"
>
@ -1021,10 +1017,6 @@
RelativePath=".\src\win32\TileView.cpp"
>
</File>
<File
RelativePath=".\src\win32\VideoMode.cpp"
>
</File>
<File
RelativePath=".\src\win32\WavWriter.cpp"
>
@ -1149,7 +1141,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
@ -1157,7 +1149,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
@ -1535,10 +1527,6 @@
RelativePath=".\src\win32\MemoryViewerDlg.h"
>
</File>
<File
RelativePath=".\src\win32\ModeConfirm.h"
>
</File>
<File
RelativePath=".\src\win32\OALConfig.h"
>
@ -1591,10 +1579,6 @@
RelativePath=".\src\win32\UniVideoModeDlg.h"
>
</File>
<File
RelativePath=".\src\win32\VideoMode.h"
>
</File>
<File
RelativePath=".\src\win32\WavWriter.h"
>
@ -1858,6 +1842,14 @@
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
@ -1868,14 +1860,6 @@
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
@ -1898,6 +1882,14 @@
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
@ -1908,14 +1900,6 @@
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
@ -1938,6 +1922,14 @@
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
@ -1948,14 +1940,6 @@
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
@ -1978,6 +1962,14 @@
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
@ -1988,14 +1980,6 @@
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
@ -2017,7 +2001,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
@ -2025,7 +2009,7 @@
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool

View File

@ -132,7 +132,6 @@ struct {
{ "OptionsEmulatorShowSpeedDetailed", ID_OPTIONS_EMULATOR_SHOWSPEED_DETAILED },
{ "OptionsEmulatorShowSpeedTransparent", ID_OPTIONS_EMULATOR_SHOWSPEED_TRANSPARENT },
{ "OptionsEmulatorSpeedupToggle", ID_OPTIONS_EMULATOR_SPEEDUPTOGGLE },
{ "OptionsEmulatorAutoHideMenu", ID_OPTIONS_EMULATOR_AUTOHIDEMENU },
{ "OptionsEmulatorSaveAuto", ID_OPTIONS_EMULATOR_SAVETYPE_AUTOMATIC },
{ "OptionsEmulatorSaveEEPROM", ID_OPTIONS_EMULATOR_SAVETYPE_EEPROM },
{ "OptionsEmulatorSaveSRAM", ID_OPTIONS_EMULATOR_SAVETYPE_SRAM },

View File

@ -33,7 +33,6 @@ class IDisplay {
struct VIDEO_MODE
{
GUID *adapter_ddraw;
unsigned int adapter;
unsigned int width;
unsigned int height;
@ -44,7 +43,6 @@ class IDisplay {
virtual bool initialize() = 0;
virtual void cleanup() = 0;
virtual void render() = 0;
virtual void checkFullScreen() {};
virtual void clear() = 0;
virtual bool changeRenderSize(int w, int h) { return true; };
virtual void resize(int w, int h) {};

View File

@ -486,7 +486,6 @@ void systemGbPrint(u8 *data,
int palette,
int contrast)
{
theApp.winCheckFullscreen();
GBPrinterDlg printer;
printer.processData(data);
printer.DoModal();

View File

@ -52,8 +52,6 @@
static char THIS_FILE[] = __FILE__;
#endif
#define VBA_CONFIRM_MODE WM_APP + 100
extern void remoteCleanUp();
extern int gbHardware;
@ -191,8 +189,6 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_REALTIMECLOCK, OnUpdateOptionsEmulatorRealtimeclock)
ON_COMMAND(ID_OPTIONS_EMULATOR_GENERICFLASHCARD, OnOptionsEmulatorGenericflashcard)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_GENERICFLASHCARD, OnUpdateOptionsEmulatorGenericflashcard)
ON_COMMAND(ID_OPTIONS_EMULATOR_AUTOHIDEMENU, OnOptionsEmulatorAutohidemenu)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_AUTOHIDEMENU, OnUpdateOptionsEmulatorAutohidemenu)
ON_COMMAND(ID_OPTIONS_EMULATOR_REWINDINTERVAL, OnOptionsEmulatorRewindinterval)
ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_AUTOMATIC, OnOptionsEmulatorSavetypeAutomatic)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_AUTOMATIC, OnUpdateOptionsEmulatorSavetypeAutomatic)
@ -417,7 +413,6 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_JOYPAD_DEFAULTJOYPAD_1, ID_OPTIONS_JOYPAD_DEFAULTJOYPAD_4, OnUpdateOptionsJoypadDefault)
ON_COMMAND_EX_RANGE(ID_OPTIONS_JOYPAD_AUTOFIRE_A, ID_OPTIONS_JOYPAD_AUTOFIRE_R, OnOptionsJoypadAutofire)
ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_JOYPAD_AUTOFIRE_A, ID_OPTIONS_JOYPAD_AUTOFIRE_R, OnUpdateOptionsJoypadAutofire)
ON_MESSAGE(VBA_CONFIRM_MODE, OnConfirmMode)
ON_MESSAGE(WM_SYSCOMMAND, OnMySysCommand)
ON_COMMAND(ID_OPTIONS_SOUND_HARDWAREACCELERATION, &MainWnd::OnOptionsSoundHardwareacceleration)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_HARDWAREACCELERATION, &MainWnd::OnUpdateOptionsSoundHardwareacceleration)
@ -644,9 +639,6 @@ bool MainWnd::FileRun()
theApp.updateFrameSkip();
if(theApp.autoHideMenu && theApp.videoOption > VIDEO_4X && theApp.menuToggle)
OnFileTogglemenu();
emulating = true;
if(theApp.autoLoadMostRecent)

View File

@ -56,7 +56,6 @@ class MainWnd : public CWnd
void screenCapture(int captureNumber);
HACCEL m_hAccelTable;
bool fileOpenSelect( int system );
afx_msg LRESULT OnConfirmMode(WPARAM, LPARAM);
afx_msg LRESULT OnMySysCommand(WPARAM, LPARAM);
afx_msg void OnUpdateFileLoadGameSlot(CCmdUI *pCmdUI);
afx_msg void OnUpdateFileSaveGameSlot(CCmdUI *pCmdUI);
@ -78,7 +77,6 @@ class MainWnd : public CWnd
afx_msg void OnSystemMinimize();
afx_msg void OnUpdateVideoLayer(CCmdUI* pCmdUI);
afx_msg BOOL OnVideoLayer(UINT nID);
void winConfirmMode();
afx_msg BOOL OnOptionVideoSize(UINT nID);
afx_msg BOOL OnOptionsFrameskip(UINT nID);
bool fileImportGSACodeFile(CString& fileName);
@ -225,8 +223,6 @@ class MainWnd : public CWnd
afx_msg void OnUpdateOptionsEmulatorRealtimeclock(CCmdUI* pCmdUI);
afx_msg void OnOptionsEmulatorGenericflashcard();
afx_msg void OnUpdateOptionsEmulatorGenericflashcard(CCmdUI* pCmdUI);
afx_msg void OnOptionsEmulatorAutohidemenu();
afx_msg void OnUpdateOptionsEmulatorAutohidemenu(CCmdUI* pCmdUI);
afx_msg void OnOptionsEmulatorRewindinterval();
afx_msg void OnOptionsEmulatorSavetypeAutomatic();
afx_msg void OnUpdateOptionsEmulatorSavetypeAutomatic(CCmdUI* pCmdUI);

View File

@ -33,7 +33,6 @@ extern int emulating;
void MainWnd::OnCheatsSearchforcheats()
{
theApp.winCheckFullscreen();
if(theApp.cartridgeType == 0) {
GBACheatSearch dlg;
dlg.DoModal();
@ -50,7 +49,6 @@ void MainWnd::OnUpdateCheatsSearchforcheats(CCmdUI* pCmdUI)
void MainWnd::OnCheatsCheatlist()
{
theApp.winCheckFullscreen();
if(theApp.cartridgeType == 0) {
GBACheatList dlg;
dlg.DoModal();
@ -77,7 +75,6 @@ void MainWnd::OnUpdateCheatsAutomaticsaveloadcheats(CCmdUI* pCmdUI)
void MainWnd::OnCheatsLoadcheatlist()
{
theApp.winCheckFullscreen();
CString buffer;
CString filename;
@ -116,7 +113,6 @@ void MainWnd::OnUpdateCheatsLoadcheatlist(CCmdUI* pCmdUI)
void MainWnd::OnCheatsSavecheatlist()
{
theApp.winCheckFullscreen();
CString buffer;
CString filename;

View File

@ -44,7 +44,6 @@ extern void InterframeCleanup();
void MainWnd::OnFileOpen()
{
theApp.winCheckFullscreen();
if( fileOpenSelect( 0 ) ) {
FileRun();
}
@ -166,7 +165,6 @@ void MainWnd::OnUpdateFileClose(CCmdUI* pCmdUI)
void MainWnd::OnFileOpengameboy()
{
theApp.winCheckFullscreen();
if( fileOpenSelect( 2 ) ) {
FileRun();
}
@ -175,7 +173,6 @@ void MainWnd::OnFileOpengameboy()
void MainWnd::OnFileOpenGbc()
{
theApp.winCheckFullscreen();
if( fileOpenSelect( 1 ) ) {
FileRun();
}
@ -184,7 +181,6 @@ void MainWnd::OnFileOpenGbc()
void MainWnd::OnFileLoad()
{
theApp.winCheckFullscreen();
CString buffer;
CString filename;
@ -293,7 +289,6 @@ BOOL MainWnd::OnFileLoadSlot(UINT nID)
void MainWnd::OnFileSave()
{
theApp.winCheckFullscreen();
CString buffer;
CString filename;
@ -390,7 +385,6 @@ BOOL MainWnd::OnFileSaveSlot(UINT nID)
void MainWnd::OnFileImportBatteryfile()
{
theApp.winCheckFullscreen();
LPCTSTR exts[] = { ".sav", ".dat" };
CString filter = winLoadFilter(IDS_FILTER_SAV);
CString title = winResLoadString(IDS_SELECT_BATTERY_FILE);
@ -442,7 +436,6 @@ void MainWnd::OnUpdateFileImportBatteryfile(CCmdUI* pCmdUI)
void MainWnd::OnFileImportGamesharkcodefile()
{
theApp.winCheckFullscreen();
LPCTSTR exts[] = { "" };
CString filter = theApp.cartridgeType == 0 ? winLoadFilter(IDS_FILTER_SPC) : winLoadFilter(IDS_FILTER_GCF);
CString title = winResLoadString(IDS_SELECT_CODE_FILE);
@ -476,7 +469,6 @@ void MainWnd::OnUpdateFileImportGamesharkcodefile(CCmdUI* pCmdUI)
void MainWnd::OnFileImportGamesharksnapshot()
{
theApp.winCheckFullscreen();
LPCTSTR exts[] = { ".gbs" };
CString filter = theApp.cartridgeType == 1 ? winLoadFilter(IDS_FILTER_GBS) : winLoadFilter(IDS_FILTER_SPS);
CString title = winResLoadString(IDS_SELECT_SNAPSHOT_FILE);
@ -507,7 +499,6 @@ void MainWnd::OnUpdateFileImportGamesharksnapshot(CCmdUI* pCmdUI)
void MainWnd::OnFileExportBatteryfile()
{
theApp.winCheckFullscreen();
CString name;
int index = theApp.filename.ReverseFind('\\');
@ -570,7 +561,6 @@ void MainWnd::OnUpdateFileExportBatteryfile(CCmdUI* pCmdUI)
void MainWnd::OnFileExportGamesharksnapshot()
{
theApp.winCheckFullscreen();
if(eepromInUse) {
systemMessage(IDS_EEPROM_NOT_SUPPORTED, "EEPROM saves cannot be exported");
return;
@ -618,7 +608,6 @@ void MainWnd::OnUpdateFileExportGamesharksnapshot(CCmdUI* pCmdUI)
void MainWnd::OnFileScreencapture()
{
theApp.winCheckFullscreen();
CString name;
CString filename;
@ -686,7 +675,6 @@ void MainWnd::OnUpdateFileScreencapture(CCmdUI* pCmdUI)
void MainWnd::OnFileRominformation()
{
theApp.winCheckFullscreen();
if(theApp.cartridgeType == 0) {
RomInfoGBA dlg(rom);
dlg.DoModal();
@ -703,34 +691,13 @@ void MainWnd::OnUpdateFileRominformation(CCmdUI* pCmdUI)
void MainWnd::OnFileTogglemenu()
{
if(theApp.videoOption <= VIDEO_4X) {
theApp.updateWindowSize( theApp.lastFullscreen );
return;
}
if(( theApp.renderMethod != -1 )) { //either D3D OR OGL
// display API does not support GDI objects in fullscreen
theApp.updateWindowSize( theApp.lastWindowed );
return;
}
theApp.menuToggle = !theApp.menuToggle;
if(theApp.menuToggle) {
theApp.updateMenuBar();
if(theApp.tripleBuffering) {
if(theApp.display)
theApp.display->checkFullScreen();
DrawMenuBar();
}
} else {
SetMenu(NULL);
DestroyMenu(theApp.menu);
}
theApp.adjustDestRect();
if(theApp.display)
theApp.display->resize(theApp.dest.right-theApp.dest.left, theApp.dest.bottom-theApp.dest.top);
if( theApp.videoOption <= VIDEO_4X ) {
// switch to full screen
theApp.updateWindowSize( theApp.lastFullscreen );
} else {
// switch to windowed mode
theApp.updateWindowSize( theApp.lastWindowed );
}
}
void MainWnd::OnUpdateFileTogglemenu(CCmdUI* pCmdUI)

View File

@ -25,7 +25,6 @@ extern int emulating;
void MainWnd::OnHelpAbout()
{
theApp.winCheckFullscreen();
AboutDialog dlg;
dlg.DoModal();

View File

@ -27,7 +27,6 @@
#include "GBColorDlg.h"
#include "Joypad.h"
#include "MaxScale.h"
#include "ModeConfirm.h"
#include "Reg.h"
#include "RewindInterval.h"
#include "skin.h"
@ -50,8 +49,6 @@
extern int emulating;
#define VBA_CONFIRM_MODE WM_APP + 100
extern void CPUUpdateRenderBuffers(bool force);
@ -337,8 +334,6 @@ void MainWnd::OnOptionsVideoFullscreen1280x1024()
void MainWnd::OnOptionsVideoFullscreen()
{
theApp.winCheckFullscreen();
IDisplay::VIDEO_MODE mode;
ZeroMemory( &mode, sizeof(IDisplay::VIDEO_MODE) );
@ -347,7 +342,6 @@ void MainWnd::OnOptionsVideoFullscreen()
( mode.height != theApp.fsHeight ) ||
( mode.bitDepth != theApp.fsColorDepth ) ||
( mode.frequency != theApp.fsFrequency ) ||
( mode.adapter_ddraw != theApp.pVideoDriverGUID ) ||
( mode.adapter != theApp.fsAdapter ) ||
( theApp.videoOption != VIDEO_OTHER ) )
{
@ -356,16 +350,7 @@ void MainWnd::OnOptionsVideoFullscreen()
theApp.fsHeight = mode.height;
theApp.fsFrequency = mode.frequency;
theApp.fsColorDepth = mode.bitDepth;
theApp.pVideoDriverGUID = mode.adapter_ddraw;
theApp.fsAdapter = mode.adapter;
if( mode.adapter_ddraw ) {
theApp.videoDriverGUID = *mode.adapter_ddraw;
regSetDwordValue( "defaultVideoDriver", FALSE );
regSetBinaryValue( "videoDriverGUID",
(char *)mode.adapter_ddraw, sizeof(GUID) );
} else {
regSetDwordValue( "defaultVideoDriver", TRUE );
}
theApp.updateVideoSize( ID_OPTIONS_VIDEO_FULLSCREEN );
}
}
@ -589,14 +574,12 @@ void MainWnd::OnOptionsVideoRenderingoptionsGLSLShaders()
void MainWnd::OnOptionsEmulatorAssociate()
{
theApp.winCheckFullscreen();
Associate dlg;
dlg.DoModal();
}
void MainWnd::OnOptionsEmulatorDirectories()
{
theApp.winCheckFullscreen();
Directories dlg;
dlg.DoModal();
}
@ -673,11 +656,6 @@ void MainWnd::OnUpdateOptionsEmulatorRealtimeclock(CCmdUI* pCmdUI)
pCmdUI->SetCheck(theApp.winRtcEnable);
}
void MainWnd::OnOptionsEmulatorAutohidemenu()
{
theApp.autoHideMenu = !theApp.autoHideMenu;
}
void MainWnd::OnOptionsEmulatorGenericflashcard()
{
if(emulating && theApp.cartridgeType == IMAGE_GB)
@ -694,12 +672,6 @@ void MainWnd::OnUpdateOptionsEmulatorGenericflashcard(CCmdUI* pCmdUI)
pCmdUI->Enable(emulating && theApp.cartridgeType == IMAGE_GB);
}
void MainWnd::OnUpdateOptionsEmulatorAutohidemenu(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(theApp.autoHideMenu);
}
void MainWnd::OnOptionsEmulatorRewindinterval()
{
RewindInterval dlg(theApp.rewindTimer/6);
@ -1271,7 +1243,6 @@ void MainWnd::OnUpdateOptionsGameboyGameboycolors(CCmdUI* pCmdUI)
void MainWnd::OnOptionsGameboyColors()
{
theApp.winCheckFullscreen();
GBColorDlg dlg;
if(dlg.DoModal()) {
gbPaletteOption = dlg.getWhich();
@ -1536,7 +1507,6 @@ void MainWnd::OnUpdateOptionsLanguageEnglish(CCmdUI* pCmdUI)
void MainWnd::OnOptionsLanguageOther()
{
theApp.winCheckFullscreen();
theApp.winSetLanguageOption(2, false);
theApp.winAccelMgr.UpdateMenu(theApp.menu);
}
@ -1549,7 +1519,6 @@ void MainWnd::OnUpdateOptionsLanguageOther(CCmdUI* pCmdUI)
void MainWnd::OnOptionsJoypadConfigure1()
{
theApp.winCheckFullscreen();
JoypadConfig dlg(0);
dlg.DoModal();
}
@ -1561,7 +1530,6 @@ void MainWnd::OnUpdateOptionsJoypadConfigure1(CCmdUI* pCmdUI)
void MainWnd::OnOptionsJoypadConfigure2()
{
theApp.winCheckFullscreen();
JoypadConfig dlg(1);
dlg.DoModal();
}
@ -1573,7 +1541,6 @@ void MainWnd::OnUpdateOptionsJoypadConfigure2(CCmdUI* pCmdUI)
void MainWnd::OnOptionsJoypadConfigure3()
{
theApp.winCheckFullscreen();
JoypadConfig dlg(2);
dlg.DoModal();
}
@ -1585,7 +1552,6 @@ void MainWnd::OnUpdateOptionsJoypadConfigure3(CCmdUI* pCmdUI)
void MainWnd::OnOptionsJoypadConfigure4()
{
theApp.winCheckFullscreen();
JoypadConfig dlg(3);
dlg.DoModal();
}
@ -1608,7 +1574,6 @@ void MainWnd::OnUpdateOptionsJoypadDefault(CCmdUI *pCmdUI)
void MainWnd::OnOptionsJoypadMotionconfigure()
{
theApp.winCheckFullscreen();
MotionConfig dlg;
dlg.DoModal();
}
@ -1683,33 +1648,10 @@ void MainWnd::OnUpdateOptionsJoypadAutofire(CCmdUI *pCmdUI)
pCmdUI->SetCheck(check);
}
LRESULT MainWnd::OnConfirmMode(WPARAM, LPARAM)
{
// we need to do this separately or the window will not have the right
// parent. must be related to the way MFC does modal dialogs
winConfirmMode();
return 0;
}
void MainWnd::winConfirmMode()
{
if( theApp.videoOption > VIDEO_4X ) {
theApp.winCheckFullscreen();
ModeConfirm dlg(theApp.m_pMainWnd);
if(!dlg.DoModal()) {
theApp.updateVideoSize(ID_OPTIONS_VIDEO_X2);
}
}
theApp.winAccelMgr.UpdateMenu(theApp.menu);
}
void MainWnd::OnOptionsVideoFullscreenmaxscale()
{
MaxScale dlg;
theApp.winCheckFullscreen();
dlg.DoModal();
if( theApp.display ) {
@ -1967,8 +1909,6 @@ void MainWnd::OnUpdateRenderapiD3dmotionblur(CCmdUI *pCmdUI)
void MainWnd::OnEmulatorBiosfiles()
{
theApp.winCheckFullscreen();
BIOSDialog dlg;
dlg.m_enableBIOS_GBA = theApp.useBiosFileGBA ? TRUE : FALSE;
dlg.m_enableBIOS_GB = theApp.useBiosFileGB ? TRUE : FALSE;

View File

@ -197,7 +197,6 @@ void MainWnd::OnDebugNextframe()
void MainWnd::OnToolsDebugGdb()
{
theApp.winCheckFullscreen();
GDBPortDlg dlg;
if(dlg.DoModal()) {
@ -233,7 +232,6 @@ void MainWnd::OnUpdateToolsDebugGdb(CCmdUI* pCmdUI)
void MainWnd::OnToolsDebugLoadandwait()
{
theApp.winCheckFullscreen();
if(fileOpenSelect(0)) {
if(FileRun()) {
if(theApp.cartridgeType != 0) {
@ -290,7 +288,6 @@ void MainWnd::OnUpdateToolsDebugDisconnect(CCmdUI* pCmdUI)
void MainWnd::OnOptionsSoundStartrecording()
{
theApp.winCheckFullscreen();
CString captureBuffer;
CString capdir = regQueryStringValue("soundRecordDir", NULL);
@ -345,8 +342,6 @@ void MainWnd::OnUpdateOptionsSoundStoprecording(CCmdUI* pCmdUI)
void MainWnd::OnToolsRecordStartavirecording()
{
theApp.winCheckFullscreen();
CString captureBuffer;
CString capdir = regQueryStringValue( "aviRecordDir", NULL );
@ -459,7 +454,6 @@ void MainWnd::OnUpdateToolsRecordStopavirecording(CCmdUI* pCmdUI)
void MainWnd::OnToolsRecordStartmovierecording()
{
theApp.winCheckFullscreen();
CString captureBuffer;
CString capdir = regQueryStringValue("movieRecordDir", "");

View File

@ -1,113 +0,0 @@
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
// Copyright (C) 1999-2003 Forgotten
// Copyright (C) 2004 Forgotten and the VBA development team
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or(at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ModeConfirm.cpp : implementation file
//
#include "stdafx.h"
#include "vba.h"
#include "ModeConfirm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// ModeConfirm dialog
ModeConfirm::ModeConfirm(CWnd* pParent /*=NULL*/)
: CDialog(ModeConfirm::IDD, pParent)
{
//{{AFX_DATA_INIT(ModeConfirm)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void ModeConfirm::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(ModeConfirm)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(ModeConfirm, CDialog)
//{{AFX_MSG_MAP(ModeConfirm)
ON_BN_CLICKED(ID_CANCEL, OnCancel)
ON_BN_CLICKED(ID_OK, OnOk)
ON_WM_DESTROY()
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// ModeConfirm message handlers
void ModeConfirm::OnCancel()
{
EndDialog(FALSE);
}
void ModeConfirm::OnOk()
{
EndDialog(TRUE);
}
void ModeConfirm::OnDestroy()
{
CDialog::OnDestroy();
KillTimer(timer);
timer = 0;
}
BOOL ModeConfirm::OnInitDialog()
{
CDialog::OnInitDialog();
timer = SetTimer(0, 1000, NULL);
count = 10;
CString buffer;
buffer.Format("%d", count);
GetDlgItem(IDC_TIMER)->SetWindowText(buffer);
CenterWindow(theApp.m_pMainWnd);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void ModeConfirm::OnTimer(UINT_PTR nIDEvent)
{
CString buffer;
count--;
if(count == 0)
EndDialog(FALSE);
buffer.Format("%d", count);
GetDlgItem(IDC_TIMER)->SetWindowText(buffer);
CDialog::OnTimer(nIDEvent);
}

View File

@ -1,71 +0,0 @@
// -*- C++ -*-
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
// Copyright (C) 1999-2003 Forgotten
// Copyright (C) 2004 Forgotten and the VBA development team
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or(at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#if !defined(AFX_MODECONFIRM_H__AF9F877E_6EDF_4523_95C9_1C745ABBA796__INCLUDED_)
#define AFX_MODECONFIRM_H__AF9F877E_6EDF_4523_95C9_1C745ABBA796__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ModeConfirm.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// ModeConfirm dialog
class ModeConfirm : public CDialog
{
// Construction
public:
int count;
UINT_PTR timer;
ModeConfirm(CWnd* pParent); // standard constructor
// Dialog Data
//{{AFX_DATA(ModeConfirm)
enum { IDD = IDD_MODE_CONFIRM };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ModeConfirm)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(ModeConfirm)
afx_msg void OnCancel();
afx_msg void OnOk();
afx_msg void OnDestroy();
virtual BOOL OnInitDialog();
afx_msg void OnTimer(UINT_PTR nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MODECONFIRM_H__AF9F877E_6EDF_4523_95C9_1C745ABBA796__INCLUDED_)

View File

@ -17,8 +17,12 @@
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// VBA.cpp : Defines the class behaviors for the application.
//
#ifdef NO_D3D
#ifdef NO_OGL
#error NO_D3D and NO_OGL must not be defined at the same time.
#endif
#endif
#include "stdafx.h"
#include "AVIWrite.h"
@ -271,13 +275,11 @@ VBA::VBA()
rewindTimer = 0;
captureFormat = 0;
tripleBuffering = true;
autoHideMenu = false;
throttle = 0;
autoFrameSkipLastTime = 0;
autoFrameSkip = false;
vsync = false;
changingVideoSize = false;
pVideoDriverGUID = NULL;
renderMethod = DIRECT_3D;
audioAPI = DIRECTSOUND;
#ifndef NO_OAL
@ -528,8 +530,6 @@ BOOL VBA::InitInstance()
if(!initDisplay()) {
if(videoOption >= VIDEO_320x240) {
regSetDwordValue("video", VIDEO_1X);
if(pVideoDriverGUID)
regSetDwordValue("defaultVideoDriver", TRUE);
}
return FALSE;
}
@ -1087,8 +1087,6 @@ void systemMessage(int number, const char *defaultMsg, ...)
va_start(valist, defaultMsg);
buffer.FormatV(msg, valist);
theApp.winCheckFullscreen();
AfxGetApp()->m_pMainWnd->MessageBox(buffer, winResLoadString(IDS_ERROR), MB_OK|MB_ICONERROR);
va_end(valist);
@ -1422,19 +1420,6 @@ void VBA::loadSettings()
if(videoOption < VIDEO_1X || videoOption > VIDEO_OTHER)
videoOption = VIDEO_3X;
bool defaultVideoDriver = regQueryDwordValue("defaultVideoDriver", true) ?
true : false;
if(!regQueryBinaryValue("videoDriverGUID", (char *)&videoDriverGUID,
sizeof(GUID))) {
defaultVideoDriver = TRUE;
}
if(defaultVideoDriver)
pVideoDriverGUID = NULL;
else
pVideoDriverGUID = &videoDriverGUID;
fsAdapter = regQueryDwordValue("fsAdapter", 0);
fsWidth = regQueryDwordValue("fsWidth", 800);
fsHeight = regQueryDwordValue("fsHeight", 600);
@ -1449,12 +1434,13 @@ void VBA::loadSettings()
}
renderMethod = (DISPLAY_TYPE)regQueryDwordValue("renderMethod", DIRECT_3D);
if( ( renderMethod != DIRECT_3D )
if( ( renderMethod != DIRECT_3D ) && ( renderMethod != OPENGL ) ) {
#ifndef NO_OGL
&& ( renderMethod != OPENGL )
renderMethod = OPENGL;
#endif
#ifndef NO_D3D
renderMethod = DIRECT_3D;
#endif
) {
renderMethod = DIRECT_3D;
}
audioAPI = (AUDIO_API)regQueryDwordValue( "audioAPI", DIRECTSOUND );
@ -1586,8 +1572,6 @@ void VBA::loadSettings()
winRtcEnable = regQueryDwordValue("rtcEnabled", 0) ? true : false;
rtcEnable(winRtcEnable);
autoHideMenu = regQueryDwordValue("autoHideMenu", 0) ? true : false;
skinEnabled = regQueryDwordValue("skinEnabled", 0) ? true : false;
skinName = regQueryStringValue("skinName", "");
@ -1815,8 +1799,6 @@ void VBA::updateWindowSize(int value)
videoOption == VIDEO_1280x1024 ||
videoOption == VIDEO_OTHER) {
regSetDwordValue("video", VIDEO_1X);
if(pVideoDriverGUID)
regSetDwordValue("defaultVideoDriver", TRUE);
}
changingVideoSize = false;
AfxPostQuitMessage(0);
@ -2185,16 +2167,6 @@ bool VBA::updateRenderMethod0(bool force)
}
void VBA::winCheckFullscreen()
{
if(videoOption > VIDEO_4X && tripleBuffering) {
if(display) {
display->checkFullScreen();
}
}
}
void VBA::shutdownDisplay()
{
if(display != NULL) {
@ -2504,14 +2476,6 @@ void VBA::saveSettings()
regSetDwordValue("video", videoOption);
regSetDwordValue("defaultVideoDriver", pVideoDriverGUID == NULL);
if(pVideoDriverGUID) {
regSetBinaryValue("videoDriverGUID", (char *)&videoDriverGUID,
sizeof(GUID));
}
regSetDwordValue("fsAdapter", fsAdapter);
regSetDwordValue("fsWidth", fsWidth);
regSetDwordValue("fsHeight", fsHeight);
@ -2597,8 +2561,6 @@ void VBA::saveSettings()
regSetDwordValue("rtcEnabled", winRtcEnable);
regSetDwordValue("autoHideMenu", autoHideMenu);
regSetDwordValue("skinEnabled", skinEnabled);
regSetStringValue("skinName", skinName);

View File

@ -144,14 +144,11 @@ class VBA : public CWinApp
int rewindTimer;
int captureFormat;
bool tripleBuffering;
bool autoHideMenu;
unsigned short throttle;
u32 autoFrameSkipLastTime;
bool autoFrameSkip;
bool vsync;
bool changingVideoSize;
GUID videoDriverGUID;
GUID *pVideoDriverGUID;
DISPLAY_TYPE renderMethod;
AUDIO_API audioAPI;
#ifndef NO_OAL
@ -265,7 +262,6 @@ class VBA : public CWinApp
void winUpdateSkin();
void directXMessage(const char *msg);
void shutdownDisplay();
void winCheckFullscreen();
bool preInitialize();
bool updateRenderMethod0(bool force);
bool updateRenderMethod(bool force);

View File

@ -1,6 +1,6 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include "resource."
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
@ -893,17 +893,6 @@ BEGIN
LTEXT "Size:",IDC_STATIC,7,29,65,8
END
IDD_MODES DIALOG 0, 0, 208, 129
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Select video mode"
FONT 8, "MS Sans Serif"
BEGIN
LISTBOX IDC_MODES,7,18,194,80,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK",ID_OK,45,108,50,14
PUSHBUTTON "Cancel",ID_CANCEL,112,108,50,14
LTEXT "Available video modes:",IDC_STATIC,7,7,194,8
END
IDD_DRIVERS DIALOG 0, 0, 208, 121
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Select video driver"
@ -1091,17 +1080,6 @@ BEGIN
CONTROL "Automatic update",IDC_AUTO_UPDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,178,71,10
END
IDD_MODE_CONFIRM DIALOG 0, 0, 186, 57
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Confirm mode"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",ID_OK,31,36,50,14
PUSHBUTTON "Cancel",ID_CANCEL,103,36,50,14
CTEXT "Do you want to keep the current mode?",IDC_STATIC,7,7,172,8
CTEXT "",IDC_TIMER,7,19,172,8,SS_NOPREFIX,WS_EX_TOOLWINDOW
END
IDD_REWIND_INTERVAL DIALOG 0, 0, 186, 68
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Select rewind interval"
@ -1460,14 +1438,6 @@ BEGIN
BOTTOMMARGIN, 60
END
IDD_MODES, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 201
TOPMARGIN, 7
BOTTOMMARGIN, 122
END
IDD_DRIVERS, DIALOG
BEGIN
LEFTMARGIN, 7
@ -1524,14 +1494,6 @@ BEGIN
BOTTOMMARGIN, 227
END
IDD_MODE_CONFIRM, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 50
END
IDD_REWIND_INTERVAL, DIALOG
BEGIN
LEFTMARGIN, 7
@ -1877,7 +1839,6 @@ BEGIN
MENUITEM "AGB Print", ID_OPTIONS_EMULATOR_AGBPRINT
MENUITEM "Real Time Clock", ID_OPTIONS_EMULATOR_REALTIMECLOCK
MENUITEM "&Game Overrides...", ID_OPTIONS_EMULATOR_GAMEOVERRIDES
MENUITEM "Auto hide menu", ID_OPTIONS_EMULATOR_AUTOHIDEMENU
POPUP "Show speed"
BEGIN
MENUITEM "None", ID_OPTIONS_EMULATOR_SHOWSPEED_NONE

View File

@ -1,395 +0,0 @@
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
// Copyright (C) 1999-2003 Forgotten
// Copyright (C) 2004 Forgotten and the VBA development team
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or(at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// VideoMode.cpp : implementation file
//
#include "stdafx.h"
#include "VBA.h"
#define DIRECTDRAW_VERSION 0x0700
#include <ddraw.h>
#include "VideoMode.h"
#include "../System.h"
#include "resource.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define MAX_DRIVERS 32 // 32 drivers maximum
//-----------------------------------------------------------------------------
// Local structures
//-----------------------------------------------------------------------------
// Keeps data on the available DDraw drivers
struct
{
char szDescription[128];
char szName[128];
GUID *pGUID;
GUID GUIDcopy;
HMONITOR hm;
} Drivers[MAX_DRIVERS];
//-----------------------------------------------------------------------------
// Local data
//-----------------------------------------------------------------------------
static int gDriverCnt = 0; // Total number of drivers
static GUID *gpSelectedDriverGUID;
//-----------------------------------------------------------------------------
// Name: DDEnumCallbackEx()
// Desc: This call back is used to determine the existing available DDraw
// devices, so the user can pick which one to run on.
//-----------------------------------------------------------------------------
BOOL WINAPI
DDEnumCallbackEx(GUID *pGUID, LPSTR pDescription, LPSTR pName, LPVOID pContext, HMONITOR hm)
{
if (pGUID)
{
Drivers[gDriverCnt].GUIDcopy = *pGUID;
Drivers[gDriverCnt].pGUID = &Drivers[gDriverCnt].GUIDcopy;
}
else
Drivers[gDriverCnt].pGUID = NULL;
Drivers[gDriverCnt].szDescription[127] = '\0';
Drivers[gDriverCnt].szName[127] = '\0';
strncpy(Drivers[gDriverCnt].szDescription,pDescription,127);
strncpy(Drivers[gDriverCnt].szName,pName,127);
Drivers[gDriverCnt].hm = hm;
if (gDriverCnt < MAX_DRIVERS)
gDriverCnt++;
else
return DDENUMRET_CANCEL;
return DDENUMRET_OK;
}
//-----------------------------------------------------------------------------
// Name: DDEnumCallback()
// Desc: This callback is used only with old versions of DDraw.
//-----------------------------------------------------------------------------
BOOL WINAPI
DDEnumCallback(GUID *pGUID, LPSTR pDescription, LPSTR pName, LPVOID context)
{
return (DDEnumCallbackEx(pGUID, pDescription, pName, context, NULL));
}
static HRESULT WINAPI addVideoMode(LPDDSURFACEDESC2 surf, LPVOID lpContext)
{
HWND h = (HWND)lpContext;
char buffer[50];
switch( surf->ddpfPixelFormat.dwRGBBitCount )
{
case 16:
case 24:
case 32:
sprintf(
buffer,
_T("%4dx%4dx%2d"),
surf->dwWidth,
surf->dwHeight,
surf->ddpfPixelFormat.dwRGBBitCount
);
WPARAM pos = ::SendMessage( h, LB_ADDSTRING, 0, (LPARAM)buffer );
::SendMessage(
h,
LB_SETITEMDATA,
pos,
(surf->ddpfPixelFormat.dwRGBBitCount << 24) |
((surf->dwWidth & 4095) << 12) |
(surf->dwHeight & 4095)
);
break;
}
return DDENUMRET_OK;
}
int winVideoModeSelect(CWnd *pWnd, GUID **guid)
{
#ifdef _AFXDLL
HINSTANCE h = AfxLoadLibrary("ddraw.dll");
#else
HMODULE h = LoadLibrary( _T("ddraw.dll") );
#endif
// If ddraw.dll doesn't exist in the search path,
// then DirectX probably isn't installed, so fail.
if (!h)
return -1;
gDriverCnt = 0;
// Note that you must know which version of the
// function to retrieve (see the following text).
// For this example, we use the ANSI version.
LPDIRECTDRAWENUMERATEEX lpDDEnumEx;
lpDDEnumEx = (LPDIRECTDRAWENUMERATEEX)
GetProcAddress(h,"DirectDrawEnumerateExA");
// If the function is there, call it to enumerate all display
// devices attached to the desktop, and any non-display DirectDraw
// devices.
if (lpDDEnumEx)
lpDDEnumEx(DDEnumCallbackEx, NULL,
DDENUM_ATTACHEDSECONDARYDEVICES |
DDENUM_NONDISPLAYDEVICES
);
else {
/*
* We must be running on an old version of DirectDraw.
* Therefore MultiMon isn't supported. Fall back on
* DirectDrawEnumerate to enumerate standard devices on a
* single-monitor system.
*/
BOOL (WINAPI *lpDDEnum)(LPDDENUMCALLBACK, LPVOID);
lpDDEnum = (BOOL (WINAPI *)(LPDDENUMCALLBACK, LPVOID))
GetProcAddress(h, "DirectDrawEnumerateA");
if(lpDDEnum)
lpDDEnum(DDEnumCallback,NULL);
/* Note that it could be handy to let the OldCallback function
* be a wrapper for a DDEnumCallbackEx.
*
* Such a function would look like:
* BOOL FAR PASCAL OldCallback(GUID FAR *lpGUID,
* LPSTR pDesc,
* LPSTR pName,
* LPVOID pContext)
* {
* return Callback(lpGUID,pDesc,pName,pContext,NULL);
* }
*/
}
int selected = 0;
if(gDriverCnt > 1) {
VideoDriverSelect d(pWnd);
INT_PTR selected = d.DoModal();
if(selected == -1) {
#ifdef _AFXDLL
AfxFreeLibrary( h );
#else
FreeLibrary( h );
#endif
return -1;
}
}
HRESULT (WINAPI *DDrawCreateEx)(GUID *,LPVOID *,REFIID,IUnknown *);
DDrawCreateEx = (HRESULT (WINAPI *)(GUID *,LPVOID *,REFIID,IUnknown *))
GetProcAddress(h, "DirectDrawCreateEx");
LPDIRECTDRAW7 ddraw = NULL;
if(DDrawCreateEx) {
HRESULT hret = DDrawCreateEx(Drivers[selected].pGUID,
(void **)&ddraw,
IID_IDirectDraw7,
NULL);
if(hret != DD_OK) {
systemMessage(0, "Error during DirectDrawCreateEx: %08x", hret);
#ifdef _AFXDLL
AfxFreeLibrary( h );
#else
FreeLibrary( h );
#endif
return -1;
}
} else {
// should not happen....
systemMessage(0, "Error getting DirectDrawCreateEx");
#ifdef _AFXDLL
AfxFreeLibrary( h );
#else
FreeLibrary( h );
#endif
return -1;
}
VideoMode dlg(ddraw, pWnd);
INT_PTR res = dlg.DoModal();
if(res != -1) {
*guid = Drivers[selected].pGUID;
}
ddraw->Release();
ddraw = NULL;
// If the library was loaded by calling LoadLibrary(),
// then you must use FreeLibrary() to let go of it.
#ifdef _AFXDLL
AfxFreeLibrary( h );
#else
FreeLibrary( h );
#endif
return (int)res;
}
/////////////////////////////////////////////////////////////////////////////
// VideoMode dialog
VideoMode::VideoMode(LPDIRECTDRAW7 pDraw, CWnd* pParent /*=NULL*/)
: CDialog(VideoMode::IDD, pParent)
{
//{{AFX_DATA_INIT(VideoMode)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
pDirectDraw = pDraw;
}
void VideoMode::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(VideoMode)
DDX_Control(pDX, IDC_MODES, m_modes);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(VideoMode, CDialog)
//{{AFX_MSG_MAP(VideoMode)
ON_LBN_SELCHANGE(IDC_MODES, OnSelchangeModes)
ON_BN_CLICKED(ID_CANCEL, OnCancel)
ON_BN_CLICKED(ID_OK, OnOk)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// VideoMode message handlers
void VideoMode::OnSelchangeModes()
{
int item = m_modes.GetCurSel();
GetDlgItem(ID_OK)->EnableWindow(item != -1);
}
void VideoMode::OnCancel()
{
EndDialog(-1);
}
void VideoMode::OnOk()
{
DWORD_PTR cur = m_modes.GetCurSel();
if(cur != -1) {
cur = m_modes.GetItemData((int)cur);
}
EndDialog((int)cur);
}
BOOL VideoMode::OnInitDialog()
{
CDialog::OnInitDialog();
// check for available fullscreen modes
pDirectDraw->EnumDisplayModes(
DDEDM_STANDARDVGAMODES,
NULL,
m_modes.m_hWnd,
addVideoMode);
GetDlgItem(ID_OK)->EnableWindow(FALSE);
CenterWindow();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
/////////////////////////////////////////////////////////////////////////////
// VideoDriverSelect dialog
VideoDriverSelect::VideoDriverSelect(CWnd* pParent /*=NULL*/)
: CDialog(VideoDriverSelect::IDD, pParent)
{
//{{AFX_DATA_INIT(VideoDriverSelect)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void VideoDriverSelect::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(VideoDriverSelect)
DDX_Control(pDX, IDC_DRIVERS, m_drivers);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(VideoDriverSelect, CDialog)
//{{AFX_MSG_MAP(VideoDriverSelect)
ON_BN_CLICKED(ID_OK, OnOk)
ON_BN_CLICKED(ID_CANCEL, OnCancel)
ON_LBN_SELCHANGE(IDC_DRIVERS, OnSelchangeDrivers)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// VideoDriverSelect message handlers
void VideoDriverSelect::OnCancel()
{
EndDialog(-1);
}
void VideoDriverSelect::OnOk()
{
EndDialog(m_drivers.GetCurSel());
}
BOOL VideoDriverSelect::OnInitDialog()
{
CDialog::OnInitDialog();
for(int i = 0; i < gDriverCnt; i++) {
m_drivers.AddString(Drivers[i].szDescription);
}
GetDlgItem(ID_OK)->EnableWindow(FALSE);
CenterWindow();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void VideoDriverSelect::OnSelchangeDrivers()
{
GetDlgItem(ID_OK)->EnableWindow(m_drivers.GetCurSel() != -1);
}

View File

@ -1,102 +0,0 @@
// -*- C++ -*-
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
// Copyright (C) 1999-2003 Forgotten
// Copyright (C) 2004 Forgotten and the VBA development team
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or(at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#if !defined(AFX_VIDEOMODE_H__074B2426_32EA_4D69_9215_AB5E90F885D0__INCLUDED_)
#define AFX_VIDEOMODE_H__074B2426_32EA_4D69_9215_AB5E90F885D0__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// VideoMode.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// VideoMode dialog
class VideoMode : public CDialog
{
// Construction
public:
VideoMode(LPDIRECTDRAW7 pDraw,CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(VideoMode)
enum { IDD = IDD_MODES };
CListBox m_modes;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(VideoMode)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(VideoMode)
afx_msg void OnSelchangeModes();
afx_msg void OnCancel();
afx_msg void OnOk();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
LPDIRECTDRAW7 pDirectDraw;
};
/////////////////////////////////////////////////////////////////////////////
// VideoDriverSelect dialog
class VideoDriverSelect : public CDialog
{
// Construction
public:
VideoDriverSelect(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(VideoDriverSelect)
enum { IDD = IDD_DRIVERS };
CListBox m_drivers;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(VideoDriverSelect)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(VideoDriverSelect)
afx_msg void OnCancel();
afx_msg void OnOk();
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeDrivers();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif // !defined(AFX_VIDEOMODE_H__074B2426_32EA_4D69_9215_AB5E90F885D0__INCLUDED_)