summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/CMakeLists.txt6
-rw-r--r--src/core/hle/kernel/svc.cpp11
-rw-r--r--src/core/hle/service/friend/friend.cpp10
-rw-r--r--src/core/hle/service/friend/friend_u.cpp18
-rw-r--r--src/core/hle/service/friend/friend_u.h16
-rw-r--r--src/core/hle/service/friend/interface.cpp (renamed from src/core/hle/service/friend/friend_a.cpp)9
-rw-r--r--src/core/hle/service/friend/interface.h (renamed from src/core/hle/service/friend/friend_a.h)4
-rw-r--r--src/core/loader/deconstructed_rom_directory.cpp29
-rw-r--r--src/video_core/engines/maxwell_3d.cpp8
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp7
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h27
-rw-r--r--src/video_core/textures/decoders.cpp3
12 files changed, 54 insertions, 94 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 6b6efbc00..b7d52babc 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -146,10 +146,8 @@ add_library(core STATIC
hle/service/filesystem/fsp_srv.h
hle/service/friend/friend.cpp
hle/service/friend/friend.h
- hle/service/friend/friend_a.cpp
- hle/service/friend/friend_a.h
- hle/service/friend/friend_u.cpp
- hle/service/friend/friend_u.h
+ hle/service/friend/interface.cpp
+ hle/service/friend/interface.h
hle/service/hid/hid.cpp
hle/service/hid/hid.h
hle/service/lm/lm.cpp
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 7b41c9cfd..da7cacb57 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -165,11 +165,14 @@ static ResultCode WaitSynchronization(Handle* index, VAddr handles_address, u64
using ObjectPtr = SharedPtr<WaitObject>;
std::vector<ObjectPtr> objects(handle_count);
- for (int i = 0; i < handle_count; ++i) {
- Handle handle = Memory::Read32(handles_address + i * sizeof(Handle));
- auto object = g_handle_table.Get<WaitObject>(handle);
- if (object == nullptr)
+ for (u64 i = 0; i < handle_count; ++i) {
+ const Handle handle = Memory::Read32(handles_address + i * sizeof(Handle));
+ const auto object = g_handle_table.Get<WaitObject>(handle);
+
+ if (object == nullptr) {
return ERR_INVALID_HANDLE;
+ }
+
objects[i] = object;
}
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp
index c98a46e05..fb4d89068 100644
--- a/src/core/hle/service/friend/friend.cpp
+++ b/src/core/hle/service/friend/friend.cpp
@@ -5,8 +5,7 @@
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/friend/friend.h"
-#include "core/hle/service/friend/friend_a.h"
-#include "core/hle/service/friend/friend_u.h"
+#include "core/hle/service/friend/interface.h"
namespace Service::Friend {
@@ -21,8 +20,11 @@ Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
void InstallInterfaces(SM::ServiceManager& service_manager) {
auto module = std::make_shared<Module>();
- std::make_shared<Friend_A>(module)->InstallAsService(service_manager);
- std::make_shared<Friend_U>(module)->InstallAsService(service_manager);
+ std::make_shared<Friend>(module, "friend:a")->InstallAsService(service_manager);
+ std::make_shared<Friend>(module, "friend:m")->InstallAsService(service_manager);
+ std::make_shared<Friend>(module, "friend:s")->InstallAsService(service_manager);
+ std::make_shared<Friend>(module, "friend:u")->InstallAsService(service_manager);
+ std::make_shared<Friend>(module, "friend:v")->InstallAsService(service_manager);
}
} // namespace Service::Friend
diff --git a/src/core/hle/service/friend/friend_u.cpp b/src/core/hle/service/friend/friend_u.cpp
deleted file mode 100644
index 90b30883f..000000000
--- a/src/core/hle/service/friend/friend_u.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2018 yuzu emulator team
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/friend/friend_u.h"
-
-namespace Service::Friend {
-
-Friend_U::Friend_U(std::shared_ptr<Module> module)
- : Module::Interface(std::move(module), "friend:u") {
- static const FunctionInfo functions[] = {
- {0, &Friend_U::CreateFriendService, "CreateFriendService"},
- {1, nullptr, "CreateNotificationService"},
- };
- RegisterHandlers(functions);
-}
-
-} // namespace Service::Friend
diff --git a/src/core/hle/service/friend/friend_u.h b/src/core/hle/service/friend/friend_u.h
deleted file mode 100644
index 0d953d807..000000000
--- a/src/core/hle/service/friend/friend_u.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2018 yuzu emulator team
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/friend/friend.h"
-
-namespace Service::Friend {
-
-class Friend_U final : public Module::Interface {
-public:
- explicit Friend_U(std::shared_ptr<Module> module);
-};
-
-} // namespace Service::Friend
diff --git a/src/core/hle/service/friend/friend_a.cpp b/src/core/hle/service/friend/interface.cpp
index a2cc81926..27c6a09e2 100644
--- a/src/core/hle/service/friend/friend_a.cpp
+++ b/src/core/hle/service/friend/interface.cpp
@@ -2,15 +2,16 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include "core/hle/service/friend/friend_a.h"
+#include "core/hle/service/friend/interface.h"
namespace Service::Friend {
-Friend_A::Friend_A(std::shared_ptr<Module> module)
- : Module::Interface(std::move(module), "friend:a") {
+Friend::Friend(std::shared_ptr<Module> module, const char* name)
+ : Interface(std::move(module), name) {
static const FunctionInfo functions[] = {
- {0, &Friend_A::CreateFriendService, "CreateFriendService"},
+ {0, &Friend::CreateFriendService, "CreateFriendService"},
{1, nullptr, "CreateNotificationService"},
+ {2, nullptr, "CreateDaemonSuspendSessionService"},
};
RegisterHandlers(functions);
}
diff --git a/src/core/hle/service/friend/friend_a.h b/src/core/hle/service/friend/interface.h
index 81257583b..89dae8471 100644
--- a/src/core/hle/service/friend/friend_a.h
+++ b/src/core/hle/service/friend/interface.h
@@ -8,9 +8,9 @@
namespace Service::Friend {
-class Friend_A final : public Module::Interface {
+class Friend final : public Module::Interface {
public:
- explicit Friend_A(std::shared_ptr<Module> module);
+ explicit Friend(std::shared_ptr<Module> module, const char* name);
};
} // namespace Service::Friend
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp
index 18bd62a08..b0277a875 100644
--- a/src/core/loader/deconstructed_rom_directory.cpp
+++ b/src/core/loader/deconstructed_rom_directory.cpp
@@ -6,7 +6,6 @@
#include "common/common_funcs.h"
#include "common/file_util.h"
#include "common/logging/log.h"
-#include "common/string_util.h"
#include "core/file_sys/content_archive.h"
#include "core/gdbstub/gdbstub.h"
#include "core/hle/kernel/process.h"
@@ -18,34 +17,6 @@
namespace Loader {
-static std::string FindRomFS(const std::string& directory) {
- std::string filepath_romfs;
- const auto callback = [&filepath_romfs](u64*, const std::string& directory,
- const std::string& virtual_name) -> bool {
- const std::string physical_name = directory + virtual_name;
- if (FileUtil::IsDirectory(physical_name)) {
- // Skip directories
- return true;
- }
-
- // Verify extension
- const std::string extension = physical_name.substr(physical_name.find_last_of(".") + 1);
- if (Common::ToLower(extension) != "romfs") {
- return true;
- }
-
- // Found it - we are done
- filepath_romfs = std::move(physical_name);
- return false;
- };
-
- // Search the specified directory recursively, looking for the first .romfs file, which will
- // be used for the RomFS
- FileUtil::ForeachDirectoryEntry(nullptr, directory, callback);
-
- return filepath_romfs;
-}
-
AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys::VirtualFile file)
: AppLoader(std::move(file)) {}
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index d7328ff39..0e205ed72 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -75,14 +75,6 @@ void Maxwell3D::WriteReg(u32 method, u32 value, u32 remaining_params) {
ProcessMacroUpload(value);
break;
}
- case MAXWELL3D_REG_INDEX(code_address.code_address_high):
- case MAXWELL3D_REG_INDEX(code_address.code_address_low): {
- // Note: For some reason games (like Puyo Puyo Tetris) seem to write 0 to the CODE_ADDRESS
- // register, we do not currently know if that's intended or a bug, so we assert it lest
- // stuff breaks in other places (like the shader address calculation).
- ASSERT_MSG(regs.code_address.CodeAddress() == 0, "Unexpected CODE_ADDRESS register value.");
- break;
- }
case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]):
case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]):
case MAXWELL3D_REG_INDEX(const_buffer.cb_data[2]):
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 1d3aff97b..0f5006383 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -111,6 +111,8 @@ static constexpr std::array<FormatTuple, SurfaceParams::MaxPixelFormat> tex_form
{GL_RGBA32F, GL_RGBA, GL_FLOAT, ComponentType::Float, false}, // RGBA32F
{GL_RG32F, GL_RG, GL_FLOAT, ComponentType::Float, false}, // RG32F
{GL_R32F, GL_RED, GL_FLOAT, ComponentType::Float, false}, // R32F
+ {GL_R16F, GL_RED, GL_HALF_FLOAT, ComponentType::Float, false}, // R16F
+ {GL_R16, GL_RED, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // R16UNORM
// DepthStencil formats
{GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, ComponentType::UNorm,
@@ -204,7 +206,8 @@ static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr),
MortonCopy<true, PixelFormat::BC7U>, MortonCopy<true, PixelFormat::ASTC_2D_4X4>,
MortonCopy<true, PixelFormat::G8R8>, MortonCopy<true, PixelFormat::BGRA8>,
MortonCopy<true, PixelFormat::RGBA32F>, MortonCopy<true, PixelFormat::RG32F>,
- MortonCopy<true, PixelFormat::R32F>, MortonCopy<true, PixelFormat::Z24S8>,
+ MortonCopy<true, PixelFormat::R32F>, MortonCopy<true, PixelFormat::R16F>,
+ MortonCopy<true, PixelFormat::R16UNORM>, MortonCopy<true, PixelFormat::Z24S8>,
MortonCopy<true, PixelFormat::S8Z24>, MortonCopy<true, PixelFormat::Z32F>,
MortonCopy<true, PixelFormat::Z16>,
};
@@ -232,6 +235,8 @@ static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr),
MortonCopy<false, PixelFormat::RGBA32F>,
MortonCopy<false, PixelFormat::RG32F>,
MortonCopy<false, PixelFormat::R32F>,
+ MortonCopy<false, PixelFormat::R16F>,
+ MortonCopy<false, PixelFormat::R16UNORM>,
MortonCopy<false, PixelFormat::Z24S8>,
MortonCopy<false, PixelFormat::S8Z24>,
MortonCopy<false, PixelFormat::Z32F>,
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index 800d239d9..e1d3670d9 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -41,14 +41,16 @@ struct SurfaceParams {
RGBA32F = 16,
RG32F = 17,
R32F = 18,
+ R16F = 19,
+ R16UNORM = 20,
MaxColorFormat,
// DepthStencil formats
- Z24S8 = 19,
- S8Z24 = 20,
- Z32F = 21,
- Z16 = 22,
+ Z24S8 = 21,
+ S8Z24 = 22,
+ Z32F = 23,
+ Z16 = 24,
MaxDepthStencilFormat,
@@ -105,6 +107,8 @@ struct SurfaceParams {
1, // RGBA32F
1, // RG32F
1, // R32F
+ 1, // R16F
+ 1, // R16UNORM
1, // Z24S8
1, // S8Z24
1, // Z32F
@@ -139,6 +143,8 @@ struct SurfaceParams {
128, // RGBA32F
64, // RG32F
32, // R32F
+ 16, // R16F
+ 16, // R16UNORM
32, // Z24S8
32, // S8Z24
32, // Z32F
@@ -226,6 +232,16 @@ struct SurfaceParams {
UNREACHABLE();
case Tegra::Texture::TextureFormat::R32_G32:
return PixelFormat::RG32F;
+ case Tegra::Texture::TextureFormat::R16:
+ switch (component_type) {
+ case Tegra::Texture::ComponentType::FLOAT:
+ return PixelFormat::R16F;
+ case Tegra::Texture::ComponentType::UNORM:
+ return PixelFormat::R16UNORM;
+ }
+ LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}",
+ static_cast<u32>(component_type));
+ UNREACHABLE();
case Tegra::Texture::TextureFormat::R32:
return PixelFormat::R32F;
case Tegra::Texture::TextureFormat::DXT1:
@@ -290,6 +306,9 @@ struct SurfaceParams {
return Tegra::Texture::TextureFormat::R32_G32;
case PixelFormat::R32F:
return Tegra::Texture::TextureFormat::R32;
+ case PixelFormat::R16F:
+ case PixelFormat::R16UNORM:
+ return Tegra::Texture::TextureFormat::R16;
default:
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
UNREACHABLE();
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index cda2646ad..970c06e71 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -66,6 +66,7 @@ u32 BytesPerPixel(TextureFormat format) {
case TextureFormat::A1B5G5R5:
case TextureFormat::B5G6R5:
case TextureFormat::G8R8:
+ case TextureFormat::R16:
return 2;
case TextureFormat::R8:
return 1;
@@ -123,6 +124,7 @@ std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width,
case TextureFormat::R32_G32_B32_A32:
case TextureFormat::R32_G32:
case TextureFormat::R32:
+ case TextureFormat::R16:
case TextureFormat::BF10GF11RF11:
case TextureFormat::ASTC_2D_4X4:
CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data,
@@ -181,6 +183,7 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat
case TextureFormat::R32_G32_B32_A32:
case TextureFormat::R32_G32:
case TextureFormat::R32:
+ case TextureFormat::R16:
// TODO(Subv): For the time being just forward the same data without any decoding.
rgba_data = texture_data;
break;