From 461077b1a13a05870873ae6f98409823c5cc5334 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Sun, 20 Jul 2008 12:26:32 +0000 Subject: [PATCH] More GFX plugin cleanup, still no visible changes. New right-click popup menu in game list - allow editing patch files easily. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@31 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Common.cpp | 17 + Source/Core/Common/Src/Common.h | 2 + Source/Core/Common/Src/FileUtil.cpp | 37 +- Source/Core/Common/Src/FileUtil.h | 2 + Source/Core/Core/Src/HLE/HLE.cpp | 2 +- Source/Core/Core/Src/HW/DSP.cpp | 6 +- Source/Core/DiscIO/Src/BannerLoader.h | 2 +- Source/Core/DiscIO/Src/BannerLoaderGC.cpp | 6 +- Source/Core/DiscIO/Src/BannerLoaderGC.h | 2 +- Source/Core/DiscIO/Src/BannerLoaderWii.cpp | 2 +- Source/Core/DiscIO/Src/BannerLoaderWii.h | 2 +- Source/Core/DolphinWX/src/Frame.cpp | 9 + Source/Core/DolphinWX/src/GameListCtrl.cpp | 70 ++- Source/Core/DolphinWX/src/GameListCtrl.h | 15 +- Source/Core/DolphinWX/src/Globals.h | 2 + Source/Core/DolphinWX/src/ISOFile.cpp | 3 +- Source/Core/DolphinWX/src/ISOFile.h | 11 +- Source/Core/VideoCommon/Src/BPMemory.cpp | 20 +- Source/Core/VideoCommon/Src/BPMemory.h | 46 ++ Source/Core/VideoCommon/Src/CPMemory.cpp | 20 +- Source/Core/VideoCommon/Src/CPMemory.h | 53 +++ Source/Core/VideoCommon/Src/LookUpTables.cpp | 17 + Source/Core/VideoCommon/Src/LookUpTables.h | 17 + .../VideoCommon}/Src/TextureDecoder.cpp | 3 - .../VideoCommon}/Src/TextureDecoder.h | 0 Source/Core/VideoCommon/Src/XFMemory.cpp | 17 + Source/Core/VideoCommon/Src/XFMemory.h | 51 +- Source/Core/VideoCommon/VideoCommon.vcproj | 12 + .../Plugin_VideoDX9/Plugin_VideoDX9.vcproj | 24 +- .../Plugins/Plugin_VideoDX9/Src/BPStructs.cpp | 33 -- .../Plugins/Plugin_VideoDX9/Src/BPStructs.h | 1 - .../Plugins/Plugin_VideoDX9/Src/CPStructs.cpp | 11 +- .../Plugins/Plugin_VideoDX9/Src/CPStructs.h | 5 - .../Plugins/Plugin_VideoDX9/Src/D3DShader.cpp | 45 -- .../Plugins/Plugin_VideoDX9/Src/D3DShader.h | 2 - .../Plugin_VideoDX9/Src/DecodedVArray.h | 2 +- Source/Plugins/Plugin_VideoDX9/Src/Fifo.cpp | 26 +- .../Plugin_VideoDX9/Src/OpcodeDecoding.cpp | 10 +- .../Plugin_VideoDX9/Src/PixelShader.cpp | 53 +-- .../Plugins/Plugin_VideoDX9/Src/PixelShader.h | 6 +- .../Plugin_VideoDX9/Src/ShaderManager.cpp | 35 +- .../Plugin_VideoDX9/Src/ShaderManager.h | 3 + .../Plugin_VideoDX9/Src/TextureCache.cpp | 10 +- .../Plugin_VideoDX9/Src/TextureDecoder.cpp | 447 ------------------ .../Plugin_VideoDX9/Src/TextureDecoder.h | 61 --- .../Plugin_VideoDX9/Src/VertexLoader_Color.h | 23 +- .../Plugin_VideoOGL/Plugin_VideoOGL.vcproj | 12 +- .../Plugins/Plugin_VideoOGL/Src/BPStructs.cpp | 30 +- .../Plugin_VideoOGL/Src/OpcodeDecoding.cpp | 10 +- .../Plugin_VideoOGL/Src/PixelShader.cpp | 12 +- .../Src/VertexShaderManager.cpp | 2 - .../Plugin_VideoOGL/Src/VertexShaderManager.h | 5 +- 52 files changed, 509 insertions(+), 805 deletions(-) rename Source/{Plugins/Plugin_VideoOGL => Core/VideoCommon}/Src/TextureDecoder.cpp (96%) rename Source/{Plugins/Plugin_VideoOGL => Core/VideoCommon}/Src/TextureDecoder.h (100%) delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/TextureDecoder.cpp delete mode 100644 Source/Plugins/Plugin_VideoDX9/Src/TextureDecoder.h diff --git a/Source/Core/Common/Src/Common.cpp b/Source/Core/Common/Src/Common.cpp index fb5b649267..3b562a717c 100644 --- a/Source/Core/Common/Src/Common.cpp +++ b/Source/Core/Common/Src/Common.cpp @@ -78,6 +78,23 @@ bool PanicYesNo(const char* format, ...) } +bool AskYesNo(const char* format, ...) +{ + va_list args; + va_start(args, format); + bool retval; +#ifdef _WIN32 + std::string msg; + StringFromFormatV(&msg, format, args); + retval = IDYES == MessageBox(0, msg.c_str(), "Dolphin", MB_ICONQUESTION | MB_YESNO); +#elif __GNUC__ + //vprintf(format, args); + return(true); //#error Do a messagebox! +#endif + + va_end(args); + return(retval); +} // Standard implementation of logging - simply print to standard output. // Programs are welcome to override this. /* diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h index a9891b68b3..b086269b42 100644 --- a/Source/Core/Common/Src/Common.h +++ b/Source/Core/Common/Src/Common.h @@ -223,6 +223,8 @@ inline u64 swap64(u64 data) {return(((u64)swap32(data) << 32) | swap32(data >> 3 void PanicAlert(const char* text, ...); bool PanicYesNo(const char* text, ...); +bool AskYesNo(const char* text, ...); + extern void __Log(int logNumber, const char* text, ...); diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 1eb5540486..8ec72c061a 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -1,5 +1,6 @@ #include "Common.h" #include "FileUtil.h" +#include bool File::Exists(const std::string &filename) { @@ -8,4 +9,38 @@ bool File::Exists(const std::string &filename) #else return true; //TODO #endif -} \ No newline at end of file +} + + +std::string SanitizePath(const std::string &filename) { + std::string copy = filename; + for (int i = 0; i < copy.size(); i++) + if (copy[i] == '/') copy[i] = '\\'; + return copy; +} + +void File::Launch(const std::string &filename) +{ +#ifdef _WIN32 + std::string win_filename = SanitizePath(filename); + SHELLEXECUTEINFO shex = { sizeof(shex) }; + shex.fMask = SEE_MASK_NO_CONSOLE; // | SEE_MASK_ASYNC_OK; + shex.lpVerb = "open"; + shex.lpFile = win_filename.c_str(); + shex.nShow = SW_SHOWNORMAL; + ShellExecuteEx(&shex); +#endif +} + +void File::Explore(const std::string &path) +{ +#ifdef _WIN32 + std::string win_path = SanitizePath(path); + SHELLEXECUTEINFO shex = { sizeof(shex) }; + shex.fMask = SEE_MASK_NO_CONSOLE; // | SEE_MASK_ASYNC_OK; + shex.lpVerb = "explore"; + shex.lpFile = win_path.c_str(); + shex.nShow = SW_SHOWNORMAL; + ShellExecuteEx(&shex); +#endif +} diff --git a/Source/Core/Common/Src/FileUtil.h b/Source/Core/Common/Src/FileUtil.h index b170d45ba7..30508f8394 100644 --- a/Source/Core/Common/Src/FileUtil.h +++ b/Source/Core/Common/Src/FileUtil.h @@ -7,6 +7,8 @@ class File { public: static bool Exists(const std::string &filename); + static void Launch(const std::string &filename); + static void Explore(const std::string &path); }; #endif diff --git a/Source/Core/Core/Src/HLE/HLE.cpp b/Source/Core/Core/Src/HLE/HLE.cpp index e92664c5bf..f69a2d7bc6 100644 --- a/Source/Core/Core/Src/HLE/HLE.cpp +++ b/Source/Core/Core/Src/HLE/HLE.cpp @@ -113,7 +113,7 @@ void Execute(u32 _CurrentPC, u32 _Instruction) } else { - _dbg_assert_(HLE, 0); + PanicAlert("HLE system tried to call an undefined HLE function %i.", FunctionIndex); } // _dbg_assert_msg_(HLE,NPC == LR, "Broken HLE function (doesn't set NPC)", OSPatches[pos].m_szPatchName); diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index 9204282d18..6126128db3 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -281,12 +281,12 @@ void Write16(const u16 _Value, const u32 _Address) PluginDSP::DSP_WriteMailboxLow(true, _Value); break; - case DSP_MAIL_FROM_DSP_HI: - _dbg_assert_(DSPINTERFACE,0); + case DSP_MAIL_FROM_DSP_HI: + _dbg_assert_msg_(DSPINTERFACE, 0, "W16: DSP_MAIL_FROM_DSP_HI"); break; case DSP_MAIL_FROM_DSP_LO: - _dbg_assert_(DSPINTERFACE,0); + _dbg_assert_msg_(DSPINTERFACE, 0, "W16: DSP_MAIL_FROM_DSP_LO"); break; // ================================================================================== diff --git a/Source/Core/DiscIO/Src/BannerLoader.h b/Source/Core/DiscIO/Src/BannerLoader.h index e7a6e8dea2..a5be1939ab 100644 --- a/Source/Core/DiscIO/Src/BannerLoader.h +++ b/Source/Core/DiscIO/Src/BannerLoader.h @@ -38,7 +38,7 @@ class IBannerLoader virtual bool GetBanner(u32* _pBannerImage) = 0; - virtual bool GetName(std::string& _rName) = 0; + virtual bool GetName(std::string& _rName, int language) = 0; virtual bool GetCompany(std::string& _rCompany) = 0; diff --git a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp index 0707cb2053..c8e11eac6d 100644 --- a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp +++ b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp @@ -82,7 +82,7 @@ CBannerLoaderGC::GetBanner(u32* _pBannerImage) bool -CBannerLoaderGC::GetName(std::string& _rName) +CBannerLoaderGC::GetName(std::string& _rName, int language) { _rName = "invalid image"; @@ -93,7 +93,9 @@ CBannerLoaderGC::GetName(std::string& _rName) DVDBanner2* pBanner = (DVDBanner2*)m_pBannerFile; - if (!CopyToStringAndCheck(_rName, pBanner->comment[0].longTitle)) + int lang = 0; + + if (!CopyToStringAndCheck(_rName, language != 0 ? pBanner->comment[0].shortTitle : pBanner->comment[0].longTitle)) { return(false); } diff --git a/Source/Core/DiscIO/Src/BannerLoaderGC.h b/Source/Core/DiscIO/Src/BannerLoaderGC.h index eedb5c4715..7c1264ee45 100644 --- a/Source/Core/DiscIO/Src/BannerLoaderGC.h +++ b/Source/Core/DiscIO/Src/BannerLoaderGC.h @@ -35,7 +35,7 @@ class CBannerLoaderGC virtual bool GetBanner(u32* _pBannerImage); - virtual bool GetName(std::string& _rName); + virtual bool GetName(std::string& _rName, int language); virtual bool GetCompany(std::string& _rCompany); diff --git a/Source/Core/DiscIO/Src/BannerLoaderWii.cpp b/Source/Core/DiscIO/Src/BannerLoaderWii.cpp index 3759d00a0b..357c53639f 100644 --- a/Source/Core/DiscIO/Src/BannerLoaderWii.cpp +++ b/Source/Core/DiscIO/Src/BannerLoaderWii.cpp @@ -89,7 +89,7 @@ CBannerLoaderWii::GetBanner(u32* _pBannerImage) bool -CBannerLoaderWii::GetName(std::string& _rName) +CBannerLoaderWii::GetName(std::string& _rName, int language) { _rName = m_Name; return(true); diff --git a/Source/Core/DiscIO/Src/BannerLoaderWii.h b/Source/Core/DiscIO/Src/BannerLoaderWii.h index 425d6a5291..9ed9f21fdc 100644 --- a/Source/Core/DiscIO/Src/BannerLoaderWii.h +++ b/Source/Core/DiscIO/Src/BannerLoaderWii.h @@ -35,7 +35,7 @@ class CBannerLoaderWii virtual bool GetBanner(u32* _pBannerImage); - virtual bool GetName(std::string& _rName); + virtual bool GetName(std::string& _rName, int language); virtual bool GetCompany(std::string& _rCompany); diff --git a/Source/Core/DolphinWX/src/Frame.cpp b/Source/Core/DolphinWX/src/Frame.cpp index 480d49b83c..230675e15d 100644 --- a/Source/Core/DolphinWX/src/Frame.cpp +++ b/Source/Core/DolphinWX/src/Frame.cpp @@ -187,6 +187,15 @@ CFrame::CreateMenu() m_pMenuBar->Append(fileMenu, _T("&File")); } + // Game menu + { + wxMenu* pGameMenu = new wxMenu; + { + wxMenuItem *pItem = new wxMenuItem(pGameMenu, IDM_EDITPATCHFILE, "Edit patch file"); + pGameMenu->Append(pItem); + } + } + // emulation menu { wxMenu* pEmulationMenu = new wxMenu; diff --git a/Source/Core/DolphinWX/src/GameListCtrl.cpp b/Source/Core/DolphinWX/src/GameListCtrl.cpp index eb5b739cff..513e7a95a2 100644 --- a/Source/Core/DolphinWX/src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/src/GameListCtrl.cpp @@ -18,8 +18,10 @@ #include "Globals.h" #include +#include #include "FileSearch.h" +#include "FileUtil.h" #include "StringUtil.h" #include "BootManager.h" #include "Config.h" @@ -42,6 +44,8 @@ EVT_LIST_COL_BEGIN_DRAG(LIST_CTRL, CGameListCtrl::OnColBeginDrag) EVT_LIST_ITEM_SELECTED(LIST_CTRL, CGameListCtrl::OnSelected) EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CGameListCtrl::OnActivated) EVT_LIST_COL_END_DRAG(LIST_CTRL, CGameListCtrl::OnColEndDrag) +EVT_MENU(IDM_EDITPATCHFILE, CGameListCtrl::OnEditPatchFile) +EVT_MENU(IDM_OPENCONTAININGFOLDER, CGameListCtrl::OnOpenContainingFolder) END_EVENT_TABLE() @@ -116,6 +120,7 @@ CGameListCtrl::Update() { InsertItemInReportView(i); } + SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } else { @@ -126,6 +131,7 @@ CGameListCtrl::Update() long item = InsertItem(0, buf, -1); SetItemFont(item, *wxITALIC_FONT); SetColumnWidth(item, wxLIST_AUTOSIZE); + SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } AutomaticColumnWidth(); @@ -299,6 +305,7 @@ CGameListCtrl::ScanForISOs() } } } + std::sort(m_ISOFiles.begin(), m_ISOFiles.end()); } @@ -317,8 +324,25 @@ CGameListCtrl::OnColEndDrag(wxListEvent& WXUNUSED (event)) void -CGameListCtrl::OnRightClick(wxMouseEvent& WXUNUSED (event)) -{} +CGameListCtrl::OnRightClick(wxMouseEvent& event) +{ + // Focus the clicked item. + int flags; + long item = HitTest(event.GetPosition(), flags); + if (item != wxNOT_FOUND) { + SetItemState(item, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED, + wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED); + } + const CISOFile *selected_iso = GetSelectedISO(); + if (selected_iso) { + std::string unique_id = selected_iso->GetUniqueID(); + wxMenu popupMenu; + std::string menu_text = StringFromFormat("Edit &patch file: %s.ini", unique_id.c_str()); + popupMenu.Append(IDM_EDITPATCHFILE, menu_text); + popupMenu.Append(IDM_OPENCONTAININGFOLDER, "Open &containing folder"); + PopupMenu(&popupMenu); + } +} void @@ -331,7 +355,6 @@ CGameListCtrl::OnActivated(wxListEvent& event) else { size_t Index = event.GetData(); - if (Index < m_ISOFiles.size()) { const CISOFile& rISOFile = m_ISOFiles[Index]; @@ -340,6 +363,47 @@ CGameListCtrl::OnActivated(wxListEvent& event) } } +const CISOFile * +CGameListCtrl::GetSelectedISO() const +{ + int item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); + if (item == -1) + return 0; + else + return &m_ISOFiles[GetItemData(item)]; +} + +void +CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event)) { + const CISOFile *iso = GetSelectedISO(); + if (!iso) + return; + std::string path; + SplitPath(iso->GetFileName(), &path, 0, 0); + File::Explore(path); +} + +void +CGameListCtrl::OnEditPatchFile(wxCommandEvent& WXUNUSED (event)) +{ + const CISOFile *iso = GetSelectedISO(); + if (!iso) + return; + std::string filename = "Patches/" + iso->GetUniqueID() + ".ini"; + if (!File::Exists(filename)) { + if (AskYesNo("%s.ini does not exist. Do you want to create it?", iso->GetUniqueID().c_str())) { + FILE *f = fopen(filename.c_str(), "w"); + fprintf(f, "# %s - %s\r\n\r\n", iso->GetUniqueID().c_str(), iso->GetName().c_str()); + fprintf(f, "[OnFrame]\r\n#Add memory patches here.\r\n\r\n"); + fprintf(f, "[ActionReplay]\r\n#Add decrypted action replay cheats here.\r\n"); + fclose(f); + } else { + return; + } + } + File::Launch(filename); +} + void CGameListCtrl::OnSelected(wxListEvent& WXUNUSED (event)) diff --git a/Source/Core/DolphinWX/src/GameListCtrl.h b/Source/Core/DolphinWX/src/GameListCtrl.h index d324887eba..748047daee 100644 --- a/Source/Core/DolphinWX/src/GameListCtrl.h +++ b/Source/Core/DolphinWX/src/GameListCtrl.h @@ -20,20 +20,18 @@ #include +#include "wx/listctrl.h" + #include "ISOFile.h" -// Define a new application -class CGameListCtrl - : public wxListCtrl +class CGameListCtrl : public wxListCtrl { public: CGameListCtrl(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style); - void Update(); - void BrowseForDirectory(); - + const CISOFile *GetSelectedISO() const; private: @@ -51,13 +49,12 @@ class CGameListCtrl std::vectorm_FlagImageIndex; bool m_test; - std::vectorm_ISOFiles; + std::vector m_ISOFiles; void InitBitmaps(); void InsertItemInReportView(size_t _Index); void ScanForISOs(); - DECLARE_EVENT_TABLE() // events @@ -68,6 +65,8 @@ class CGameListCtrl void OnSelected(wxListEvent& event); void OnActivated(wxListEvent& event); void OnSize(wxSizeEvent& event); + void OnEditPatchFile(wxCommandEvent& event); + void OnOpenContainingFolder(wxCommandEvent& event); virtual bool MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem); diff --git a/Source/Core/DolphinWX/src/Globals.h b/Source/Core/DolphinWX/src/Globals.h index f4f1f4890b..2f1209117e 100644 --- a/Source/Core/DolphinWX/src/Globals.h +++ b/Source/Core/DolphinWX/src/Globals.h @@ -25,6 +25,8 @@ enum IDM_PLAY, IDM_STOP, IDM_BROWSE, + IDM_EDITPATCHFILE, + IDM_OPENCONTAININGFOLDER, IDM_PLUGIN_OPTIONS, IDM_CONFIG_GFX_PLUGIN, IDM_CONFIG_DSP_PLUGIN, diff --git a/Source/Core/DolphinWX/src/ISOFile.cpp b/Source/Core/DolphinWX/src/ISOFile.cpp index a1098d041e..54a21a4c45 100644 --- a/Source/Core/DolphinWX/src/ISOFile.cpp +++ b/Source/Core/DolphinWX/src/ISOFile.cpp @@ -44,6 +44,7 @@ CISOFile::CISOFile(const std::string& _rFileName) m_Country = pVolume->GetCountry(); m_FileSize = pVolume->GetSize(); m_Name = pVolume->GetName(); + m_UniqueID = pVolume->GetUniqueID(); // check if we can get some infos from the banner file too DiscIO::IFileSystem* pFileSystem = DiscIO::CreateFileSystem(*pVolume); @@ -56,7 +57,7 @@ CISOFile::CISOFile(const std::string& _rFileName) { if (pBannerLoader->IsValid()) { - pBannerLoader->GetName(m_Name); + pBannerLoader->GetName(m_Name, 0); //m_Country == DiscIO::IVolume::COUNTRY_JAP ? 1 : 0); pBannerLoader->GetCompany(m_Company); if (pBannerLoader->GetBanner(g_ImageTemp)) diff --git a/Source/Core/DolphinWX/src/ISOFile.h b/Source/Core/DolphinWX/src/ISOFile.h index d618e94341..a8ff08dd7a 100644 --- a/Source/Core/DolphinWX/src/ISOFile.h +++ b/Source/Core/DolphinWX/src/ISOFile.h @@ -29,30 +29,31 @@ class CISOFile bool IsValid() const {return(m_Valid);} - const std::string& GetFileName() const {return(m_FileName);} - const std::string& GetName() const {return(m_Name);} - const std::string& GetCompany() const {return(m_Company);} + const std::string& GetUniqueID() const {return(m_UniqueID);} DiscIO::IVolume::ECountry GetCountry() const {return(m_Country);} - u64 GetFileSize() const {return(m_FileSize);} - const wxImage& GetImage() const {return(m_Image);} + bool operator < (const CISOFile &other) const { + // HACK - they end up in reverse order in the list view + return strcmp(m_Name.c_str(), other.m_Name.c_str()) > 0; + } private: std::string m_FileName; std::string m_Name; std::string m_Company; + std::string m_UniqueID; u64 m_FileSize; diff --git a/Source/Core/VideoCommon/Src/BPMemory.cpp b/Source/Core/VideoCommon/Src/BPMemory.cpp index 483edad1ae..22419d16ba 100644 --- a/Source/Core/VideoCommon/Src/BPMemory.cpp +++ b/Source/Core/VideoCommon/Src/BPMemory.cpp @@ -1,7 +1,23 @@ +// Copyright (C) 2003-2008 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + #include "Common.h" #include "BPMemory.h" //BP state -BPMemory bpmem; - +BPMemory bpmem; \ No newline at end of file diff --git a/Source/Core/VideoCommon/Src/BPMemory.h b/Source/Core/VideoCommon/Src/BPMemory.h index 42eb872647..7e029af09a 100644 --- a/Source/Core/VideoCommon/Src/BPMemory.h +++ b/Source/Core/VideoCommon/Src/BPMemory.h @@ -1,3 +1,20 @@ +// Copyright (C) 2003-2008 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + #ifndef _BPMEMORY_H #define _BPMEMORY_H @@ -5,6 +22,35 @@ #pragma pack(4) +#define BPMEM_GENMODE 0x00 +#define BPMEM_IND_MTX 0x06 +#define BPMEM_RAS1_SS0 0x25 // ind tex coord scale 0 +#define BPMEM_RAS1_SS1 0x26 // ind tex coord scale 1 +#define BPMEM_ZMODE 0x40 +#define BPMEM_BLENDMODE 0x41 +#define BPMEM_CONSTANTALPHA 0x42 +#define BPMEM_ALPHACOMPARE 0xF3 +#define BPMEM_LINEPTWIDTH 0x22 +#define BPMEM_TEXINVALIDATE 0x66 +#define BPMEM_SCISSORTL 0x20 +#define BPMEM_SCISSORBR 0x21 +#define BPMEM_SCISSOROFFSET 0x59 +#define BPMEM_CLEARBBOX1 0x55 // let's hope not many games use bboxes.. +#define BPMEM_CLEARBBOX2 0x56 // TODO(ector): add something that watches bboxes +#define BPMEM_TEXMODE0_1 0x80 +#define BPMEM_TEXMODE0_2 0xA0 +#define BPMEM_FOGPARAM0 0xEE +#define BPMEM_FOGBMAGNITUDE 0xEF +#define BPMEM_FOGBEXPONENT 0xF0 +#define BPMEM_FOGPARAM3 0xF1 +#define BPMEM_FOGCOLOR 0xF2 +#define BPMEM_ZTEX1 0xF4 +#define BPMEM_ZTEX2 0xF5 +#define BPMEM_DRAWDONE 0x45 + +#define BPMEM_PE_TOKEN_ID 0x47 +#define BPMEM_PE_TOKEN_INT_ID 0x48 + ////////////////////////////////////////////////////////////////////////// // Tev/combiner things ////////////////////////////////////////////////////////////////////////// diff --git a/Source/Core/VideoCommon/Src/CPMemory.cpp b/Source/Core/VideoCommon/Src/CPMemory.cpp index 36d910f038..5a47b6044e 100644 --- a/Source/Core/VideoCommon/Src/CPMemory.cpp +++ b/Source/Core/VideoCommon/Src/CPMemory.cpp @@ -1,7 +1,25 @@ +// Copyright (C) 2003-2008 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + #include "Common.h" #include "CPMemory.h" // CP state u32 arraybases[16]; u32 arraystrides[16]; - +TMatrixIndexA MatrixIndexA; +TMatrixIndexB MatrixIndexB; diff --git a/Source/Core/VideoCommon/Src/CPMemory.h b/Source/Core/VideoCommon/Src/CPMemory.h index 5200ff7b59..8e17ba8f64 100644 --- a/Source/Core/VideoCommon/Src/CPMemory.h +++ b/Source/Core/VideoCommon/Src/CPMemory.h @@ -1,3 +1,20 @@ +// Copyright (C) 2003-2008 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + #ifndef _CPMEMORY_H #define _CPMEMORY_H @@ -183,9 +200,45 @@ struct TVtxAttr u8 NormalIndex3; }; +// Matrix indices +union TMatrixIndexA +{ + struct + { + unsigned PosNormalMtxIdx : 6; + unsigned Tex0MtxIdx : 6; + unsigned Tex1MtxIdx : 6; + unsigned Tex2MtxIdx : 6; + unsigned Tex3MtxIdx : 6; + }; + struct + { + u32 Hex : 30; + u32 unused : 2; + }; +}; + +union TMatrixIndexB +{ + struct + { + unsigned Tex4MtxIdx : 6; + unsigned Tex5MtxIdx : 6; + unsigned Tex6MtxIdx : 6; + unsigned Tex7MtxIdx : 6; + }; + struct + { + u32 Hex : 24; + u32 unused : 8; + }; +}; + #pragma pack() extern u32 arraybases[16]; extern u32 arraystrides[16]; +extern TMatrixIndexA MatrixIndexA; +extern TMatrixIndexB MatrixIndexB; #endif diff --git a/Source/Core/VideoCommon/Src/LookUpTables.cpp b/Source/Core/VideoCommon/Src/LookUpTables.cpp index fd69cee6d9..cf12c3fd7b 100644 --- a/Source/Core/VideoCommon/Src/LookUpTables.cpp +++ b/Source/Core/VideoCommon/Src/LookUpTables.cpp @@ -1,3 +1,20 @@ +// Copyright (C) 2003-2008 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + #include "LookUpTables.h" int lut3to8[8]; diff --git a/Source/Core/VideoCommon/Src/LookUpTables.h b/Source/Core/VideoCommon/Src/LookUpTables.h index 43e86e8209..4c0bc0c5d5 100644 --- a/Source/Core/VideoCommon/Src/LookUpTables.h +++ b/Source/Core/VideoCommon/Src/LookUpTables.h @@ -1,3 +1,20 @@ +// Copyright (C) 2003-2008 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + #ifndef _LOOKUPTABLES_H #define _LOOKUPTABLES_H diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp similarity index 96% rename from Source/Plugins/Plugin_VideoOGL/Src/TextureDecoder.cpp rename to Source/Core/VideoCommon/Src/TextureDecoder.cpp index 0dcd3ff8c6..7ce75f5c56 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -15,7 +15,6 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#include "Globals.h" #include "Common.h" #include "TextureDecoder.h" @@ -329,8 +328,6 @@ void decodeDXTBlock(u32 *dst, DXTBlock *src, int pitch) //need to add DXT support too PC_TexFormat TexDecoder_Decode(u8 *dst, u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt) { - DVSTARTPROFILE(); - switch (texformat) { case GX_TF_C4: diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureDecoder.h b/Source/Core/VideoCommon/Src/TextureDecoder.h similarity index 100% rename from Source/Plugins/Plugin_VideoOGL/Src/TextureDecoder.h rename to Source/Core/VideoCommon/Src/TextureDecoder.h diff --git a/Source/Core/VideoCommon/Src/XFMemory.cpp b/Source/Core/VideoCommon/Src/XFMemory.cpp index bf8c95dc0f..7d3dbbe0d9 100644 --- a/Source/Core/VideoCommon/Src/XFMemory.cpp +++ b/Source/Core/VideoCommon/Src/XFMemory.cpp @@ -1,3 +1,20 @@ +// Copyright (C) 2003-2008 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + #include "XFMemory.h" XFRegisters xfregs; diff --git a/Source/Core/VideoCommon/Src/XFMemory.h b/Source/Core/VideoCommon/Src/XFMemory.h index 995463c7bf..49b3e6fdc3 100644 --- a/Source/Core/VideoCommon/Src/XFMemory.h +++ b/Source/Core/VideoCommon/Src/XFMemory.h @@ -1,3 +1,20 @@ +// Copyright (C) 2003-2008 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + #ifndef _XFMEMORY_H #define _XFMEMORY_H @@ -168,40 +185,6 @@ struct XFRegisters #define XFMEM_LIGHTS 0x600 #define XFMEM_LIGHTS_END 0x680 -// Matrix indices -union TMatrixIndexA -{ - struct - { - unsigned PosNormalMtxIdx : 6; - unsigned Tex0MtxIdx : 6; - unsigned Tex1MtxIdx : 6; - unsigned Tex2MtxIdx : 6; - unsigned Tex3MtxIdx : 6; - }; - struct - { - u32 Hex : 30; - u32 unused : 2; - }; -}; - -union TMatrixIndexB -{ - struct - { - unsigned Tex4MtxIdx : 6; - unsigned Tex5MtxIdx : 6; - unsigned Tex6MtxIdx : 6; - unsigned Tex7MtxIdx : 6; - }; - struct - { - u32 Hex : 24; - u32 unused : 8; - }; -}; - struct Viewport { float wd; diff --git a/Source/Core/VideoCommon/VideoCommon.vcproj b/Source/Core/VideoCommon/VideoCommon.vcproj index d768ad6fc4..841200e4f1 100644 --- a/Source/Core/VideoCommon/VideoCommon.vcproj +++ b/Source/Core/VideoCommon/VideoCommon.vcproj @@ -405,6 +405,10 @@ RelativePath=".\Src\CPMemory.h" > + + @@ -413,6 +417,14 @@ RelativePath=".\Src\LookUpTables.h" > + + + + diff --git a/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj b/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj index f7097511cd..c9f95f106a 100644 --- a/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj +++ b/Source/Plugins/Plugin_VideoDX9/Plugin_VideoDX9.vcproj @@ -1366,14 +1366,6 @@ RelativePath=".\Src\TextureCache.h" > - - - - @@ -1395,18 +1387,6 @@ > - - - - - - @@ -1487,6 +1467,10 @@ RelativePath=".\Src\Globals.h" > + + diff --git a/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.cpp b/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.cpp index 875b3eb58c..c038a9aacf 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.cpp @@ -12,40 +12,8 @@ #include "main.h" //for the plugin interface -//BP state -BPMemory bpmem; - bool textureChanged[8]; -#define BPMEM_GENMODE 0x00 -#define BPMEM_IND_MTX 0x06 -#define BPMEM_RAS1_SS0 0x25 // ind tex coord scale 0 -#define BPMEM_RAS1_SS1 0x26 // ind tex coord scale 1 -#define BPMEM_ZMODE 0x40 -#define BPMEM_BLENDMODE 0x41 -#define BPMEM_CONSTANTALPHA 0x42 -#define BPMEM_ALPHACOMPARE 0xF3 -#define BPMEM_LINEPTWIDTH 0x22 -#define BPMEM_TEXINVALIDATE 0x66 -#define BPMEM_SCISSORTL 0x20 -#define BPMEM_SCISSORBR 0x21 -#define BPMEM_SCISSOROFFSET 0x59 -#define BPMEM_CLEARBBOX1 0x55 // let's hope not many games use bboxes.. -#define BPMEM_CLEARBBOX2 0x56 // TODO(ector): add something that watches bboxes -#define BPMEM_TEXMODE0_1 0x80 -#define BPMEM_TEXMODE0_2 0xA0 -#define BPMEM_FOGPARAM0 0xEE -#define BPMEM_FOGBMAGNITUDE 0xEF -#define BPMEM_FOGBEXPONENT 0xF0 -#define BPMEM_FOGPARAM3 0xF1 -#define BPMEM_FOGCOLOR 0xF2 -#define BPMEM_ZTEX1 0xF4 -#define BPMEM_ZTEX2 0xF5 -#define BPMEM_DRAWDONE 0x45 - -#define BPMEM_PE_TOKEN_ID 0x47 -#define BPMEM_PE_TOKEN_INT_ID 0x48 - // State translation lookup tables const D3DBLEND d3dSrcFactors[8] = { @@ -107,7 +75,6 @@ const D3DTEXTUREADDRESS d3dClamps[4] = D3DTADDRESS_WRAP //reserved }; - void BPInit() { memset(&bpmem, 0, sizeof(bpmem)); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.h b/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.h index e0f3d912c7..476d55ef3b 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/BPStructs.h @@ -9,7 +9,6 @@ void BPInit(); size_t BPSaveLoadState(char *ptr, BOOL save); //bool BPWritten(int addr, int changes); void LoadBPReg(u32 value0); - void ActivateTextures(); #endif \ No newline at end of file diff --git a/Source/Plugins/Plugin_VideoDX9/Src/CPStructs.cpp b/Source/Plugins/Plugin_VideoDX9/Src/CPStructs.cpp index f6eb5604a5..5d0b6682cb 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/CPStructs.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/CPStructs.cpp @@ -6,9 +6,6 @@ #include "VertexHandler.h" #include "VertexLoader.h" -TMatrixIndexA MatrixIndexA; -TMatrixIndexB MatrixIndexB; - // PROBLEM - matrix switching within vbuffers may be stateful! void CPUpdateMatricesA() @@ -65,10 +62,10 @@ void LoadCPReg(u32 SubCmd, u32 Value) size_t CPSaveLoadState(char *ptr, BOOL save) { BEGINSAVELOAD; - SAVELOAD(arraybases,16*sizeof(u32)); - SAVELOAD(arraystrides,16*sizeof(u32)); - SAVELOAD(&MatrixIndexA,sizeof(TMatrixIndexA)); - SAVELOAD(&MatrixIndexB,sizeof(TMatrixIndexB)); + SAVELOAD(arraybases, 16 * sizeof(u32)); + SAVELOAD(arraystrides, 16 * sizeof(u32)); + SAVELOAD(&MatrixIndexA, sizeof(TMatrixIndexA)); + SAVELOAD(&MatrixIndexB, sizeof(TMatrixIndexB)); if (!save) { CPUpdateMatricesA(); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/CPStructs.h b/Source/Plugins/Plugin_VideoDX9/Src/CPStructs.h index 344a8e8b01..cb3e669d1f 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/CPStructs.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/CPStructs.h @@ -5,11 +5,6 @@ #include "CPMemory.h" #include "XFMemory.h" -extern TMatrixIndexA MatrixIndexA; -extern TMatrixIndexB MatrixIndexB; -extern u32 arraybases[16]; -extern u32 arraystrides[16]; - void CPUpdateMatricesA(); void CPUpdateMatricesB(); size_t CPSaveLoadState(char *ptr, BOOL save); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp b/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp index ce7056b837..cbd2df629d 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp @@ -50,29 +50,6 @@ namespace D3D return vShader; } - LPDIRECT3DVERTEXSHADER9 LoadVShader(const char *filename) - { - //alloc a temp buffer for code - char *temp = new char[65536]; - - //open and read the file - FILE *f = fopen(filename,"rb"); - if (!f) - { - MessageBox(0,"FATAL ERROR Vertex Shader file not found",filename,0); - return 0; - } - fseek(f,0,SEEK_END); - int len = ftell(f); - fseek(f,0,SEEK_SET); - fread(temp,len,1,f); - fclose(f); - LPDIRECT3DVERTEXSHADER9 vShader = CompileVShader(temp,len); - //kill off our temp code buffer - delete [] temp; - //return the compiled shader, or null - return vShader; - } LPDIRECT3DPIXELSHADER9 CompilePShader(const char *code, int len) { @@ -111,26 +88,4 @@ namespace D3D return pShader; } - - LPDIRECT3DPIXELSHADER9 LoadPShader(const char *filename) - { - //open and read the file - FILE *f = fopen(filename,"rb"); - if (!f) - { - MessageBox(0,"FATAL ERROR Pixel Shader file not found",filename,0); - return 0; - } - fseek(f,0,SEEK_END); - int len = ftell(f); - char *temp = new char[len]; - fseek(f,0,SEEK_SET); - fread(temp,len,1,f); - fclose(f); - LPDIRECT3DPIXELSHADER9 pShader = CompilePShader(temp,len); - //kill off our temp code buffer - delete [] temp; - //return the compiled shader, or null - return pShader; - } } diff --git a/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.h b/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.h index adedeec47d..a37ddaabcc 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.h @@ -5,7 +5,5 @@ namespace D3D { LPDIRECT3DVERTEXSHADER9 CompileVShader(const char *code, int len); - LPDIRECT3DVERTEXSHADER9 LoadVShader(const char *filename); LPDIRECT3DPIXELSHADER9 CompilePShader(const char *code, int len); - LPDIRECT3DPIXELSHADER9 LoadPShader(const char *filename); } \ No newline at end of file diff --git a/Source/Plugins/Plugin_VideoDX9/Src/DecodedVArray.h b/Source/Plugins/Plugin_VideoDX9/Src/DecodedVArray.h index f9192daaf2..82190e2ee2 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/DecodedVArray.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/DecodedVArray.h @@ -29,7 +29,7 @@ public: int count; DecodedVArray(); ~DecodedVArray(); - void SetComponents(u32 comps) {components = comps; vertexSize=ComputeVertexSize(components);} + void SetComponents(u32 comps) {components = comps; vertexSize = ComputeVertexSize(components);} u32 GetComponents() const {return components;} void Create(int _size, int pmcount, int tmcount, int nrmcount, int colcount, int tccount); void Zero(); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Fifo.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Fifo.cpp index 5db2135442..1e95450c85 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Fifo.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Fifo.cpp @@ -1,3 +1,20 @@ +// Copyright (C) 2003-2008 Dolphin Project. + +// 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, version 2.0. + +// 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 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official SVN repository and contact information can be found at +// http://code.google.com/p/dolphin-emu/ + #include #include @@ -31,7 +48,7 @@ int FAKE_GetFifoSize() { if (size < readptr) { - DebugBreak(); + PanicAlert("GFX Fifo underrun encountered."); } return (size - readptr); } @@ -70,6 +87,11 @@ u32 FAKE_ReadFifo32() return val; } +void FAKE_SkipFifo(u32 skip) +{ + readptr += skip; +} + void Video_SendFifoData(BYTE *_uData) { memcpy(videoBuffer + size, _uData, 32); @@ -78,7 +100,7 @@ void Video_SendFifoData(BYTE *_uData) { if (FAKE_GetFifoSize() > readptr) { - MessageBox(NULL, "out of bounds", "video-plugin", MB_OK); + PanicAlert("FIFO out of bounds", "video-plugin", MB_OK); exit(1); } diff --git a/Source/Plugins/Plugin_VideoDX9/Src/OpcodeDecoding.cpp b/Source/Plugins/Plugin_VideoDX9/Src/OpcodeDecoding.cpp index 5fd60618b3..1dbb77edbf 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/OpcodeDecoding.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/OpcodeDecoding.cpp @@ -152,8 +152,14 @@ bool FifoCommandRunnable(void) } else { - char szTemp[512]; - sprintf(szTemp, "Error: Unknown Opcode (0x%x)", Cmd); + char szTemp[1024]; + sprintf(szTemp, "GFX: Unknown Opcode (0x%x).\n" + "This means one of the following:\n" + "* The emulated GPU got desynced, disabling dual core can help\n" + "* Command stream corrupted by some spurious memory bug\n" + "* This really is an unknown opcode (unlikely)\n\n" + "* Some other sort of bug\n\n" + "Dolphin will now likely crash or hang. Enjoy.", Cmd); MessageBox(NULL, szTemp, "Video-Plugin", MB_OK); g_VideoInitialize.pLog(szTemp, TRUE); } diff --git a/Source/Plugins/Plugin_VideoDX9/Src/PixelShader.cpp b/Source/Plugins/Plugin_VideoDX9/Src/PixelShader.cpp index f56feb0b2b..dc0f1f4abb 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/PixelShader.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/PixelShader.cpp @@ -1,10 +1,7 @@ #include "Globals.h" -#include "D3DShader.h" #include "PixelShader.h" #include "BPStructs.h" #include "XFStructs.h" -#include "W32Util/Misc.h" -#include "Utils.h" /* old tev->pixelshader notes @@ -239,32 +236,6 @@ const char *alphaRef[2] = }; -//I hope we don't get too many hash collisions :p -//all these magic numbers are primes, it should help a bit -tevhash GetCurrentTEV() -{ - u32 hash = bpmem.genMode.numindstages + bpmem.genMode.numtevstages*11 + bpmem.genMode.numtexgens*8*17; - for (int i = 0; i < (int)bpmem.genMode.numtevstages+1; i++) - { - hash = _rotl(hash,3) ^ (bpmem.combiners[i].colorC.hex*13); - hash = _rotl(hash,7) ^ ((bpmem.combiners[i].alphaC.hex&0xFFFFFFFC)*3); - hash = _rotl(hash,9) ^ xfregs.texcoords[i].texmtxinfo.projection*451; - } - for (int i = 0; i < (int)bpmem.genMode.numtevstages/2+1; i++) - { - hash = _rotl(hash,13) ^ (bpmem.tevorders[i].hex*7); - } - for (int i = 0; i < 8; i++) - { - hash = _rotl(hash,3) ^ bpmem.tevksel[i].swap1; - hash = _rotl(hash,3) ^ bpmem.tevksel[i].swap2; - } - hash ^= bpmem.dstalpha.enable ^ 0xc0debabe; - hash = _rotl(hash,4) ^ bpmem.alphaFunc.comp0*7; - hash = _rotl(hash,4) ^ bpmem.alphaFunc.comp1*13; - hash = _rotl(hash,4) ^ bpmem.alphaFunc.logic*11; - return hash; -} char text[65536]; #define WRITE p+=sprintf @@ -290,12 +261,8 @@ void BuildSwapModeTable() } } - - -LPDIRECT3DPIXELSHADER9 GeneratePixelShader() +const char *GeneratePixelShader() { - DVSTARTPROFILE(); - BuildSwapModeTable(); int numStages = bpmem.genMode.numtevstages + 1; int numTexgen = bpmem.genMode.numtexgens; @@ -332,14 +299,9 @@ LPDIRECT3DPIXELSHADER9 GeneratePixelShader() WRITE(p,"float4 c0=color0,c1=color1,c2=color2,prev=float4(0.0f,0.0f,0.0f,0.0f),textemp,rastemp,konsttemp;\n"); WRITE(p,"\n"); - //WRITE(p, "return 1;}\n"); - //return D3D::CompilePShader(text,(int)(p-text)); - for (int i = 0; i < numStages; i++) WriteStage(p,i); //build the equation for this stage - //WRITE(p, "prev = textemp;\n"); - //WRITE(p, "prev = float4(uv[0].x,uv[0].y,0,1);\n"); WriteAlphaTest(p); if (bpmem.dstalpha.enable) @@ -350,18 +312,7 @@ LPDIRECT3DPIXELSHADER9 GeneratePixelShader() WRITE(p,"}\n"); WRITE(p,"\0"); -//#ifndef TEASER -/* - FILE *f=fopen("D:\\dlistlogs.txt","a"); - fprintf(f,"===========================================\n"); - fprintf(f,"%s",text); - fclose(f); -*/ - //W32Util::CopyTextToClipboard(0,text); -//#endif - - //MessageBox(0,text,0,0); - return D3D::CompilePShader(text,(int)(p-text)); + return text; } void WriteStage(char *&p, int n) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/PixelShader.h b/Source/Plugins/Plugin_VideoDX9/Src/PixelShader.h index f66bf91415..17c83143eb 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/PixelShader.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/PixelShader.h @@ -1,11 +1,9 @@ #pragma once #include "Common.h" +#include "D3DShader.h" -typedef u32 tevhash; - -tevhash GetCurrentTEV(); -LPDIRECT3DPIXELSHADER9 GeneratePixelShader(); +const char *GeneratePixelShader(); #define PS_CONST_COLORS 0 #define PS_CONST_KCOLORS 4 diff --git a/Source/Plugins/Plugin_VideoDX9/Src/ShaderManager.cpp b/Source/Plugins/Plugin_VideoDX9/Src/ShaderManager.cpp index fdc034eb20..9b28e8ce0c 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/ShaderManager.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/ShaderManager.cpp @@ -2,6 +2,37 @@ #include "Utils.h" #include "Globals.h" #include "ShaderManager.h" +#include "BPMemory.h" +#include "XFMemory.h" + + +//I hope we don't get too many hash collisions :p +//all these magic numbers are primes, it should help a bit +tevhash GetCurrentTEV() +{ + u32 hash = bpmem.genMode.numindstages + bpmem.genMode.numtevstages*11 + bpmem.genMode.numtexgens*8*17; + for (int i = 0; i < (int)bpmem.genMode.numtevstages+1; i++) + { + hash = _rotl(hash,3) ^ (bpmem.combiners[i].colorC.hex*13); + hash = _rotl(hash,7) ^ ((bpmem.combiners[i].alphaC.hex&0xFFFFFFFC)*3); + hash = _rotl(hash,9) ^ xfregs.texcoords[i].texmtxinfo.projection*451; + } + for (int i = 0; i < (int)bpmem.genMode.numtevstages/2+1; i++) + { + hash = _rotl(hash,13) ^ (bpmem.tevorders[i].hex*7); + } + for (int i = 0; i < 8; i++) + { + hash = _rotl(hash,3) ^ bpmem.tevksel[i].swap1; + hash = _rotl(hash,3) ^ bpmem.tevksel[i].swap2; + } + hash ^= bpmem.dstalpha.enable ^ 0xc0debabe; + hash = _rotl(hash,4) ^ bpmem.alphaFunc.comp0*7; + hash = _rotl(hash,4) ^ bpmem.alphaFunc.comp1*13; + hash = _rotl(hash,4) ^ bpmem.alphaFunc.logic*11; + return hash; +} + PShaderCache::PSCache PShaderCache::pshaders; VShaderCache::VSCache VShaderCache::vshaders; @@ -47,8 +78,8 @@ void PShaderCache::SetShader() return; } - LPDIRECT3DPIXELSHADER9 shader = GeneratePixelShader(); - + const char *code = GeneratePixelShader(); + LPDIRECT3DPIXELSHADER9 shader = D3D::CompilePShader(code, strlen(code)); if (shader) { //Make an entry in the table diff --git a/Source/Plugins/Plugin_VideoDX9/Src/ShaderManager.h b/Source/Plugins/Plugin_VideoDX9/Src/ShaderManager.h index 21a0a4d801..dd53640526 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/ShaderManager.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/ShaderManager.h @@ -6,6 +6,9 @@ #include "PixelShader.h" #include "VertexShader.h" +typedef u32 tevhash; + +tevhash GetCurrentTEV(); class PShaderCache diff --git a/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp index 0a4e7c0151..479a4fc882 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp @@ -141,7 +141,13 @@ void TextureCache::Load(int stage, DWORD address, int width, int height, int for int bs = TexDecoder_GetBlockWidthInTexels(format)-1; //TexelSizeInNibbles(format)*width*height/16; int expandedWidth = (width+bs) & (~bs); - D3DFORMAT dfmt = TexDecoder_Decode(temp,ptr,expandedWidth,height,format, tlutaddr, tlutfmt); + PC_TexFormat pcfmt = TexDecoder_Decode(temp,ptr,expandedWidth,height,format, tlutaddr, tlutfmt); + D3DFORMAT d3d_fmt; + switch (pcfmt) { + case PC_TEX_FMT_BGRA32: + d3d_fmt = D3DFMT_A8R8G8B8; + break; + } //Make an entry in the table TCacheEntry entry; @@ -154,7 +160,7 @@ void TextureCache::Load(int stage, DWORD address, int width, int height, int for entry.addr = address; entry.isRenderTarget=false; entry.isNonPow2 = ((width&(width-1)) || (height&(height-1))); - entry.texture = D3D::CreateTexture2D((BYTE*)temp,width,height,expandedWidth,dfmt); + entry.texture = D3D::CreateTexture2D((BYTE*)temp, width, height, expandedWidth, d3d_fmt); entry.frameCount = frameCount; entry.w=width; entry.h=height; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/TextureDecoder.cpp b/Source/Plugins/Plugin_VideoDX9/Src/TextureDecoder.cpp deleted file mode 100644 index 90b2963e90..0000000000 --- a/Source/Plugins/Plugin_VideoDX9/Src/TextureDecoder.cpp +++ /dev/null @@ -1,447 +0,0 @@ -#include "stdafx.h" -#include "D3DBase.h" - -#include "main.h" -#include "Utils.h" - -#include "BPStructs.h" -#include "TextureDecoder.h" - -#include "OpcodeDecoding.h" - - -// TRAM -u8 texMem[TMEM_SIZE]; - -////////////////////////////////////////////////////////////////////////// -// Gamecube texture decoder -////////////////////////////////////////////////////////////////////////// -// Decodes all known Gamecube texture formats. -// TODO - speedup -// by ector -////////////////////////////////////////////////////////////////////////// -int TexDecoder_GetTexelSizeInNibbles(int format) -{ - switch(format) { - case GX_TF_I4: return 1; - case GX_TF_I8: return 2; - case GX_TF_IA4: return 2; - case GX_TF_IA8: return 4; - case GX_TF_RGB565: return 4; - case GX_TF_RGB5A3: return 4; - case GX_TF_RGBA8: return 8; - case GX_TF_C4: return 1; - case GX_TF_C8: return 2; - case GX_TF_C14X2: return 4; - case GX_TF_CMPR: return 1; - default: return 1; - } -} -int TexDecoder_GetBlockWidthInTexels(int format) -{ - switch(format) { - case GX_TF_I4: return 8; - case GX_TF_I8: return 8; - case GX_TF_IA4: return 8; - case GX_TF_IA8: return 4; - case GX_TF_RGB565: return 4; - case GX_TF_RGB5A3: return 4; - case GX_TF_RGBA8: return 4; - case GX_TF_C4: return 8; - case GX_TF_C8: return 8; - case GX_TF_C14X2: return 4; - case GX_TF_CMPR: return 8; - default:return 8; - } -} - -//returns bytes -int TexDecoder_GetPaletteSize(int format) -{ - switch (format) { - case GX_TF_C4: return 16*2; - case GX_TF_C8: return 256*2; - case GX_TF_C14X2: return 16384*2; - default: - return 0; - } -} - -inline u32 decode565(u16 val) -{ - int r,g,b,a; - r=lut5to8[(val>>11)&0x1f]; - g=lut6to8[(val>>5 )&0x3f]; - b=lut5to8[(val )&0x1f]; - a=0xFF; - return (a<<24) | (r<<16) | (g<<8) | b; -} - -inline u32 decodeIA8(u16 val) -{ - int a=val>>8; - int r,g,b; - r=g=b=val&0xFF; - return (a<<24) | (r<<16) | (g<<8) | b; -} - -inline u32 decode5A3(u16 val) -{ - int r,g,b,a; - if ((val&0x8000)) - { - r=lut5to8[(val>>10)&0x1f]; - g=lut5to8[(val>>5 )&0x1f]; - b=lut5to8[(val )&0x1f]; - a=0xFF; - } - else - { - a=lut3to8[(val>>12)&0x7]; - r=lut4to8[(val>>8 )&0xf]; - g=lut4to8[(val>>4 )&0xf]; - b=lut4to8[(val )&0xf]; - } - return (a<<24) | (r<<16) | (g<<8) | b; -} - - - -struct DXTBlock -{ - u16 color1; - u16 color2; - u8 lines[4]; -}; - -inline int expand8888(const int j) -{ - int i = j | (j<<8); - return i|(i<<16); -} - -void decodebytesI4(u32 *dst, u8 *src, int numbytes) -{ - for (int x=0; x>4]); - *dst++ = expand8888(lut4to8[val&15]); - } -} - -void decodebytesI8(u32 *dst, u8 *src, int numbytes) -{ - for (int x=0; x>4)])); - *dst++ = decodeIA8(_byteswap_ushort(tlut[(val&15)])); - break; - case 1: - *dst++ = decode565(_byteswap_ushort(tlut[(val>>4)])); - *dst++ = decode565(_byteswap_ushort(tlut[(val&15)])); - break; - case 2: - *dst++ = decode5A3(_byteswap_ushort(tlut[(val>>4)])); - *dst++ = decode5A3(_byteswap_ushort(tlut[(val&15)])); - break; - case 3: //ERROR - *dst++ = 0xFFFF00FF; - *dst++ = 0xFFFF00FF; - break; - } - } -} - -void decodebytesC8(u32 *dst, u8 *src, int numbytes, int tlutaddr, int tlutfmt) -{ - u16 *tlut = (u16*)(texMem+tlutaddr); - for (int x=0; x>4]; - int r = lut4to8[val&15]; - *dst++ = (a<<24) | (r<<16) | (r<<8) | r; - } -} - -inline void decodebytesIA8(u32 *dst, u16 *src, int numpixels) -{ - for (int x=0; x>=8; - - *dst++ = (a<<16) | (val<<24); - } -} -void decodebytesARGB8pass2(u32 *dst, u16 *src, int numpixels) -{ - for (int x=0; x>=8; - - *dst++ |= (val<<8) | (a<<0); - } -} - -inline u32 makecol(int r,int g,int b,int a) -{ - return ((a&255)<<24)|((r&255)<<16)|((g&255)<<8)|((b&255)); -} - - -//this needs to be FAST, used by some games realtime video -//TODO: port to ASM or intrinsics -void decodeDXTBlock(u32 *dst, DXTBlock *src, int pitch) -{ - u16 c1 = _byteswap_ushort(src->color1); - u16 c2 = _byteswap_ushort(src->color2); - int blue1 = lut5to8[c1&0x1F]; - int blue2 = lut5to8[c2&0x1F]; - int green1 = lut6to8[(c1>>5)&0x3F]; - int green2 = lut6to8[(c2>>5)&0x3F]; - int red1 = lut5to8[(c1>>11)&0x1F]; - int red2 = lut5to8[(c2>>11)&0x1F]; - - int colors[4]; - - if (c1>c2) - { - colors[0]=makecol(red1,green1,blue1,255); - colors[1]=makecol(red2,green2,blue2,255); - colors[2]=makecol(red1+(red2-red1)/3,green1+(green2-green1)/3,blue1+(blue2-blue1)/3,255); - colors[3]=makecol(red2+(red1-red2)/3,green2+(green1-green2)/3,blue2+(blue1-blue2)/3,255); - } - else - { - colors[0]=makecol(red1,green1,blue1,255); - colors[1]=makecol(red2,green2,blue2,255); - colors[2]=makecol((red1+red2)/2,(green1+green2)/2,(blue1+blue2)/2,255); - colors[3]=makecol(0,0,0,0); //transparent - } - - for (int y=0; y<4; y++) - { - int val = src->lines[y]; - for (int x=0; x<4; x++) - { - dst[x] = colors[(val>>6)&3]; - val<<=2; - } - dst+=pitch; - } -} - - -//switch endianness, unswizzle -//TODO: to save memory, don't blindly convert everything to argb8888 -//also ARGB order needs to be swapped later, to accommodate modern hardware better -//need to add DXT support too -D3DFORMAT TexDecoder_Decode(u8 *dst, u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt) -{ - DVSTARTPROFILE(); - - switch (texformat) - { - case GX_TF_C4: - { - for (int y=0; y - - - - @@ -1439,6 +1431,10 @@ RelativePath=".\Src\Globals.h" > + + diff --git a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp index 8d51a011ab..9dedf537ec 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp @@ -27,35 +27,6 @@ #include "VertexShaderManager.h" #include "PixelShaderManager.h" -#define BPMEM_GENMODE 0x00 -#define BPMEM_IND_MTX 0x06 -#define BPMEM_RAS1_SS0 0x25 // ind tex coord scale 0 -#define BPMEM_RAS1_SS1 0x26 // ind tex coord scale 1 -#define BPMEM_ZMODE 0x40 -#define BPMEM_BLENDMODE 0x41 -#define BPMEM_CONSTANTALPHA 0x42 -#define BPMEM_ALPHACOMPARE 0xF3 -#define BPMEM_LINEPTWIDTH 0x22 -#define BPMEM_TEXINVALIDATE 0x66 -#define BPMEM_SCISSORTL 0x20 -#define BPMEM_SCISSORBR 0x21 -#define BPMEM_SCISSOROFFSET 0x59 -#define BPMEM_CLEARBBOX1 0x55 // let's hope not many games use bboxes.. -#define BPMEM_CLEARBBOX2 0x56 // TODO(ector): add something that watches bboxes -#define BPMEM_TEXMODE0_1 0x80 -#define BPMEM_TEXMODE0_2 0xA0 -#define BPMEM_FOGPARAM0 0xEE -#define BPMEM_FOGBMAGNITUDE 0xEF -#define BPMEM_FOGBEXPONENT 0xF0 -#define BPMEM_FOGPARAM3 0xF1 -#define BPMEM_FOGCOLOR 0xF2 -#define BPMEM_ZTEX1 0xF4 -#define BPMEM_ZTEX2 0xF5 -#define BPMEM_DRAWDONE 0x45 - -#define BPMEM_PE_TOKEN_ID 0x47 -#define BPMEM_PE_TOKEN_INT_ID 0x48 - // State translation lookup tables const GLenum glSrcFactors[8] = { @@ -214,6 +185,7 @@ void BPWritten(int addr, int changes, int newval) if( Renderer::CanBlendLogicOp() ) { if( bpmem.blendmode.logicopenable ) { glEnable(GL_COLOR_LOGIC_OP); + PanicAlert("Logic Op Blend : %i", bpmem.blendmode.logicmode); glLogicOp(glLogicOpCodes[bpmem.blendmode.logicmode]); } else glDisable(GL_COLOR_LOGIC_OP); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp b/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp index 5741bc5c3d..5079cb9060 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/OpcodeDecoding.cpp @@ -150,8 +150,14 @@ bool FifoCommandRunnable(void) } } else { - char szTemp[512]; - sprintf(szTemp, "Error: Unknown Opcode (0x%x)", Cmd); + char szTemp[1024]; + sprintf(szTemp, "GFX: Unknown Opcode (0x%x).\n" + "This means one of the following:\n" + "* The emulated GPU got desynced, disabling dual core can help\n" + "* Command stream corrupted by some spurious memory bug\n" + "* This really is an unknown opcode (unlikely)\n\n" + "* Some other sort of bug\n\n" + "Dolphin will now likely crash or hang. Enjoy.", Cmd); SysMessage(szTemp); g_VideoInitialize.pLog(szTemp, TRUE); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/PixelShader.cpp b/Source/Plugins/Plugin_VideoOGL/Src/PixelShader.cpp index 732a2661cc..cb741b6afb 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/PixelShader.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/PixelShader.cpp @@ -234,6 +234,12 @@ const char *tevRasTable[] = "float4(0,0,0,0)", // zero }; +const char *alphaRef[2] = +{ + I_ALPHA"[0].x", + I_ALPHA"[0].y" +}; + const char *tevTexFunc[] = { "tex2D", "texRECT" }; const char *tevCOutputTable[] = { "prev.rgb", "c0.rgb", "c1.rgb", "c2.rgb" }; @@ -742,12 +748,6 @@ void WrapNonPow2Tex(char* &p, const char* var, int texmap, u32 texture_mask) } } -const char *alphaRef[2] = -{ - I_ALPHA"[0].x", - I_ALPHA"[0].y" -}; - void WriteAlphaCompare(char *&p, int num, int comp) { switch(comp) { diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp index 096afabe08..60d4929179 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.cpp @@ -28,8 +28,6 @@ VertexShaderMngr::VSCache VertexShaderMngr::vshaders; VERTEXSHADER* VertexShaderMngr::pShaderLast = NULL; -TMatrixIndexA VertexShaderMngr::MatrixIndexA; -TMatrixIndexB VertexShaderMngr::MatrixIndexB; float VertexShaderMngr::rawViewport[6] = {0}; float VertexShaderMngr::rawProjection[7] = {0}; float GC_ALIGNED16(g_fProjectionMatrix[16]); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.h b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.h index 67f26704a7..347942d154 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderManager.h @@ -93,10 +93,8 @@ class VertexShaderMngr static VSCache vshaders; static VERTEXSHADER* pShaderLast; - static TMatrixIndexA MatrixIndexA; - static TMatrixIndexB MatrixIndexB; - static void GetVertexShaderId(VERTEXSHADERUID& uid, u32 components); + static void GetVertexShaderId(VERTEXSHADERUID& uid, u32 components); static void SetVSConstant4f(int const_number, float f1, float f2, float f3, float f4); static void SetVSConstant4fv(int const_number, const float *f); @@ -127,4 +125,5 @@ public: static float rawProjection[7]; }; + #endif