diff options
Diffstat (limited to 'src/citra')
| -rw-r--r-- | src/citra/citra.cpp | 20 | ||||
| -rw-r--r-- | src/citra/config.cpp | 23 | ||||
| -rw-r--r-- | src/citra/default_ini.h | 41 | ||||
| -rw-r--r-- | src/citra/emu_window/emu_window_sdl2.cpp | 22 | ||||
| -rw-r--r-- | src/citra/emu_window/emu_window_sdl2.h | 5 | 
5 files changed, 91 insertions, 20 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 99c096ac7..76f5caeb1 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -141,6 +141,26 @@ int main(int argc, char** argv) {      case Core::System::ResultStatus::ErrorLoader:          LOG_CRITICAL(Frontend, "Failed to load ROM!");          return -1; +    case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: +        LOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before " +                               "being used with Citra. \n\n For more information on dumping and " +                               "decrypting games, please refer to: " +                               "https://citra-emu.org/wiki/Dumping-Game-Cartridges"); +        return -1; +    case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: +        LOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); +        return -1; +    case Core::System::ResultStatus::ErrorNotInitialized: +        LOG_CRITICAL(Frontend, "CPUCore not initialized"); +        return -1; +    case Core::System::ResultStatus::ErrorSystemMode: +        LOG_CRITICAL(Frontend, "Failed to determine system mode!"); +        return -1; +    case Core::System::ResultStatus::ErrorVideoCore: +        LOG_CRITICAL(Frontend, "VideoCore not initialized"); +        return -1; +    case Core::System::ResultStatus::Success: +        break; // Expected case      }      while (emu_window->IsOpen()) { diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 29462c982..fac1c9a0e 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -63,8 +63,8 @@ void Config::ReadValues() {      // Renderer      Settings::values.use_hw_renderer = sdl2_config->GetBoolean("Renderer", "use_hw_renderer", true);      Settings::values.use_shader_jit = sdl2_config->GetBoolean("Renderer", "use_shader_jit", true); -    Settings::values.use_scaled_resolution = -        sdl2_config->GetBoolean("Renderer", "use_scaled_resolution", false); +    Settings::values.resolution_factor = +        (float)sdl2_config->GetReal("Renderer", "resolution_factor", 1.0);      Settings::values.use_vsync = sdl2_config->GetBoolean("Renderer", "use_vsync", false);      Settings::values.toggle_framelimit =          sdl2_config->GetBoolean("Renderer", "toggle_framelimit", true); @@ -82,6 +82,7 @@ void Config::ReadValues() {      Settings::values.sink_id = sdl2_config->Get("Audio", "output_engine", "auto");      Settings::values.enable_audio_stretching =          sdl2_config->GetBoolean("Audio", "enable_audio_stretching", true); +    Settings::values.audio_device_id = sdl2_config->Get("Audio", "output_device", "auto");      // Data Storage      Settings::values.use_virtual_sd = @@ -89,7 +90,23 @@ void Config::ReadValues() {      // System      Settings::values.is_new_3ds = sdl2_config->GetBoolean("System", "is_new_3ds", false); -    Settings::values.region_value = sdl2_config->GetInteger("System", "region_value", 1); +    Settings::values.region_value = +        sdl2_config->GetInteger("System", "region_value", Settings::REGION_VALUE_AUTO_SELECT); + +    // Camera +    using namespace Service::CAM; +    Settings::values.camera_name[OuterRightCamera] = +        sdl2_config->Get("Camera", "camera_outer_right_name", "blank"); +    Settings::values.camera_config[OuterRightCamera] = +        sdl2_config->Get("Camera", "camera_outer_right_config", ""); +    Settings::values.camera_name[InnerCamera] = +        sdl2_config->Get("Camera", "camera_inner_name", "blank"); +    Settings::values.camera_config[InnerCamera] = +        sdl2_config->Get("Camera", "camera_inner_config", ""); +    Settings::values.camera_name[OuterLeftCamera] = +        sdl2_config->Get("Camera", "camera_outer_left_name", "blank"); +    Settings::values.camera_config[OuterLeftCamera] = +        sdl2_config->Get("Camera", "camera_outer_left_config", "");      // Miscellaneous      Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Info"); diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index 001b18ac2..435ba6f00 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h @@ -51,14 +51,21 @@ use_hw_renderer =  # 0: Interpreter (slow), 1 (default): JIT (fast)  use_shader_jit = -# Whether to use native 3DS screen resolution or to scale rendering resolution to the displayed screen size. -# 0 (default): Native, 1: Scaled -use_scaled_resolution = +# Resolution scale factor +# 0: Auto (scales resolution to window size), 1: Native 3DS screen resolution, Otherwise a scale +# factor for the 3DS resolution +resolution_factor =  # Whether to enable V-Sync (caps the framerate at 60FPS) or not.  # 0 (default): Off, 1: On  use_vsync = +# The clear color for the renderer. What shows up on the sides of the bottom screen. +# Must be in range of 0.0-1.0. Defaults to 1.0 for all. +bg_red = +bg_blue = +bg_green = +  [Layout]  # Layout for the screen inside the render window.  # 0 (default): Default Top Bottom Screen, 1: Single Screen Only, 2: Large Screen Small Screen @@ -73,12 +80,6 @@ toggle_framelimit =  # 0 (default): Top Screen is prominent, 1: Bottom Screen is prominent  swap_screen = -# The clear color for the renderer. What shows up on the sides of the bottom screen. -# Must be in range of 0.0-1.0. Defaults to 1.0 for all. -bg_red = -bg_blue = -bg_green = -  [Audio]  # Which audio output engine to use.  # auto (default): Auto-select, null: No audio output, sdl2: SDL2 (if available) @@ -90,6 +91,10 @@ output_engine =  # 0: No, 1 (default): Yes  enable_audio_stretching = +# Which audio device to use. +# auto (default): Auto-select +output_device = +  [Data Storage]  # Whether to create a virtual SD card.  # 1 (default): Yes, 0: No @@ -101,9 +106,25 @@ use_virtual_sd =  is_new_3ds =  # The system region that Citra will use during emulation -# 0: Japan, 1: USA (default), 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan +# -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan  region_value = +[Camera] +# Which camera engine to use for the right outer camera +# blank (default): a dummy camera that always returns black image +camera_outer_right_name = + +# A config string for the right outer camera. Its meaning is defined by the camera engine +camera_outer_right_config = + +# ... for the left outer camera +camera_outer_left_name = +camera_outer_left_config = + +# ... for the inner camera +camera_inner_name = +camera_inner_config = +  [Miscellaneous]  # A filter which removes logs below a certain logging level.  # Examples: *:Debug Kernel.SVC:Trace Service.*:Critical diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index b0d82b670..81a3abe3f 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -19,16 +19,22 @@  void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) {      TouchMoved((unsigned)std::max(x, 0), (unsigned)std::max(y, 0)); +    motion_emu->Tilt(x, y);  }  void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) { -    if (button != SDL_BUTTON_LEFT) -        return; - -    if (state == SDL_PRESSED) { -        TouchPressed((unsigned)std::max(x, 0), (unsigned)std::max(y, 0)); -    } else { -        TouchReleased(); +    if (button == SDL_BUTTON_LEFT) { +        if (state == SDL_PRESSED) { +            TouchPressed((unsigned)std::max(x, 0), (unsigned)std::max(y, 0)); +        } else { +            TouchReleased(); +        } +    } else if (button == SDL_BUTTON_RIGHT) { +        if (state == SDL_PRESSED) { +            motion_emu->BeginTilt(x, y); +        } else { +            motion_emu->EndTilt(); +        }      }  } @@ -54,6 +60,7 @@ EmuWindow_SDL2::EmuWindow_SDL2() {      keyboard_id = KeyMap::NewDeviceId();      ReloadSetKeymaps(); +    motion_emu = std::make_unique<Motion::MotionEmu>(*this);      SDL_SetMainReady(); @@ -109,6 +116,7 @@ EmuWindow_SDL2::EmuWindow_SDL2() {  EmuWindow_SDL2::~EmuWindow_SDL2() {      SDL_GL_DeleteContext(gl_context);      SDL_Quit(); +    motion_emu = nullptr;  }  void EmuWindow_SDL2::SwapBuffers() { diff --git a/src/citra/emu_window/emu_window_sdl2.h b/src/citra/emu_window/emu_window_sdl2.h index c8cd919c6..b1cbf16d7 100644 --- a/src/citra/emu_window/emu_window_sdl2.h +++ b/src/citra/emu_window/emu_window_sdl2.h @@ -4,8 +4,10 @@  #pragma once +#include <memory>  #include <utility>  #include "core/frontend/emu_window.h" +#include "core/frontend/motion_emu.h"  struct SDL_Window; @@ -61,4 +63,7 @@ private:      /// Device id of keyboard for use with KeyMap      int keyboard_id; + +    /// Motion sensors emulation +    std::unique_ptr<Motion::MotionEmu> motion_emu;  };  | 
