summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rw-r--r--src/common/file_util.h2
-rw-r--r--src/common/string_util.cpp134
-rw-r--r--src/common/string_util.h21
-rw-r--r--src/core/file_sys/card_image.cpp4
-rw-r--r--src/core/file_sys/patch_manager.cpp30
-rw-r--r--src/core/file_sys/patch_manager.h1
-rw-r--r--src/core/file_sys/romfs_factory.cpp51
-rw-r--r--src/core/hle/service/aoc/aoc_u.cpp93
-rw-r--r--src/core/hle/service/aoc/aoc_u.h4
-rw-r--r--src/core/hle/service/lbl/lbl.cpp38
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp5
12 files changed, 178 insertions, 213 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cd990188e..92c3e855c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -344,14 +344,6 @@ ELSEIF (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU|SunOS)$")
set(PLATFORM_LIBRARIES rt)
ENDIF (APPLE)
-# MINGW: GCC does not support codecvt, so use iconv instead
-if (UNIX OR MINGW)
- find_library(ICONV_LIBRARY NAMES iconv)
- if (ICONV_LIBRARY)
- list(APPEND PLATFORM_LIBRARIES ${ICONV_LIBRARY})
- endif()
-endif()
-
# Setup a custom clang-format target (if clang-format can be found) that will run
# against all the src files. This should be used before making a pull request.
# =======================================================================
diff --git a/src/common/file_util.h b/src/common/file_util.h
index 3d8fe6264..571503d2a 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -285,7 +285,7 @@ private:
template <typename T>
void OpenFStream(T& fstream, const std::string& filename, std::ios_base::openmode openmode) {
#ifdef _MSC_VER
- fstream.open(Common::UTF8ToTStr(filename).c_str(), openmode);
+ fstream.open(Common::UTF8ToUTF16W(filename).c_str(), openmode);
#else
fstream.open(filename.c_str(), openmode);
#endif
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index c9a5425a7..731d1db34 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -5,6 +5,7 @@
#include <algorithm>
#include <cctype>
#include <cerrno>
+#include <codecvt>
#include <cstdio>
#include <cstdlib>
#include <cstring>
@@ -13,11 +14,7 @@
#include "common/string_util.h"
#ifdef _WIN32
-#include <codecvt>
#include <windows.h>
-#include "common/common_funcs.h"
-#else
-#include <iconv.h>
#endif
namespace Common {
@@ -195,11 +192,9 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st
return result;
}
-#ifdef _WIN32
-
std::string UTF16ToUTF8(const std::u16string& input) {
-#if _MSC_VER >= 1900
- // Workaround for missing char16_t/char32_t instantiations in MSVC2015
+#ifdef _MSC_VER
+ // Workaround for missing char16_t/char32_t instantiations in MSVC2017
std::wstring_convert<std::codecvt_utf8_utf16<__int16>, __int16> convert;
std::basic_string<__int16> tmp_buffer(input.cbegin(), input.cend());
return convert.to_bytes(tmp_buffer);
@@ -210,8 +205,8 @@ std::string UTF16ToUTF8(const std::u16string& input) {
}
std::u16string UTF8ToUTF16(const std::string& input) {
-#if _MSC_VER >= 1900
- // Workaround for missing char16_t/char32_t instantiations in MSVC2015
+#ifdef _MSC_VER
+ // Workaround for missing char16_t/char32_t instantiations in MSVC2017
std::wstring_convert<std::codecvt_utf8_utf16<__int16>, __int16> convert;
auto tmp_buffer = convert.from_bytes(input);
return std::u16string(tmp_buffer.cbegin(), tmp_buffer.cend());
@@ -221,6 +216,7 @@ std::u16string UTF8ToUTF16(const std::string& input) {
#endif
}
+#ifdef _WIN32
static std::wstring CPToUTF16(u32 code_page, const std::string& input) {
const auto size =
MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), nullptr, 0);
@@ -261,124 +257,6 @@ std::wstring UTF8ToUTF16W(const std::string& input) {
return CPToUTF16(CP_UTF8, input);
}
-std::string SHIFTJISToUTF8(const std::string& input) {
- return UTF16ToUTF8(CPToUTF16(932, input));
-}
-
-std::string CP1252ToUTF8(const std::string& input) {
- return UTF16ToUTF8(CPToUTF16(1252, input));
-}
-
-#else
-
-template <typename T>
-static std::string CodeToUTF8(const char* fromcode, const std::basic_string<T>& input) {
- iconv_t const conv_desc = iconv_open("UTF-8", fromcode);
- if ((iconv_t)(-1) == conv_desc) {
- LOG_ERROR(Common, "Iconv initialization failure [{}]: {}", fromcode, strerror(errno));
- iconv_close(conv_desc);
- return {};
- }
-
- const std::size_t in_bytes = sizeof(T) * input.size();
- // Multiply by 4, which is the max number of bytes to encode a codepoint
- const std::size_t out_buffer_size = 4 * in_bytes;
-
- std::string out_buffer(out_buffer_size, '\0');
-
- auto src_buffer = &input[0];
- std::size_t src_bytes = in_bytes;
- auto dst_buffer = &out_buffer[0];
- std::size_t dst_bytes = out_buffer.size();
-
- while (0 != src_bytes) {
- std::size_t const iconv_result =
- iconv(conv_desc, (char**)(&src_buffer), &src_bytes, &dst_buffer, &dst_bytes);
-
- if (static_cast<std::size_t>(-1) == iconv_result) {
- if (EILSEQ == errno || EINVAL == errno) {
- // Try to skip the bad character
- if (0 != src_bytes) {
- --src_bytes;
- ++src_buffer;
- }
- } else {
- LOG_ERROR(Common, "iconv failure [{}]: {}", fromcode, strerror(errno));
- break;
- }
- }
- }
-
- std::string result;
- out_buffer.resize(out_buffer_size - dst_bytes);
- out_buffer.swap(result);
-
- iconv_close(conv_desc);
-
- return result;
-}
-
-std::u16string UTF8ToUTF16(const std::string& input) {
- iconv_t const conv_desc = iconv_open("UTF-16LE", "UTF-8");
- if ((iconv_t)(-1) == conv_desc) {
- LOG_ERROR(Common, "Iconv initialization failure [UTF-8]: {}", strerror(errno));
- iconv_close(conv_desc);
- return {};
- }
-
- const std::size_t in_bytes = sizeof(char) * input.size();
- // Multiply by 4, which is the max number of bytes to encode a codepoint
- const std::size_t out_buffer_size = 4 * sizeof(char16_t) * in_bytes;
-
- std::u16string out_buffer(out_buffer_size, char16_t{});
-
- char* src_buffer = const_cast<char*>(&input[0]);
- std::size_t src_bytes = in_bytes;
- char* dst_buffer = (char*)(&out_buffer[0]);
- std::size_t dst_bytes = out_buffer.size();
-
- while (0 != src_bytes) {
- std::size_t const iconv_result =
- iconv(conv_desc, &src_buffer, &src_bytes, &dst_buffer, &dst_bytes);
-
- if (static_cast<std::size_t>(-1) == iconv_result) {
- if (EILSEQ == errno || EINVAL == errno) {
- // Try to skip the bad character
- if (0 != src_bytes) {
- --src_bytes;
- ++src_buffer;
- }
- } else {
- LOG_ERROR(Common, "iconv failure [UTF-8]: {}", strerror(errno));
- break;
- }
- }
- }
-
- std::u16string result;
- out_buffer.resize(out_buffer_size - dst_bytes);
- out_buffer.swap(result);
-
- iconv_close(conv_desc);
-
- return result;
-}
-
-std::string UTF16ToUTF8(const std::u16string& input) {
- return CodeToUTF8("UTF-16LE", input);
-}
-
-std::string CP1252ToUTF8(const std::string& input) {
- // return CodeToUTF8("CP1252//TRANSLIT", input);
- // return CodeToUTF8("CP1252//IGNORE", input);
- return CodeToUTF8("CP1252", input);
-}
-
-std::string SHIFTJISToUTF8(const std::string& input) {
- // return CodeToUTF8("CP932", input);
- return CodeToUTF8("SJIS", input);
-}
-
#endif
std::string StringFromFixedZeroTerminatedBuffer(const char* buffer, std::size_t max_len) {
diff --git a/src/common/string_util.h b/src/common/string_util.h
index dcca6bc38..32bf6a19c 100644
--- a/src/common/string_util.h
+++ b/src/common/string_util.h
@@ -72,31 +72,10 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st
std::string UTF16ToUTF8(const std::u16string& input);
std::u16string UTF8ToUTF16(const std::string& input);
-std::string CP1252ToUTF8(const std::string& str);
-std::string SHIFTJISToUTF8(const std::string& str);
-
#ifdef _WIN32
std::string UTF16ToUTF8(const std::wstring& input);
std::wstring UTF8ToUTF16W(const std::string& str);
-#ifdef _UNICODE
-inline std::string TStrToUTF8(const std::wstring& str) {
- return UTF16ToUTF8(str);
-}
-
-inline std::wstring UTF8ToTStr(const std::string& str) {
- return UTF8ToUTF16W(str);
-}
-#else
-inline std::string TStrToUTF8(const std::string& str) {
- return str;
-}
-
-inline std::string UTF8ToTStr(const std::string& str) {
- return str;
-}
-#endif
-
#endif
/**
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp
index edfc1bbd4..8f5142a07 100644
--- a/src/core/file_sys/card_image.cpp
+++ b/src/core/file_sys/card_image.cpp
@@ -20,7 +20,9 @@ namespace FileSys {
constexpr std::array<const char*, 0x4> partition_names = {"update", "normal", "secure", "logo"};
-XCI::XCI(VirtualFile file_) : file(std::move(file_)), partitions(0x4) {
+XCI::XCI(VirtualFile file_)
+ : file(std::move(file_)), program_nca_status{Loader::ResultStatus::ErrorXCIMissingProgramNCA},
+ partitions(0x4) {
if (file->ReadObject(&header) != sizeof(GamecardHeader)) {
status = Loader::ResultStatus::ErrorBadXCIHeader;
return;
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp
index 4b3b5e665..57b7741f8 100644
--- a/src/core/file_sys/patch_manager.cpp
+++ b/src/core/file_sys/patch_manager.cpp
@@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <algorithm>
#include <array>
#include <cstddef>
@@ -18,6 +19,7 @@
namespace FileSys {
constexpr u64 SINGLE_BYTE_MODULUS = 0x100;
+constexpr u64 DLC_BASE_TITLE_ID_MASK = 0xFFFFFFFFFFFFE000;
std::string FormatTitleVersion(u32 version, TitleVersionFormat format) {
std::array<u8, sizeof(u32)> bytes{};
@@ -32,9 +34,10 @@ std::string FormatTitleVersion(u32 version, TitleVersionFormat format) {
return fmt::format("v{}.{}.{}", bytes[3], bytes[2], bytes[1]);
}
-constexpr std::array<const char*, 2> PATCH_TYPE_NAMES{
+constexpr std::array<const char*, 3> PATCH_TYPE_NAMES{
"Update",
"LayeredFS",
+ "DLC",
};
std::string FormatPatchTypeName(PatchType type) {
@@ -139,6 +142,7 @@ std::map<PatchType, std::string> PatchManager::GetPatchVersionNames() const {
std::map<PatchType, std::string> out;
const auto installed = Service::FileSystem::GetUnionContents();
+ // Game Updates
const auto update_tid = GetUpdateTitleID(title_id);
PatchManager update{update_tid};
auto [nacp, discard_icon_file] = update.GetControlMetadata();
@@ -157,10 +161,34 @@ std::map<PatchType, std::string> PatchManager::GetPatchVersionNames() const {
}
}
+ // LayeredFS
const auto lfs_dir = Service::FileSystem::GetModificationLoadRoot(title_id);
if (lfs_dir != nullptr && lfs_dir->GetSize() > 0)
out.insert_or_assign(PatchType::LayeredFS, "");
+ // DLC
+ const auto dlc_entries = installed->ListEntriesFilter(TitleType::AOC, ContentRecordType::Data);
+ std::vector<RegisteredCacheEntry> dlc_match;
+ dlc_match.reserve(dlc_entries.size());
+ std::copy_if(dlc_entries.begin(), dlc_entries.end(), std::back_inserter(dlc_match),
+ [this, &installed](const RegisteredCacheEntry& entry) {
+ return (entry.title_id & DLC_BASE_TITLE_ID_MASK) == title_id &&
+ installed->GetEntry(entry)->GetStatus() ==
+ Loader::ResultStatus::Success;
+ });
+ if (!dlc_match.empty()) {
+ // Ensure sorted so DLC IDs show in order.
+ std::sort(dlc_match.begin(), dlc_match.end());
+
+ std::string list;
+ for (size_t i = 0; i < dlc_match.size() - 1; ++i)
+ list += fmt::format("{}, ", dlc_match[i].title_id & 0x7FF);
+
+ list += fmt::format("{}", dlc_match.back().title_id & 0x7FF);
+
+ out.insert_or_assign(PatchType::DLC, std::move(list));
+ }
+
return out;
}
diff --git a/src/core/file_sys/patch_manager.h b/src/core/file_sys/patch_manager.h
index 464f17515..3a2a9d212 100644
--- a/src/core/file_sys/patch_manager.h
+++ b/src/core/file_sys/patch_manager.h
@@ -27,6 +27,7 @@ std::string FormatTitleVersion(u32 version,
enum class PatchType {
Update,
LayeredFS,
+ DLC,
};
std::string FormatPatchTypeName(PatchType type);
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp
index d027a8d59..4994c2532 100644
--- a/src/core/file_sys/romfs_factory.cpp
+++ b/src/core/file_sys/romfs_factory.cpp
@@ -39,36 +39,35 @@ ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() {
}
ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage, ContentRecordType type) {
+ std::shared_ptr<NCA> res;
+
switch (storage) {
- case StorageId::NandSystem: {
- const auto res = Service::FileSystem::GetSystemNANDContents()->GetEntry(title_id, type);
- if (res == nullptr) {
- // TODO(DarkLordZach): Find the right error code to use here
- return ResultCode(-1);
- }
- const auto romfs = res->GetRomFS();
- if (romfs == nullptr) {
- // TODO(DarkLordZach): Find the right error code to use here
- return ResultCode(-1);
- }
- return MakeResult<VirtualFile>(romfs);
- }
- case StorageId::NandUser: {
- const auto res = Service::FileSystem::GetUserNANDContents()->GetEntry(title_id, type);
- if (res == nullptr) {
- // TODO(DarkLordZach): Find the right error code to use here
- return ResultCode(-1);
- }
- const auto romfs = res->GetRomFS();
- if (romfs == nullptr) {
- // TODO(DarkLordZach): Find the right error code to use here
- return ResultCode(-1);
- }
- return MakeResult<VirtualFile>(romfs);
- }
+ case StorageId::None:
+ res = Service::FileSystem::GetUnionContents()->GetEntry(title_id, type);
+ break;
+ case StorageId::NandSystem:
+ res = Service::FileSystem::GetSystemNANDContents()->GetEntry(title_id, type);
+ break;
+ case StorageId::NandUser:
+ res = Service::FileSystem::GetUserNANDContents()->GetEntry(title_id, type);
+ break;
+ case StorageId::SdCard:
+ res = Service::FileSystem::GetSDMCContents()->GetEntry(title_id, type);
+ break;
default:
UNIMPLEMENTED_MSG("Unimplemented storage_id={:02X}", static_cast<u8>(storage));
}
+
+ if (res == nullptr) {
+ // TODO(DarkLordZach): Find the right error code to use here
+ return ResultCode(-1);
+ }
+ const auto romfs = res->GetRomFS();
+ if (romfs == nullptr) {
+ // TODO(DarkLordZach): Find the right error code to use here
+ return ResultCode(-1);
+ }
+ return MakeResult<VirtualFile>(romfs);
}
} // namespace FileSys
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp
index d9eeac9ec..cfc28fa0c 100644
--- a/src/core/hle/service/aoc/aoc_u.cpp
+++ b/src/core/hle/service/aoc/aoc_u.cpp
@@ -2,22 +2,57 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <algorithm>
+#include <numeric>
+#include <vector>
#include "common/logging/log.h"
+#include "core/file_sys/content_archive.h"
+#include "core/file_sys/nca_metadata.h"
+#include "core/file_sys/partition_filesystem.h"
+#include "core/file_sys/registered_cache.h"
#include "core/hle/ipc_helpers.h"
+#include "core/hle/kernel/process.h"
#include "core/hle/service/aoc/aoc_u.h"
+#include "core/hle/service/filesystem/filesystem.h"
+#include "core/loader/loader.h"
namespace Service::AOC {
-AOC_U::AOC_U() : ServiceFramework("aoc:u") {
+constexpr u64 DLC_BASE_TITLE_ID_MASK = 0xFFFFFFFFFFFFE000;
+constexpr u64 DLC_BASE_TO_AOC_ID_MASK = 0x1000;
+
+static bool CheckAOCTitleIDMatchesBase(u64 base, u64 aoc) {
+ return (aoc & DLC_BASE_TITLE_ID_MASK) == base;
+}
+
+static std::vector<u64> AccumulateAOCTitleIDs() {
+ std::vector<u64> add_on_content;
+ const auto rcu = FileSystem::GetUnionContents();
+ const auto list =
+ rcu->ListEntriesFilter(FileSys::TitleType::AOC, FileSys::ContentRecordType::Data);
+ std::transform(list.begin(), list.end(), std::back_inserter(add_on_content),
+ [](const FileSys::RegisteredCacheEntry& rce) { return rce.title_id; });
+ add_on_content.erase(
+ std::remove_if(
+ add_on_content.begin(), add_on_content.end(),
+ [&rcu](u64 tid) {
+ return rcu->GetEntry(tid, FileSys::ContentRecordType::Data)->GetStatus() !=
+ Loader::ResultStatus::Success;
+ }),
+ add_on_content.end());
+ return add_on_content;
+}
+
+AOC_U::AOC_U() : ServiceFramework("aoc:u"), add_on_content(AccumulateAOCTitleIDs()) {
static const FunctionInfo functions[] = {
{0, nullptr, "CountAddOnContentByApplicationId"},
{1, nullptr, "ListAddOnContentByApplicationId"},
{2, &AOC_U::CountAddOnContent, "CountAddOnContent"},
{3, &AOC_U::ListAddOnContent, "ListAddOnContent"},
{4, nullptr, "GetAddOnContentBaseIdByApplicationId"},
- {5, nullptr, "GetAddOnContentBaseId"},
+ {5, &AOC_U::GetAddOnContentBaseId, "GetAddOnContentBaseId"},
{6, nullptr, "PrepareAddOnContentByApplicationId"},
- {7, nullptr, "PrepareAddOnContent"},
+ {7, &AOC_U::PrepareAddOnContent, "PrepareAddOnContent"},
{8, nullptr, "GetAddOnContentListChangedEvent"},
};
RegisterHandlers(functions);
@@ -28,15 +63,59 @@ AOC_U::~AOC_U() = default;
void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
- rb.Push<u64>(0);
- LOG_WARNING(Service_AOC, "(STUBBED) called");
+
+ const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID();
+ rb.Push<u32>(std::count_if(add_on_content.begin(), add_on_content.end(), [&current](u64 tid) {
+ return (tid & DLC_BASE_TITLE_ID_MASK) == current;
+ }));
}
void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+
+ const auto offset = rp.PopRaw<u32>();
+ auto count = rp.PopRaw<u32>();
+
+ const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID();
+
+ std::vector<u32> out;
+ for (size_t i = 0; i < add_on_content.size(); ++i) {
+ if ((add_on_content[i] & DLC_BASE_TITLE_ID_MASK) == current)
+ out.push_back(static_cast<u32>(add_on_content[i] & 0x7FF));
+ }
+
+ if (out.size() <= offset) {
+ IPC::ResponseBuilder rb{ctx, 2};
+ // TODO(DarkLordZach): Find the correct error code.
+ rb.Push(ResultCode(-1));
+ return;
+ }
+
+ count = std::min<size_t>(out.size() - offset, count);
+ std::rotate(out.begin(), out.begin() + offset, out.end());
+ out.resize(count);
+
+ ctx.WriteBuffer(out);
+
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(RESULT_SUCCESS);
+}
+
+void AOC_U::GetAddOnContentBaseId(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
- rb.Push<u64>(0);
- LOG_WARNING(Service_AOC, "(STUBBED) called");
+ rb.Push(Core::System::GetInstance().CurrentProcess()->GetTitleID() | DLC_BASE_TO_AOC_ID_MASK);
+}
+
+void AOC_U::PrepareAddOnContent(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+
+ const auto aoc_id = rp.PopRaw<u32>();
+
+ LOG_WARNING(Service_AOC, "(STUBBED) called with aoc_id={:08X}", aoc_id);
+
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(RESULT_SUCCESS);
}
void InstallInterfaces(SM::ServiceManager& service_manager) {
diff --git a/src/core/hle/service/aoc/aoc_u.h b/src/core/hle/service/aoc/aoc_u.h
index 29ce8f488..b3c7cab7a 100644
--- a/src/core/hle/service/aoc/aoc_u.h
+++ b/src/core/hle/service/aoc/aoc_u.h
@@ -16,6 +16,10 @@ public:
private:
void CountAddOnContent(Kernel::HLERequestContext& ctx);
void ListAddOnContent(Kernel::HLERequestContext& ctx);
+ void GetAddOnContentBaseId(Kernel::HLERequestContext& ctx);
+ void PrepareAddOnContent(Kernel::HLERequestContext& ctx);
+
+ std::vector<u64> add_on_content;
};
/// Registers all AOC services with the specified service manager.
diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp
index 8fc8b1057..7321584e1 100644
--- a/src/core/hle/service/lbl/lbl.cpp
+++ b/src/core/hle/service/lbl/lbl.cpp
@@ -21,29 +21,29 @@ public:
{0, nullptr, "Unknown1"},
{1, nullptr, "Unknown2"},
{2, nullptr, "Unknown3"},
- {3, nullptr, "Unknown4"},
- {4, nullptr, "Unknown5"},
- {5, nullptr, "Unknown6"},
+ {3, nullptr, "GetCurrentBacklightLevel"},
+ {4, nullptr, "Unknown4"},
+ {5, nullptr, "GetAlsComputedBacklightLevel"},
{6, nullptr, "TurnOffBacklight"},
{7, nullptr, "TurnOnBacklight"},
{8, nullptr, "GetBacklightStatus"},
- {9, nullptr, "Unknown7"},
- {10, nullptr, "Unknown8"},
- {11, nullptr, "Unknown9"},
- {12, nullptr, "Unknown10"},
- {13, nullptr, "Unknown11"},
- {14, nullptr, "Unknown12"},
- {15, nullptr, "Unknown13"},
+ {9, nullptr, "Unknown5"},
+ {10, nullptr, "Unknown6"},
+ {11, nullptr, "Unknown7"},
+ {12, nullptr, "Unknown8"},
+ {13, nullptr, "Unknown9"},
+ {14, nullptr, "Unknown10"},
+ {15, nullptr, "GetAutoBrightnessSetting"},
{16, nullptr, "ReadRawLightSensor"},
- {17, nullptr, "Unknown14"},
- {18, nullptr, "Unknown15"},
- {19, nullptr, "Unknown16"},
- {20, nullptr, "Unknown17"},
- {21, nullptr, "Unknown18"},
- {22, nullptr, "Unknown19"},
- {23, nullptr, "Unknown20"},
- {24, nullptr, "Unknown21"},
- {25, nullptr, "Unknown22"},
+ {17, nullptr, "Unknown11"},
+ {18, nullptr, "Unknown12"},
+ {19, nullptr, "Unknown13"},
+ {20, nullptr, "Unknown14"},
+ {21, nullptr, "Unknown15"},
+ {22, nullptr, "Unknown16"},
+ {23, nullptr, "Unknown17"},
+ {24, nullptr, "Unknown18"},
+ {25, nullptr, "Unknown19"},
{26, &LBL::EnableVrMode, "EnableVrMode"},
{27, &LBL::DisableVrMode, "DisableVrMode"},
{28, &LBL::GetVrMode, "GetVrMode"},
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 14d82a7bc..587d9dffb 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -909,7 +909,10 @@ void RasterizerOpenGL::SyncTransformFeedback() {
void RasterizerOpenGL::SyncPointState() {
const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
- state.point.size = regs.point_size;
+ // TODO(Rodrigo): Most games do not set a point size. I think this is a case of a
+ // register carrying a default value. For now, if the point size is zero, assume it's
+ // OpenGL's default (1).
+ state.point.size = regs.point_size == 0 ? 1 : regs.point_size;
}
} // namespace OpenGL