diff options
| -rw-r--r-- | src/citra/config.cpp | 17 | ||||
| -rw-r--r-- | src/citra/default_ini.h | 15 | ||||
| -rw-r--r-- | src/citra_qt/CMakeLists.txt | 46 | ||||
| -rw-r--r-- | src/citra_qt/configuration/config.cpp (renamed from src/citra_qt/config.cpp) | 20 | ||||
| -rw-r--r-- | src/citra_qt/configuration/config.h (renamed from src/citra_qt/config.h) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure.ui (renamed from src/citra_qt/configure.ui) | 12 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_audio.cpp (renamed from src/citra_qt/configure_audio.cpp) | 2 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_audio.h (renamed from src/citra_qt/configure_audio.h) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_audio.ui (renamed from src/citra_qt/configure_audio.ui) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_debug.cpp (renamed from src/citra_qt/configure_debug.cpp) | 2 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_debug.h (renamed from src/citra_qt/configure_debug.h) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_debug.ui (renamed from src/citra_qt/configure_debug.ui) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_dialog.cpp (renamed from src/citra_qt/configure_dialog.cpp) | 4 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_dialog.h (renamed from src/citra_qt/configure_dialog.h) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_general.cpp (renamed from src/citra_qt/configure_general.cpp) | 2 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_general.h (renamed from src/citra_qt/configure_general.h) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_general.ui (renamed from src/citra_qt/configure_general.ui) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_graphics.cpp (renamed from src/citra_qt/configure_graphics.cpp) | 4 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_graphics.h (renamed from src/citra_qt/configure_graphics.h) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_graphics.ui (renamed from src/citra_qt/configure_graphics.ui) | 2 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_input.cpp (renamed from src/citra_qt/configure_input.cpp) | 4 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_input.h (renamed from src/citra_qt/configure_input.h) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_input.ui (renamed from src/citra_qt/configure_input.ui) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_system.cpp (renamed from src/citra_qt/configure_system.cpp) | 2 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_system.h (renamed from src/citra_qt/configure_system.h) | 0 | ||||
| -rw-r--r-- | src/citra_qt/configuration/configure_system.ui (renamed from src/citra_qt/configure_system.ui) | 0 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 4 | ||||
| -rw-r--r-- | src/common/framebuffer_layout.cpp | 19 | ||||
| -rw-r--r-- | src/common/framebuffer_layout.h | 8 | ||||
| -rw-r--r-- | src/core/frontend/emu_window.cpp | 26 | ||||
| -rw-r--r-- | src/core/hle/function_wrappers.h | 4 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/soc_u.cpp | 71 | ||||
| -rw-r--r-- | src/core/hle/svc.cpp | 4 | ||||
| -rw-r--r-- | src/core/settings.h | 10 |
35 files changed, 182 insertions, 98 deletions
diff --git a/src/citra/config.cpp b/src/citra/config.cpp index ef1229912..a4162e9ad 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp | |||
| @@ -94,6 +94,23 @@ void Config::ReadValues() { | |||
| 94 | Settings::values.layout_option = | 94 | Settings::values.layout_option = |
| 95 | static_cast<Settings::LayoutOption>(sdl2_config->GetInteger("Layout", "layout_option", 0)); | 95 | static_cast<Settings::LayoutOption>(sdl2_config->GetInteger("Layout", "layout_option", 0)); |
| 96 | Settings::values.swap_screen = sdl2_config->GetBoolean("Layout", "swap_screen", false); | 96 | Settings::values.swap_screen = sdl2_config->GetBoolean("Layout", "swap_screen", false); |
| 97 | Settings::values.custom_layout = sdl2_config->GetBoolean("Layout", "custom_layout", false); | ||
| 98 | Settings::values.custom_top_left = | ||
| 99 | static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_top_left", 0)); | ||
| 100 | Settings::values.custom_top_top = | ||
| 101 | static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_top_top", 0)); | ||
| 102 | Settings::values.custom_top_right = | ||
| 103 | static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_top_right", 400)); | ||
| 104 | Settings::values.custom_top_bottom = | ||
| 105 | static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_top_bottom", 240)); | ||
| 106 | Settings::values.custom_bottom_left = | ||
| 107 | static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_bottom_left", 40)); | ||
| 108 | Settings::values.custom_bottom_top = | ||
| 109 | static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_bottom_top", 240)); | ||
| 110 | Settings::values.custom_bottom_right = | ||
| 111 | static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_bottom_right", 360)); | ||
| 112 | Settings::values.custom_bottom_bottom = | ||
| 113 | static_cast<u16>(sdl2_config->GetInteger("Layout", "custom_bottom_bottom", 480)); | ||
| 97 | 114 | ||
| 98 | // Audio | 115 | // Audio |
| 99 | Settings::values.sink_id = sdl2_config->Get("Audio", "output_engine", "auto"); | 116 | Settings::values.sink_id = sdl2_config->Get("Audio", "output_engine", "auto"); |
diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index af9f7aa2a..084372df4 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h | |||
| @@ -84,6 +84,21 @@ bg_green = | |||
| 84 | # 0 (default): Default Top Bottom Screen, 1: Single Screen Only, 2: Large Screen Small Screen | 84 | # 0 (default): Default Top Bottom Screen, 1: Single Screen Only, 2: Large Screen Small Screen |
| 85 | layout_option = | 85 | layout_option = |
| 86 | 86 | ||
| 87 | # Toggle custom layout (using the settings below) on or off. | ||
| 88 | # 0 (default): Off , 1: On | ||
| 89 | custom_layout = | ||
| 90 | |||
| 91 | # Screen placement when using Custom layout option | ||
| 92 | # 0x, 0y is the top left corner of the render window. | ||
| 93 | custom_top_left = | ||
| 94 | custom_top_top = | ||
| 95 | custom_top_right = | ||
| 96 | custom_top_bottom = | ||
| 97 | custom_bottom_left = | ||
| 98 | custom_bottom_top = | ||
| 99 | custom_bottom_right = | ||
| 100 | custom_bottom_bottom = | ||
| 101 | |||
| 87 | #Whether to toggle frame limiter on or off. | 102 | #Whether to toggle frame limiter on or off. |
| 88 | # 0: Off , 1 (default): On | 103 | # 0: Off , 1 (default): On |
| 89 | toggle_framelimit = | 104 | toggle_framelimit = |
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 2b1c59a92..3e6106f0a 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt | |||
| @@ -3,7 +3,14 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) | |||
| 3 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) | 3 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) |
| 4 | 4 | ||
| 5 | set(SRCS | 5 | set(SRCS |
| 6 | config.cpp | 6 | configuration/config.cpp |
| 7 | configuration/configure_audio.cpp | ||
| 8 | configuration/configure_debug.cpp | ||
| 9 | configuration/configure_dialog.cpp | ||
| 10 | configuration/configure_general.cpp | ||
| 11 | configuration/configure_graphics.cpp | ||
| 12 | configuration/configure_input.cpp | ||
| 13 | configuration/configure_system.cpp | ||
| 7 | debugger/callstack.cpp | 14 | debugger/callstack.cpp |
| 8 | debugger/disassembler.cpp | 15 | debugger/disassembler.cpp |
| 9 | debugger/graphics/graphics.cpp | 16 | debugger/graphics/graphics.cpp |
| @@ -19,13 +26,6 @@ set(SRCS | |||
| 19 | util/spinbox.cpp | 26 | util/spinbox.cpp |
| 20 | util/util.cpp | 27 | util/util.cpp |
| 21 | bootmanager.cpp | 28 | bootmanager.cpp |
| 22 | configure_audio.cpp | ||
| 23 | configure_debug.cpp | ||
| 24 | configure_dialog.cpp | ||
| 25 | configure_general.cpp | ||
| 26 | configure_graphics.cpp | ||
| 27 | configure_system.cpp | ||
| 28 | configure_input.cpp | ||
| 29 | game_list.cpp | 29 | game_list.cpp |
| 30 | hotkeys.cpp | 30 | hotkeys.cpp |
| 31 | main.cpp | 31 | main.cpp |
| @@ -35,7 +35,14 @@ set(SRCS | |||
| 35 | ) | 35 | ) |
| 36 | 36 | ||
| 37 | set(HEADERS | 37 | set(HEADERS |
| 38 | config.h | 38 | configuration/config.h |
| 39 | configuration/configure_audio.h | ||
| 40 | configuration/configure_debug.h | ||
| 41 | configuration/configure_dialog.h | ||
| 42 | configuration/configure_general.h | ||
| 43 | configuration/configure_graphics.h | ||
| 44 | configuration/configure_input.h | ||
| 45 | configuration/configure_system.h | ||
| 39 | debugger/callstack.h | 46 | debugger/callstack.h |
| 40 | debugger/disassembler.h | 47 | debugger/disassembler.h |
| 41 | debugger/graphics/graphics.h | 48 | debugger/graphics/graphics.h |
| @@ -52,13 +59,6 @@ set(HEADERS | |||
| 52 | util/spinbox.h | 59 | util/spinbox.h |
| 53 | util/util.h | 60 | util/util.h |
| 54 | bootmanager.h | 61 | bootmanager.h |
| 55 | configure_audio.h | ||
| 56 | configure_debug.h | ||
| 57 | configure_dialog.h | ||
| 58 | configure_general.h | ||
| 59 | configure_graphics.h | ||
| 60 | configure_system.h | ||
| 61 | configure_input.h | ||
| 62 | game_list.h | 62 | game_list.h |
| 63 | game_list_p.h | 63 | game_list_p.h |
| 64 | hotkeys.h | 64 | hotkeys.h |
| @@ -67,16 +67,16 @@ set(HEADERS | |||
| 67 | ) | 67 | ) |
| 68 | 68 | ||
| 69 | set(UIS | 69 | set(UIS |
| 70 | configuration/configure.ui | ||
| 71 | configuration/configure_audio.ui | ||
| 72 | configuration/configure_debug.ui | ||
| 73 | configuration/configure_general.ui | ||
| 74 | configuration/configure_graphics.ui | ||
| 75 | configuration/configure_input.ui | ||
| 76 | configuration/configure_system.ui | ||
| 70 | debugger/callstack.ui | 77 | debugger/callstack.ui |
| 71 | debugger/disassembler.ui | 78 | debugger/disassembler.ui |
| 72 | debugger/registers.ui | 79 | debugger/registers.ui |
| 73 | configure.ui | ||
| 74 | configure_audio.ui | ||
| 75 | configure_debug.ui | ||
| 76 | configure_general.ui | ||
| 77 | configure_graphics.ui | ||
| 78 | configure_system.ui | ||
| 79 | configure_input.ui | ||
| 80 | hotkeys.ui | 80 | hotkeys.ui |
| 81 | main.ui | 81 | main.ui |
| 82 | ) | 82 | ) |
diff --git a/src/citra_qt/config.cpp b/src/citra_qt/configuration/config.cpp index 6ccfa1577..0b9b73f9e 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/configuration/config.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <QSettings> | 5 | #include <QSettings> |
| 6 | #include "citra_qt/config.h" | 6 | #include "citra_qt/configuration/config.h" |
| 7 | #include "citra_qt/ui_settings.h" | 7 | #include "citra_qt/ui_settings.h" |
| 8 | #include "common/file_util.h" | 8 | #include "common/file_util.h" |
| 9 | #include "input_common/main.h" | 9 | #include "input_common/main.h" |
| @@ -79,6 +79,15 @@ void Config::ReadValues() { | |||
| 79 | Settings::values.layout_option = | 79 | Settings::values.layout_option = |
| 80 | static_cast<Settings::LayoutOption>(qt_config->value("layout_option").toInt()); | 80 | static_cast<Settings::LayoutOption>(qt_config->value("layout_option").toInt()); |
| 81 | Settings::values.swap_screen = qt_config->value("swap_screen", false).toBool(); | 81 | Settings::values.swap_screen = qt_config->value("swap_screen", false).toBool(); |
| 82 | Settings::values.custom_layout = qt_config->value("custom_layout", false).toBool(); | ||
| 83 | Settings::values.custom_top_left = qt_config->value("custom_top_left", 0).toInt(); | ||
| 84 | Settings::values.custom_top_top = qt_config->value("custom_top_top", 0).toInt(); | ||
| 85 | Settings::values.custom_top_right = qt_config->value("custom_top_right", 400).toInt(); | ||
| 86 | Settings::values.custom_top_bottom = qt_config->value("custom_top_bottom", 240).toInt(); | ||
| 87 | Settings::values.custom_bottom_left = qt_config->value("custom_bottom_left", 40).toInt(); | ||
| 88 | Settings::values.custom_bottom_top = qt_config->value("custom_bottom_top", 240).toInt(); | ||
| 89 | Settings::values.custom_bottom_right = qt_config->value("custom_bottom_right", 360).toInt(); | ||
| 90 | Settings::values.custom_bottom_bottom = qt_config->value("custom_bottom_bottom", 480).toInt(); | ||
| 82 | qt_config->endGroup(); | 91 | qt_config->endGroup(); |
| 83 | 92 | ||
| 84 | qt_config->beginGroup("Audio"); | 93 | qt_config->beginGroup("Audio"); |
| @@ -207,6 +216,15 @@ void Config::SaveValues() { | |||
| 207 | qt_config->beginGroup("Layout"); | 216 | qt_config->beginGroup("Layout"); |
| 208 | qt_config->setValue("layout_option", static_cast<int>(Settings::values.layout_option)); | 217 | qt_config->setValue("layout_option", static_cast<int>(Settings::values.layout_option)); |
| 209 | qt_config->setValue("swap_screen", Settings::values.swap_screen); | 218 | qt_config->setValue("swap_screen", Settings::values.swap_screen); |
| 219 | qt_config->setValue("custom_layout", Settings::values.custom_layout); | ||
| 220 | qt_config->setValue("custom_top_left", Settings::values.custom_top_left); | ||
| 221 | qt_config->setValue("custom_top_top", Settings::values.custom_top_top); | ||
| 222 | qt_config->setValue("custom_top_right", Settings::values.custom_top_right); | ||
| 223 | qt_config->setValue("custom_top_bottom", Settings::values.custom_top_bottom); | ||
| 224 | qt_config->setValue("custom_bottom_left", Settings::values.custom_bottom_left); | ||
| 225 | qt_config->setValue("custom_bottom_top", Settings::values.custom_bottom_top); | ||
| 226 | qt_config->setValue("custom_bottom_right", Settings::values.custom_bottom_right); | ||
| 227 | qt_config->setValue("custom_bottom_bottom", Settings::values.custom_bottom_bottom); | ||
| 210 | qt_config->endGroup(); | 228 | qt_config->endGroup(); |
| 211 | 229 | ||
| 212 | qt_config->beginGroup("Audio"); | 230 | qt_config->beginGroup("Audio"); |
diff --git a/src/citra_qt/config.h b/src/citra_qt/configuration/config.h index cbf745ea2..cbf745ea2 100644 --- a/src/citra_qt/config.h +++ b/src/citra_qt/configuration/config.h | |||
diff --git a/src/citra_qt/configure.ui b/src/citra_qt/configuration/configure.ui index 28b4a3b90..85e206e42 100644 --- a/src/citra_qt/configure.ui +++ b/src/citra_qt/configuration/configure.ui | |||
| @@ -64,37 +64,37 @@ | |||
| 64 | <customwidget> | 64 | <customwidget> |
| 65 | <class>ConfigureGeneral</class> | 65 | <class>ConfigureGeneral</class> |
| 66 | <extends>QWidget</extends> | 66 | <extends>QWidget</extends> |
| 67 | <header>configure_general.h</header> | 67 | <header>configuration/configure_general.h</header> |
| 68 | <container>1</container> | 68 | <container>1</container> |
| 69 | </customwidget> | 69 | </customwidget> |
| 70 | <customwidget> | 70 | <customwidget> |
| 71 | <class>ConfigureSystem</class> | 71 | <class>ConfigureSystem</class> |
| 72 | <extends>QWidget</extends> | 72 | <extends>QWidget</extends> |
| 73 | <header>configure_system.h</header> | 73 | <header>configuration/configure_system.h</header> |
| 74 | <container>1</container> | 74 | <container>1</container> |
| 75 | </customwidget> | 75 | </customwidget> |
| 76 | <customwidget> | 76 | <customwidget> |
| 77 | <class>ConfigureAudio</class> | 77 | <class>ConfigureAudio</class> |
| 78 | <extends>QWidget</extends> | 78 | <extends>QWidget</extends> |
| 79 | <header>configure_audio.h</header> | 79 | <header>configuration/configure_audio.h</header> |
| 80 | <container>1</container> | 80 | <container>1</container> |
| 81 | </customwidget> | 81 | </customwidget> |
| 82 | <customwidget> | 82 | <customwidget> |
| 83 | <class>ConfigureDebug</class> | 83 | <class>ConfigureDebug</class> |
| 84 | <extends>QWidget</extends> | 84 | <extends>QWidget</extends> |
| 85 | <header>configure_debug.h</header> | 85 | <header>configuration/configure_debug.h</header> |
| 86 | <container>1</container> | 86 | <container>1</container> |
| 87 | </customwidget> | 87 | </customwidget> |
| 88 | <customwidget> | 88 | <customwidget> |
| 89 | <class>ConfigureInput</class> | 89 | <class>ConfigureInput</class> |
| 90 | <extends>QWidget</extends> | 90 | <extends>QWidget</extends> |
| 91 | <header>configure_input.h</header> | 91 | <header>configuration/configure_input.h</header> |
| 92 | <container>1</container> | 92 | <container>1</container> |
| 93 | </customwidget> | 93 | </customwidget> |
| 94 | <customwidget> | 94 | <customwidget> |
| 95 | <class>ConfigureGraphics</class> | 95 | <class>ConfigureGraphics</class> |
| 96 | <extends>QWidget</extends> | 96 | <extends>QWidget</extends> |
| 97 | <header>configure_graphics.h</header> | 97 | <header>configuration/configure_graphics.h</header> |
| 98 | <container>1</container> | 98 | <container>1</container> |
| 99 | </customwidget> | 99 | </customwidget> |
| 100 | </customwidgets> | 100 | </customwidgets> |
diff --git a/src/citra_qt/configure_audio.cpp b/src/citra_qt/configuration/configure_audio.cpp index 3ddcf9232..3fd1d127a 100644 --- a/src/citra_qt/configure_audio.cpp +++ b/src/citra_qt/configuration/configure_audio.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "audio_core/audio_core.h" | 6 | #include "audio_core/audio_core.h" |
| 7 | #include "audio_core/sink.h" | 7 | #include "audio_core/sink.h" |
| 8 | #include "audio_core/sink_details.h" | 8 | #include "audio_core/sink_details.h" |
| 9 | #include "citra_qt/configure_audio.h" | 9 | #include "citra_qt/configuration/configure_audio.h" |
| 10 | #include "core/settings.h" | 10 | #include "core/settings.h" |
| 11 | #include "ui_configure_audio.h" | 11 | #include "ui_configure_audio.h" |
| 12 | 12 | ||
diff --git a/src/citra_qt/configure_audio.h b/src/citra_qt/configuration/configure_audio.h index 8190e694f..8190e694f 100644 --- a/src/citra_qt/configure_audio.h +++ b/src/citra_qt/configuration/configure_audio.h | |||
diff --git a/src/citra_qt/configure_audio.ui b/src/citra_qt/configuration/configure_audio.ui index dd870eb61..dd870eb61 100644 --- a/src/citra_qt/configure_audio.ui +++ b/src/citra_qt/configuration/configure_audio.ui | |||
diff --git a/src/citra_qt/configure_debug.cpp b/src/citra_qt/configuration/configure_debug.cpp index dcc398eee..263f73f38 100644 --- a/src/citra_qt/configure_debug.cpp +++ b/src/citra_qt/configuration/configure_debug.cpp | |||
| @@ -2,7 +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 "citra_qt/configure_debug.h" | 5 | #include "citra_qt/configuration/configure_debug.h" |
| 6 | #include "core/settings.h" | 6 | #include "core/settings.h" |
| 7 | #include "ui_configure_debug.h" | 7 | #include "ui_configure_debug.h" |
| 8 | 8 | ||
diff --git a/src/citra_qt/configure_debug.h b/src/citra_qt/configuration/configure_debug.h index d167eb996..d167eb996 100644 --- a/src/citra_qt/configure_debug.h +++ b/src/citra_qt/configuration/configure_debug.h | |||
diff --git a/src/citra_qt/configure_debug.ui b/src/citra_qt/configuration/configure_debug.ui index bbbb0e3f4..bbbb0e3f4 100644 --- a/src/citra_qt/configure_debug.ui +++ b/src/citra_qt/configuration/configure_debug.ui | |||
diff --git a/src/citra_qt/configure_dialog.cpp b/src/citra_qt/configuration/configure_dialog.cpp index 525a7cc4e..dfc8c03a7 100644 --- a/src/citra_qt/configure_dialog.cpp +++ b/src/citra_qt/configuration/configure_dialog.cpp | |||
| @@ -2,8 +2,8 @@ | |||
| 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 "citra_qt/config.h" | 5 | #include "citra_qt/configuration/config.h" |
| 6 | #include "citra_qt/configure_dialog.h" | 6 | #include "citra_qt/configuration/configure_dialog.h" |
| 7 | #include "core/settings.h" | 7 | #include "core/settings.h" |
| 8 | #include "ui_configure.h" | 8 | #include "ui_configure.h" |
| 9 | 9 | ||
diff --git a/src/citra_qt/configure_dialog.h b/src/citra_qt/configuration/configure_dialog.h index 21fa1f501..21fa1f501 100644 --- a/src/citra_qt/configure_dialog.h +++ b/src/citra_qt/configuration/configure_dialog.h | |||
diff --git a/src/citra_qt/configure_general.cpp b/src/citra_qt/configuration/configure_general.cpp index ac90a6df4..a21176c34 100644 --- a/src/citra_qt/configure_general.cpp +++ b/src/citra_qt/configuration/configure_general.cpp | |||
| @@ -2,7 +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 "citra_qt/configure_general.h" | 5 | #include "citra_qt/configuration/configure_general.h" |
| 6 | #include "citra_qt/ui_settings.h" | 6 | #include "citra_qt/ui_settings.h" |
| 7 | #include "core/core.h" | 7 | #include "core/core.h" |
| 8 | #include "core/settings.h" | 8 | #include "core/settings.h" |
diff --git a/src/citra_qt/configure_general.h b/src/citra_qt/configuration/configure_general.h index 447552d8c..447552d8c 100644 --- a/src/citra_qt/configure_general.h +++ b/src/citra_qt/configuration/configure_general.h | |||
diff --git a/src/citra_qt/configure_general.ui b/src/citra_qt/configuration/configure_general.ui index c739605a4..c739605a4 100644 --- a/src/citra_qt/configure_general.ui +++ b/src/citra_qt/configuration/configure_general.ui | |||
diff --git a/src/citra_qt/configure_graphics.cpp b/src/citra_qt/configuration/configure_graphics.cpp index 54f799b47..b5a5ab1e1 100644 --- a/src/citra_qt/configure_graphics.cpp +++ b/src/citra_qt/configuration/configure_graphics.cpp | |||
| @@ -2,7 +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 "citra_qt/configure_graphics.h" | 5 | #include "citra_qt/configuration/configure_graphics.h" |
| 6 | #include "core/core.h" | 6 | #include "core/core.h" |
| 7 | #include "core/settings.h" | 7 | #include "core/settings.h" |
| 8 | #include "ui_configure_graphics.h" | 8 | #include "ui_configure_graphics.h" |
| @@ -14,6 +14,8 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) | |||
| 14 | this->setConfiguration(); | 14 | this->setConfiguration(); |
| 15 | 15 | ||
| 16 | ui->toggle_vsync->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | 16 | ui->toggle_vsync->setEnabled(!Core::System::GetInstance().IsPoweredOn()); |
| 17 | |||
| 18 | ui->layoutBox->setEnabled(!Settings::values.custom_layout); | ||
| 17 | } | 19 | } |
| 18 | 20 | ||
| 19 | ConfigureGraphics::~ConfigureGraphics() {} | 21 | ConfigureGraphics::~ConfigureGraphics() {} |
diff --git a/src/citra_qt/configure_graphics.h b/src/citra_qt/configuration/configure_graphics.h index 5497a55f7..5497a55f7 100644 --- a/src/citra_qt/configure_graphics.h +++ b/src/citra_qt/configuration/configure_graphics.h | |||
diff --git a/src/citra_qt/configure_graphics.ui b/src/citra_qt/configuration/configure_graphics.ui index a091f4c60..228f2a869 100644 --- a/src/citra_qt/configure_graphics.ui +++ b/src/citra_qt/configuration/configure_graphics.ui | |||
| @@ -126,7 +126,7 @@ | |||
| 126 | </layout> | 126 | </layout> |
| 127 | </item> | 127 | </item> |
| 128 | <item> | 128 | <item> |
| 129 | <widget class="QGroupBox" name="groupBox2"> | 129 | <widget class="QGroupBox" name="layoutBox"> |
| 130 | <property name="title"> | 130 | <property name="title"> |
| 131 | <string>Layout</string> | 131 | <string>Layout</string> |
| 132 | </property> | 132 | </property> |
diff --git a/src/citra_qt/configure_input.cpp b/src/citra_qt/configuration/configure_input.cpp index b59713e2c..daac9b63a 100644 --- a/src/citra_qt/configure_input.cpp +++ b/src/citra_qt/configuration/configure_input.cpp | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | #include <memory> | 6 | #include <memory> |
| 7 | #include <utility> | 7 | #include <utility> |
| 8 | #include <QTimer> | 8 | #include <QTimer> |
| 9 | #include "citra_qt/config.h" | 9 | #include "citra_qt/configuration/config.h" |
| 10 | #include "citra_qt/configure_input.h" | 10 | #include "citra_qt/configuration/configure_input.h" |
| 11 | #include "common/param_package.h" | 11 | #include "common/param_package.h" |
| 12 | #include "input_common/main.h" | 12 | #include "input_common/main.h" |
| 13 | 13 | ||
diff --git a/src/citra_qt/configure_input.h b/src/citra_qt/configuration/configure_input.h index c950fbcb4..c950fbcb4 100644 --- a/src/citra_qt/configure_input.h +++ b/src/citra_qt/configuration/configure_input.h | |||
diff --git a/src/citra_qt/configure_input.ui b/src/citra_qt/configuration/configure_input.ui index 2760787e5..2760787e5 100644 --- a/src/citra_qt/configure_input.ui +++ b/src/citra_qt/configuration/configure_input.ui | |||
diff --git a/src/citra_qt/configure_system.cpp b/src/citra_qt/configuration/configure_system.cpp index 040185e82..a3a9015a4 100644 --- a/src/citra_qt/configure_system.cpp +++ b/src/citra_qt/configuration/configure_system.cpp | |||
| @@ -2,7 +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 "citra_qt/configure_system.h" | 5 | #include "citra_qt/configuration/configure_system.h" |
| 6 | #include "citra_qt/ui_settings.h" | 6 | #include "citra_qt/ui_settings.h" |
| 7 | #include "core/core.h" | 7 | #include "core/core.h" |
| 8 | #include "core/hle/service/cfg/cfg.h" | 8 | #include "core/hle/service/cfg/cfg.h" |
diff --git a/src/citra_qt/configure_system.h b/src/citra_qt/configuration/configure_system.h index db0ead13c..db0ead13c 100644 --- a/src/citra_qt/configure_system.h +++ b/src/citra_qt/configuration/configure_system.h | |||
diff --git a/src/citra_qt/configure_system.ui b/src/citra_qt/configuration/configure_system.ui index cc54fa37f..cc54fa37f 100644 --- a/src/citra_qt/configure_system.ui +++ b/src/citra_qt/configuration/configure_system.ui | |||
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 2723a0217..73b4dd34f 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -14,8 +14,8 @@ | |||
| 14 | #include <QtGui> | 14 | #include <QtGui> |
| 15 | #include <QtWidgets> | 15 | #include <QtWidgets> |
| 16 | #include "citra_qt/bootmanager.h" | 16 | #include "citra_qt/bootmanager.h" |
| 17 | #include "citra_qt/config.h" | 17 | #include "citra_qt/configuration/config.h" |
| 18 | #include "citra_qt/configure_dialog.h" | 18 | #include "citra_qt/configuration/configure_dialog.h" |
| 19 | #include "citra_qt/debugger/callstack.h" | 19 | #include "citra_qt/debugger/callstack.h" |
| 20 | #include "citra_qt/debugger/disassembler.h" | 20 | #include "citra_qt/debugger/disassembler.h" |
| 21 | #include "citra_qt/debugger/graphics/graphics.h" | 21 | #include "citra_qt/debugger/graphics/graphics.h" |
diff --git a/src/common/framebuffer_layout.cpp b/src/common/framebuffer_layout.cpp index 46c008d9c..a2a0e7dad 100644 --- a/src/common/framebuffer_layout.cpp +++ b/src/common/framebuffer_layout.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 8 | #include "common/framebuffer_layout.h" | 8 | #include "common/framebuffer_layout.h" |
| 9 | #include "core/settings.h" | ||
| 9 | #include "video_core/video_core.h" | 10 | #include "video_core/video_core.h" |
| 10 | 11 | ||
| 11 | namespace Layout { | 12 | namespace Layout { |
| @@ -135,4 +136,22 @@ FramebufferLayout LargeFrameLayout(unsigned width, unsigned height, bool swapped | |||
| 135 | res.bottom_screen = swapped ? large_screen : small_screen; | 136 | res.bottom_screen = swapped ? large_screen : small_screen; |
| 136 | return res; | 137 | return res; |
| 137 | } | 138 | } |
| 139 | |||
| 140 | FramebufferLayout CustomFrameLayout(unsigned width, unsigned height) { | ||
| 141 | ASSERT(width > 0); | ||
| 142 | ASSERT(height > 0); | ||
| 143 | |||
| 144 | FramebufferLayout res{width, height, true, true, {}, {}}; | ||
| 145 | |||
| 146 | MathUtil::Rectangle<unsigned> top_screen{ | ||
| 147 | Settings::values.custom_top_left, Settings::values.custom_top_top, | ||
| 148 | Settings::values.custom_top_right, Settings::values.custom_top_bottom}; | ||
| 149 | MathUtil::Rectangle<unsigned> bot_screen{ | ||
| 150 | Settings::values.custom_bottom_left, Settings::values.custom_bottom_top, | ||
| 151 | Settings::values.custom_bottom_right, Settings::values.custom_bottom_bottom}; | ||
| 152 | |||
| 153 | res.top_screen = top_screen; | ||
| 154 | res.bottom_screen = bot_screen; | ||
| 155 | return res; | ||
| 156 | } | ||
| 138 | } | 157 | } |
diff --git a/src/common/framebuffer_layout.h b/src/common/framebuffer_layout.h index a125646a3..f1df5c55a 100644 --- a/src/common/framebuffer_layout.h +++ b/src/common/framebuffer_layout.h | |||
| @@ -44,4 +44,12 @@ FramebufferLayout SingleFrameLayout(unsigned width, unsigned height, bool is_swa | |||
| 44 | * @return Newly created FramebufferLayout object with default screen regions initialized | 44 | * @return Newly created FramebufferLayout object with default screen regions initialized |
| 45 | */ | 45 | */ |
| 46 | FramebufferLayout LargeFrameLayout(unsigned width, unsigned height, bool is_swapped); | 46 | FramebufferLayout LargeFrameLayout(unsigned width, unsigned height, bool is_swapped); |
| 47 | |||
| 48 | /** | ||
| 49 | * Factory method for constructing a custom FramebufferLayout | ||
| 50 | * @param width Window framebuffer width in pixels | ||
| 51 | * @param height Window framebuffer height in pixels | ||
| 52 | * @return Newly created FramebufferLayout object with default screen regions initialized | ||
| 53 | */ | ||
| 54 | FramebufferLayout CustomFrameLayout(unsigned width, unsigned height); | ||
| 47 | } | 55 | } |
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 73a44bfe7..5fdb3a7e8 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp | |||
| @@ -89,17 +89,21 @@ void EmuWindow::GyroscopeChanged(float x, float y, float z) { | |||
| 89 | 89 | ||
| 90 | void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) { | 90 | void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) { |
| 91 | Layout::FramebufferLayout layout; | 91 | Layout::FramebufferLayout layout; |
| 92 | switch (Settings::values.layout_option) { | 92 | if (Settings::values.custom_layout == true) { |
| 93 | case Settings::LayoutOption::SingleScreen: | 93 | layout = Layout::CustomFrameLayout(width, height); |
| 94 | layout = Layout::SingleFrameLayout(width, height, Settings::values.swap_screen); | 94 | } else { |
| 95 | break; | 95 | switch (Settings::values.layout_option) { |
| 96 | case Settings::LayoutOption::LargeScreen: | 96 | case Settings::LayoutOption::SingleScreen: |
| 97 | layout = Layout::LargeFrameLayout(width, height, Settings::values.swap_screen); | 97 | layout = Layout::SingleFrameLayout(width, height, Settings::values.swap_screen); |
| 98 | break; | 98 | break; |
| 99 | case Settings::LayoutOption::Default: | 99 | case Settings::LayoutOption::LargeScreen: |
| 100 | default: | 100 | layout = Layout::LargeFrameLayout(width, height, Settings::values.swap_screen); |
| 101 | layout = Layout::DefaultFrameLayout(width, height, Settings::values.swap_screen); | 101 | break; |
| 102 | break; | 102 | case Settings::LayoutOption::Default: |
| 103 | default: | ||
| 104 | layout = Layout::DefaultFrameLayout(width, height, Settings::values.swap_screen); | ||
| 105 | break; | ||
| 106 | } | ||
| 103 | } | 107 | } |
| 104 | NotifyFramebufferLayoutChanged(layout); | 108 | NotifyFramebufferLayoutChanged(layout); |
| 105 | } | 109 | } |
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h index 7875971ce..f6eb900f0 100644 --- a/src/core/hle/function_wrappers.h +++ b/src/core/hle/function_wrappers.h | |||
| @@ -256,9 +256,9 @@ void Wrap() { | |||
| 256 | func(((s64)PARAM(1) << 32) | PARAM(0)); | 256 | func(((s64)PARAM(1) << 32) | PARAM(0)); |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | template <void func(const char*)> | 259 | template <void func(const char*, int len)> |
| 260 | void Wrap() { | 260 | void Wrap() { |
| 261 | func((char*)Memory::GetPointer(PARAM(0))); | 261 | func((char*)Memory::GetPointer(PARAM(0)), PARAM(1)); |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | template <void func(u8)> | 264 | template <void func(u8)> |
diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index 8ff808fd9..2542f8303 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp | |||
| @@ -134,9 +134,9 @@ void Init() { | |||
| 134 | ASSERT_MSG(archive_result.Succeeded(), "Could not open the PTM SharedExtSaveData archive!"); | 134 | ASSERT_MSG(archive_result.Succeeded(), "Could not open the PTM SharedExtSaveData archive!"); |
| 135 | 135 | ||
| 136 | FileSys::Path gamecoin_path("/gamecoin.dat"); | 136 | FileSys::Path gamecoin_path("/gamecoin.dat"); |
| 137 | Service::FS::CreateFileInArchive(*archive_result, gamecoin_path, sizeof(GameCoin)); | ||
| 137 | FileSys::Mode open_mode = {}; | 138 | FileSys::Mode open_mode = {}; |
| 138 | open_mode.write_flag.Assign(1); | 139 | open_mode.write_flag.Assign(1); |
| 139 | open_mode.create_flag.Assign(1); | ||
| 140 | // Open the file and write the default gamecoin information | 140 | // Open the file and write the default gamecoin information |
| 141 | auto gamecoin_result = | 141 | auto gamecoin_result = |
| 142 | Service::FS::OpenFileFromArchive(*archive_result, gamecoin_path, open_mode); | 142 | Service::FS::OpenFileFromArchive(*archive_result, gamecoin_path, open_mode); |
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp index dcc5c3c90..530614e6f 100644 --- a/src/core/hle/service/soc_u.cpp +++ b/src/core/hle/service/soc_u.cpp | |||
| @@ -362,18 +362,18 @@ static void Socket(Interface* self) { | |||
| 362 | return; | 362 | return; |
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | u32 socket_handle = static_cast<u32>(::socket(domain, type, protocol)); | 365 | u32 ret = static_cast<u32>(::socket(domain, type, protocol)); |
| 366 | 366 | ||
| 367 | if ((s32)socket_handle != SOCKET_ERROR_VALUE) | 367 | if ((s32)ret != SOCKET_ERROR_VALUE) |
| 368 | open_sockets[socket_handle] = {socket_handle, true}; | 368 | open_sockets[ret] = {ret, true}; |
| 369 | 369 | ||
| 370 | int result = 0; | 370 | int result = 0; |
| 371 | if ((s32)socket_handle == SOCKET_ERROR_VALUE) | 371 | if ((s32)ret == SOCKET_ERROR_VALUE) |
| 372 | result = TranslateError(GET_ERRNO); | 372 | ret = TranslateError(GET_ERRNO); |
| 373 | 373 | ||
| 374 | cmd_buffer[0] = IPC::MakeHeader(2, 2, 0); | 374 | cmd_buffer[0] = IPC::MakeHeader(2, 2, 0); |
| 375 | cmd_buffer[1] = result; | 375 | cmd_buffer[1] = result; |
| 376 | cmd_buffer[2] = socket_handle; | 376 | cmd_buffer[2] = ret; |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | static void Bind(Interface* self) { | 379 | static void Bind(Interface* self) { |
| @@ -393,15 +393,15 @@ static void Bind(Interface* self) { | |||
| 393 | 393 | ||
| 394 | sockaddr sock_addr = CTRSockAddr::ToPlatform(ctr_sock_addr); | 394 | sockaddr sock_addr = CTRSockAddr::ToPlatform(ctr_sock_addr); |
| 395 | 395 | ||
| 396 | int res = ::bind(socket_handle, &sock_addr, std::max<u32>(sizeof(sock_addr), len)); | 396 | int ret = ::bind(socket_handle, &sock_addr, std::max<u32>(sizeof(sock_addr), len)); |
| 397 | 397 | ||
| 398 | int result = 0; | 398 | int result = 0; |
| 399 | if (res != 0) | 399 | if (ret != 0) |
| 400 | result = TranslateError(GET_ERRNO); | 400 | ret = TranslateError(GET_ERRNO); |
| 401 | 401 | ||
| 402 | cmd_buffer[0] = IPC::MakeHeader(5, 2, 0); | 402 | cmd_buffer[0] = IPC::MakeHeader(5, 2, 0); |
| 403 | cmd_buffer[1] = result; | 403 | cmd_buffer[1] = result; |
| 404 | cmd_buffer[2] = res; | 404 | cmd_buffer[2] = ret; |
| 405 | } | 405 | } |
| 406 | 406 | ||
| 407 | static void Fcntl(Interface* self) { | 407 | static void Fcntl(Interface* self) { |
| @@ -426,8 +426,7 @@ static void Fcntl(Interface* self) { | |||
| 426 | #else | 426 | #else |
| 427 | int ret = ::fcntl(socket_handle, F_GETFL, 0); | 427 | int ret = ::fcntl(socket_handle, F_GETFL, 0); |
| 428 | if (ret == SOCKET_ERROR_VALUE) { | 428 | if (ret == SOCKET_ERROR_VALUE) { |
| 429 | result = TranslateError(GET_ERRNO); | 429 | posix_ret = TranslateError(GET_ERRNO); |
| 430 | posix_ret = -1; | ||
| 431 | return; | 430 | return; |
| 432 | } | 431 | } |
| 433 | posix_ret = 0; | 432 | posix_ret = 0; |
| @@ -439,8 +438,7 @@ static void Fcntl(Interface* self) { | |||
| 439 | unsigned long tmp = (ctr_arg & 4 /* O_NONBLOCK */) ? 1 : 0; | 438 | unsigned long tmp = (ctr_arg & 4 /* O_NONBLOCK */) ? 1 : 0; |
| 440 | int ret = ioctlsocket(socket_handle, FIONBIO, &tmp); | 439 | int ret = ioctlsocket(socket_handle, FIONBIO, &tmp); |
| 441 | if (ret == SOCKET_ERROR_VALUE) { | 440 | if (ret == SOCKET_ERROR_VALUE) { |
| 442 | result = TranslateError(GET_ERRNO); | 441 | posix_ret = TranslateError(GET_ERRNO); |
| 443 | posix_ret = -1; | ||
| 444 | return; | 442 | return; |
| 445 | } | 443 | } |
| 446 | auto iter = open_sockets.find(socket_handle); | 444 | auto iter = open_sockets.find(socket_handle); |
| @@ -449,8 +447,7 @@ static void Fcntl(Interface* self) { | |||
| 449 | #else | 447 | #else |
| 450 | int flags = ::fcntl(socket_handle, F_GETFL, 0); | 448 | int flags = ::fcntl(socket_handle, F_GETFL, 0); |
| 451 | if (flags == SOCKET_ERROR_VALUE) { | 449 | if (flags == SOCKET_ERROR_VALUE) { |
| 452 | result = TranslateError(GET_ERRNO); | 450 | posix_ret = TranslateError(GET_ERRNO); |
| 453 | posix_ret = -1; | ||
| 454 | return; | 451 | return; |
| 455 | } | 452 | } |
| 456 | 453 | ||
| @@ -460,15 +457,13 @@ static void Fcntl(Interface* self) { | |||
| 460 | 457 | ||
| 461 | int ret = ::fcntl(socket_handle, F_SETFL, flags); | 458 | int ret = ::fcntl(socket_handle, F_SETFL, flags); |
| 462 | if (ret == SOCKET_ERROR_VALUE) { | 459 | if (ret == SOCKET_ERROR_VALUE) { |
| 463 | result = TranslateError(GET_ERRNO); | 460 | posix_ret = TranslateError(GET_ERRNO); |
| 464 | posix_ret = -1; | ||
| 465 | return; | 461 | return; |
| 466 | } | 462 | } |
| 467 | #endif | 463 | #endif |
| 468 | } else { | 464 | } else { |
| 469 | LOG_ERROR(Service_SOC, "Unsupported command (%d) in fcntl call", ctr_cmd); | 465 | LOG_ERROR(Service_SOC, "Unsupported command (%d) in fcntl call", ctr_cmd); |
| 470 | result = TranslateError(EINVAL); // TODO: Find the correct error | 466 | posix_ret = TranslateError(EINVAL); // TODO: Find the correct error |
| 471 | posix_ret = -1; | ||
| 472 | return; | 467 | return; |
| 473 | } | 468 | } |
| 474 | } | 469 | } |
| @@ -481,7 +476,7 @@ static void Listen(Interface* self) { | |||
| 481 | int ret = ::listen(socket_handle, backlog); | 476 | int ret = ::listen(socket_handle, backlog); |
| 482 | int result = 0; | 477 | int result = 0; |
| 483 | if (ret != 0) | 478 | if (ret != 0) |
| 484 | result = TranslateError(GET_ERRNO); | 479 | ret = TranslateError(GET_ERRNO); |
| 485 | 480 | ||
| 486 | cmd_buffer[0] = IPC::MakeHeader(3, 2, 0); | 481 | cmd_buffer[0] = IPC::MakeHeader(3, 2, 0); |
| 487 | cmd_buffer[1] = result; | 482 | cmd_buffer[1] = result; |
| @@ -504,7 +499,7 @@ static void Accept(Interface* self) { | |||
| 504 | 499 | ||
| 505 | int result = 0; | 500 | int result = 0; |
| 506 | if ((s32)ret == SOCKET_ERROR_VALUE) { | 501 | if ((s32)ret == SOCKET_ERROR_VALUE) { |
| 507 | result = TranslateError(GET_ERRNO); | 502 | ret = TranslateError(GET_ERRNO); |
| 508 | } else { | 503 | } else { |
| 509 | CTRSockAddr ctr_addr = CTRSockAddr::FromPlatform(addr); | 504 | CTRSockAddr ctr_addr = CTRSockAddr::FromPlatform(addr); |
| 510 | Memory::WriteBlock(cmd_buffer[0x104 >> 2], &ctr_addr, sizeof(ctr_addr)); | 505 | Memory::WriteBlock(cmd_buffer[0x104 >> 2], &ctr_addr, sizeof(ctr_addr)); |
| @@ -545,7 +540,7 @@ static void Close(Interface* self) { | |||
| 545 | 540 | ||
| 546 | int result = 0; | 541 | int result = 0; |
| 547 | if (ret != 0) | 542 | if (ret != 0) |
| 548 | result = TranslateError(GET_ERRNO); | 543 | ret = TranslateError(GET_ERRNO); |
| 549 | 544 | ||
| 550 | cmd_buffer[2] = ret; | 545 | cmd_buffer[2] = ret; |
| 551 | cmd_buffer[1] = result; | 546 | cmd_buffer[1] = result; |
| @@ -589,7 +584,7 @@ static void SendTo(Interface* self) { | |||
| 589 | 584 | ||
| 590 | int result = 0; | 585 | int result = 0; |
| 591 | if (ret == SOCKET_ERROR_VALUE) | 586 | if (ret == SOCKET_ERROR_VALUE) |
| 592 | result = TranslateError(GET_ERRNO); | 587 | ret = TranslateError(GET_ERRNO); |
| 593 | 588 | ||
| 594 | cmd_buffer[2] = ret; | 589 | cmd_buffer[2] = ret; |
| 595 | cmd_buffer[1] = result; | 590 | cmd_buffer[1] = result; |
| @@ -638,7 +633,7 @@ static void RecvFrom(Interface* self) { | |||
| 638 | int result = 0; | 633 | int result = 0; |
| 639 | int total_received = ret; | 634 | int total_received = ret; |
| 640 | if (ret == SOCKET_ERROR_VALUE) { | 635 | if (ret == SOCKET_ERROR_VALUE) { |
| 641 | result = TranslateError(GET_ERRNO); | 636 | ret = TranslateError(GET_ERRNO); |
| 642 | total_received = 0; | 637 | total_received = 0; |
| 643 | } else { | 638 | } else { |
| 644 | // Write only the data we received to avoid overwriting parts of the buffer with zeros | 639 | // Write only the data we received to avoid overwriting parts of the buffer with zeros |
| @@ -673,7 +668,7 @@ static void Poll(Interface* self) { | |||
| 673 | std::vector<pollfd> platform_pollfd(nfds); | 668 | std::vector<pollfd> platform_pollfd(nfds); |
| 674 | std::transform(ctr_fds.begin(), ctr_fds.end(), platform_pollfd.begin(), CTRPollFD::ToPlatform); | 669 | std::transform(ctr_fds.begin(), ctr_fds.end(), platform_pollfd.begin(), CTRPollFD::ToPlatform); |
| 675 | 670 | ||
| 676 | const int ret = ::poll(platform_pollfd.data(), nfds, timeout); | 671 | int ret = ::poll(platform_pollfd.data(), nfds, timeout); |
| 677 | 672 | ||
| 678 | // Now update the output pollfd structure | 673 | // Now update the output pollfd structure |
| 679 | std::transform(platform_pollfd.begin(), platform_pollfd.end(), ctr_fds.begin(), | 674 | std::transform(platform_pollfd.begin(), platform_pollfd.end(), ctr_fds.begin(), |
| @@ -683,7 +678,7 @@ static void Poll(Interface* self) { | |||
| 683 | 678 | ||
| 684 | int result = 0; | 679 | int result = 0; |
| 685 | if (ret == SOCKET_ERROR_VALUE) | 680 | if (ret == SOCKET_ERROR_VALUE) |
| 686 | result = TranslateError(GET_ERRNO); | 681 | ret = TranslateError(GET_ERRNO); |
| 687 | 682 | ||
| 688 | cmd_buffer[1] = result; | 683 | cmd_buffer[1] = result; |
| 689 | cmd_buffer[2] = ret; | 684 | cmd_buffer[2] = ret; |
| @@ -710,7 +705,7 @@ static void GetSockName(Interface* self) { | |||
| 710 | 705 | ||
| 711 | int result = 0; | 706 | int result = 0; |
| 712 | if (ret != 0) | 707 | if (ret != 0) |
| 713 | result = TranslateError(GET_ERRNO); | 708 | ret = TranslateError(GET_ERRNO); |
| 714 | 709 | ||
| 715 | cmd_buffer[2] = ret; | 710 | cmd_buffer[2] = ret; |
| 716 | cmd_buffer[1] = result; | 711 | cmd_buffer[1] = result; |
| @@ -724,7 +719,7 @@ static void Shutdown(Interface* self) { | |||
| 724 | int ret = ::shutdown(socket_handle, how); | 719 | int ret = ::shutdown(socket_handle, how); |
| 725 | int result = 0; | 720 | int result = 0; |
| 726 | if (ret != 0) | 721 | if (ret != 0) |
| 727 | result = TranslateError(GET_ERRNO); | 722 | ret = TranslateError(GET_ERRNO); |
| 728 | cmd_buffer[2] = ret; | 723 | cmd_buffer[2] = ret; |
| 729 | cmd_buffer[1] = result; | 724 | cmd_buffer[1] = result; |
| 730 | } | 725 | } |
| @@ -750,7 +745,7 @@ static void GetPeerName(Interface* self) { | |||
| 750 | 745 | ||
| 751 | int result = 0; | 746 | int result = 0; |
| 752 | if (ret != 0) | 747 | if (ret != 0) |
| 753 | result = TranslateError(GET_ERRNO); | 748 | ret = TranslateError(GET_ERRNO); |
| 754 | 749 | ||
| 755 | cmd_buffer[2] = ret; | 750 | cmd_buffer[2] = ret; |
| 756 | cmd_buffer[1] = result; | 751 | cmd_buffer[1] = result; |
| @@ -777,7 +772,7 @@ static void Connect(Interface* self) { | |||
| 777 | int ret = ::connect(socket_handle, &input_addr, sizeof(input_addr)); | 772 | int ret = ::connect(socket_handle, &input_addr, sizeof(input_addr)); |
| 778 | int result = 0; | 773 | int result = 0; |
| 779 | if (ret != 0) | 774 | if (ret != 0) |
| 780 | result = TranslateError(GET_ERRNO); | 775 | ret = TranslateError(GET_ERRNO); |
| 781 | 776 | ||
| 782 | cmd_buffer[0] = IPC::MakeHeader(6, 2, 0); | 777 | cmd_buffer[0] = IPC::MakeHeader(6, 2, 0); |
| 783 | cmd_buffer[1] = result; | 778 | cmd_buffer[1] = result; |
| @@ -815,7 +810,7 @@ static void GetSockOpt(Interface* self) { | |||
| 815 | int optname = TranslateSockOpt(cmd_buffer[3]); | 810 | int optname = TranslateSockOpt(cmd_buffer[3]); |
| 816 | socklen_t optlen = (socklen_t)cmd_buffer[4]; | 811 | socklen_t optlen = (socklen_t)cmd_buffer[4]; |
| 817 | 812 | ||
| 818 | int ret = -1; | 813 | int ret = 0; |
| 819 | int err = 0; | 814 | int err = 0; |
| 820 | 815 | ||
| 821 | if (optname < 0) { | 816 | if (optname < 0) { |
| @@ -830,9 +825,8 @@ static void GetSockOpt(Interface* self) { | |||
| 830 | // >> 2 = convert to u32 offset instead of byte offset (cmd_buffer = u32*) | 825 | // >> 2 = convert to u32 offset instead of byte offset (cmd_buffer = u32*) |
| 831 | char* optval = reinterpret_cast<char*>(Memory::GetPointer(cmd_buffer[0x104 >> 2])); | 826 | char* optval = reinterpret_cast<char*>(Memory::GetPointer(cmd_buffer[0x104 >> 2])); |
| 832 | 827 | ||
| 833 | ret = ::getsockopt(socket_handle, level, optname, optval, &optlen); | 828 | err = ::getsockopt(socket_handle, level, optname, optval, &optlen); |
| 834 | err = 0; | 829 | if (err == SOCKET_ERROR_VALUE) { |
| 835 | if (ret == SOCKET_ERROR_VALUE) { | ||
| 836 | err = TranslateError(GET_ERRNO); | 830 | err = TranslateError(GET_ERRNO); |
| 837 | } | 831 | } |
| 838 | } | 832 | } |
| @@ -849,7 +843,7 @@ static void SetSockOpt(Interface* self) { | |||
| 849 | u32 level = cmd_buffer[2]; | 843 | u32 level = cmd_buffer[2]; |
| 850 | int optname = TranslateSockOpt(cmd_buffer[3]); | 844 | int optname = TranslateSockOpt(cmd_buffer[3]); |
| 851 | 845 | ||
| 852 | int ret = -1; | 846 | int ret = 0; |
| 853 | int err = 0; | 847 | int err = 0; |
| 854 | 848 | ||
| 855 | if (optname < 0) { | 849 | if (optname < 0) { |
| @@ -862,9 +856,8 @@ static void SetSockOpt(Interface* self) { | |||
| 862 | socklen_t optlen = static_cast<socklen_t>(cmd_buffer[4]); | 856 | socklen_t optlen = static_cast<socklen_t>(cmd_buffer[4]); |
| 863 | const char* optval = reinterpret_cast<const char*>(Memory::GetPointer(cmd_buffer[8])); | 857 | const char* optval = reinterpret_cast<const char*>(Memory::GetPointer(cmd_buffer[8])); |
| 864 | 858 | ||
| 865 | ret = static_cast<u32>(::setsockopt(socket_handle, level, optname, optval, optlen)); | 859 | err = static_cast<u32>(::setsockopt(socket_handle, level, optname, optval, optlen)); |
| 866 | err = 0; | 860 | if (err == SOCKET_ERROR_VALUE) { |
| 867 | if (ret == SOCKET_ERROR_VALUE) { | ||
| 868 | err = TranslateError(GET_ERRNO); | 861 | err = TranslateError(GET_ERRNO); |
| 869 | } | 862 | } |
| 870 | } | 863 | } |
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 4e0c3fb8b..2db823c61 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp | |||
| @@ -467,8 +467,8 @@ static void Break(u8 break_reason) { | |||
| 467 | } | 467 | } |
| 468 | 468 | ||
| 469 | /// Used to output a message on a debug hardware unit - does nothing on a retail unit | 469 | /// Used to output a message on a debug hardware unit - does nothing on a retail unit |
| 470 | static void OutputDebugString(const char* string) { | 470 | static void OutputDebugString(const char* string, int len) { |
| 471 | LOG_DEBUG(Debug_Emulated, "%s", string); | 471 | LOG_DEBUG(Debug_Emulated, "%.*s", len, string); |
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | /// Get resource limit | 474 | /// Get resource limit |
diff --git a/src/core/settings.h b/src/core/settings.h index d1a9f0da8..03c64c94c 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -15,7 +15,6 @@ enum class LayoutOption { | |||
| 15 | Default, | 15 | Default, |
| 16 | SingleScreen, | 16 | SingleScreen, |
| 17 | LargeScreen, | 17 | LargeScreen, |
| 18 | Custom, | ||
| 19 | }; | 18 | }; |
| 20 | 19 | ||
| 21 | namespace NativeButton { | 20 | namespace NativeButton { |
| @@ -99,6 +98,15 @@ struct Values { | |||
| 99 | 98 | ||
| 100 | LayoutOption layout_option; | 99 | LayoutOption layout_option; |
| 101 | bool swap_screen; | 100 | bool swap_screen; |
| 101 | bool custom_layout; | ||
| 102 | u16 custom_top_left; | ||
| 103 | u16 custom_top_top; | ||
| 104 | u16 custom_top_right; | ||
| 105 | u16 custom_top_bottom; | ||
| 106 | u16 custom_bottom_left; | ||
| 107 | u16 custom_bottom_top; | ||
| 108 | u16 custom_bottom_right; | ||
| 109 | u16 custom_bottom_bottom; | ||
| 102 | 110 | ||
| 103 | float bg_red; | 111 | float bg_red; |
| 104 | float bg_green; | 112 | float bg_green; |