ISOProperties.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. // Copyright 2008 Dolphin Emulator Project
  2. // Licensed under GPLv2+
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <cstddef>
  6. #include <memory>
  7. #include <set>
  8. #include <string>
  9. #include <utility>
  10. #include <vector>
  11. #include <wx/dialog.h>
  12. #include <wx/treebase.h>
  13. #include "Common/IniFile.h"
  14. #include "Core/ActionReplay.h"
  15. #include "DiscIO/Filesystem.h"
  16. #include "DiscIO/Volume.h"
  17. #include "DiscIO/VolumeCreator.h"
  18. #include "DolphinWX/ARCodeAddEdit.h"
  19. #include "DolphinWX/PatchAddEdit.h"
  20. class GameListItem;
  21. class wxButton;
  22. class wxCheckBox;
  23. class wxCheckListBox;
  24. class wxChoice;
  25. class wxSlider;
  26. class wxSpinCtrl;
  27. class wxStaticBitmap;
  28. class wxTextCtrl;
  29. class wxTreeCtrl;
  30. namespace DiscIO { struct SFileInfo; }
  31. namespace Gecko { class CodeConfigPanel; }
  32. class WiiPartition final : public wxTreeItemData
  33. {
  34. public:
  35. WiiPartition(std::unique_ptr<DiscIO::IVolume> partition, std::unique_ptr<DiscIO::IFileSystem> file_system)
  36. : Partition(std::move(partition)), FileSystem(std::move(file_system))
  37. {
  38. }
  39. std::unique_ptr<DiscIO::IVolume> Partition;
  40. std::unique_ptr<DiscIO::IFileSystem> FileSystem;
  41. };
  42. struct PHackData
  43. {
  44. bool PHackSZNear;
  45. bool PHackSZFar;
  46. std::string PHZNear;
  47. std::string PHZFar;
  48. };
  49. class CISOProperties : public wxDialog
  50. {
  51. public:
  52. CISOProperties(const std::string fileName,
  53. wxWindow* parent,
  54. wxWindowID id = wxID_ANY,
  55. const wxString& title = _("Properties"),
  56. const wxPoint& pos = wxDefaultPosition,
  57. const wxSize& size = wxDefaultSize,
  58. long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
  59. virtual ~CISOProperties();
  60. bool bRefreshList;
  61. void ActionReplayList_Load();
  62. bool SaveGameConfig();
  63. private:
  64. DECLARE_EVENT_TABLE();
  65. DiscIO::IVolume *OpenISO;
  66. DiscIO::IFileSystem *pFileSystem;
  67. std::vector<PatchEngine::Patch> onFrame;
  68. std::vector<ActionReplay::ARCode> arCodes;
  69. PHackData m_PHack_Data;
  70. // Core
  71. wxCheckBox *CPUThread, *SkipIdle, *MMU, *DCBZOFF, *FPRF;
  72. wxCheckBox *SyncGPU, *FastDiscSpeed, *DSPHLE;
  73. wxArrayString arrayStringFor_GPUDeterminism;
  74. wxChoice* GPUDeterminism;
  75. // Wii
  76. wxCheckBox* EnableWideScreen;
  77. // Stereoscopy
  78. wxSlider* DepthPercentage;
  79. wxSpinCtrl* ConvergenceMinimum;
  80. wxCheckBox* MonoDepth;
  81. wxArrayString arrayStringFor_EmuState;
  82. wxChoice* EmuState;
  83. wxTextCtrl* EmuIssues;
  84. wxCheckListBox* Patches;
  85. wxButton* EditPatch;
  86. wxButton* RemovePatch;
  87. wxCheckListBox* Cheats;
  88. wxButton* EditCheat;
  89. wxButton* RemoveCheat;
  90. wxTextCtrl* m_InternalName;
  91. wxTextCtrl* m_GameID;
  92. wxTextCtrl* m_Country;
  93. wxTextCtrl* m_MakerID;
  94. wxTextCtrl* m_Revision;
  95. wxTextCtrl* m_Date;
  96. wxTextCtrl* m_FST;
  97. wxTextCtrl* m_MD5Sum;
  98. wxButton* m_MD5SumCompute;
  99. wxArrayString arrayStringFor_Lang;
  100. wxChoice* m_Lang;
  101. wxTextCtrl* m_Name;
  102. wxTextCtrl* m_Maker;
  103. wxTextCtrl* m_Comment;
  104. wxStaticBitmap* m_Banner;
  105. wxTreeCtrl* m_Treectrl;
  106. wxTreeItemId RootId;
  107. Gecko::CodeConfigPanel* m_geckocode_panel;
  108. enum
  109. {
  110. ID_TREECTRL = 1000,
  111. ID_NOTEBOOK,
  112. ID_GAMECONFIG,
  113. ID_PATCH_PAGE,
  114. ID_ARCODE_PAGE,
  115. ID_SPEEDHACK_PAGE,
  116. ID_INFORMATION,
  117. ID_FILESYSTEM,
  118. ID_USEDUALCORE,
  119. ID_IDLESKIP,
  120. ID_MMU,
  121. ID_DCBZOFF,
  122. ID_FPRF,
  123. ID_SYNCGPU,
  124. ID_DISCSPEED,
  125. ID_AUDIO_DSP_HLE,
  126. ID_USE_BBOX,
  127. ID_ENABLEPROGRESSIVESCAN,
  128. ID_ENABLEWIDESCREEN,
  129. ID_EDITCONFIG,
  130. ID_SHOWDEFAULTCONFIG,
  131. ID_EMUSTATE,
  132. ID_EMU_ISSUES,
  133. ID_PATCHES_LIST,
  134. ID_EDITPATCH,
  135. ID_ADDPATCH,
  136. ID_REMOVEPATCH,
  137. ID_CHEATS_LIST,
  138. ID_EDITCHEAT,
  139. ID_ADDCHEAT,
  140. ID_REMOVECHEAT,
  141. ID_GPUDETERMINISM,
  142. ID_DEPTHPERCENTAGE,
  143. ID_CONVERGENCEMINIMUM,
  144. ID_MONODEPTH,
  145. ID_NAME,
  146. ID_GAMEID,
  147. ID_COUNTRY,
  148. ID_MAKERID,
  149. ID_REVISION,
  150. ID_DATE,
  151. ID_FST,
  152. ID_MD5SUM,
  153. ID_MD5SUMCOMPUTE,
  154. ID_VERSION,
  155. ID_LANG,
  156. ID_SHORTNAME,
  157. ID_LONGNAME,
  158. ID_MAKER,
  159. ID_COMMENT,
  160. ID_BANNER,
  161. IDM_EXTRACTDIR,
  162. IDM_EXTRACTALL,
  163. IDM_EXTRACTFILE,
  164. IDM_EXTRACTAPPLOADER,
  165. IDM_EXTRACTDOL,
  166. IDM_CHECKINTEGRITY,
  167. IDM_BNRSAVEAS
  168. };
  169. void LaunchExternalEditor(const std::string& filename, bool wait_until_closed);
  170. void CreateGUIControls();
  171. void OnClose(wxCloseEvent& event);
  172. void OnCloseClick(wxCommandEvent& event);
  173. void OnEditConfig(wxCommandEvent& event);
  174. void OnComputeMD5Sum(wxCommandEvent& event);
  175. void OnShowDefaultConfig(wxCommandEvent& event);
  176. void ListSelectionChanged(wxCommandEvent& event);
  177. void PatchButtonClicked(wxCommandEvent& event);
  178. void ActionReplayButtonClicked(wxCommandEvent& event);
  179. void RightClickOnBanner(wxMouseEvent& event);
  180. void OnBannerImageSave(wxCommandEvent& event);
  181. void OnRightClickOnTree(wxTreeEvent& event);
  182. void OnExtractFile(wxCommandEvent& event);
  183. void OnExtractDir(wxCommandEvent& event);
  184. void OnExtractDataFromHeader(wxCommandEvent& event);
  185. void CheckPartitionIntegrity(wxCommandEvent& event);
  186. void SetRefresh(wxCommandEvent& event);
  187. void OnChangeBannerLang(wxCommandEvent& event);
  188. GameListItem* OpenGameListItem;
  189. typedef std::vector<const DiscIO::SFileInfo*>::iterator fileIter;
  190. size_t CreateDirectoryTree(wxTreeItemId& parent,
  191. const std::vector<DiscIO::SFileInfo>& fileInfos);
  192. size_t CreateDirectoryTree(wxTreeItemId& parent,
  193. const std::vector<DiscIO::SFileInfo>& fileInfos,
  194. const size_t _FirstIndex,
  195. const size_t _LastIndex);
  196. void ExportDir(const std::string& _rFullPath, const std::string& _rExportFilename,
  197. const WiiPartition* partition = nullptr);
  198. IniFile GameIniDefault;
  199. IniFile GameIniLocal;
  200. std::string GameIniFileLocal;
  201. std::string game_id;
  202. std::set<std::string> DefaultPatches;
  203. std::set<std::string> DefaultCheats;
  204. void LoadGameConfig();
  205. void PatchList_Load();
  206. void PatchList_Save();
  207. void ActionReplayList_Save();
  208. void ChangeBannerDetails(DiscIO::IVolume::ELanguage language);
  209. long GetElementStyle(const char* section, const char* key);
  210. void SetCheckboxValueFromGameini(const char* section, const char* key, wxCheckBox* checkbox);
  211. void SaveGameIniValueFrom3StateCheckbox(const char* section, const char* key, wxCheckBox* checkbox);
  212. };