diff options
| author | hrydgard <hrydgard@gmail.com> | 2009-09-13 17:46:33 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2009-09-13 17:46:33 +0000 |
| commit | a7c70ddb6684aee4dfcbc7ce43f07447fac7761d (patch) | |
| tree | 86a9cf8ffb27cb03733dfa656ee2647d7f93fb22 /Source/Core | |
| parent | 5911abc60010d65d9ed9f18b7637d89cf8fe541b (diff) | |
D3D: Eliminate black borders, add 4:3 and 16:9 settings, and the widescreen hack. Unfortunately this temporarily breaks MSAA (in d3d only) until I have time to fix it.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4263 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/BPFunctions.h | 1 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/BPStructs.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 4 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/Render.h | 7 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/Statistics.h | 1 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VideoConfig.cpp | 12 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/Src/VideoConfig.h | 3 |
8 files changed, 18 insertions, 19 deletions
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp index c472842584..bb7627b56c 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp @@ -218,7 +218,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32 PanicAlert("Cant read from DVD_Plugin - DVD-Interface: Fatal Error"); } - FileMon::CheckFile(std::string(pFilename), m_pFileSystem->GetFileSize(pFilename)); + FileMon::CheckFile(std::string(pFilename), (int)m_pFileSystem->GetFileSize(pFilename)); } break; diff --git a/Source/Core/VideoCommon/Src/BPFunctions.h b/Source/Core/VideoCommon/Src/BPFunctions.h index ea735351a0..3825fd9f58 100644 --- a/Source/Core/VideoCommon/Src/BPFunctions.h +++ b/Source/Core/VideoCommon/Src/BPFunctions.h @@ -46,7 +46,6 @@ void SetDitherMode(const BPCmd &bp); void SetLogicOpMode(const BPCmd &bp); void SetColorMask(const BPCmd &bp); void CopyEFB(const BPCmd &bp, const EFBRectangle &rc, const u32 &address, const bool &fromZBuffer, const bool &isIntensityFmt, const u32 ©fmt, const int &scaleByHalf); -void RenderToXFB(const BPCmd &bp, const EFBRectangle &rc, const float &yScale, const float &xfbLines, u32 xfbAddr, const u32 &dstWidth, const u32 &dstHeight); void ClearScreen(const BPCmd &bp, const EFBRectangle &rc); void RestoreRenderState(const BPCmd &bp); u8 *GetPointer(const u32 &address); diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index 8b817c0621..9c031f0a71 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.cpp @@ -19,6 +19,7 @@ #include "Profiler.h" #include "Statistics.h" +#include "Render.h" #include "VideoCommon.h" #include "PixelShaderManager.h" #include "BPFunctions.h" @@ -40,6 +41,12 @@ void BPInit() bpmem.bpMask = 0xFFFFFF; } + +void RenderToXFB(const BPCmd &bp, const EFBRectangle &rc, float yScale, float xfbLines, u32 xfbAddr, const u32 dstWidth, const u32 dstHeight) +{ + Renderer::RenderToXFB(xfbAddr, dstWidth, dstHeight, rc); +} + void BPWritten(const BPCmd& bp) { /* diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 4e55902088..75bc8dc31b 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -67,8 +67,8 @@ void GetPixelShaderId(PIXELSHADERUID &uid, u32 texturemask, u32 dstAlphaEnable) TevStageCombiner::ColorCombiner &cc = bpmem.combiners[i].colorC; TevStageCombiner::AlphaCombiner &ac = bpmem.combiners[i].alphaC; - u32 val0 = cc.hex&0xffffff; - u32 val1 = ac.hex&0xffffff; + u32 val0 = cc.hex & 0xffffff; + u32 val1 = ac.hex & 0xffffff; val0 |= bpmem.tevksel[i / 2].getKC(i & 1) << 24; val1 |= bpmem.tevksel[i / 2].getKA(i & 1) << 24; pcurvalue[0] = val0; diff --git a/Source/Core/VideoCommon/Src/Render.h b/Source/Core/VideoCommon/Src/Render.h index 598ab9595c..d21dbcf5d4 100644 --- a/Source/Core/VideoCommon/Src/Render.h +++ b/Source/Core/VideoCommon/Src/Render.h @@ -15,7 +15,6 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ - // --------------------------------------------------------------------------------------------- // GC graphics pipeline // --------------------------------------------------------------------------------------------- @@ -33,9 +32,13 @@ #include "MathUtil.h" #include "pluginspecs_video.h" +// TODO: Move these out of here. extern int frameCount; extern int OSDChoice, OSDTime, OSDInternalW, OSDInternalH; +// Renderer really isn't a very good name for this class - it's more like "Misc". +// The long term goal is to get rid of this class and replace it with others that make +// more sense. class Renderer { public: @@ -48,8 +51,6 @@ public: static void ReinitView(); - static void SwapBuffers(); - static void SetColorMask(); static void SetBlendMode(bool forceUpdate); static bool SetScissorRect(); diff --git a/Source/Core/VideoCommon/Src/Statistics.h b/Source/Core/VideoCommon/Src/Statistics.h index 1061041e7f..c6329f4059 100644 --- a/Source/Core/VideoCommon/Src/Statistics.h +++ b/Source/Core/VideoCommon/Src/Statistics.h @@ -17,7 +17,6 @@ #include "CommonTypes.h" #include "VideoCommon.h" -#include "Render.h" // for EFBRectangle.h, unfortunately. #include <vector> #ifndef _STATISTICS_H diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp index e95503a2f8..aa561512b7 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.cpp +++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp @@ -97,6 +97,7 @@ void VideoConfig::Load(const char *ini_file) iniFile.Get("Hardware", "WindowedRes", &iWindowedRes, 0); iniFile.Get("Hardware", "VSync", &bVsync, 0); iniFile.Get("Hardware", "FullscreenRes", &iFSResolution, 0); + iniFile.Get("Hardware", "SimpleFB", &bSimpleFB, false); // Load common settings iniFile.Load(CONFIG_FILE); @@ -175,12 +176,11 @@ void VideoConfig::Save(const char *ini_file) iniFile.Set("Hardware", "WindowedRes", iWindowedRes); iniFile.Set("Hardware", "VSync", bVsync); iniFile.Set("Hardware", "FullscreenRes", iFSResolution); + iniFile.Set("Hardware", "SimpleFB", bSimpleFB); iniFile.Save(ini_file); } - - // TODO: Figure out a better place for this function. void ComputeDrawRectangle(int backbuffer_width, int backbuffer_height, bool flip, TargetRectangle *rc) { @@ -198,8 +198,8 @@ void ComputeDrawRectangle(int backbuffer_width, int backbuffer_height, bool flip { // The rendering window aspect ratio as a proportion of the 4:3 or 16:9 ratio float Ratio = (WinWidth / WinHeight) / (g_Config.bKeepAR43 ? (4.0f / 3.0f) : (16.0f / 9.0f)); - // Check if height or width is the limiting factor. If ratio > 1 the picture is to wide and have to limit the width. - if (Ratio > 1) + // Check if height or width is the limiting factor. If ratio > 1 the picture is too wide and have to limit the width. + if (Ratio > 1.0f) { // Scale down and center in the X direction. FloatGLWidth /= Ratio; @@ -230,12 +230,8 @@ void ComputeDrawRectangle(int backbuffer_width, int backbuffer_height, bool flip // Adjust the X and Y offset FloatXOffset = FloatXOffset - (IncreasedWidth * 0.5f); FloatYOffset = FloatYOffset - (IncreasedHeight * 0.5f); - //NOTICE_LOG(OSREPORT, "Crop Ratio:%1.2f IncreasedHeight:%3.0f YOffset:%3.0f", Ratio, IncreasedHeight, FloatYOffset); - //NOTICE_LOG(OSREPORT, "Crop FloatGLWidth:%1.2f FloatGLHeight:%3.0f", (float)FloatGLWidth, (float)FloatGLHeight); - //NOTICE_LOG(OSREPORT, ""); } - // round(float) = floor(float + 0.5) int XOffset = (int)(FloatXOffset + 0.5f); int YOffset = (int)(FloatYOffset + 0.5f); rc->left = XOffset; diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h index c78b8d2dba..be4383f72c 100644 --- a/Source/Core/VideoCommon/Src/VideoConfig.h +++ b/Source/Core/VideoCommon/Src/VideoConfig.h @@ -131,9 +131,6 @@ struct VideoConfig // With this enabled, the plugin renders directly to the backbuffer. Many features are // disabled but it might be faster on really old GPUs. bool bSimpleFB; - - // Runtime detection config - bool bOldCard; }; extern VideoConfig g_Config; |
