From c5049e7a5d1179edd76ef01ceb1a37b85c22c59e Mon Sep 17 00:00:00 2001 From: DJRobX Date: Wed, 31 Oct 2007 02:33:28 +0000 Subject: [PATCH] Project cleanups, add _CRT_SECURE_NO_WARNINGS to reduce absurdly high warning count. Fix DirectDraw initializer to check for 1024x768 and 1280x1024, they were grayed out. Default resolutions set to 60hz and DirectDraw now obeys fsFrequency setting. --- VBA.suo | Bin 53248 -> 53248 bytes VBA.vcproj | 8 ++++---- libpng/libpng.vcproj | 4 ++-- res/VBA.rc | 4 ++-- src/hq4x_16.asm | 6 ++---- src/win32/Direct3D.cpp | 7 +++++++ src/win32/DirectDraw.cpp | 16 +++++++++++++++- src/win32/VBA.cpp | 19 ++++++++++++------- zlib/zlib.vcproj | 4 ++-- 9 files changed, 46 insertions(+), 22 deletions(-) diff --git a/VBA.suo b/VBA.suo index b5cff28b3707ef7bd1218c38253709ea586deaea..6b6d8a4c5abbdbcf0a9673a8e7d8e25fb40c0e0f 100644 GIT binary patch delta 8230 zcmb`L3wTt;702i9Zk7Zg1PB;N2zfzxXLkt+1dt60kPQX`1c?|SAp`=31j2?#gzN?^ z*j6lL)F1^6)CVnCBTN01`hbcQtXj2NwLa^k)vEZSUn|w5|Nri}Nuae4+mr8~Irn$x z-aB{hnVB=|Z?XDYtgX2gTcT1*=UFC&Plj^^4{owl_HJu$Z=ZsLY-k$Pro*h)*?RM| z*P3D^X~WugS7}j`tt!&(yl}1}_Kac0$rBp_^|ldK+X4d>4|OY!>TQ4G_NP*tbMD#G z)cVu7EiS#Q)e&%qpNJh?sA^S>TCFNjdeugipbAu(s)m-6>E~>T`b1c`F-o6|=&MU3 zV(h(e({QEh3sQ{C;AwZ5Ei4yL%`>ZnRiR3j-dHfi7}rrF2Q}i%8upE-(P|0a#L-bD z3st6>RU&Rcm3l}8z8*5oHt8~D;K12SseGsp_|u2e`+U-NuARIF$CT?5UKgg+p|C*1 zh)1oq*HBNp$Gl~WqLY#~KA{B8E4bo!(5n!;`*oCWKy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KzyTsV6oTU_ZX7WRpJ2S7yk7M#P`F$x?m$fhYy;BBgsK70jwm21!3#3wQq(}rbEd%7YvkRZxfV^Yj_EivJFZ` z+3o~Z3qmsPDL;osLOCAExIz64=dJLP^1L9Ij~!6TQK*~XG1zR23p$K+Gl4*Rhw$jD=1vyI1zF_V3K38@f6U@gI)A0S*RhJ>uGu(^tE7aI?|5;mn(EDiP^vBO~& zbPjMw1m6!s=YaNs*wD)*8^(Qwk}sG7 zdyE)=x?|h^{F+&zi=in}L8V-O(UV0asLe`xIJK#P6H&4}Xu_{hD0 zKR&XL2g{FhYKT~#7~j*ToGK;d^O znk-Bj3>N15VhOPQd7ZUxJ7J-7z^{X7;hak zS(snIh~U6`U67F<=Ud1r+cX^>5F~PMB|OIPZ3gr&a`U4$G`Ui7cVXp{#F)ov`E?fK zBGN^EHDX*!dAgxIB1U^vgflv<4T3yNZImN-8>MY+6LWVS&aj_}?UWzu$)gc5cOb@P zdMyNykQnV3#9oZR)S@Fx?Vg){EywWel;dlj$Opxo?aldpkGq?RK6-19_w@23MPS!_ zEOt2pXQea~n3!*#`f+0D?9pu7~DinD>vGJDB=o5CNX=zRSUu&-4{|{#uR1^RJ diff --git a/VBA.vcproj b/VBA.vcproj index e790f475..0b1a8470 100644 --- a/VBA.vcproj +++ b/VBA.vcproj @@ -52,7 +52,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(SolutionDir)zlib";"$(SolutionDir)libpng"" - PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;DEV_VERSION;BKPT_SUPPORT;MMX" + PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;DEV_VERSION;BKPT_SUPPORT;MMX;_CRT_SECURE_NO_WARNINGS" StringPooling="false" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -165,7 +165,7 @@ OmitFramePointers="false" EnableFiberSafeOptimizations="false" AdditionalIncludeDirectories=""$(SolutionDir)zlib";"$(SolutionDir)libpng"" - PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;FINAL_VERSION;MMX" + PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;FINAL_VERSION;MMX;_CRT_SECURE_NO_WARNINGS" IgnoreStandardIncludePath="false" GeneratePreprocessedFile="0" KeepComments="false" @@ -307,13 +307,13 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories=""$(SolutionDir)zlib";"$(SolutionDir)libpng"" - PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;FINAL_VERSION;MMX" + PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;FINAL_VERSION;MMX;_CRT_SECURE_NO_WARNINGS" IgnoreStandardIncludePath="false" GeneratePreprocessedFile="0" KeepComments="false" StringPooling="true" MinimalRebuild="false" - ExceptionHandling="0" + ExceptionHandling="1" BasicRuntimeChecks="0" SmallerTypeCheck="false" RuntimeLibrary="0" diff --git a/libpng/libpng.vcproj b/libpng/libpng.vcproj index 4042293f..5fa03fd4 100644 --- a/libpng/libpng.vcproj +++ b/libpng/libpng.vcproj @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(SolutionDir)zlib"" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -106,7 +106,7 @@ GetAdapterModeCount(theApp.fsAdapter, D3DFMT_R5G6B5); for (i = 0; iddpfPixelFormat.dwRGBBitCount == 16) { theApp.mode800Available = TRUE; } + if(surf->dwWidth == 1024 && + surf->dwHeight == 768 && + surf->ddpfPixelFormat.dwRGBBitCount == 16) { + theApp.mode1024Available = TRUE; + } + if(surf->dwWidth == 1280 && + surf->dwHeight == 1024 && + surf->ddpfPixelFormat.dwRGBBitCount == 16) { + theApp.mode1280Available = TRUE; + } + + return DDENUMRET_OK; } @@ -346,6 +358,8 @@ bool DirectDrawDisplay::initialize() theApp.mode320Available = false; theApp.mode640Available = false; theApp.mode800Available = false; + theApp.mode1024Available = false; + theApp.mode1280Available = false; // check for available fullscreen modes pDirectDraw->EnumDisplayModes(DDEDM_STANDARDVGAMODES, NULL, NULL, checkModesAvailable); @@ -371,7 +385,7 @@ bool DirectDrawDisplay::initialize() hret = pDirectDraw->SetDisplayMode(theApp.fsWidth, theApp.fsHeight, theApp.fsColorDepth, - 60, + theApp.fsFrequency, 0); if(hret != DD_OK) { winlog("Error SetDisplayMode %08x\n", hret); diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index 9ab16c22..45705cb3 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -1286,7 +1286,7 @@ void VBA::loadSettings() fsWidth = regQueryDwordValue("fsWidth", 0); fsHeight = regQueryDwordValue("fsHeight", 0); fsColorDepth = regQueryDwordValue("fsColorDepth", 0); - fsFrequency = regQueryDwordValue("fsFrequency", 0); + fsFrequency = regQueryDwordValue("fsFrequency", 60); fsAdapter = regQueryDwordValue("fsAdapter", 0); if(videoOption == VIDEO_OTHER) @@ -1421,27 +1421,32 @@ void VBA::loadSettings() fsWidth = 320; fsHeight = 240; fsColorDepth = 16; + fsFrequency = 60; break; case VIDEO_640x480: fsWidth = 640; fsHeight = 480; fsColorDepth = 16; - break; + fsFrequency = 60; + break; case VIDEO_800x600: fsWidth = 800; fsHeight = 600; fsColorDepth = 16; - break; + fsFrequency = 60; + break; case VIDEO_1024x768: fsWidth = 1024; fsHeight = 768; - fsColorDepth = 32; - break; + fsColorDepth = 16; + fsFrequency = 60; + break; case VIDEO_1280x1024: fsWidth = 1280; fsHeight = 1024; - fsColorDepth = 32; - break; + fsColorDepth = 16; + fsFrequency = 60; + break; } winGbBorderOn = regQueryDwordValue("borderOn", 0); diff --git a/zlib/zlib.vcproj b/zlib/zlib.vcproj index 3a4d3e04..c3b7df8f 100644 --- a/zlib/zlib.vcproj +++ b/zlib/zlib.vcproj @@ -40,7 +40,7 @@