diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra_qt/game_list.cpp | 11 | ||||
| -rw-r--r-- | src/citra_qt/game_list.h | 2 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 11 | ||||
| -rw-r--r-- | src/core/core.cpp | 11 | ||||
| -rw-r--r-- | src/core/frontend/emu_window.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.h | 4 | ||||
| -rw-r--r-- | src/video_core/shader/shader.cpp | 3 |
7 files changed, 23 insertions, 21 deletions
diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index 09469f3c5..28e01d81a 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <QFileInfo> | ||
| 5 | #include <QHeaderView> | 6 | #include <QHeaderView> |
| 6 | #include <QMenu> | 7 | #include <QMenu> |
| 7 | #include <QThreadPool> | 8 | #include <QThreadPool> |
| @@ -131,6 +132,14 @@ void GameList::LoadInterfaceLayout() { | |||
| 131 | item_model->sort(header->sortIndicatorSection(), header->sortIndicatorOrder()); | 132 | item_model->sort(header->sortIndicatorSection(), header->sortIndicatorOrder()); |
| 132 | } | 133 | } |
| 133 | 134 | ||
| 135 | const QStringList GameList::supported_file_extensions = {"3ds", "3dsx", "elf", "axf", | ||
| 136 | "cci", "cxi", "app"}; | ||
| 137 | |||
| 138 | static bool HasSupportedFileExtension(const std::string& file_name) { | ||
| 139 | QFileInfo file = QFileInfo(file_name.c_str()); | ||
| 140 | return GameList::supported_file_extensions.contains(file.completeSuffix(), Qt::CaseInsensitive); | ||
| 141 | } | ||
| 142 | |||
| 134 | void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion) { | 143 | void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion) { |
| 135 | const auto callback = [this, recursion](unsigned* num_entries_out, const std::string& directory, | 144 | const auto callback = [this, recursion](unsigned* num_entries_out, const std::string& directory, |
| 136 | const std::string& virtual_name) -> bool { | 145 | const std::string& virtual_name) -> bool { |
| @@ -139,7 +148,7 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign | |||
| 139 | if (stop_processing) | 148 | if (stop_processing) |
| 140 | return false; // Breaks the callback loop. | 149 | return false; // Breaks the callback loop. |
| 141 | 150 | ||
| 142 | if (!FileUtil::IsDirectory(physical_name)) { | 151 | if (!FileUtil::IsDirectory(physical_name) && HasSupportedFileExtension(physical_name)) { |
| 143 | std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(physical_name); | 152 | std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(physical_name); |
| 144 | if (!loader) | 153 | if (!loader) |
| 145 | return true; | 154 | return true; |
diff --git a/src/citra_qt/game_list.h b/src/citra_qt/game_list.h index 1abf10051..e6b7eea0b 100644 --- a/src/citra_qt/game_list.h +++ b/src/citra_qt/game_list.h | |||
| @@ -33,6 +33,8 @@ public: | |||
| 33 | void SaveInterfaceLayout(); | 33 | void SaveInterfaceLayout(); |
| 34 | void LoadInterfaceLayout(); | 34 | void LoadInterfaceLayout(); |
| 35 | 35 | ||
| 36 | static const QStringList supported_file_extensions; | ||
| 37 | |||
| 36 | signals: | 38 | signals: |
| 37 | void GameChosen(QString game_path); | 39 | void GameChosen(QString game_path); |
| 38 | void ShouldCancelWorker(); | 40 | void ShouldCancelWorker(); |
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index f765c0147..3c2e19344 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -466,9 +466,14 @@ void GMainWindow::OnGameListOpenSaveFolder(u64 program_id) { | |||
| 466 | } | 466 | } |
| 467 | 467 | ||
| 468 | void GMainWindow::OnMenuLoadFile() { | 468 | void GMainWindow::OnMenuLoadFile() { |
| 469 | QString filename = | 469 | QString extensions; |
| 470 | QFileDialog::getOpenFileName(this, tr("Load File"), UISettings::values.roms_path, | 470 | for (const auto& piece : game_list->supported_file_extensions) |
| 471 | tr("3DS executable (*.3ds *.3dsx *.elf *.axf *.cci *.cxi)")); | 471 | extensions += "*." + piece + " "; |
| 472 | |||
| 473 | QString file_filter = tr("3DS executable") + " (" + extensions + ")"; | ||
| 474 | |||
| 475 | QString filename = QFileDialog::getOpenFileName(this, tr("Load File"), | ||
| 476 | UISettings::values.roms_path, file_filter); | ||
| 472 | if (!filename.isEmpty()) { | 477 | if (!filename.isEmpty()) { |
| 473 | UISettings::values.roms_path = QFileInfo(filename).path(); | 478 | UISettings::values.roms_path = QFileInfo(filename).path(); |
| 474 | 479 | ||
diff --git a/src/core/core.cpp b/src/core/core.cpp index 202cd332b..c9c9b7615 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -67,10 +67,6 @@ System::ResultStatus System::SingleStep() { | |||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& filepath) { | 69 | System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& filepath) { |
| 70 | if (app_loader) { | ||
| 71 | app_loader.reset(); | ||
| 72 | } | ||
| 73 | |||
| 74 | app_loader = Loader::GetLoader(filepath); | 70 | app_loader = Loader::GetLoader(filepath); |
| 75 | 71 | ||
| 76 | if (!app_loader) { | 72 | if (!app_loader) { |
| @@ -123,10 +119,6 @@ void System::Reschedule() { | |||
| 123 | } | 119 | } |
| 124 | 120 | ||
| 125 | System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { | 121 | System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { |
| 126 | if (cpu_core) { | ||
| 127 | cpu_core.reset(); | ||
| 128 | } | ||
| 129 | |||
| 130 | Memory::Init(); | 122 | Memory::Init(); |
| 131 | 123 | ||
| 132 | if (Settings::values.use_cpu_jit) { | 124 | if (Settings::values.use_cpu_jit) { |
| @@ -159,7 +151,8 @@ void System::Shutdown() { | |||
| 159 | Kernel::Shutdown(); | 151 | Kernel::Shutdown(); |
| 160 | HW::Shutdown(); | 152 | HW::Shutdown(); |
| 161 | CoreTiming::Shutdown(); | 153 | CoreTiming::Shutdown(); |
| 162 | cpu_core.reset(); | 154 | cpu_core = nullptr; |
| 155 | app_loader = nullptr; | ||
| 163 | 156 | ||
| 164 | LOG_DEBUG(Core, "Shutdown OK"); | 157 | LOG_DEBUG(Core, "Shutdown OK"); |
| 165 | } | 158 | } |
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 4f0f786ce..6b4637741 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp | |||
| @@ -70,14 +70,12 @@ void EmuWindow::TouchPressed(unsigned framebuffer_x, unsigned framebuffer_y) { | |||
| 70 | (framebuffer_layout.bottom_screen.bottom - framebuffer_layout.bottom_screen.top); | 70 | (framebuffer_layout.bottom_screen.bottom - framebuffer_layout.bottom_screen.top); |
| 71 | 71 | ||
| 72 | touch_pressed = true; | 72 | touch_pressed = true; |
| 73 | pad_state.touch.Assign(1); | ||
| 74 | } | 73 | } |
| 75 | 74 | ||
| 76 | void EmuWindow::TouchReleased() { | 75 | void EmuWindow::TouchReleased() { |
| 77 | touch_pressed = false; | 76 | touch_pressed = false; |
| 78 | touch_x = 0; | 77 | touch_x = 0; |
| 79 | touch_y = 0; | 78 | touch_y = 0; |
| 80 | pad_state.touch.Assign(0); | ||
| 81 | } | 79 | } |
| 82 | 80 | ||
| 83 | void EmuWindow::TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y) { | 81 | void EmuWindow::TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y) { |
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index 21e66dfe0..c7f4ee138 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h | |||
| @@ -42,8 +42,6 @@ struct PadState { | |||
| 42 | BitField<14, 1, u32> zl; | 42 | BitField<14, 1, u32> zl; |
| 43 | BitField<15, 1, u32> zr; | 43 | BitField<15, 1, u32> zr; |
| 44 | 44 | ||
| 45 | BitField<20, 1, u32> touch; | ||
| 46 | |||
| 47 | BitField<24, 1, u32> c_right; | 45 | BitField<24, 1, u32> c_right; |
| 48 | BitField<25, 1, u32> c_left; | 46 | BitField<25, 1, u32> c_left; |
| 49 | BitField<26, 1, u32> c_up; | 47 | BitField<26, 1, u32> c_up; |
| @@ -203,8 +201,6 @@ const PadState PAD_Y = {{1u << 11}}; | |||
| 203 | const PadState PAD_ZL = {{1u << 14}}; | 201 | const PadState PAD_ZL = {{1u << 14}}; |
| 204 | const PadState PAD_ZR = {{1u << 15}}; | 202 | const PadState PAD_ZR = {{1u << 15}}; |
| 205 | 203 | ||
| 206 | const PadState PAD_TOUCH = {{1u << 20}}; | ||
| 207 | |||
| 208 | const PadState PAD_C_RIGHT = {{1u << 24}}; | 204 | const PadState PAD_C_RIGHT = {{1u << 24}}; |
| 209 | const PadState PAD_C_LEFT = {{1u << 25}}; | 205 | const PadState PAD_C_LEFT = {{1u << 25}}; |
| 210 | const PadState PAD_C_UP = {{1u << 26}}; | 206 | const PadState PAD_C_UP = {{1u << 26}}; |
diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index b42fa3cb4..67ed19ba8 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp | |||
| @@ -40,9 +40,8 @@ OutputVertex OutputVertex::FromAttributeBuffer(const RasterizerRegs& regs, Attri | |||
| 40 | 40 | ||
| 41 | for (unsigned comp = 0; comp < 4; ++comp) { | 41 | for (unsigned comp = 0; comp < 4; ++comp) { |
| 42 | RasterizerRegs::VSOutputAttributes::Semantic semantic = semantics[comp]; | 42 | RasterizerRegs::VSOutputAttributes::Semantic semantic = semantics[comp]; |
| 43 | float24* out = &vertex_slots[semantic]; | ||
| 44 | if (semantic < vertex_slots.size()) { | 43 | if (semantic < vertex_slots.size()) { |
| 45 | *out = input.attr[i][comp]; | 44 | vertex_slots[semantic] = input.attr[i][comp]; |
| 46 | } else if (semantic != RasterizerRegs::VSOutputAttributes::INVALID) { | 45 | } else if (semantic != RasterizerRegs::VSOutputAttributes::INVALID) { |
| 47 | LOG_ERROR(HW_GPU, "Invalid/unknown semantic id: %u", (unsigned int)semantic); | 46 | LOG_ERROR(HW_GPU, "Invalid/unknown semantic id: %u", (unsigned int)semantic); |
| 48 | } | 47 | } |