2015-12-20 06:24:48 +01:00
|
|
|
// Copyright 2015 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2015-12-20 06:24:48 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-01-24 15:25:35 +01:00
|
|
|
#include <array>
|
2017-12-31 20:33:36 +01:00
|
|
|
#include <memory>
|
2017-06-14 11:58:11 +02:00
|
|
|
#include <string>
|
2021-02-27 23:40:17 +01:00
|
|
|
#include <vector>
|
2017-06-14 11:58:11 +02:00
|
|
|
|
2015-12-20 06:24:48 +01:00
|
|
|
#include <QMenuBar>
|
2019-01-21 21:05:31 +01:00
|
|
|
#include <QPointer>
|
2015-12-20 06:24:48 +01:00
|
|
|
|
2021-02-27 23:40:17 +01:00
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
2019-02-25 20:59:49 +01:00
|
|
|
class QMenu;
|
2021-02-27 23:40:17 +01:00
|
|
|
class ParallelProgressDialog;
|
2019-02-25 20:59:49 +01:00
|
|
|
|
2017-09-04 20:12:13 +02:00
|
|
|
namespace Core
|
|
|
|
{
|
|
|
|
enum class State;
|
|
|
|
}
|
|
|
|
|
2017-08-24 17:38:31 +02:00
|
|
|
namespace DiscIO
|
|
|
|
{
|
|
|
|
enum class Region;
|
|
|
|
};
|
|
|
|
|
2017-12-31 20:33:36 +01:00
|
|
|
namespace UICommon
|
|
|
|
{
|
|
|
|
class GameFile;
|
|
|
|
}
|
|
|
|
|
2021-02-27 23:40:17 +01:00
|
|
|
using RSOPairEntry = std::pair<u32, std::string>;
|
|
|
|
using RSOVector = std::vector<RSOPairEntry>;
|
|
|
|
|
2015-12-20 06:24:48 +01:00
|
|
|
class MenuBar final : public QMenuBar
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2019-01-21 21:05:31 +01:00
|
|
|
static MenuBar* GetMenuBar() { return s_menu_bar; }
|
|
|
|
|
2015-12-22 04:46:03 +01:00
|
|
|
explicit MenuBar(QWidget* parent = nullptr);
|
2015-12-20 06:24:48 +01:00
|
|
|
|
2017-06-30 11:24:26 +02:00
|
|
|
void UpdateToolsMenu(bool emulation_started);
|
|
|
|
|
2019-01-21 21:05:31 +01:00
|
|
|
QMenu* GetListColumnsMenu() const { return m_cols_menu; }
|
|
|
|
|
2018-05-25 00:19:36 +02:00
|
|
|
void InstallUpdateManually();
|
|
|
|
|
2015-12-20 06:24:48 +01:00
|
|
|
signals:
|
2016-02-15 02:56:40 +01:00
|
|
|
// File
|
2015-12-20 06:24:48 +01:00
|
|
|
void Open();
|
|
|
|
void Exit();
|
2018-03-23 01:18:53 +01:00
|
|
|
void ChangeDisc();
|
|
|
|
void BootDVDBackup(const QString& backup);
|
|
|
|
void EjectDisc();
|
2015-12-20 06:24:48 +01:00
|
|
|
|
2016-02-15 02:56:40 +01:00
|
|
|
// Emulation
|
|
|
|
void Play();
|
|
|
|
void Pause();
|
|
|
|
void Stop();
|
|
|
|
void Reset();
|
|
|
|
void Fullscreen();
|
|
|
|
void FrameAdvance();
|
|
|
|
void Screenshot();
|
2017-07-20 17:52:45 +02:00
|
|
|
void StartNetPlay();
|
2019-03-30 14:50:57 +01:00
|
|
|
void BrowseNetPlay();
|
2016-02-15 02:56:40 +01:00
|
|
|
void StateLoad();
|
|
|
|
void StateSave();
|
|
|
|
void StateLoadSlot();
|
|
|
|
void StateSaveSlot();
|
|
|
|
void StateLoadSlotAt(int slot);
|
|
|
|
void StateSaveSlotAt(int slot);
|
|
|
|
void StateLoadUndo();
|
|
|
|
void StateSaveUndo();
|
|
|
|
void StateSaveOldest();
|
|
|
|
void SetStateSlot(int slot);
|
2017-07-06 11:00:37 +02:00
|
|
|
void BootWiiSystemMenu();
|
2017-08-24 17:38:31 +02:00
|
|
|
void ImportNANDBackup();
|
2016-02-15 02:56:40 +01:00
|
|
|
|
2017-06-14 11:58:11 +02:00
|
|
|
void PerformOnlineUpdate(const std::string& region);
|
|
|
|
|
2017-08-24 16:35:47 +02:00
|
|
|
// Tools
|
2018-01-25 19:54:50 +01:00
|
|
|
void ShowMemcardManager();
|
2017-08-24 16:35:47 +02:00
|
|
|
void BootGameCubeIPL(DiscIO::Region region);
|
2017-08-30 16:44:28 +02:00
|
|
|
void ShowFIFOPlayer();
|
|
|
|
void ShowAboutDialog();
|
2018-03-26 04:17:47 +02:00
|
|
|
void ShowCheatsManager();
|
2018-11-17 16:36:28 +01:00
|
|
|
void ShowResourcePackManager();
|
2018-01-24 15:25:35 +01:00
|
|
|
void ConnectWiiRemote(int id);
|
2017-08-24 16:35:47 +02:00
|
|
|
|
2017-06-06 13:49:49 +02:00
|
|
|
// Options
|
2017-07-16 23:11:11 +02:00
|
|
|
void Configure();
|
|
|
|
void ConfigureGraphics();
|
|
|
|
void ConfigureAudio();
|
|
|
|
void ConfigureControllers();
|
2017-06-06 13:49:49 +02:00
|
|
|
void ConfigureHotkeys();
|
2020-06-12 07:27:34 +02:00
|
|
|
void ConfigureFreelook();
|
2017-06-06 13:49:49 +02:00
|
|
|
|
2016-02-15 02:56:40 +01:00
|
|
|
// View
|
2015-12-20 06:24:48 +01:00
|
|
|
void ShowList();
|
2017-08-05 10:28:53 +02:00
|
|
|
void ShowGrid();
|
2018-10-14 18:03:10 +02:00
|
|
|
void PurgeGameListCache();
|
2019-03-17 22:08:59 +01:00
|
|
|
void ShowSearch();
|
2017-05-08 19:03:59 +02:00
|
|
|
void ColumnVisibilityToggled(const QString& row, bool visible);
|
2017-07-11 16:13:09 +02:00
|
|
|
void GameListPlatformVisibilityToggled(const QString& row, bool visible);
|
|
|
|
void GameListRegionVisibilityToggled(const QString& row, bool visible);
|
2015-12-20 06:24:48 +01:00
|
|
|
|
2017-08-27 13:55:05 +02:00
|
|
|
// Movie
|
|
|
|
void PlayRecording();
|
|
|
|
void StartRecording();
|
|
|
|
void StopRecording();
|
|
|
|
void ExportRecording();
|
2018-01-27 14:35:02 +01:00
|
|
|
void ShowTASInput();
|
2017-08-27 13:55:05 +02:00
|
|
|
|
2017-12-31 20:33:36 +01:00
|
|
|
void SelectionChanged(std::shared_ptr<const UICommon::GameFile> game_file);
|
2017-08-27 13:55:05 +02:00
|
|
|
void RecordingStatusChanged(bool recording);
|
|
|
|
void ReadOnlyModeChanged(bool read_only);
|
|
|
|
|
2018-05-11 22:38:32 +02:00
|
|
|
// Synbols
|
|
|
|
void NotifySymbolsUpdated();
|
|
|
|
|
2015-12-20 06:24:48 +01:00
|
|
|
private:
|
2017-09-04 20:12:13 +02:00
|
|
|
void OnEmulationStateChanged(Core::State state);
|
|
|
|
|
2015-12-20 06:24:48 +01:00
|
|
|
void AddFileMenu();
|
2018-03-23 01:18:53 +01:00
|
|
|
void AddDVDBackupMenu(QMenu* file_menu);
|
2015-12-20 06:24:48 +01:00
|
|
|
|
2016-02-15 02:56:40 +01:00
|
|
|
void AddEmulationMenu();
|
|
|
|
void AddStateLoadMenu(QMenu* emu_menu);
|
|
|
|
void AddStateSaveMenu(QMenu* emu_menu);
|
|
|
|
void AddStateSlotMenu(QMenu* emu_menu);
|
|
|
|
|
|
|
|
void AddViewMenu();
|
2015-12-20 06:24:48 +01:00
|
|
|
void AddGameListTypeSection(QMenu* view_menu);
|
2017-08-05 10:28:53 +02:00
|
|
|
void AddListColumnsMenu(QMenu* view_menu);
|
2017-07-11 16:13:09 +02:00
|
|
|
void AddShowPlatformsMenu(QMenu* view_menu);
|
|
|
|
void AddShowRegionsMenu(QMenu* view_menu);
|
2016-02-15 02:56:40 +01:00
|
|
|
|
2017-06-06 13:49:49 +02:00
|
|
|
void AddOptionsMenu();
|
2017-05-04 23:01:12 +02:00
|
|
|
void AddToolsMenu();
|
2016-02-15 02:56:40 +01:00
|
|
|
void AddHelpMenu();
|
2017-08-27 13:55:05 +02:00
|
|
|
void AddMovieMenu();
|
2018-04-09 15:31:20 +02:00
|
|
|
void AddJITMenu();
|
2018-02-14 23:25:01 +01:00
|
|
|
void AddSymbolsMenu();
|
2016-02-15 02:56:40 +01:00
|
|
|
|
2019-08-01 19:59:29 +02:00
|
|
|
void UpdateStateSlotMenu();
|
|
|
|
|
2017-08-24 17:38:31 +02:00
|
|
|
void InstallWAD();
|
|
|
|
void ImportWiiSave();
|
|
|
|
void ExportWiiSaves();
|
2017-10-03 16:45:59 +02:00
|
|
|
void CheckNAND();
|
2017-08-26 14:41:53 +02:00
|
|
|
void NANDExtractCertificates();
|
2018-02-14 23:25:01 +01:00
|
|
|
void ChangeDebugFont();
|
|
|
|
|
|
|
|
// Debugging UI
|
|
|
|
void ClearSymbols();
|
|
|
|
void GenerateSymbolsFromAddress();
|
|
|
|
void GenerateSymbolsFromSignatureDB();
|
|
|
|
void GenerateSymbolsFromRSO();
|
2020-03-10 10:41:59 +01:00
|
|
|
void GenerateSymbolsFromRSOAuto();
|
2021-02-27 23:40:17 +01:00
|
|
|
RSOVector DetectRSOModules(ParallelProgressDialog& progress);
|
2018-02-14 23:25:01 +01:00
|
|
|
void LoadSymbolMap();
|
|
|
|
void LoadOtherSymbolMap();
|
2018-10-09 02:59:55 +02:00
|
|
|
void LoadBadSymbolMap();
|
2018-02-14 23:25:01 +01:00
|
|
|
void SaveSymbolMap();
|
|
|
|
void SaveSymbolMapAs();
|
|
|
|
void SaveCode();
|
2018-10-09 02:59:55 +02:00
|
|
|
bool TryLoadMapFile(const QString& path, const bool bad = false);
|
2018-07-10 20:05:25 +02:00
|
|
|
void TrySaveSymbolMap(const QString& path);
|
2018-02-14 23:25:01 +01:00
|
|
|
void CreateSignatureFile();
|
2018-10-09 02:59:55 +02:00
|
|
|
void AppendSignatureFile();
|
|
|
|
void ApplySignatureFile();
|
|
|
|
void CombineSignatureFiles();
|
2018-02-14 23:25:01 +01:00
|
|
|
void PatchHLEFunctions();
|
2018-04-09 15:31:20 +02:00
|
|
|
void ClearCache();
|
|
|
|
void LogInstructions();
|
|
|
|
void SearchInstruction();
|
2017-08-24 17:38:31 +02:00
|
|
|
|
2017-12-31 20:33:36 +01:00
|
|
|
void OnSelectionChanged(std::shared_ptr<const UICommon::GameFile> game_file);
|
2017-08-27 13:55:05 +02:00
|
|
|
void OnRecordingStatusChanged(bool recording);
|
|
|
|
void OnReadOnlyModeChanged(bool read_only);
|
2017-09-13 19:33:45 +02:00
|
|
|
void OnDebugModeToggled(bool enabled);
|
2017-08-27 13:55:05 +02:00
|
|
|
|
2019-10-12 18:04:51 +02:00
|
|
|
QString GetSignatureSelector() const;
|
|
|
|
|
2019-01-21 21:05:31 +01:00
|
|
|
static QPointer<MenuBar> s_menu_bar;
|
|
|
|
|
2016-02-15 02:56:40 +01:00
|
|
|
// File
|
|
|
|
QAction* m_open_action;
|
|
|
|
QAction* m_exit_action;
|
2018-03-23 01:18:53 +01:00
|
|
|
QAction* m_change_disc;
|
|
|
|
QAction* m_eject_disc;
|
|
|
|
QMenu* m_backup_menu;
|
2016-02-15 02:56:40 +01:00
|
|
|
|
2017-05-04 23:01:12 +02:00
|
|
|
// Tools
|
|
|
|
QAction* m_wad_install_action;
|
2017-06-14 11:58:11 +02:00
|
|
|
QMenu* m_perform_online_update_menu;
|
|
|
|
QAction* m_perform_online_update_for_current_region;
|
2017-08-24 16:35:47 +02:00
|
|
|
QAction* m_ntscj_ipl;
|
|
|
|
QAction* m_ntscu_ipl;
|
|
|
|
QAction* m_pal_ipl;
|
2019-05-19 00:24:25 +02:00
|
|
|
QMenu* m_manage_nand_menu;
|
2017-08-24 17:38:31 +02:00
|
|
|
QAction* m_import_backup;
|
2017-10-03 16:45:59 +02:00
|
|
|
QAction* m_check_nand;
|
2017-08-26 14:41:53 +02:00
|
|
|
QAction* m_extract_certificates;
|
2018-01-24 15:25:35 +01:00
|
|
|
std::array<QAction*, 5> m_wii_remotes;
|
2017-05-04 23:01:12 +02:00
|
|
|
|
2016-02-15 02:56:40 +01:00
|
|
|
// Emulation
|
|
|
|
QAction* m_play_action;
|
|
|
|
QAction* m_pause_action;
|
|
|
|
QAction* m_stop_action;
|
|
|
|
QAction* m_reset_action;
|
|
|
|
QAction* m_fullscreen_action;
|
|
|
|
QAction* m_frame_advance_action;
|
|
|
|
QAction* m_screenshot_action;
|
2017-07-06 11:00:37 +02:00
|
|
|
QAction* m_boot_sysmenu;
|
2016-02-15 02:56:40 +01:00
|
|
|
QMenu* m_state_load_menu;
|
|
|
|
QMenu* m_state_save_menu;
|
|
|
|
QMenu* m_state_slot_menu;
|
|
|
|
QActionGroup* m_state_slots;
|
|
|
|
QMenu* m_state_load_slots_menu;
|
|
|
|
QMenu* m_state_save_slots_menu;
|
2017-08-27 13:55:05 +02:00
|
|
|
|
|
|
|
// Movie
|
|
|
|
QAction* m_recording_export;
|
|
|
|
QAction* m_recording_play;
|
|
|
|
QAction* m_recording_start;
|
|
|
|
QAction* m_recording_stop;
|
|
|
|
QAction* m_recording_read_only;
|
2017-09-13 19:33:45 +02:00
|
|
|
|
2018-02-14 23:25:01 +01:00
|
|
|
// Options
|
|
|
|
QAction* m_boot_to_pause;
|
|
|
|
QAction* m_automatic_start;
|
2021-10-17 09:18:48 +02:00
|
|
|
QAction* m_reset_ignore_panic_handler;
|
2018-02-14 23:25:01 +01:00
|
|
|
QAction* m_change_font;
|
2018-11-23 11:02:00 +01:00
|
|
|
QAction* m_controllers_action;
|
2018-02-14 23:25:01 +01:00
|
|
|
|
2017-09-13 19:33:45 +02:00
|
|
|
// View
|
2018-02-14 23:25:01 +01:00
|
|
|
QAction* m_show_code;
|
2017-09-13 19:33:45 +02:00
|
|
|
QAction* m_show_registers;
|
2020-03-21 08:48:49 +01:00
|
|
|
QAction* m_show_threads;
|
2017-09-27 08:53:05 +02:00
|
|
|
QAction* m_show_watch;
|
2017-10-03 18:43:44 +02:00
|
|
|
QAction* m_show_breakpoints;
|
2018-03-16 12:39:53 +01:00
|
|
|
QAction* m_show_memory;
|
2020-04-19 21:30:50 +02:00
|
|
|
QAction* m_show_network;
|
2018-04-09 15:31:20 +02:00
|
|
|
QAction* m_show_jit;
|
2019-01-21 21:05:31 +01:00
|
|
|
QMenu* m_cols_menu;
|
2018-04-09 15:31:20 +02:00
|
|
|
|
|
|
|
// JIT
|
|
|
|
QMenu* m_jit;
|
2018-02-14 23:25:01 +01:00
|
|
|
|
|
|
|
// Symbols
|
|
|
|
QMenu* m_symbols;
|
2018-04-09 15:31:20 +02:00
|
|
|
QAction* m_jit_interpreter_core;
|
|
|
|
QAction* m_jit_block_linking;
|
|
|
|
QAction* m_jit_disable_cache;
|
2020-06-02 12:18:45 +02:00
|
|
|
QAction* m_jit_disable_fastmem;
|
2018-04-09 15:31:20 +02:00
|
|
|
QAction* m_jit_clear_cache;
|
|
|
|
QAction* m_jit_log_coverage;
|
|
|
|
QAction* m_jit_search_instruction;
|
|
|
|
QAction* m_jit_off;
|
|
|
|
QAction* m_jit_loadstore_off;
|
|
|
|
QAction* m_jit_loadstore_lbzx_off;
|
|
|
|
QAction* m_jit_loadstore_lxz_off;
|
|
|
|
QAction* m_jit_loadstore_lwz_off;
|
|
|
|
QAction* m_jit_loadstore_floating_off;
|
|
|
|
QAction* m_jit_loadstore_paired_off;
|
|
|
|
QAction* m_jit_floatingpoint_off;
|
|
|
|
QAction* m_jit_integer_off;
|
|
|
|
QAction* m_jit_paired_off;
|
|
|
|
QAction* m_jit_systemregisters_off;
|
2018-07-08 20:32:40 +02:00
|
|
|
QAction* m_jit_branch_off;
|
2019-11-16 11:25:26 +01:00
|
|
|
QAction* m_jit_register_cache_off;
|
2019-08-14 13:45:07 +02:00
|
|
|
|
|
|
|
bool m_game_selected = false;
|
2015-12-20 06:24:48 +01:00
|
|
|
};
|