diff --git a/CMakeLists.txt b/CMakeLists.txt index cd14241a6..ba879a736 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -461,6 +461,12 @@ set(SYSTEM_LIBS src/core/libraries/system/commondialog.cpp src/core/libraries/mouse/mouse.h src/core/libraries/web_browser_dialog/webbrowserdialog.cpp src/core/libraries/web_browser_dialog/webbrowserdialog.h + src/core/libraries/font/font.cpp + src/core/libraries/font/font.h + src/core/libraries/font/fontft.cpp + src/core/libraries/font/fontft.h + src/core/libraries/font/font_error.h + ) set(VIDEOOUT_LIB src/core/libraries/videoout/buffer.h diff --git a/src/common/io_file.cpp b/src/common/io_file.cpp index 74000ac7e..5791d915e 100644 --- a/src/common/io_file.cpp +++ b/src/common/io_file.cpp @@ -40,28 +40,30 @@ namespace { switch (mode) { case FileAccessMode::Read: return L"rb"; - case FileAccessMode::Write: - return L"wb"; case FileAccessMode::Append: return L"ab"; + case FileAccessMode::Write: case FileAccessMode::ReadWrite: return L"r+b"; case FileAccessMode::ReadAppend: return L"a+b"; + case FileAccessMode::Create: + return L"wb"; } break; case FileType::TextFile: switch (mode) { case FileAccessMode::Read: return L"r"; - case FileAccessMode::Write: - return L"w"; case FileAccessMode::Append: return L"a"; + case FileAccessMode::Write: case FileAccessMode::ReadWrite: return L"r+"; case FileAccessMode::ReadAppend: return L"a+"; + case FileAccessMode::Create: + return L"w"; } break; } @@ -91,28 +93,30 @@ namespace { switch (mode) { case FileAccessMode::Read: return "rb"; - case FileAccessMode::Write: - return "wb"; case FileAccessMode::Append: return "ab"; + case FileAccessMode::Write: case FileAccessMode::ReadWrite: return "r+b"; case FileAccessMode::ReadAppend: return "a+b"; + case FileAccessMode::Create: + return "wb"; } break; case FileType::TextFile: switch (mode) { case FileAccessMode::Read: return "r"; - case FileAccessMode::Write: - return "w"; case FileAccessMode::Append: return "a"; + case FileAccessMode::Write: case FileAccessMode::ReadWrite: return "r+"; case FileAccessMode::ReadAppend: return "a+"; + case FileAccessMode::Create: + return "w"; } break; } diff --git a/src/common/io_file.h b/src/common/io_file.h index 3c65a0d83..9536b7650 100644 --- a/src/common/io_file.h +++ b/src/common/io_file.h @@ -21,9 +21,8 @@ enum class FileAccessMode { */ Read = 1 << 0, /** - * If the file at path exists, the existing contents of the file are erased. - * The empty file is then opened for writing. - * If the file at path does not exist, it creates and opens a new empty file for writing. + * If the file at path exists, it opens the file for writing. + * If the file at path does not exist, it fails to open the file. */ Write = 1 << 1, /** @@ -42,6 +41,12 @@ enum class FileAccessMode { * reading and appending. */ ReadAppend = Read | Append, + /** + * If the file at path exists, the existing contents of the file are erased. + * The empty file is then opened for writing. + * If the file at path does not exist, it creates and opens a new empty file for writing. + */ + Create = 1 << 3, }; DECLARE_ENUM_FLAG_OPERATORS(FileAccessMode); @@ -102,6 +107,11 @@ public: return file != nullptr; } + bool IsWriteOnly() const { + return file_access_mode == FileAccessMode::Append || + file_access_mode == FileAccessMode::Write; + } + uintptr_t GetFileMapping(); int Open(const std::filesystem::path& path, FileAccessMode mode, @@ -209,7 +219,7 @@ public: } static size_t WriteBytes(const std::filesystem::path path, const auto& data) { - IOFile out(path, FileAccessMode::Write); + IOFile out(path, FileAccessMode::Create); return out.Write(data); } std::FILE* file = nullptr; diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index ce9386853..6b68651de 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -62,7 +62,7 @@ private: class FileBackend { public: explicit FileBackend(const std::filesystem::path& filename, bool should_append = false) - : file{filename, should_append ? FS::FileAccessMode::Append : FS::FileAccessMode::Write, + : file{filename, should_append ? FS::FileAccessMode::Append : FS::FileAccessMode::Create, FS::FileType::TextFile} {} ~FileBackend() = default; diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 2f98f07a0..bf6844c7d 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -140,6 +140,8 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) { SUB(Lib, NpParty) \ SUB(Lib, Zlib) \ SUB(Lib, Hmd) \ + SUB(Lib, Font) \ + SUB(Lib, FontFt) \ SUB(Lib, HmdSetupDialog) \ SUB(Lib, SigninDialog) \ SUB(Lib, Camera) \ diff --git a/src/common/logging/types.h b/src/common/logging/types.h index eee9d4ca2..035a959db 100644 --- a/src/common/logging/types.h +++ b/src/common/logging/types.h @@ -114,6 +114,8 @@ enum class Class : u8 { Lib_CompanionHttpd, ///< The LibCompanionHttpd implementation. Lib_CompanionUtil, ///< The LibCompanionUtil implementation. Lib_VrTracker, ///< The LibSceVrTracker implementation. + Lib_Font, ///< The libSceFont implementation. + Lib_FontFt, ///< The libSceFontFt implementation. Frontend, ///< Emulator UI Render, ///< Video Core Render_Vulkan, ///< Vulkan backend diff --git a/src/core/devtools/widget/common.h b/src/core/devtools/widget/common.h index 4684f6e3b..1c79ffcac 100644 --- a/src/core/devtools/widget/common.h +++ b/src/core/devtools/widget/common.h @@ -152,7 +152,7 @@ inline std::string RunDisassembler(const std::string& disassembler_cli, const T& } } else { cli.replace(pos, src_arg.size(), "\"" + bin_path.string() + "\""); - Common::FS::IOFile file(bin_path, Common::FS::FileAccessMode::Write); + Common::FS::IOFile file(bin_path, Common::FS::FileAccessMode::Create); file.Write(shader_code); file.Close(); diff --git a/src/core/devtools/widget/frame_dump.cpp b/src/core/devtools/widget/frame_dump.cpp index 1eaa78897..06b65b0ba 100644 --- a/src/core/devtools/widget/frame_dump.cpp +++ b/src/core/devtools/widget/frame_dump.cpp @@ -123,7 +123,7 @@ void FrameDumpViewer::Draw() { const auto fname = fmt::format("{:%F %H-%M-%S} {}_{}_{}.bin", now_time, magic_enum::enum_name(selected_queue_type), selected_submit_num, selected_queue_num2); - Common::FS::IOFile file(fname, Common::FS::FileAccessMode::Write); + Common::FS::IOFile file(fname, Common::FS::FileAccessMode::Create); const auto& data = frame_dump->queues[selected_cmd].data; if (file.IsOpen()) { DebugState.ShowDebugMessage(fmt::format("Dumping cmd as {}", fname)); diff --git a/src/core/file_format/psf.cpp b/src/core/file_format/psf.cpp index 7e0ffc9a3..047828330 100644 --- a/src/core/file_format/psf.cpp +++ b/src/core/file_format/psf.cpp @@ -99,7 +99,7 @@ bool PSF::Open(const std::vector& psf_buffer) { } bool PSF::Encode(const std::filesystem::path& filepath) const { - Common::FS::IOFile file(filepath, Common::FS::FileAccessMode::Write); + Common::FS::IOFile file(filepath, Common::FS::FileAccessMode::Create); if (!file.IsOpen()) { return false; } diff --git a/src/core/libraries/font/font.cpp b/src/core/libraries/font/font.cpp new file mode 100644 index 000000000..1454004aa --- /dev/null +++ b/src/core/libraries/font/font.cpp @@ -0,0 +1,1611 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "common/logging/log.h" +#include "core/libraries/error_codes.h" +#include "core/libraries/font/font.h" +#include "core/libraries/libs.h" +#include "font_error.h" + +namespace Libraries::Font { + +s32 PS4_SYSV_ABI sceFontAttachDeviceCacheBuffer() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontBindRenderer() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCharacterGetBidiLevel(OrbisFontTextCharacter* textCharacter, + int* bidiLevel) { + if (!textCharacter || !bidiLevel) { + LOG_DEBUG(Lib_Font, "Invalid parameter"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + *bidiLevel = textCharacter->bidiLevel; + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCharacterGetSyllableStringState() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCharacterGetTextFontCode() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCharacterGetTextOrder(OrbisFontTextCharacter* textCharacter, + void** pTextOrder) { + if (!pTextOrder) { + LOG_DEBUG(Lib_Font, "Invalid parameter"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + if (!textCharacter) { + LOG_DEBUG(Lib_Font, "Invalid parameter"); + *pTextOrder = NULL; + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + // Retrieve text order + *pTextOrder = textCharacter->textOrder; + return ORBIS_OK; +} + +u32 PS4_SYSV_ABI sceFontCharacterLooksFormatCharacters(OrbisFontTextCharacter* textCharacter) { + if (!textCharacter) { + return 0; + } + + // Check if the format flag (bit 2) is set + return (textCharacter->formatFlags & 0x04) ? textCharacter->characterCode : 0; +} + +u32 PS4_SYSV_ABI sceFontCharacterLooksWhiteSpace(OrbisFontTextCharacter* textCharacter) { + if (!textCharacter) { + return 0; + } + + return (textCharacter->charType == 0x0E) ? textCharacter->characterCode : 0; +} + +OrbisFontTextCharacter* PS4_SYSV_ABI +sceFontCharacterRefersTextBack(OrbisFontTextCharacter* textCharacter) { + if (!textCharacter) + return NULL; // Check if input is NULL + + OrbisFontTextCharacter* current = textCharacter->prev; // Move backward instead of forward + while (current) { + if (current->unkn_0x31 == 0 && current->unkn_0x33 == 0) { + return current; // Return the first matching node + } + current = current->prev; // Move to the previous node + } + + return NULL; // No valid node found +} + +OrbisFontTextCharacter* PS4_SYSV_ABI +sceFontCharacterRefersTextNext(OrbisFontTextCharacter* textCharacter) { + if (!textCharacter) + return NULL; // Null check + + OrbisFontTextCharacter* current = textCharacter->next; + while (current) { + if (current->unkn_0x31 == 0 && current->unkn_0x33 == 0) { + return current; // Found a match + } + current = current->next; // Move to the next node + } + + return NULL; // No matching node found +} + +s32 PS4_SYSV_ABI sceFontCharactersRefersTextCodes() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontClearDeviceCache() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCloseFont() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontControl() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCreateGraphicsDevice() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCreateGraphicsService() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCreateGraphicsServiceWithEdition() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCreateLibrary() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCreateLibraryWithEdition() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCreateRenderer() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCreateRendererWithEdition() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCreateString() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCreateWords() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontCreateWritingLine() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontDefineAttribute() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontDeleteGlyph() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontDestroyGraphicsDevice() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontDestroyGraphicsService() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontDestroyLibrary() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontDestroyRenderer() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontDestroyString() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontDestroyWords() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontDestroyWritingLine() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontDettachDeviceCacheBuffer() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGenerateCharGlyph() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetAttribute() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetCharGlyphCode() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetCharGlyphMetrics() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetEffectSlant() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetEffectWeight() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetFontGlyphsCount() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetFontGlyphsOutlineProfile() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetFontMetrics() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetFontResolution() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetFontStyleInformation() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetGlyphExpandBufferState() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetHorizontalLayout() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetKerning() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetLibrary() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetPixelResolution() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetRenderCharGlyphMetrics() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetRenderEffectSlant() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetRenderEffectWeight() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetRenderScaledKerning() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetRenderScalePixel() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetRenderScalePoint() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetResolutionDpi() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetScalePixel() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetScalePoint() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetScriptLanguage() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetTypographicDesign() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGetVerticalLayout() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphDefineAttribute() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphGetAttribute() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphGetGlyphForm() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphGetMetricsForm() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphGetScalePixel() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphRefersMetrics() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontal() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontalAdvance() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontalX() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphRefersOutline() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphRenderImage() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphRenderImageHorizontal() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGlyphRenderImageVertical() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsBeginFrame() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsDrawingCancel() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsDrawingFinish() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsEndFrame() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsExchangeResource() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsFillMethodInit() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsFillPlotInit() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsFillPlotSetLayout() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsFillPlotSetMapping() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsFillRatesInit() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetFillEffect() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetLayout() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetMapping() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsGetDeviceUsage() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsRegionInit() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsRegionInitCircular() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsRegionInitRoundish() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsRelease() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsRenderResource() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetFramePolicy() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupClipping() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupColorRates() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupFillMethod() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupFillRates() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupGlyphFill() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupGlyphFillPlot() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupHandleDefault() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupLocation() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupPositioning() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupRotation() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupScaling() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupShapeFill() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsSetupShapeFillPlot() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsStructureCanvas() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsStructureCanvasSequence() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsStructureDesign() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsStructureDesignResource() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsStructureSurfaceTexture() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateClipping() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateColorRates() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateFillMethod() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateFillRates() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateGlyphFill() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateGlyphFillPlot() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateLocation() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdatePositioning() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateRotation() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateScaling() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateShapeFill() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontGraphicsUpdateShapeFillPlot() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontMemoryInit() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontMemoryTerm() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontOpenFontFile() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontOpenFontInstance() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontOpenFontMemory() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontOpenFontSet() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontRebindRenderer() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontRenderCharGlyphImage() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontRenderCharGlyphImageHorizontal() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontRenderCharGlyphImageVertical() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontRendererGetOutlineBufferSize() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontRendererResetOutlineBuffer() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontRendererSetOutlineBufferPolicy() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +void PS4_SYSV_ABI sceFontRenderSurfaceInit(OrbisFontRenderSurface* renderSurface, void* buffer, + int bufWidthByte, int pixelSizeByte, int widthPixel, + int heightPixel) { + if (renderSurface) { // Ensure surface is not NULL before modifying it + renderSurface->buffer = buffer; + renderSurface->widthByte = bufWidthByte; + renderSurface->pixelSizeByte = pixelSizeByte; + + // Initialize unknown fields (likely reserved or flags) + renderSurface->unkn_0xd = 0; + renderSurface->styleFlag = 0; + renderSurface->unkn_0xf = 0; + + // Ensure width and height are non-negative + renderSurface->width = (widthPixel < 0) ? 0 : widthPixel; + renderSurface->height = (heightPixel < 0) ? 0 : heightPixel; + + // Set the clipping/scaling rectangle + renderSurface->sc_x0 = 0; + renderSurface->sc_y0 = 0; + renderSurface->sc_x1 = renderSurface->width; + renderSurface->sc_y1 = renderSurface->height; + } +} + +void PS4_SYSV_ABI sceFontRenderSurfaceSetScissor(OrbisFontRenderSurface* renderSurface, int x0, + int y0, int w, int h) { + if (!renderSurface) + return; // Null check + + // Handle horizontal clipping + int surfaceWidth = renderSurface->width; + int clip_x0, clip_x1; + + if (surfaceWidth != 0) { + if (x0 < 0) { // Adjust for negative x0 + clip_x0 = 0; + clip_x1 = (w + x0 > surfaceWidth) ? surfaceWidth : w + x0; + if (w <= -x0) + clip_x1 = 0; // Entire width is clipped + } else { + clip_x0 = (x0 > surfaceWidth) ? surfaceWidth : x0; + clip_x1 = (w + x0 > surfaceWidth) ? surfaceWidth : w + x0; + } + renderSurface->sc_x0 = clip_x0; + renderSurface->sc_x1 = clip_x1; + } + + // Handle vertical clipping + int surfaceHeight = renderSurface->height; + int clip_y0, clip_y1; + + if (surfaceHeight != 0) { + if (y0 < 0) { // Adjust for negative y0 + clip_y0 = 0; + clip_y1 = (h + y0 > surfaceHeight) ? surfaceHeight : h + y0; + if (h <= -y0) + clip_y1 = 0; // Entire height is clipped + } else { + clip_y0 = (y0 > surfaceHeight) ? surfaceHeight : y0; + clip_y1 = (h + y0 > surfaceHeight) ? surfaceHeight : h + y0; + } + renderSurface->sc_y0 = clip_y0; + renderSurface->sc_y1 = clip_y1; + } +} + +s32 PS4_SYSV_ABI sceFontRenderSurfaceSetStyleFrame(OrbisFontRenderSurface* renderSurface, + OrbisFontStyleFrame* styleFrame) { + if (!renderSurface) { + LOG_ERROR(Lib_Font, "Invalid Parameter"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + if (!styleFrame) { + renderSurface->styleFlag &= 0xFE; // Clear style flag + } else { + // Validate magic number + if (styleFrame->magic != 0xF09) { + LOG_ERROR(Lib_Font, "Invalid magic"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + renderSurface->styleFlag |= 1; // Set style flag + } + + // Assign style frame pointer + renderSurface->unkn_28[0] = styleFrame; + *(uint32_t*)(renderSurface->unkn_28 + 1) = 0; // Reset related field + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetEffectSlant() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetEffectWeight() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetFontsOpenMode() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetResolutionDpi() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetScalePixel() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetScalePoint() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetScriptLanguage() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetTypographicDesign() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetupRenderEffectSlant() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetupRenderEffectWeight() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetupRenderScalePixel() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSetupRenderScalePoint() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStringGetTerminateCode() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStringGetTerminateOrder() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStringGetWritingForm() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStringRefersRenderCharacters() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStringRefersTextCharacters() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameGetEffectSlant(OrbisFontStyleFrame* styleFrame, + float* slantRatio) { + if (!styleFrame) { + LOG_ERROR(Lib_Font, "Invalid Parameter"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + // Validate the magic number + if (styleFrame->magic != 0xF09) { + LOG_ERROR(Lib_Font, "Invalid Magic"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + // Check if the slant effect is enabled (bit 1 in flags) + if (!(styleFrame->flags & 0x02)) { + LOG_ERROR(Lib_Font, "Flag not set"); + return ORBIS_FONT_ERROR_UNSET_PARAMETER; + } + + if (!slantRatio) { + LOG_ERROR(Lib_Font, "Invalid Parameter"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + // Retrieve slant ratio + *slantRatio = styleFrame->slantRatio; + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameGetEffectWeight(OrbisFontStyleFrame* fontStyleFrame, + float* weightXScale, float* weightYScale, + uint32_t* mode) { + if (!fontStyleFrame) { + LOG_ERROR(Lib_Font, "Invalid Parameter"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + // Validate the magic number + if (fontStyleFrame->magic != 0xF09) { + LOG_ERROR(Lib_Font, "Magic not set"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + // Check if the weight effect is enabled (bit 2 in flags) + if (!(fontStyleFrame->flags & 0x04)) { + LOG_ERROR(Lib_Font, "Flag not set"); + return ORBIS_FONT_ERROR_UNSET_PARAMETER; + } + + // Retrieve weight scales (default is +1.0 to maintain normal weight) + if (weightXScale) { + *weightXScale = fontStyleFrame->weightXScale + 1.0f; + } + if (weightYScale) { + *weightYScale = fontStyleFrame->weightYScale + 1.0f; + } + + // Reset mode if provided + if (mode) { + *mode = 0; + } + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameGetResolutionDpi() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameGetScalePixel(OrbisFontStyleFrame* styleFrame, float* w, + float* h) { + if (!styleFrame) { + LOG_ERROR(Lib_Font, "Invalid Parameter"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + if (styleFrame->magic != 0xF09) { + LOG_ERROR(Lib_Font, "Invalid magic"); + return ORBIS_FONT_ERROR_INVALID_PARAMETER; + } + + if (!(styleFrame->flags & 0x01)) { + LOG_ERROR(Lib_Font, "Scaling effect parameter not set"); + return ORBIS_FONT_ERROR_UNSET_PARAMETER; + } + + // Check if scaling is allowed + int isScalingEnabled = styleFrame->scalingFlag; + if (w) { + *w = styleFrame->scaleWidth; + if (isScalingEnabled && styleFrame->dpiX) { + *w *= ((float)styleFrame->dpiX / 72.0f); + } + } + + if (h) { + *h = styleFrame->scaleHeight; + if (isScalingEnabled && styleFrame->dpiY) { + *h *= ((float)styleFrame->dpiY / 72.0f); + } + } + + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameGetScalePoint() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameInit() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameSetEffectSlant() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameSetEffectWeight() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameSetResolutionDpi() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameSetScalePixel() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameSetScalePoint() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameUnsetEffectSlant() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameUnsetEffectWeight() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontStyleFrameUnsetScale() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSupportExternalFonts() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSupportGlyphs() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSupportSystemFonts() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontTextCodesStepBack() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontTextCodesStepNext() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontTextSourceInit() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontTextSourceRewind() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontTextSourceSetDefaultFont() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontTextSourceSetWritingForm() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontUnbindRenderer() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWordsFindWordCharacters() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWritingGetRenderMetrics() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWritingInit() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWritingLineClear() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWritingLineGetOrderingSpace() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWritingLineGetRenderMetrics() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWritingLineRefersRenderStep() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWritingLineWritesOrder() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWritingRefersRenderStep() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWritingRefersRenderStepCharacter() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontWritingSetMaskInvisible() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_00F4D778F1C88CB3() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_03C650025FBB0DE7() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_07EAB8A163B27E1A() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_09408E88E4F97CE3() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_09F92905ED82A814() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_0D142CEE1AB21ABE() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_14BD2E9E119C16F2() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_1AC53C9EDEAE8D75() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_1D401185D5E24C3D() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_1E83CD20C2CC996F() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_314B1F765B9FE78A() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_350E6725FEDE29E1() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_3DB773F0A604BF39() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_4FF49DD21E311B1C() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_526287664A493981() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_55CA718DBC84A6E9() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_563FC5F0706A8B4D() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_569E2ECD34290F45() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_5A04775B6BE47685() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_5FD93BCAB6F79750() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_62B5398F864BD3B4() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_6F9010294D822367() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_7757E947423A7A67() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_7E06BA52077F54FA() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_93B36DEA021311D6() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_94B0891E7111598A() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_9785C9128C2FE7CD() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_97DFBC9B65FBC0E1() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_ACD9717405D7D3CA() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_B19A8AEC3FD4F16F() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_C10F488AD7CF103D() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_D0C8B5FF4A6826C7() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_E48D3CD01C342A33() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_EAC96B2186B71E14() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_FE4788A96EF46256() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI Func_FE7E5AE95D3058F5() { + LOG_ERROR(Lib_Font, "(STUBBED) called"); + return ORBIS_OK; +} + +void RegisterlibSceFont(Core::Loader::SymbolsResolver* sym) { + LIB_FUNCTION("CUKn5pX-NVY", "libSceFont", 1, "libSceFont", sceFontAttachDeviceCacheBuffer); + LIB_FUNCTION("3OdRkSjOcog", "libSceFont", 1, "libSceFont", sceFontBindRenderer); + LIB_FUNCTION("6DFUkCwQLa8", "libSceFont", 1, "libSceFont", sceFontCharacterGetBidiLevel); + LIB_FUNCTION("coCrV6IWplE", "libSceFont", 1, "libSceFont", + sceFontCharacterGetSyllableStringState); + LIB_FUNCTION("zN3+nuA0SFQ", "libSceFont", 1, "libSceFont", sceFontCharacterGetTextFontCode); + LIB_FUNCTION("mxgmMj-Mq-o", "libSceFont", 1, "libSceFont", sceFontCharacterGetTextOrder); + LIB_FUNCTION("-P6X35Rq2-E", "libSceFont", 1, "libSceFont", + sceFontCharacterLooksFormatCharacters); + LIB_FUNCTION("SaRlqtqaCew", "libSceFont", 1, "libSceFont", sceFontCharacterLooksWhiteSpace); + LIB_FUNCTION("6Gqlv5KdTbU", "libSceFont", 1, "libSceFont", sceFontCharacterRefersTextBack); + LIB_FUNCTION("BkjBP+YC19w", "libSceFont", 1, "libSceFont", sceFontCharacterRefersTextNext); + LIB_FUNCTION("lVSR5ftvNag", "libSceFont", 1, "libSceFont", sceFontCharactersRefersTextCodes); + LIB_FUNCTION("I9R5VC6eZWo", "libSceFont", 1, "libSceFont", sceFontClearDeviceCache); + LIB_FUNCTION("vzHs3C8lWJk", "libSceFont", 1, "libSceFont", sceFontCloseFont); + LIB_FUNCTION("MpKSBaYKluo", "libSceFont", 1, "libSceFont", sceFontControl); + LIB_FUNCTION("WBNBaj9XiJU", "libSceFont", 1, "libSceFont", sceFontCreateGraphicsDevice); + LIB_FUNCTION("4So0MC3oBIM", "libSceFont", 1, "libSceFont", sceFontCreateGraphicsService); + LIB_FUNCTION("NlO5Qlhjkng", "libSceFont", 1, "libSceFont", + sceFontCreateGraphicsServiceWithEdition); + LIB_FUNCTION("nWrfPI4Okmg", "libSceFont", 1, "libSceFont", sceFontCreateLibrary); + LIB_FUNCTION("n590hj5Oe-k", "libSceFont", 1, "libSceFont", sceFontCreateLibraryWithEdition); + LIB_FUNCTION("u5fZd3KZcs0", "libSceFont", 1, "libSceFont", sceFontCreateRenderer); + LIB_FUNCTION("WaSFJoRWXaI", "libSceFont", 1, "libSceFont", sceFontCreateRendererWithEdition); + LIB_FUNCTION("MO24vDhmS4E", "libSceFont", 1, "libSceFont", sceFontCreateString); + LIB_FUNCTION("cYrMGk1wrMA", "libSceFont", 1, "libSceFont", sceFontCreateWords); + LIB_FUNCTION("7rogx92EEyc", "libSceFont", 1, "libSceFont", sceFontCreateWritingLine); + LIB_FUNCTION("8h-SOB-asgk", "libSceFont", 1, "libSceFont", sceFontDefineAttribute); + LIB_FUNCTION("LHDoRWVFGqk", "libSceFont", 1, "libSceFont", sceFontDeleteGlyph); + LIB_FUNCTION("5QG71IjgOpQ", "libSceFont", 1, "libSceFont", sceFontDestroyGraphicsDevice); + LIB_FUNCTION("zZQD3EwJo3c", "libSceFont", 1, "libSceFont", sceFontDestroyGraphicsService); + LIB_FUNCTION("FXP359ygujs", "libSceFont", 1, "libSceFont", sceFontDestroyLibrary); + LIB_FUNCTION("exAxkyVLt0s", "libSceFont", 1, "libSceFont", sceFontDestroyRenderer); + LIB_FUNCTION("SSCaczu2aMQ", "libSceFont", 1, "libSceFont", sceFontDestroyString); + LIB_FUNCTION("hWE4AwNixqY", "libSceFont", 1, "libSceFont", sceFontDestroyWords); + LIB_FUNCTION("PEjv7CVDRYs", "libSceFont", 1, "libSceFont", sceFontDestroyWritingLine); + LIB_FUNCTION("UuY-OJF+f0k", "libSceFont", 1, "libSceFont", sceFontDettachDeviceCacheBuffer); + LIB_FUNCTION("C-4Qw5Srlyw", "libSceFont", 1, "libSceFont", sceFontGenerateCharGlyph); + LIB_FUNCTION("5kx49CAlO-M", "libSceFont", 1, "libSceFont", sceFontGetAttribute); + LIB_FUNCTION("OINC0X9HGBY", "libSceFont", 1, "libSceFont", sceFontGetCharGlyphCode); + LIB_FUNCTION("L97d+3OgMlE", "libSceFont", 1, "libSceFont", sceFontGetCharGlyphMetrics); + LIB_FUNCTION("ynSqYL8VpoA", "libSceFont", 1, "libSceFont", sceFontGetEffectSlant); + LIB_FUNCTION("d7dDgRY+Bzw", "libSceFont", 1, "libSceFont", sceFontGetEffectWeight); + LIB_FUNCTION("ZB8xRemRRG8", "libSceFont", 1, "libSceFont", sceFontGetFontGlyphsCount); + LIB_FUNCTION("4X14YSK4Ldk", "libSceFont", 1, "libSceFont", sceFontGetFontGlyphsOutlineProfile); + LIB_FUNCTION("eb9S3zNlV5o", "libSceFont", 1, "libSceFont", sceFontGetFontMetrics); + LIB_FUNCTION("tiIlroGki+g", "libSceFont", 1, "libSceFont", sceFontGetFontResolution); + LIB_FUNCTION("3hVv3SNoL6E", "libSceFont", 1, "libSceFont", sceFontGetFontStyleInformation); + LIB_FUNCTION("gVQpMBuB7fE", "libSceFont", 1, "libSceFont", sceFontGetGlyphExpandBufferState); + LIB_FUNCTION("imxVx8lm+KM", "libSceFont", 1, "libSceFont", sceFontGetHorizontalLayout); + LIB_FUNCTION("sDuhHGNhHvE", "libSceFont", 1, "libSceFont", sceFontGetKerning); + LIB_FUNCTION("LzmHDnlcwfQ", "libSceFont", 1, "libSceFont", sceFontGetLibrary); + LIB_FUNCTION("BozJej5T6fs", "libSceFont", 1, "libSceFont", sceFontGetPixelResolution); + LIB_FUNCTION("IQtleGLL5pQ", "libSceFont", 1, "libSceFont", sceFontGetRenderCharGlyphMetrics); + LIB_FUNCTION("Gqa5Pp7y4MU", "libSceFont", 1, "libSceFont", sceFontGetRenderEffectSlant); + LIB_FUNCTION("woOjHrkjIYg", "libSceFont", 1, "libSceFont", sceFontGetRenderEffectWeight); + LIB_FUNCTION("ryPlnDDI3rU", "libSceFont", 1, "libSceFont", sceFontGetRenderScaledKerning); + LIB_FUNCTION("EY38A01lq2k", "libSceFont", 1, "libSceFont", sceFontGetRenderScalePixel); + LIB_FUNCTION("FEafYUcxEGo", "libSceFont", 1, "libSceFont", sceFontGetRenderScalePoint); + LIB_FUNCTION("8REoLjNGCpM", "libSceFont", 1, "libSceFont", sceFontGetResolutionDpi); + LIB_FUNCTION("CkVmLoCNN-8", "libSceFont", 1, "libSceFont", sceFontGetScalePixel); + LIB_FUNCTION("GoF2bhB7LYk", "libSceFont", 1, "libSceFont", sceFontGetScalePoint); + LIB_FUNCTION("IrXeG0Lc6nA", "libSceFont", 1, "libSceFont", sceFontGetScriptLanguage); + LIB_FUNCTION("7-miUT6pNQw", "libSceFont", 1, "libSceFont", sceFontGetTypographicDesign); + LIB_FUNCTION("3BrWWFU+4ts", "libSceFont", 1, "libSceFont", sceFontGetVerticalLayout); + LIB_FUNCTION("8-zmgsxkBek", "libSceFont", 1, "libSceFont", sceFontGlyphDefineAttribute); + LIB_FUNCTION("oO33Uex4Ui0", "libSceFont", 1, "libSceFont", sceFontGlyphGetAttribute); + LIB_FUNCTION("PXlA0M8ax40", "libSceFont", 1, "libSceFont", sceFontGlyphGetGlyphForm); + LIB_FUNCTION("XUfSWpLhrUw", "libSceFont", 1, "libSceFont", sceFontGlyphGetMetricsForm); + LIB_FUNCTION("lNnUqa1zA-M", "libSceFont", 1, "libSceFont", sceFontGlyphGetScalePixel); + LIB_FUNCTION("ntrc3bEWlvQ", "libSceFont", 1, "libSceFont", sceFontGlyphRefersMetrics); + LIB_FUNCTION("9kTbF59TjLs", "libSceFont", 1, "libSceFont", sceFontGlyphRefersMetricsHorizontal); + LIB_FUNCTION("nJavPEdMDvM", "libSceFont", 1, "libSceFont", + sceFontGlyphRefersMetricsHorizontalAdvance); + LIB_FUNCTION("JCnVgZgcucs", "libSceFont", 1, "libSceFont", + sceFontGlyphRefersMetricsHorizontalX); + LIB_FUNCTION("R1T4i+DOhNY", "libSceFont", 1, "libSceFont", sceFontGlyphRefersOutline); + LIB_FUNCTION("RmkXfBcZnrM", "libSceFont", 1, "libSceFont", sceFontGlyphRenderImage); + LIB_FUNCTION("r4KEihtwxGs", "libSceFont", 1, "libSceFont", sceFontGlyphRenderImageHorizontal); + LIB_FUNCTION("n22d-HIdmMg", "libSceFont", 1, "libSceFont", sceFontGlyphRenderImageVertical); + LIB_FUNCTION("RL2cAQgyXR8", "libSceFont", 1, "libSceFont", sceFontGraphicsBeginFrame); + LIB_FUNCTION("dUmIK6QjT7E", "libSceFont", 1, "libSceFont", sceFontGraphicsDrawingCancel); + LIB_FUNCTION("X2Vl3yU19Zw", "libSceFont", 1, "libSceFont", sceFontGraphicsDrawingFinish); + LIB_FUNCTION("DOmdOwV3Aqw", "libSceFont", 1, "libSceFont", sceFontGraphicsEndFrame); + LIB_FUNCTION("zdYdKRQC3rw", "libSceFont", 1, "libSceFont", sceFontGraphicsExchangeResource); + LIB_FUNCTION("UkMUIoj-e9s", "libSceFont", 1, "libSceFont", sceFontGraphicsFillMethodInit); + LIB_FUNCTION("DJURdcnVUqo", "libSceFont", 1, "libSceFont", sceFontGraphicsFillPlotInit); + LIB_FUNCTION("eQac6ftmBQQ", "libSceFont", 1, "libSceFont", sceFontGraphicsFillPlotSetLayout); + LIB_FUNCTION("PEYQJa+MWnk", "libSceFont", 1, "libSceFont", sceFontGraphicsFillPlotSetMapping); + LIB_FUNCTION("21g4m4kYF6g", "libSceFont", 1, "libSceFont", sceFontGraphicsFillRatesInit); + LIB_FUNCTION("pJzji5FvdxU", "libSceFont", 1, "libSceFont", + sceFontGraphicsFillRatesSetFillEffect); + LIB_FUNCTION("scaro-xEuUM", "libSceFont", 1, "libSceFont", sceFontGraphicsFillRatesSetLayout); + LIB_FUNCTION("W66Kqtt0xU0", "libSceFont", 1, "libSceFont", sceFontGraphicsFillRatesSetMapping); + LIB_FUNCTION("FzpLsBQEegQ", "libSceFont", 1, "libSceFont", sceFontGraphicsGetDeviceUsage); + LIB_FUNCTION("W80hs0g5d+E", "libSceFont", 1, "libSceFont", sceFontGraphicsRegionInit); + LIB_FUNCTION("S48+njg9p-o", "libSceFont", 1, "libSceFont", sceFontGraphicsRegionInitCircular); + LIB_FUNCTION("wcOQ8Fz73+M", "libSceFont", 1, "libSceFont", sceFontGraphicsRegionInitRoundish); + LIB_FUNCTION("YBaw2Yyfd5E", "libSceFont", 1, "libSceFont", sceFontGraphicsRelease); + LIB_FUNCTION("qkySrQ4FGe0", "libSceFont", 1, "libSceFont", sceFontGraphicsRenderResource); + LIB_FUNCTION("qzNjJYKVli0", "libSceFont", 1, "libSceFont", sceFontGraphicsSetFramePolicy); + LIB_FUNCTION("9iRbHCtcx-o", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupClipping); + LIB_FUNCTION("KZ3qPyz5Opc", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupColorRates); + LIB_FUNCTION("LqclbpVzRvM", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupFillMethod); + LIB_FUNCTION("Wl4FiI4qKY0", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupFillRates); + LIB_FUNCTION("WC7s95TccVo", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupGlyphFill); + LIB_FUNCTION("zC6I4ty37NA", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupGlyphFillPlot); + LIB_FUNCTION("drZUF0XKTEI", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupHandleDefault); + LIB_FUNCTION("MEAmHMynQXE", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupLocation); + LIB_FUNCTION("XRUOmQhnYO4", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupPositioning); + LIB_FUNCTION("98XGr2Bkklg", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupRotation); + LIB_FUNCTION("Nj-ZUVOVAvc", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupScaling); + LIB_FUNCTION("p0avT2ggev0", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupShapeFill); + LIB_FUNCTION("0C5aKg9KghY", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupShapeFillPlot); + LIB_FUNCTION("4pA3qqAcYco", "libSceFont", 1, "libSceFont", sceFontGraphicsStructureCanvas); + LIB_FUNCTION("cpjgdlMYdOM", "libSceFont", 1, "libSceFont", + sceFontGraphicsStructureCanvasSequence); + LIB_FUNCTION("774Mee21wKk", "libSceFont", 1, "libSceFont", sceFontGraphicsStructureDesign); + LIB_FUNCTION("Hp3NIFhUXvQ", "libSceFont", 1, "libSceFont", + sceFontGraphicsStructureDesignResource); + LIB_FUNCTION("bhmZlml6NBs", "libSceFont", 1, "libSceFont", + sceFontGraphicsStructureSurfaceTexture); + LIB_FUNCTION("5sAWgysOBfE", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateClipping); + LIB_FUNCTION("W4e8obm+w6o", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateColorRates); + LIB_FUNCTION("EgIn3QBajPs", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateFillMethod); + LIB_FUNCTION("MnUYAs2jVuU", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateFillRates); + LIB_FUNCTION("R-oVDMusYbc", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateGlyphFill); + LIB_FUNCTION("b9R+HQuHSMI", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateGlyphFillPlot); + LIB_FUNCTION("IN4P5pJADQY", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateLocation); + LIB_FUNCTION("U+LLXdr2DxM", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdatePositioning); + LIB_FUNCTION("yStTYSeb4NM", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateRotation); + LIB_FUNCTION("eDxmMoxE5xU", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateScaling); + LIB_FUNCTION("Ax6LQJJq6HQ", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateShapeFill); + LIB_FUNCTION("I5Rf2rXvBKQ", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateShapeFillPlot); + LIB_FUNCTION("whrS4oksXc4", "libSceFont", 1, "libSceFont", sceFontMemoryInit); + LIB_FUNCTION("h6hIgxXEiEc", "libSceFont", 1, "libSceFont", sceFontMemoryTerm); + LIB_FUNCTION("RvXyHMUiLhE", "libSceFont", 1, "libSceFont", sceFontOpenFontFile); + LIB_FUNCTION("JzCH3SCFnAU", "libSceFont", 1, "libSceFont", sceFontOpenFontInstance); + LIB_FUNCTION("KXUpebrFk1U", "libSceFont", 1, "libSceFont", sceFontOpenFontMemory); + LIB_FUNCTION("cKYtVmeSTcw", "libSceFont", 1, "libSceFont", sceFontOpenFontSet); + LIB_FUNCTION("Z2cdsqJH+5k", "libSceFont", 1, "libSceFont", sceFontRebindRenderer); + LIB_FUNCTION("3G4zhgKuxE8", "libSceFont", 1, "libSceFont", sceFontRenderCharGlyphImage); + LIB_FUNCTION("kAenWy1Zw5o", "libSceFont", 1, "libSceFont", + sceFontRenderCharGlyphImageHorizontal); + LIB_FUNCTION("i6UNdSig1uE", "libSceFont", 1, "libSceFont", sceFontRenderCharGlyphImageVertical); + LIB_FUNCTION("amcmrY62BD4", "libSceFont", 1, "libSceFont", sceFontRendererGetOutlineBufferSize); + LIB_FUNCTION("ai6AfGrBs4o", "libSceFont", 1, "libSceFont", sceFontRendererResetOutlineBuffer); + LIB_FUNCTION("ydF+WuH0fAk", "libSceFont", 1, "libSceFont", + sceFontRendererSetOutlineBufferPolicy); + LIB_FUNCTION("gdUCnU0gHdI", "libSceFont", 1, "libSceFont", sceFontRenderSurfaceInit); + LIB_FUNCTION("vRxf4d0ulPs", "libSceFont", 1, "libSceFont", sceFontRenderSurfaceSetScissor); + LIB_FUNCTION("0hr-w30SjiI", "libSceFont", 1, "libSceFont", sceFontRenderSurfaceSetStyleFrame); + LIB_FUNCTION("TMtqoFQjjbA", "libSceFont", 1, "libSceFont", sceFontSetEffectSlant); + LIB_FUNCTION("v0phZwa4R5o", "libSceFont", 1, "libSceFont", sceFontSetEffectWeight); + LIB_FUNCTION("kihFGYJee7o", "libSceFont", 1, "libSceFont", sceFontSetFontsOpenMode); + LIB_FUNCTION("I1acwR7Qp8E", "libSceFont", 1, "libSceFont", sceFontSetResolutionDpi); + LIB_FUNCTION("N1EBMeGhf7E", "libSceFont", 1, "libSceFont", sceFontSetScalePixel); + LIB_FUNCTION("sw65+7wXCKE", "libSceFont", 1, "libSceFont", sceFontSetScalePoint); + LIB_FUNCTION("PxSR9UfJ+SQ", "libSceFont", 1, "libSceFont", sceFontSetScriptLanguage); + LIB_FUNCTION("SnsZua35ngs", "libSceFont", 1, "libSceFont", sceFontSetTypographicDesign); + LIB_FUNCTION("lz9y9UFO2UU", "libSceFont", 1, "libSceFont", sceFontSetupRenderEffectSlant); + LIB_FUNCTION("XIGorvLusDQ", "libSceFont", 1, "libSceFont", sceFontSetupRenderEffectWeight); + LIB_FUNCTION("6vGCkkQJOcI", "libSceFont", 1, "libSceFont", sceFontSetupRenderScalePixel); + LIB_FUNCTION("nMZid4oDfi4", "libSceFont", 1, "libSceFont", sceFontSetupRenderScalePoint); + LIB_FUNCTION("ObkDGDBsVtw", "libSceFont", 1, "libSceFont", sceFontStringGetTerminateCode); + LIB_FUNCTION("+B-xlbiWDJ4", "libSceFont", 1, "libSceFont", sceFontStringGetTerminateOrder); + LIB_FUNCTION("o1vIEHeb6tw", "libSceFont", 1, "libSceFont", sceFontStringGetWritingForm); + LIB_FUNCTION("hq5LffQjz-s", "libSceFont", 1, "libSceFont", sceFontStringRefersRenderCharacters); + LIB_FUNCTION("Avv7OApgCJk", "libSceFont", 1, "libSceFont", sceFontStringRefersTextCharacters); + LIB_FUNCTION("lOfduYnjgbo", "libSceFont", 1, "libSceFont", sceFontStyleFrameGetEffectSlant); + LIB_FUNCTION("HIUdjR-+Wl8", "libSceFont", 1, "libSceFont", sceFontStyleFrameGetEffectWeight); + LIB_FUNCTION("VSw18Aqzl0U", "libSceFont", 1, "libSceFont", sceFontStyleFrameGetResolutionDpi); + LIB_FUNCTION("2QfqfeLblbg", "libSceFont", 1, "libSceFont", sceFontStyleFrameGetScalePixel); + LIB_FUNCTION("7x2xKiiB7MA", "libSceFont", 1, "libSceFont", sceFontStyleFrameGetScalePoint); + LIB_FUNCTION("la2AOWnHEAc", "libSceFont", 1, "libSceFont", sceFontStyleFrameInit); + LIB_FUNCTION("394sckksiCU", "libSceFont", 1, "libSceFont", sceFontStyleFrameSetEffectSlant); + LIB_FUNCTION("faw77-pEBmU", "libSceFont", 1, "libSceFont", sceFontStyleFrameSetEffectWeight); + LIB_FUNCTION("dB4-3Wdwls8", "libSceFont", 1, "libSceFont", sceFontStyleFrameSetResolutionDpi); + LIB_FUNCTION("da4rQ4-+p-4", "libSceFont", 1, "libSceFont", sceFontStyleFrameSetScalePixel); + LIB_FUNCTION("O997laxY-Ys", "libSceFont", 1, "libSceFont", sceFontStyleFrameSetScalePoint); + LIB_FUNCTION("dUmABkAnVgk", "libSceFont", 1, "libSceFont", sceFontStyleFrameUnsetEffectSlant); + LIB_FUNCTION("hwsuXgmKdaw", "libSceFont", 1, "libSceFont", sceFontStyleFrameUnsetEffectWeight); + LIB_FUNCTION("bePC0L0vQWY", "libSceFont", 1, "libSceFont", sceFontStyleFrameUnsetScale); + LIB_FUNCTION("mz2iTY0MK4A", "libSceFont", 1, "libSceFont", sceFontSupportExternalFonts); + LIB_FUNCTION("71w5DzObuZI", "libSceFont", 1, "libSceFont", sceFontSupportGlyphs); + LIB_FUNCTION("SsRbbCiWoGw", "libSceFont", 1, "libSceFont", sceFontSupportSystemFonts); + LIB_FUNCTION("IPoYwwlMx-g", "libSceFont", 1, "libSceFont", sceFontTextCodesStepBack); + LIB_FUNCTION("olSmXY+XP1E", "libSceFont", 1, "libSceFont", sceFontTextCodesStepNext); + LIB_FUNCTION("oaJ1BpN2FQk", "libSceFont", 1, "libSceFont", sceFontTextSourceInit); + LIB_FUNCTION("VRFd3diReec", "libSceFont", 1, "libSceFont", sceFontTextSourceRewind); + LIB_FUNCTION("eCRMCSk96NU", "libSceFont", 1, "libSceFont", sceFontTextSourceSetDefaultFont); + LIB_FUNCTION("OqQKX0h5COw", "libSceFont", 1, "libSceFont", sceFontTextSourceSetWritingForm); + LIB_FUNCTION("1QjhKxrsOB8", "libSceFont", 1, "libSceFont", sceFontUnbindRenderer); + LIB_FUNCTION("H-FNq8isKE0", "libSceFont", 1, "libSceFont", sceFontWordsFindWordCharacters); + LIB_FUNCTION("fljdejMcG1c", "libSceFont", 1, "libSceFont", sceFontWritingGetRenderMetrics); + LIB_FUNCTION("fD5rqhEXKYQ", "libSceFont", 1, "libSceFont", sceFontWritingInit); + LIB_FUNCTION("1+DgKL0haWQ", "libSceFont", 1, "libSceFont", sceFontWritingLineClear); + LIB_FUNCTION("JQKWIsS9joE", "libSceFont", 1, "libSceFont", sceFontWritingLineGetOrderingSpace); + LIB_FUNCTION("nlU2VnfpqTM", "libSceFont", 1, "libSceFont", sceFontWritingLineGetRenderMetrics); + LIB_FUNCTION("+FYcYefsVX0", "libSceFont", 1, "libSceFont", sceFontWritingLineRefersRenderStep); + LIB_FUNCTION("wyKFUOWdu3Q", "libSceFont", 1, "libSceFont", sceFontWritingLineWritesOrder); + LIB_FUNCTION("W-2WOXEHGck", "libSceFont", 1, "libSceFont", sceFontWritingRefersRenderStep); + LIB_FUNCTION("f4Onl7efPEY", "libSceFont", 1, "libSceFont", + sceFontWritingRefersRenderStepCharacter); + LIB_FUNCTION("BbCZjJizU4A", "libSceFont", 1, "libSceFont", sceFontWritingSetMaskInvisible); + LIB_FUNCTION("APTXePHIjLM", "libSceFont", 1, "libSceFont", Func_00F4D778F1C88CB3); + LIB_FUNCTION("A8ZQAl+7Dec", "libSceFont", 1, "libSceFont", Func_03C650025FBB0DE7); + LIB_FUNCTION("B+q4oWOyfho", "libSceFont", 1, "libSceFont", Func_07EAB8A163B27E1A); + LIB_FUNCTION("CUCOiOT5fOM", "libSceFont", 1, "libSceFont", Func_09408E88E4F97CE3); + LIB_FUNCTION("CfkpBe2CqBQ", "libSceFont", 1, "libSceFont", Func_09F92905ED82A814); + LIB_FUNCTION("DRQs7hqyGr4", "libSceFont", 1, "libSceFont", Func_0D142CEE1AB21ABE); + LIB_FUNCTION("FL0unhGcFvI", "libSceFont", 1, "libSceFont", Func_14BD2E9E119C16F2); + LIB_FUNCTION("GsU8nt6ujXU", "libSceFont", 1, "libSceFont", Func_1AC53C9EDEAE8D75); + LIB_FUNCTION("HUARhdXiTD0", "libSceFont", 1, "libSceFont", Func_1D401185D5E24C3D); + LIB_FUNCTION("HoPNIMLMmW8", "libSceFont", 1, "libSceFont", Func_1E83CD20C2CC996F); + LIB_FUNCTION("MUsfdluf54o", "libSceFont", 1, "libSceFont", Func_314B1F765B9FE78A); + LIB_FUNCTION("NQ5nJf7eKeE", "libSceFont", 1, "libSceFont", Func_350E6725FEDE29E1); + LIB_FUNCTION("Pbdz8KYEvzk", "libSceFont", 1, "libSceFont", Func_3DB773F0A604BF39); + LIB_FUNCTION("T-Sd0h4xGxw", "libSceFont", 1, "libSceFont", Func_4FF49DD21E311B1C); + LIB_FUNCTION("UmKHZkpJOYE", "libSceFont", 1, "libSceFont", Func_526287664A493981); + LIB_FUNCTION("VcpxjbyEpuk", "libSceFont", 1, "libSceFont", Func_55CA718DBC84A6E9); + LIB_FUNCTION("Vj-F8HBqi00", "libSceFont", 1, "libSceFont", Func_563FC5F0706A8B4D); + LIB_FUNCTION("Vp4uzTQpD0U", "libSceFont", 1, "libSceFont", Func_569E2ECD34290F45); + LIB_FUNCTION("WgR3W2vkdoU", "libSceFont", 1, "libSceFont", Func_5A04775B6BE47685); + LIB_FUNCTION("X9k7yrb3l1A", "libSceFont", 1, "libSceFont", Func_5FD93BCAB6F79750); + LIB_FUNCTION("YrU5j4ZL07Q", "libSceFont", 1, "libSceFont", Func_62B5398F864BD3B4); + LIB_FUNCTION("b5AQKU2CI2c", "libSceFont", 1, "libSceFont", Func_6F9010294D822367); + LIB_FUNCTION("d1fpR0I6emc", "libSceFont", 1, "libSceFont", Func_7757E947423A7A67); + LIB_FUNCTION("fga6Ugd-VPo", "libSceFont", 1, "libSceFont", Func_7E06BA52077F54FA); + LIB_FUNCTION("k7Nt6gITEdY", "libSceFont", 1, "libSceFont", Func_93B36DEA021311D6); + LIB_FUNCTION("lLCJHnERWYo", "libSceFont", 1, "libSceFont", Func_94B0891E7111598A); + LIB_FUNCTION("l4XJEowv580", "libSceFont", 1, "libSceFont", Func_9785C9128C2FE7CD); + LIB_FUNCTION("l9+8m2X7wOE", "libSceFont", 1, "libSceFont", Func_97DFBC9B65FBC0E1); + LIB_FUNCTION("rNlxdAXX08o", "libSceFont", 1, "libSceFont", Func_ACD9717405D7D3CA); + LIB_FUNCTION("sZqK7D-U8W8", "libSceFont", 1, "libSceFont", Func_B19A8AEC3FD4F16F); + LIB_FUNCTION("wQ9IitfPED0", "libSceFont", 1, "libSceFont", Func_C10F488AD7CF103D); + LIB_FUNCTION("0Mi1-0poJsc", "libSceFont", 1, "libSceFont", Func_D0C8B5FF4A6826C7); + LIB_FUNCTION("5I080Bw0KjM", "libSceFont", 1, "libSceFont", Func_E48D3CD01C342A33); + LIB_FUNCTION("6slrIYa3HhQ", "libSceFont", 1, "libSceFont", Func_EAC96B2186B71E14); + LIB_FUNCTION("-keIqW70YlY", "libSceFont", 1, "libSceFont", Func_FE4788A96EF46256); + LIB_FUNCTION("-n5a6V0wWPU", "libSceFont", 1, "libSceFont", Func_FE7E5AE95D3058F5); +}; + +} // namespace Libraries::Font \ No newline at end of file diff --git a/src/core/libraries/font/font.h b/src/core/libraries/font/font.h new file mode 100644 index 000000000..a8e239126 --- /dev/null +++ b/src/core/libraries/font/font.h @@ -0,0 +1,299 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "common/types.h" + +namespace Core::Loader { +class SymbolsResolver; +} + +namespace Libraries::Font { + +struct OrbisFontTextCharacter { + // Other fields... + struct OrbisFontTextCharacter* next; // Pointer to the next node 0x00 + struct OrbisFontTextCharacter* prev; // Pointer to the next node 0x08 + void* textOrder; // Field at offset 0x10 (pointer to text order info) + u32 characterCode; // Field assumed at offset 0x28 + u8 unkn_0x31; // Offset 0x31 + u8 unkn_0x33; // Offset 0x33 + u8 charType; // Field assumed at offset 0x39 + u8 bidiLevel; // Field assumed at offset 0x3B stores the Bidi level + u8 formatFlags; // Field at offset 0x3D (stores format-related flags) +}; + +struct OrbisFontRenderSurface { + void* buffer; + s32 widthByte; + s8 pixelSizeByte; + u8 unkn_0xd; + u8 styleFlag; + u8 unkn_0xf; + s32 width, height; + u32 sc_x0; + u32 sc_y0; + u32 sc_x1; + u32 sc_y1; + void* unkn_28[3]; +}; + +struct OrbisFontStyleFrame { + /*0x00*/ u16 magic; // Expected to be 0xF09 + /*0x02*/ u16 flags; + /*0x04*/ s32 dpiX; // DPI scaling factor for width + /*0x08*/ s32 dpiY; // DPI scaling factor for height + /*0x0c*/ s32 scalingFlag; // Indicates whether scaling is enabled + /*0x10*/ + /*0x14*/ float scaleWidth; // Width scaling factor + /*0x18*/ float scaleHeight; // Height scaling factor + /*0x1c*/ float weightXScale; + /*0x20*/ float weightYScale; + /*0x24*/ float slantRatio; +}; + +s32 PS4_SYSV_ABI sceFontAttachDeviceCacheBuffer(); +s32 PS4_SYSV_ABI sceFontBindRenderer(); +s32 PS4_SYSV_ABI sceFontCharacterGetBidiLevel(OrbisFontTextCharacter* textCharacter, + int* bidiLevel); +s32 PS4_SYSV_ABI sceFontCharacterGetSyllableStringState(); +s32 PS4_SYSV_ABI sceFontCharacterGetTextFontCode(); +s32 PS4_SYSV_ABI sceFontCharacterGetTextOrder(OrbisFontTextCharacter* textCharacter, + void** pTextOrder); +u32 PS4_SYSV_ABI sceFontCharacterLooksFormatCharacters(OrbisFontTextCharacter* textCharacter); +u32 PS4_SYSV_ABI sceFontCharacterLooksWhiteSpace(OrbisFontTextCharacter* textCharacter); +OrbisFontTextCharacter* PS4_SYSV_ABI +sceFontCharacterRefersTextBack(OrbisFontTextCharacter* textCharacter); +OrbisFontTextCharacter* PS4_SYSV_ABI +sceFontCharacterRefersTextNext(OrbisFontTextCharacter* textCharacter); +s32 PS4_SYSV_ABI sceFontCharactersRefersTextCodes(); +s32 PS4_SYSV_ABI sceFontClearDeviceCache(); +s32 PS4_SYSV_ABI sceFontCloseFont(); +s32 PS4_SYSV_ABI sceFontControl(); +s32 PS4_SYSV_ABI sceFontCreateGraphicsDevice(); +s32 PS4_SYSV_ABI sceFontCreateGraphicsService(); +s32 PS4_SYSV_ABI sceFontCreateGraphicsServiceWithEdition(); +s32 PS4_SYSV_ABI sceFontCreateLibrary(); +s32 PS4_SYSV_ABI sceFontCreateLibraryWithEdition(); +s32 PS4_SYSV_ABI sceFontCreateRenderer(); +s32 PS4_SYSV_ABI sceFontCreateRendererWithEdition(); +s32 PS4_SYSV_ABI sceFontCreateString(); +s32 PS4_SYSV_ABI sceFontCreateWords(); +s32 PS4_SYSV_ABI sceFontCreateWritingLine(); +s32 PS4_SYSV_ABI sceFontDefineAttribute(); +s32 PS4_SYSV_ABI sceFontDeleteGlyph(); +s32 PS4_SYSV_ABI sceFontDestroyGraphicsDevice(); +s32 PS4_SYSV_ABI sceFontDestroyGraphicsService(); +s32 PS4_SYSV_ABI sceFontDestroyLibrary(); +s32 PS4_SYSV_ABI sceFontDestroyRenderer(); +s32 PS4_SYSV_ABI sceFontDestroyString(); +s32 PS4_SYSV_ABI sceFontDestroyWords(); +s32 PS4_SYSV_ABI sceFontDestroyWritingLine(); +s32 PS4_SYSV_ABI sceFontDettachDeviceCacheBuffer(); +s32 PS4_SYSV_ABI sceFontGenerateCharGlyph(); +s32 PS4_SYSV_ABI sceFontGetAttribute(); +s32 PS4_SYSV_ABI sceFontGetCharGlyphCode(); +s32 PS4_SYSV_ABI sceFontGetCharGlyphMetrics(); +s32 PS4_SYSV_ABI sceFontGetEffectSlant(); +s32 PS4_SYSV_ABI sceFontGetEffectWeight(); +s32 PS4_SYSV_ABI sceFontGetFontGlyphsCount(); +s32 PS4_SYSV_ABI sceFontGetFontGlyphsOutlineProfile(); +s32 PS4_SYSV_ABI sceFontGetFontMetrics(); +s32 PS4_SYSV_ABI sceFontGetFontResolution(); +s32 PS4_SYSV_ABI sceFontGetFontStyleInformation(); +s32 PS4_SYSV_ABI sceFontGetGlyphExpandBufferState(); +s32 PS4_SYSV_ABI sceFontGetHorizontalLayout(); +s32 PS4_SYSV_ABI sceFontGetKerning(); +s32 PS4_SYSV_ABI sceFontGetLibrary(); +s32 PS4_SYSV_ABI sceFontGetPixelResolution(); +s32 PS4_SYSV_ABI sceFontGetRenderCharGlyphMetrics(); +s32 PS4_SYSV_ABI sceFontGetRenderEffectSlant(); +s32 PS4_SYSV_ABI sceFontGetRenderEffectWeight(); +s32 PS4_SYSV_ABI sceFontGetRenderScaledKerning(); +s32 PS4_SYSV_ABI sceFontGetRenderScalePixel(); +s32 PS4_SYSV_ABI sceFontGetRenderScalePoint(); +s32 PS4_SYSV_ABI sceFontGetResolutionDpi(); +s32 PS4_SYSV_ABI sceFontGetScalePixel(); +s32 PS4_SYSV_ABI sceFontGetScalePoint(); +s32 PS4_SYSV_ABI sceFontGetScriptLanguage(); +s32 PS4_SYSV_ABI sceFontGetTypographicDesign(); +s32 PS4_SYSV_ABI sceFontGetVerticalLayout(); +s32 PS4_SYSV_ABI sceFontGlyphDefineAttribute(); +s32 PS4_SYSV_ABI sceFontGlyphGetAttribute(); +s32 PS4_SYSV_ABI sceFontGlyphGetGlyphForm(); +s32 PS4_SYSV_ABI sceFontGlyphGetMetricsForm(); +s32 PS4_SYSV_ABI sceFontGlyphGetScalePixel(); +s32 PS4_SYSV_ABI sceFontGlyphRefersMetrics(); +s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontal(); +s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontalAdvance(); +s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontalX(); +s32 PS4_SYSV_ABI sceFontGlyphRefersOutline(); +s32 PS4_SYSV_ABI sceFontGlyphRenderImage(); +s32 PS4_SYSV_ABI sceFontGlyphRenderImageHorizontal(); +s32 PS4_SYSV_ABI sceFontGlyphRenderImageVertical(); +s32 PS4_SYSV_ABI sceFontGraphicsBeginFrame(); +s32 PS4_SYSV_ABI sceFontGraphicsDrawingCancel(); +s32 PS4_SYSV_ABI sceFontGraphicsDrawingFinish(); +s32 PS4_SYSV_ABI sceFontGraphicsEndFrame(); +s32 PS4_SYSV_ABI sceFontGraphicsExchangeResource(); +s32 PS4_SYSV_ABI sceFontGraphicsFillMethodInit(); +s32 PS4_SYSV_ABI sceFontGraphicsFillPlotInit(); +s32 PS4_SYSV_ABI sceFontGraphicsFillPlotSetLayout(); +s32 PS4_SYSV_ABI sceFontGraphicsFillPlotSetMapping(); +s32 PS4_SYSV_ABI sceFontGraphicsFillRatesInit(); +s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetFillEffect(); +s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetLayout(); +s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetMapping(); +s32 PS4_SYSV_ABI sceFontGraphicsGetDeviceUsage(); +s32 PS4_SYSV_ABI sceFontGraphicsRegionInit(); +s32 PS4_SYSV_ABI sceFontGraphicsRegionInitCircular(); +s32 PS4_SYSV_ABI sceFontGraphicsRegionInitRoundish(); +s32 PS4_SYSV_ABI sceFontGraphicsRelease(); +s32 PS4_SYSV_ABI sceFontGraphicsRenderResource(); +s32 PS4_SYSV_ABI sceFontGraphicsSetFramePolicy(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupClipping(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupColorRates(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupFillMethod(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupFillRates(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupGlyphFill(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupGlyphFillPlot(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupHandleDefault(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupLocation(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupPositioning(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupRotation(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupScaling(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupShapeFill(); +s32 PS4_SYSV_ABI sceFontGraphicsSetupShapeFillPlot(); +s32 PS4_SYSV_ABI sceFontGraphicsStructureCanvas(); +s32 PS4_SYSV_ABI sceFontGraphicsStructureCanvasSequence(); +s32 PS4_SYSV_ABI sceFontGraphicsStructureDesign(); +s32 PS4_SYSV_ABI sceFontGraphicsStructureDesignResource(); +s32 PS4_SYSV_ABI sceFontGraphicsStructureSurfaceTexture(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateClipping(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateColorRates(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateFillMethod(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateFillRates(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateGlyphFill(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateGlyphFillPlot(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateLocation(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdatePositioning(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateRotation(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateScaling(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateShapeFill(); +s32 PS4_SYSV_ABI sceFontGraphicsUpdateShapeFillPlot(); +s32 PS4_SYSV_ABI sceFontMemoryInit(); +s32 PS4_SYSV_ABI sceFontMemoryTerm(); +s32 PS4_SYSV_ABI sceFontOpenFontFile(); +s32 PS4_SYSV_ABI sceFontOpenFontInstance(); +s32 PS4_SYSV_ABI sceFontOpenFontMemory(); +s32 PS4_SYSV_ABI sceFontOpenFontSet(); +s32 PS4_SYSV_ABI sceFontRebindRenderer(); +s32 PS4_SYSV_ABI sceFontRenderCharGlyphImage(); +s32 PS4_SYSV_ABI sceFontRenderCharGlyphImageHorizontal(); +s32 PS4_SYSV_ABI sceFontRenderCharGlyphImageVertical(); +s32 PS4_SYSV_ABI sceFontRendererGetOutlineBufferSize(); +s32 PS4_SYSV_ABI sceFontRendererResetOutlineBuffer(); +s32 PS4_SYSV_ABI sceFontRendererSetOutlineBufferPolicy(); +void PS4_SYSV_ABI sceFontRenderSurfaceInit(OrbisFontRenderSurface* renderSurface, void* buffer, + int bufWidthByte, int pixelSizeByte, int widthPixel, + int heightPixel); +void PS4_SYSV_ABI sceFontRenderSurfaceSetScissor(OrbisFontRenderSurface* renderSurface, int x0, + int y0, int w, int h); +s32 PS4_SYSV_ABI sceFontRenderSurfaceSetStyleFrame(OrbisFontRenderSurface* renderSurface, + OrbisFontStyleFrame* styleFrame); +s32 PS4_SYSV_ABI sceFontSetEffectSlant(); +s32 PS4_SYSV_ABI sceFontSetEffectWeight(); +s32 PS4_SYSV_ABI sceFontSetFontsOpenMode(); +s32 PS4_SYSV_ABI sceFontSetResolutionDpi(); +s32 PS4_SYSV_ABI sceFontSetScalePixel(); +s32 PS4_SYSV_ABI sceFontSetScalePoint(); +s32 PS4_SYSV_ABI sceFontSetScriptLanguage(); +s32 PS4_SYSV_ABI sceFontSetTypographicDesign(); +s32 PS4_SYSV_ABI sceFontSetupRenderEffectSlant(); +s32 PS4_SYSV_ABI sceFontSetupRenderEffectWeight(); +s32 PS4_SYSV_ABI sceFontSetupRenderScalePixel(); +s32 PS4_SYSV_ABI sceFontSetupRenderScalePoint(); +s32 PS4_SYSV_ABI sceFontStringGetTerminateCode(); +s32 PS4_SYSV_ABI sceFontStringGetTerminateOrder(); +s32 PS4_SYSV_ABI sceFontStringGetWritingForm(); +s32 PS4_SYSV_ABI sceFontStringRefersRenderCharacters(); +s32 PS4_SYSV_ABI sceFontStringRefersTextCharacters(); +s32 PS4_SYSV_ABI sceFontStyleFrameGetEffectSlant(OrbisFontStyleFrame* styleFrame, + float* slantRatio); +s32 PS4_SYSV_ABI sceFontStyleFrameGetEffectWeight(OrbisFontStyleFrame* fontStyleFrame, + float* weightXScale, float* weightYScale, + uint32_t* mode); +s32 PS4_SYSV_ABI sceFontStyleFrameGetResolutionDpi(); +s32 PS4_SYSV_ABI sceFontStyleFrameGetScalePixel(OrbisFontStyleFrame* styleFrame, float* w, + float* h); +s32 PS4_SYSV_ABI sceFontStyleFrameGetScalePoint(); +s32 PS4_SYSV_ABI sceFontStyleFrameInit(); +s32 PS4_SYSV_ABI sceFontStyleFrameSetEffectSlant(); +s32 PS4_SYSV_ABI sceFontStyleFrameSetEffectWeight(); +s32 PS4_SYSV_ABI sceFontStyleFrameSetResolutionDpi(); +s32 PS4_SYSV_ABI sceFontStyleFrameSetScalePixel(); +s32 PS4_SYSV_ABI sceFontStyleFrameSetScalePoint(); +s32 PS4_SYSV_ABI sceFontStyleFrameUnsetEffectSlant(); +s32 PS4_SYSV_ABI sceFontStyleFrameUnsetEffectWeight(); +s32 PS4_SYSV_ABI sceFontStyleFrameUnsetScale(); +s32 PS4_SYSV_ABI sceFontSupportExternalFonts(); +s32 PS4_SYSV_ABI sceFontSupportGlyphs(); +s32 PS4_SYSV_ABI sceFontSupportSystemFonts(); +s32 PS4_SYSV_ABI sceFontTextCodesStepBack(); +s32 PS4_SYSV_ABI sceFontTextCodesStepNext(); +s32 PS4_SYSV_ABI sceFontTextSourceInit(); +s32 PS4_SYSV_ABI sceFontTextSourceRewind(); +s32 PS4_SYSV_ABI sceFontTextSourceSetDefaultFont(); +s32 PS4_SYSV_ABI sceFontTextSourceSetWritingForm(); +s32 PS4_SYSV_ABI sceFontUnbindRenderer(); +s32 PS4_SYSV_ABI sceFontWordsFindWordCharacters(); +s32 PS4_SYSV_ABI sceFontWritingGetRenderMetrics(); +s32 PS4_SYSV_ABI sceFontWritingInit(); +s32 PS4_SYSV_ABI sceFontWritingLineClear(); +s32 PS4_SYSV_ABI sceFontWritingLineGetOrderingSpace(); +s32 PS4_SYSV_ABI sceFontWritingLineGetRenderMetrics(); +s32 PS4_SYSV_ABI sceFontWritingLineRefersRenderStep(); +s32 PS4_SYSV_ABI sceFontWritingLineWritesOrder(); +s32 PS4_SYSV_ABI sceFontWritingRefersRenderStep(); +s32 PS4_SYSV_ABI sceFontWritingRefersRenderStepCharacter(); +s32 PS4_SYSV_ABI sceFontWritingSetMaskInvisible(); +s32 PS4_SYSV_ABI Func_00F4D778F1C88CB3(); +s32 PS4_SYSV_ABI Func_03C650025FBB0DE7(); +s32 PS4_SYSV_ABI Func_07EAB8A163B27E1A(); +s32 PS4_SYSV_ABI Func_09408E88E4F97CE3(); +s32 PS4_SYSV_ABI Func_09F92905ED82A814(); +s32 PS4_SYSV_ABI Func_0D142CEE1AB21ABE(); +s32 PS4_SYSV_ABI Func_14BD2E9E119C16F2(); +s32 PS4_SYSV_ABI Func_1AC53C9EDEAE8D75(); +s32 PS4_SYSV_ABI Func_1D401185D5E24C3D(); +s32 PS4_SYSV_ABI Func_1E83CD20C2CC996F(); +s32 PS4_SYSV_ABI Func_314B1F765B9FE78A(); +s32 PS4_SYSV_ABI Func_350E6725FEDE29E1(); +s32 PS4_SYSV_ABI Func_3DB773F0A604BF39(); +s32 PS4_SYSV_ABI Func_4FF49DD21E311B1C(); +s32 PS4_SYSV_ABI Func_526287664A493981(); +s32 PS4_SYSV_ABI Func_55CA718DBC84A6E9(); +s32 PS4_SYSV_ABI Func_563FC5F0706A8B4D(); +s32 PS4_SYSV_ABI Func_569E2ECD34290F45(); +s32 PS4_SYSV_ABI Func_5A04775B6BE47685(); +s32 PS4_SYSV_ABI Func_5FD93BCAB6F79750(); +s32 PS4_SYSV_ABI Func_62B5398F864BD3B4(); +s32 PS4_SYSV_ABI Func_6F9010294D822367(); +s32 PS4_SYSV_ABI Func_7757E947423A7A67(); +s32 PS4_SYSV_ABI Func_7E06BA52077F54FA(); +s32 PS4_SYSV_ABI Func_93B36DEA021311D6(); +s32 PS4_SYSV_ABI Func_94B0891E7111598A(); +s32 PS4_SYSV_ABI Func_9785C9128C2FE7CD(); +s32 PS4_SYSV_ABI Func_97DFBC9B65FBC0E1(); +s32 PS4_SYSV_ABI Func_ACD9717405D7D3CA(); +s32 PS4_SYSV_ABI Func_B19A8AEC3FD4F16F(); +s32 PS4_SYSV_ABI Func_C10F488AD7CF103D(); +s32 PS4_SYSV_ABI Func_D0C8B5FF4A6826C7(); +s32 PS4_SYSV_ABI Func_E48D3CD01C342A33(); +s32 PS4_SYSV_ABI Func_EAC96B2186B71E14(); +s32 PS4_SYSV_ABI Func_FE4788A96EF46256(); +s32 PS4_SYSV_ABI Func_FE7E5AE95D3058F5(); + +void RegisterlibSceFont(Core::Loader::SymbolsResolver* sym); +} // namespace Libraries::Font \ No newline at end of file diff --git a/src/core/libraries/font/font_error.h b/src/core/libraries/font/font_error.h new file mode 100644 index 000000000..64e8fc6a7 --- /dev/null +++ b/src/core/libraries/font/font_error.h @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/libraries/error_codes.h" + +constexpr int ORBIS_FONT_ERROR_FATAL = 0x80460001; +constexpr int ORBIS_FONT_ERROR_INVALID_PARAMETER = 0x80460002; +constexpr int ORBIS_FONT_ERROR_INVALID_MEMORY = 0x80460003; +constexpr int ORBIS_FONT_ERROR_INVALID_LIBRARY = 0x80460004; +constexpr int ORBIS_FONT_ERROR_INVALID_FONT_HANDLE = 0x80460005; +constexpr int ORBIS_FONT_ERROR_INVALID_GLYPH = 0x80460006; +constexpr int ORBIS_FONT_ERROR_INVALID_RENDERER = 0x80460007; +constexpr int ORBIS_FONT_ERROR_INVALID_TEXT_SOURCE = 0x80460008; +constexpr int ORBIS_FONT_ERROR_INVALID_STRING = 0x80460009; +constexpr int ORBIS_FONT_ERROR_INVALID_WRITING = 0x8046000A; +constexpr int ORBIS_FONT_ERROR_INVALID_WORDS = 0x8046000B; +constexpr int ORBIS_FONT_ERROR_ALLOCATION_FAILED = 0x80460010; +constexpr int ORBIS_FONT_ERROR_FS_OPEN_FAILED = 0x80460011; +constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_LIBRARY = 0x80460018; +constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_FORMAT = 0x80460019; +constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_FUNCTION = 0x80460020; +constexpr int ORBIS_FONT_ERROR_ALREADY_SPECIFIED = 0x80460021; +constexpr int ORBIS_FONT_ERROR_ALREADY_ATTACHED = 0x80460022; +constexpr int ORBIS_FONT_ERROR_ALREADY_OPENED = 0x80460023; +constexpr int ORBIS_FONT_ERROR_NOT_ATTACHED_CACHE_BUFFER = 0x80460025; +constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_FONTSET = 0x80460031; +constexpr int ORBIS_FONT_ERROR_FONT_OPEN_MAX = 0x80460033; +constexpr int ORBIS_FONT_ERROR_FONT_OPEN_FAILED = 0x80460036; +constexpr int ORBIS_FONT_ERROR_FONT_CLOSE_FAILED = 0x80460037; +constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_TYPOGRAPHY = 0x80460040; +constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_CODE = 0x80460041; +constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_GLYPH = 0x80460042; +constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_SCRIPT = 0x80460043; +constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_LANGUAGE = 0x80460044; +constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_SURFACE = 0x80460050; +constexpr int ORBIS_FONT_ERROR_UNSET_PARAMETER = 0x80460058; +constexpr int ORBIS_FONT_ERROR_FUNCTIONAL_LIMIT = 0x8046005C; +constexpr int ORBIS_FONT_ERROR_ALREADY_BOUND_RENDERER = 0x80460060; +constexpr int ORBIS_FONT_ERROR_NOT_BOUND_RENDERER = 0x80460061; +constexpr int ORBIS_FONT_ERROR_RENDERER_ALLOCATION_FAILED = 0x80460063; +constexpr int ORBIS_FONT_ERROR_RENDERER_ALLOCATION_LIMITED = 0x80460064; +constexpr int ORBIS_FONT_ERROR_RENDERER_RENDER_FAILED = 0x80460065; diff --git a/src/core/libraries/font/fontft.cpp b/src/core/libraries/font/fontft.cpp new file mode 100644 index 000000000..4a1dbb989 --- /dev/null +++ b/src/core/libraries/font/fontft.cpp @@ -0,0 +1,140 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "common/logging/log.h" +#include "core/libraries/error_codes.h" +#include "core/libraries/font/fontft.h" +#include "core/libraries/libs.h" + +namespace Libraries::FontFt { + +s32 PS4_SYSV_ABI sceFontFtInitAliases() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSetAliasFont() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSetAliasPath() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportBdf() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportCid() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportFontFormats() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportOpenType() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportOpenTypeOtf() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportOpenTypeTtf() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportPcf() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportPfr() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportSystemFonts() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportTrueType() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportTrueTypeGx() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportType1() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportType42() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtSupportWinFonts() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontFtTermAliases() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSelectGlyphsFt() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSelectLibraryFt() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +s32 PS4_SYSV_ABI sceFontSelectRendererFt() { + LOG_ERROR(Lib_FontFt, "(STUBBED) called"); + return ORBIS_OK; +} + +void RegisterlibSceFontFt(Core::Loader::SymbolsResolver* sym) { + LIB_FUNCTION("e60aorDdpB8", "libSceFontFt", 1, "libSceFontFt", sceFontFtInitAliases); + LIB_FUNCTION("BxcmiMc3UaA", "libSceFontFt", 1, "libSceFontFt", sceFontFtSetAliasFont); + LIB_FUNCTION("MEWjebIzDEI", "libSceFontFt", 1, "libSceFontFt", sceFontFtSetAliasPath); + LIB_FUNCTION("ZcQL0iSjvFw", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportBdf); + LIB_FUNCTION("LADHEyFTxRQ", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportCid); + LIB_FUNCTION("+jqQjsancTs", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportFontFormats); + LIB_FUNCTION("oakL15-mBtc", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportOpenType); + LIB_FUNCTION("dcQeaDr8UJc", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportOpenTypeOtf); + LIB_FUNCTION("2KXS-HkZT3c", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportOpenTypeTtf); + LIB_FUNCTION("H0mJnhKwV-s", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportPcf); + LIB_FUNCTION("S2mw3sYplAI", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportPfr); + LIB_FUNCTION("+ehNXJPUyhk", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportSystemFonts); + LIB_FUNCTION("4BAhDLdrzUI", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportTrueType); + LIB_FUNCTION("Utlzbdf+g9o", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportTrueTypeGx); + LIB_FUNCTION("nAfQ6qaL1fU", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportType1); + LIB_FUNCTION("X9+pzrGtBus", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportType42); + LIB_FUNCTION("w0hI3xsK-hc", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportWinFonts); + LIB_FUNCTION("w5sfH9r8ZJ4", "libSceFontFt", 1, "libSceFontFt", sceFontFtTermAliases); + LIB_FUNCTION("ojW+VKl4Ehs", "libSceFontFt", 1, "libSceFontFt", sceFontSelectGlyphsFt); + LIB_FUNCTION("oM+XCzVG3oM", "libSceFontFt", 1, "libSceFontFt", sceFontSelectLibraryFt); + LIB_FUNCTION("Xx974EW-QFY", "libSceFontFt", 1, "libSceFontFt", sceFontSelectRendererFt); +}; + +} // namespace Libraries::FontFt \ No newline at end of file diff --git a/src/core/libraries/font/fontft.h b/src/core/libraries/font/fontft.h new file mode 100644 index 000000000..cec6d7872 --- /dev/null +++ b/src/core/libraries/font/fontft.h @@ -0,0 +1,37 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "common/types.h" + +namespace Core::Loader { +class SymbolsResolver; +} + +namespace Libraries::FontFt { + +s32 PS4_SYSV_ABI sceFontFtInitAliases(); +s32 PS4_SYSV_ABI sceFontFtSetAliasFont(); +s32 PS4_SYSV_ABI sceFontFtSetAliasPath(); +s32 PS4_SYSV_ABI sceFontFtSupportBdf(); +s32 PS4_SYSV_ABI sceFontFtSupportCid(); +s32 PS4_SYSV_ABI sceFontFtSupportFontFormats(); +s32 PS4_SYSV_ABI sceFontFtSupportOpenType(); +s32 PS4_SYSV_ABI sceFontFtSupportOpenTypeOtf(); +s32 PS4_SYSV_ABI sceFontFtSupportOpenTypeTtf(); +s32 PS4_SYSV_ABI sceFontFtSupportPcf(); +s32 PS4_SYSV_ABI sceFontFtSupportPfr(); +s32 PS4_SYSV_ABI sceFontFtSupportSystemFonts(); +s32 PS4_SYSV_ABI sceFontFtSupportTrueType(); +s32 PS4_SYSV_ABI sceFontFtSupportTrueTypeGx(); +s32 PS4_SYSV_ABI sceFontFtSupportType1(); +s32 PS4_SYSV_ABI sceFontFtSupportType42(); +s32 PS4_SYSV_ABI sceFontFtSupportWinFonts(); +s32 PS4_SYSV_ABI sceFontFtTermAliases(); +s32 PS4_SYSV_ABI sceFontSelectGlyphsFt(); +s32 PS4_SYSV_ABI sceFontSelectLibraryFt(); +s32 PS4_SYSV_ABI sceFontSelectRendererFt(); + +void RegisterlibSceFontFt(Core::Loader::SymbolsResolver* sym); +} // namespace Libraries::FontFt \ No newline at end of file diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index 6da85ece7..97ff253b2 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -465,11 +465,7 @@ s32 PS4_SYSV_ABI posix_rename(const char* from, const char* to) { auto* h = Common::Singleton::Instance(); auto file = h->GetFile(src_path); if (file) { - // We need to force ReadWrite if the file had Write access before - // Otherwise f.Open will clear the file contents. - auto access_mode = file->f.GetAccessMode() == Common::FS::FileAccessMode::Write - ? Common::FS::FileAccessMode::ReadWrite - : file->f.GetAccessMode(); + auto access_mode = file->f.GetAccessMode(); file->f.Close(); std::filesystem::remove(src_path); file->f.Open(dst_path, access_mode); diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index 63e82ce81..1ae48dfed 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -9,6 +9,35 @@ namespace Libraries::Http { +static bool g_isHttpInitialized = true; // TODO temp always inited + +void NormalizeAndAppendPath(char* dest, char* src) { + char* lastSlash; + u64 length; + + lastSlash = strrchr(dest, '/'); + if (lastSlash == NULL) { + length = strlen(dest); + dest[length] = '/'; + dest[length + 1] = '\0'; + } else { + lastSlash[1] = '\0'; + } + if (*src == '/') { + dest[0] = '\0'; + } + length = strnlen(dest, 0x3fff); + strncat(dest, src, 0x3fff - length); + return; +} + +int HttpRequestInternal_Acquire(HttpRequestInternal** outRequest, u32 requestId) { + return 0; // TODO dummy +} +int HttpRequestInternal_Release(HttpRequestInternal* request) { + return 0; // TODO dummy +} + int PS4_SYSV_ABI sceHttpAbortRequest() { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; @@ -34,8 +63,9 @@ int PS4_SYSV_ABI sceHttpAddQuery() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpAddRequestHeader() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); +int PS4_SYSV_ABI sceHttpAddRequestHeader(int id, const char* name, const char* value, s32 mode) { + LOG_ERROR(Lib_Http, "(STUBBED) called id= {} name = {} value = {} mode = {}", id, + std::string(name), std::string(value), mode); return ORBIS_OK; } @@ -84,8 +114,9 @@ int PS4_SYSV_ABI sceHttpCreateConnection() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpCreateConnectionWithURL() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); +int PS4_SYSV_ABI sceHttpCreateConnectionWithURL(int tmplId, const char* url, bool enableKeepalive) { + LOG_ERROR(Lib_Http, "(STUBBED) called tmpid = {} url = {} enableKeepalive = {}", tmplId, + std::string(url), enableKeepalive ? 1 : 0); return ORBIS_OK; } @@ -104,8 +135,10 @@ int PS4_SYSV_ABI sceHttpCreateRequest2() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpCreateRequestWithURL() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); +int PS4_SYSV_ABI sceHttpCreateRequestWithURL(int connId, s32 method, const char* url, + u64 contentLength) { + LOG_ERROR(Lib_Http, "(STUBBED) called connId = {} method = {} url={} contentLength={}", connId, + method, url, contentLength); return ORBIS_OK; } @@ -184,7 +217,7 @@ int PS4_SYSV_ABI sceHttpGetAcceptEncodingGZIPEnabled() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpGetAllResponseHeaders() { +int PS4_SYSV_ABI sceHttpGetAllResponseHeaders(int reqId, char** header, u64* headerSize) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_FAIL; } @@ -254,12 +287,42 @@ int PS4_SYSV_ABI sceHttpGetResponseContentLength() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpGetStatusCode() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); +int PS4_SYSV_ABI sceHttpGetStatusCode(int reqId, int* statusCode) { + LOG_ERROR(Lib_Http, "(STUBBED) called reqId = {}", reqId); +#if 0 + if (!g_isHttpInitialized) + return ORBIS_HTTP_ERROR_BEFORE_INIT; + + if (statusCode == nullptr) + return ORBIS_HTTP_ERROR_INVALID_VALUE; + + int ret = 0; + // Lookup HttpRequestInternal by reqId + HttpRequestInternal* request = nullptr; + ret = HttpRequestInternal_Acquire(&request, reqId); + if (ret < 0) + return ret; + request->m_mutex.lock(); + if (request->state > 0x11) { + if (request->state == 0x16) { + ret = request->errorCode; + } else { + *statusCode = request->httpStatusCode; + ret = 0; + } + } else { + ret = ORBIS_HTTP_ERROR_BEFORE_SEND; + } + request->m_mutex.unlock(); + HttpRequestInternal_Release(request); + + return ret; +#else return ORBIS_OK; +#endif } -int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::size_t poolSize) { +int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, u64 poolSize) { LOG_ERROR(Lib_Http, "(DUMMY) called libnetMemId = {} libsslCtxId = {} poolSize = {}", libnetMemId, libsslCtxId, poolSize); // return a value >1 @@ -267,14 +330,104 @@ int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::size_t poolS return ++id; } -int PS4_SYSV_ABI sceHttpParseResponseHeader() { +int PS4_SYSV_ABI sceHttpParseResponseHeader(const char* header, u64 headerLen, const char* fieldStr, + const char** fieldValue, u64* valueLen) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpParseStatusLine() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); - return ORBIS_OK; +int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, u64 lineLen, int32_t* httpMajorVer, + int32_t* httpMinorVer, int32_t* responseCode, + const char** reasonPhrase, u64* phraseLen) { + if (!statusLine) { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + if (!httpMajorVer || !httpMinorVer || !responseCode || !reasonPhrase || !phraseLen) { + LOG_ERROR(Lib_Http, "Invalid value"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_VALUE; + } + *httpMajorVer = 0; + *httpMinorVer = 0; + if (lineLen < 8) { + LOG_ERROR(Lib_Http, "Linelen is smaller than 8"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + if (strncmp(statusLine, "HTTP/", 5) != 0) { + LOG_ERROR(Lib_Http, "statusLine doesn't start with HTTP/"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + + u64 index = 5; + + if (!isdigit(statusLine[index])) { + LOG_ERROR(Lib_Http, "Invalid response"); + + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + + while (isdigit(statusLine[index])) { + *httpMajorVer = *httpMajorVer * 10 + (statusLine[index] - '0'); + index++; + } + + if (statusLine[index] != '.') { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + index++; + + if (!isdigit(statusLine[index])) { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + + while (isdigit(statusLine[index])) { + *httpMinorVer = *httpMinorVer * 10 + (statusLine[index] - '0'); + index++; + } + + if (statusLine[index] != ' ') { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + index++; + + // Validate and parse the 3-digit HTTP response code + if (lineLen - index < 3 || !isdigit(statusLine[index]) || !isdigit(statusLine[index + 1]) || + !isdigit(statusLine[index + 2])) { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + + *responseCode = (statusLine[index] - '0') * 100 + (statusLine[index + 1] - '0') * 10 + + (statusLine[index + 2] - '0'); + index += 3; + + if (statusLine[index] != ' ') { + LOG_ERROR(Lib_Http, "Invalid response"); + return ORBIS_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE; + } + index++; + + // Set the reason phrase start position + *reasonPhrase = &statusLine[index]; + u64 phraseStart = index; + + while (index < lineLen && statusLine[index] != '\n') { + index++; + } + + // Determine the length of the reason phrase, excluding trailing \r if present + if (index == phraseStart) { + *phraseLen = 0; + } else { + *phraseLen = + (statusLine[index - 1] == '\r') ? (index - phraseStart - 1) : (index - phraseStart); + } + + // Return the number of bytes processed + return index + 1; } int PS4_SYSV_ABI sceHttpReadData() { @@ -317,8 +470,8 @@ int PS4_SYSV_ABI sceHttpsEnableOptionPrivate() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpSendRequest() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); +int PS4_SYSV_ABI sceHttpSendRequest(int reqId, const void* postData, u64 size) { + LOG_ERROR(Lib_Http, "(STUBBED) called reqId = {} size = {}", reqId, size); return ORBIS_OK; } @@ -548,7 +701,8 @@ int PS4_SYSV_ABI sceHttpUnsetEpoll() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpUriBuild() { +int PS4_SYSV_ABI sceHttpUriBuild(char* out, u64* require, u64 prepare, + const OrbisHttpUriElement* srcElement, u32 option) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; } @@ -563,13 +717,97 @@ int PS4_SYSV_ABI sceHttpUriEscape() { return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpUriMerge() { - LOG_ERROR(Lib_Http, "(STUBBED) called"); - return ORBIS_OK; +int PS4_SYSV_ABI sceHttpUriMerge(char* mergedUrl, char* url, char* relativeUri, u64* require, + u64 prepare, u32 option) { + u64 requiredLength; + int returnValue; + u64 baseUrlLength; + u64 relativeUriLength; + u64 totalLength; + u64 combinedLength; + int parseResult; + u64 localSizeRelativeUri; + u64 localSizeBaseUrl; + OrbisHttpUriElement parsedUriElement; + + if (option != 0 || url == NULL || relativeUri == NULL) { + LOG_ERROR(Lib_Http, "Invalid value"); + return ORBIS_HTTP_ERROR_INVALID_VALUE; + } + + returnValue = sceHttpUriParse(NULL, url, NULL, &localSizeBaseUrl, 0); + if (returnValue < 0) { + LOG_ERROR(Lib_Http, "returning {:#x}", returnValue); + return returnValue; + } + + returnValue = sceHttpUriParse(NULL, relativeUri, NULL, &localSizeRelativeUri, 0); + if (returnValue < 0) { + LOG_ERROR(Lib_Http, "returning {:#x}", returnValue); + return returnValue; + } + + baseUrlLength = strnlen(url, 0x3fff); + relativeUriLength = strnlen(relativeUri, 0x3fff); + requiredLength = localSizeBaseUrl + 2 + (relativeUriLength + baseUrlLength) * 2; + + if (require) { + *require = requiredLength; + } + + if (mergedUrl == NULL) { + return ORBIS_OK; + } + + if (prepare < requiredLength) { + LOG_ERROR(Lib_Http, "Error Out of memory"); + return ORBIS_HTTP_ERROR_OUT_OF_MEMORY; + } + + totalLength = strnlen(url, 0x3fff); + baseUrlLength = strnlen(relativeUri, 0x3fff); + combinedLength = totalLength + 1 + baseUrlLength; + relativeUriLength = prepare - combinedLength; + + returnValue = + sceHttpUriParse(&parsedUriElement, relativeUri, mergedUrl + totalLength + baseUrlLength + 1, + &localSizeRelativeUri, relativeUriLength); + if (returnValue < 0) { + LOG_ERROR(Lib_Http, "returning {:#x}", returnValue); + return returnValue; + } + if (parsedUriElement.scheme == NULL) { + strncpy(mergedUrl, relativeUri, requiredLength); + if (require) { + *require = strnlen(relativeUri, 0x3fff) + 1; + } + return ORBIS_OK; + } + + returnValue = + sceHttpUriParse(&parsedUriElement, url, mergedUrl + totalLength + baseUrlLength + 1, + &localSizeBaseUrl, relativeUriLength); + if (returnValue < 0) { + LOG_ERROR(Lib_Http, "returning {:#x}", returnValue); + return returnValue; + } + + combinedLength += localSizeBaseUrl; + strncpy(mergedUrl + combinedLength, parsedUriElement.path, prepare - combinedLength); + NormalizeAndAppendPath(mergedUrl + combinedLength, relativeUri); + + returnValue = sceHttpUriBuild(mergedUrl, 0, ~(baseUrlLength + totalLength) + prepare, + &parsedUriElement, 0x3f); + if (returnValue >= 0) { + return ORBIS_OK; + } else { + LOG_ERROR(Lib_Http, "returning {:#x}", returnValue); + return returnValue; + } } int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, void* pool, - size_t* require, size_t prepare) { + u64* require, u64 prepare) { LOG_INFO(Lib_Http, "srcUri = {}", std::string(srcUri)); if (!srcUri) { LOG_ERROR(Lib_Http, "invalid url"); @@ -586,10 +824,10 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v } // Track the total required buffer size - size_t requiredSize = 0; + u64 requiredSize = 0; // Parse the scheme (e.g., "http:", "https:", "file:") - size_t schemeLength = 0; + u64 schemeLength = 0; while (srcUri[schemeLength] && srcUri[schemeLength] != ':') { if (!isalnum(srcUri[schemeLength])) { LOG_ERROR(Lib_Http, "invalid url"); @@ -611,7 +849,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v requiredSize += schemeLength + 1; // Move past the scheme and ':' character - size_t offset = schemeLength + 1; + u64 offset = schemeLength + 1; // Check if "//" appears after the scheme if (strncmp(srcUri + offset, "//", 2) == 0) { @@ -638,7 +876,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v // Parse the path (everything after the slashes) char* pathStart = (char*)srcUri + offset; - size_t pathLength = 0; + u64 pathLength = 0; while (pathStart[pathLength] && pathStart[pathLength] != '?' && pathStart[pathLength] != '#') { pathLength++; @@ -689,7 +927,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v hostStart++; } - size_t hostLength = 0; + u64 hostLength = 0; while (hostStart[hostLength] && hostStart[hostLength] != '/' && hostStart[hostLength] != '?' && hostStart[hostLength] != ':') { hostLength++; @@ -714,7 +952,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v // Parse the port (if present) if (hostStart[hostLength] == ':') { char* portStart = hostStart + hostLength + 1; - size_t portLength = 0; + u64 portLength = 0; while (portStart[portLength] && isdigit(portStart[portLength])) { portLength++; } @@ -754,7 +992,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v // Parse the path (if present) if (srcUri[offset] == '/') { char* pathStart = (char*)srcUri + offset; - size_t pathLength = 0; + u64 pathLength = 0; while (pathStart[pathLength] && pathStart[pathLength] != '?' && pathStart[pathLength] != '#') { pathLength++; @@ -780,7 +1018,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v // Parse the query (if present) if (srcUri[offset] == '?') { char* queryStart = (char*)srcUri + offset + 1; - size_t queryLength = 0; + u64 queryLength = 0; while (queryStart[queryLength] && queryStart[queryLength] != '#') { queryLength++; } @@ -805,7 +1043,7 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v // Parse the fragment (if present) if (srcUri[offset] == '#') { char* fragmentStart = (char*)srcUri + offset + 1; - size_t fragmentLength = 0; + u64 fragmentLength = 0; while (fragmentStart[fragmentLength]) { fragmentLength++; } @@ -833,12 +1071,12 @@ int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, v return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, size_t srcSize) { +int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, u64 srcSize) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; } -int PS4_SYSV_ABI sceHttpUriUnescape(char* out, size_t* require, size_t prepare, const char* in) { +int PS4_SYSV_ABI sceHttpUriUnescape(char* out, u64* require, u64 prepare, const char* in) { LOG_ERROR(Lib_Http, "(STUBBED) called"); return ORBIS_OK; } diff --git a/src/core/libraries/network/http.h b/src/core/libraries/network/http.h index 228080207..701bb0e05 100644 --- a/src/core/libraries/network/http.h +++ b/src/core/libraries/network/http.h @@ -3,6 +3,7 @@ #pragma once +#include #include "common/types.h" #include "core/libraries/network/ssl.h" @@ -25,6 +26,12 @@ struct OrbisHttpUriElement { u8 reserved[10]; }; +struct HttpRequestInternal { + int state; // +0x20 + int errorCode; // +0x28 + int httpStatusCode; // +0x20C + std::mutex m_mutex; +}; using OrbisHttpsCaList = Libraries::Ssl::OrbisSslCaList; int PS4_SYSV_ABI sceHttpAbortRequest(); @@ -32,7 +39,7 @@ int PS4_SYSV_ABI sceHttpAbortRequestForce(); int PS4_SYSV_ABI sceHttpAbortWaitRequest(); int PS4_SYSV_ABI sceHttpAddCookie(); int PS4_SYSV_ABI sceHttpAddQuery(); -int PS4_SYSV_ABI sceHttpAddRequestHeader(); +int PS4_SYSV_ABI sceHttpAddRequestHeader(int id, const char* name, const char* value, s32 mode); int PS4_SYSV_ABI sceHttpAddRequestHeaderRaw(); int PS4_SYSV_ABI sceHttpAuthCacheExport(); int PS4_SYSV_ABI sceHttpAuthCacheFlush(); @@ -42,11 +49,12 @@ int PS4_SYSV_ABI sceHttpCookieExport(); int PS4_SYSV_ABI sceHttpCookieFlush(); int PS4_SYSV_ABI sceHttpCookieImport(); int PS4_SYSV_ABI sceHttpCreateConnection(); -int PS4_SYSV_ABI sceHttpCreateConnectionWithURL(); +int PS4_SYSV_ABI sceHttpCreateConnectionWithURL(int tmplId, const char* url, bool enableKeepalive); int PS4_SYSV_ABI sceHttpCreateEpoll(); int PS4_SYSV_ABI sceHttpCreateRequest(); int PS4_SYSV_ABI sceHttpCreateRequest2(); -int PS4_SYSV_ABI sceHttpCreateRequestWithURL(); +int PS4_SYSV_ABI sceHttpCreateRequestWithURL(int connId, s32 method, const char* url, + u64 contentLength); int PS4_SYSV_ABI sceHttpCreateRequestWithURL2(); int PS4_SYSV_ABI sceHttpCreateTemplate(); int PS4_SYSV_ABI sceHttpDbgEnableProfile(); @@ -62,7 +70,7 @@ int PS4_SYSV_ABI sceHttpDeleteRequest(); int PS4_SYSV_ABI sceHttpDeleteTemplate(); int PS4_SYSV_ABI sceHttpDestroyEpoll(); int PS4_SYSV_ABI sceHttpGetAcceptEncodingGZIPEnabled(); -int PS4_SYSV_ABI sceHttpGetAllResponseHeaders(); +int PS4_SYSV_ABI sceHttpGetAllResponseHeaders(int reqId, char** header, u64* headerSize); int PS4_SYSV_ABI sceHttpGetAuthEnabled(); int PS4_SYSV_ABI sceHttpGetAutoRedirect(); int PS4_SYSV_ABI sceHttpGetConnectionStat(); @@ -76,10 +84,13 @@ int PS4_SYSV_ABI sceHttpGetMemoryPoolStats(); int PS4_SYSV_ABI sceHttpGetNonblock(); int PS4_SYSV_ABI sceHttpGetRegisteredCtxIds(); int PS4_SYSV_ABI sceHttpGetResponseContentLength(); -int PS4_SYSV_ABI sceHttpGetStatusCode(); -int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, std::size_t poolSize); -int PS4_SYSV_ABI sceHttpParseResponseHeader(); -int PS4_SYSV_ABI sceHttpParseStatusLine(); +int PS4_SYSV_ABI sceHttpGetStatusCode(int reqId, int* statusCode); +int PS4_SYSV_ABI sceHttpInit(int libnetMemId, int libsslCtxId, u64 poolSize); +int PS4_SYSV_ABI sceHttpParseResponseHeader(const char* header, u64 headerLen, const char* fieldStr, + const char** fieldValue, u64* valueLen); +int PS4_SYSV_ABI sceHttpParseStatusLine(const char* statusLine, u64 lineLen, int32_t* httpMajorVer, + int32_t* httpMinorVer, int32_t* responseCode, + const char** reasonPhrase, u64* phraseLen); int PS4_SYSV_ABI sceHttpReadData(); int PS4_SYSV_ABI sceHttpRedirectCacheFlush(); int PS4_SYSV_ABI sceHttpRemoveRequestHeader(); @@ -88,7 +99,7 @@ int PS4_SYSV_ABI sceHttpsDisableOption(); int PS4_SYSV_ABI sceHttpsDisableOptionPrivate(); int PS4_SYSV_ABI sceHttpsEnableOption(); int PS4_SYSV_ABI sceHttpsEnableOptionPrivate(); -int PS4_SYSV_ABI sceHttpSendRequest(); +int PS4_SYSV_ABI sceHttpSendRequest(int reqId, const void* postData, u64 size); int PS4_SYSV_ABI sceHttpSetAcceptEncodingGZIPEnabled(); int PS4_SYSV_ABI sceHttpSetAuthEnabled(); int PS4_SYSV_ABI sceHttpSetAuthInfoCallback(); @@ -134,14 +145,16 @@ int PS4_SYSV_ABI sceHttpTerm(); int PS4_SYSV_ABI sceHttpTryGetNonblock(); int PS4_SYSV_ABI sceHttpTrySetNonblock(); int PS4_SYSV_ABI sceHttpUnsetEpoll(); -int PS4_SYSV_ABI sceHttpUriBuild(); +int PS4_SYSV_ABI sceHttpUriBuild(char* out, u64* require, u64 prepare, + const OrbisHttpUriElement* srcElement, u32 option); int PS4_SYSV_ABI sceHttpUriCopy(); int PS4_SYSV_ABI sceHttpUriEscape(); -int PS4_SYSV_ABI sceHttpUriMerge(); +int PS4_SYSV_ABI sceHttpUriMerge(char* mergedUrl, char* url, char* relativeUri, u64* require, + u64 prepare, u32 option); int PS4_SYSV_ABI sceHttpUriParse(OrbisHttpUriElement* out, const char* srcUri, void* pool, - size_t* require, size_t prepare); -int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, size_t srcSize); -int PS4_SYSV_ABI sceHttpUriUnescape(char* out, size_t* require, size_t prepare, const char* in); + u64* require, u64 prepare); +int PS4_SYSV_ABI sceHttpUriSweepPath(char* dst, const char* src, u64 srcSize); +int PS4_SYSV_ABI sceHttpUriUnescape(char* out, u64* require, u64 prepare, const char* in); int PS4_SYSV_ABI sceHttpWaitRequest(); void RegisterLib(Core::Loader::SymbolsResolver* sym); diff --git a/src/core/libraries/network/net.cpp b/src/core/libraries/network/net.cpp index d9ef76afc..97005813b 100644 --- a/src/core/libraries/network/net.cpp +++ b/src/core/libraries/network/net.cpp @@ -1285,7 +1285,8 @@ u16 PS4_SYSV_ABI sceNetNtohs(u16 net16) { int PS4_SYSV_ABI sceNetPoolCreate(const char* name, int size, int flags) { LOG_ERROR(Lib_Net, "(DUMMY) name = {} size = {} flags = {} ", std::string(name), size, flags); - return ORBIS_OK; + static s32 id = 1; + return id++; } int PS4_SYSV_ABI sceNetPoolDestroy() { diff --git a/src/core/libraries/save_data/save_instance.cpp b/src/core/libraries/save_data/save_instance.cpp index 6050486ef..c3c2fc3c0 100644 --- a/src/core/libraries/save_data/save_instance.cpp +++ b/src/core/libraries/save_data/save_instance.cpp @@ -185,7 +185,7 @@ void SaveInstance::SetupAndMount(bool read_only, bool copy_icon, bool ignore_cor } if (!ignore_corrupt && !read_only) { - Common::FS::IOFile f(corrupt_file_path, Common::FS::FileAccessMode::Write); + Common::FS::IOFile f(corrupt_file_path, Common::FS::FileAccessMode::Create); f.Close(); } diff --git a/src/core/libraries/save_data/save_memory.cpp b/src/core/libraries/save_data/save_memory.cpp index 278300d0d..8862cb1e1 100644 --- a/src/core/libraries/save_data/save_memory.cpp +++ b/src/core/libraries/save_data/save_memory.cpp @@ -58,7 +58,7 @@ void PersistMemory(u32 slot_id, bool lock) { while (n++ < 10) { try { IOFile f; - int r = f.Open(memoryPath, Common::FS::FileAccessMode::Write); + int r = f.Open(memoryPath, Common::FS::FileAccessMode::Create); if (f.IsOpen()) { f.WriteRaw(data.memory_cache.data(), data.memory_cache.size()); f.Close(); @@ -150,7 +150,7 @@ void SetIcon(u32 slot_id, void* buf, size_t buf_size) { fs::copy_file(src_icon, icon_path); } } else { - int fd = qfs->Operation.Open(icon_path, QUASI_O_WRONLY | QUASI_O_TRUNC); + int fd = qfs->Operation.Creat(icon_path); qfs->Operation.Write(fd, buf, buf_size); qfs->Operation.Close(fd); } diff --git a/src/core/libraries/save_data/savedata.cpp b/src/core/libraries/save_data/savedata.cpp index aec7c1d54..7fba8ed21 100644 --- a/src/core/libraries/save_data/savedata.cpp +++ b/src/core/libraries/save_data/savedata.cpp @@ -1389,7 +1389,7 @@ Error PS4_SYSV_ABI sceSaveDataSaveIcon(const OrbisSaveDataMountPoint* mountPoint } try { - const Common::FS::IOFile file(path, Common::FS::FileAccessMode::Write); + const Common::FS::IOFile file(path, Common::FS::FileAccessMode::Create); file.WriteRaw(icon->buf, std::min(icon->bufSize, icon->dataSize)); } catch (const fs::filesystem_error& e) { LOG_ERROR(Lib_SaveData, "Failed to load icon: {}", e.what()); diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 4de20436f..ed3f43c1c 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -502,19 +502,19 @@ bool Elf::IsSharedLib() { } void Elf::ElfHeaderDebugDump(const std::filesystem::path& file_name) { - Common::FS::IOFile f{file_name, Common::FS::FileAccessMode::Write, + Common::FS::IOFile f{file_name, Common::FS::FileAccessMode::Create, Common::FS::FileType::TextFile}; f.WriteString(ElfHeaderStr()); } void Elf::SelfHeaderDebugDump(const std::filesystem::path& file_name) { - Common::FS::IOFile f{file_name, Common::FS::FileAccessMode::Write, + Common::FS::IOFile f{file_name, Common::FS::FileAccessMode::Create, Common::FS::FileType::TextFile}; f.WriteString(SElfHeaderStr()); } void Elf::SelfSegHeaderDebugDump(const std::filesystem::path& file_name) { - Common::FS::IOFile f{file_name, Common::FS::FileAccessMode::Write, + Common::FS::IOFile f{file_name, Common::FS::FileAccessMode::Create, Common::FS::FileType::TextFile}; for (u16 i = 0; i < m_self.segment_count; i++) { f.WriteString(SELFSegHeader(i)); @@ -522,7 +522,7 @@ void Elf::SelfSegHeaderDebugDump(const std::filesystem::path& file_name) { } void Elf::PHeaderDebugDump(const std::filesystem::path& file_name) { - Common::FS::IOFile f{file_name, Common::FS::FileAccessMode::Write, + Common::FS::IOFile f{file_name, Common::FS::FileAccessMode::Create, Common::FS::FileType::TextFile}; if (m_elf_header.e_phentsize > 0) { for (u16 i = 0; i < m_elf_header.e_phnum; i++) { diff --git a/src/core/loader/symbols_resolver.cpp b/src/core/loader/symbols_resolver.cpp index 09c7fae8a..9fef1a2a2 100644 --- a/src/core/loader/symbols_resolver.cpp +++ b/src/core/loader/symbols_resolver.cpp @@ -32,7 +32,7 @@ const SymbolRecord* SymbolsResolver::FindSymbol(const SymbolResolver& s) const { } void SymbolsResolver::DebugDump(const std::filesystem::path& file_name) { - Common::FS::IOFile f{file_name, Common::FS::FileAccessMode::Write, + Common::FS::IOFile f{file_name, Common::FS::FileAccessMode::Create, Common::FS::FileType::TextFile}; for (const auto& symbol : m_symbols) { const auto ids = Common::SplitString(symbol.name, '#'); diff --git a/src/emulator.cpp b/src/emulator.cpp index f3903ee72..a73e6c9fd 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -31,6 +31,8 @@ #include "core/file_format/trp.h" #include "core/file_sys/fs.h" #include "core/libraries/disc_map/disc_map.h" +#include "core/libraries/font/font.h" +#include "core/libraries/font/fontft.h" #include "core/libraries/libc_internal/libc_internal.h" #include "core/libraries/libs.h" #include "core/libraries/ngs2/ngs2.h" @@ -621,8 +623,8 @@ void Emulator::LoadSystemModules(const std::string& game_serial) { {"libSceJson2.sprx", nullptr}, {"libSceLibcInternal.sprx", &Libraries::LibcInternal::RegisterLib}, {"libSceCesCs.sprx", nullptr}, - {"libSceFont.sprx", nullptr}, - {"libSceFontFt.sprx", nullptr}, + {"libSceFont.sprx", &Libraries::Font::RegisterlibSceFont}, + {"libSceFontFt.sprx", &Libraries::FontFt::RegisterlibSceFontFt}, {"libSceFreeTypeOt.sprx", nullptr}}); std::vector found_modules; diff --git a/src/shader_recompiler/frontend/translate/translate.cpp b/src/shader_recompiler/frontend/translate/translate.cpp index 668882254..57b50a3e1 100644 --- a/src/shader_recompiler/frontend/translate/translate.cpp +++ b/src/shader_recompiler/frontend/translate/translate.cpp @@ -559,7 +559,7 @@ void Translator::EmitFetch(const GcnInst& inst) { std::filesystem::create_directories(dump_dir); } const auto filename = fmt::format("vs_{:#018x}.fetch.bin", info.pgm_hash); - const auto file = IOFile{dump_dir / filename, FileAccessMode::Write}; + const auto file = IOFile{dump_dir / filename, FileAccessMode::Create}; file.WriteRaw(fetch_data->code, fetch_data->size); } diff --git a/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp b/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp index 1d3b46b43..7626b9c9f 100644 --- a/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp +++ b/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp @@ -39,7 +39,7 @@ static void DumpSrtProgram(const Shader::Info& info, const u8* code, size_t code std::filesystem::create_directories(dump_dir); } const auto filename = fmt::format("{}_{:#018x}.srtprogram.txt", info.stage, info.pgm_hash); - const auto file = IOFile{dump_dir / filename, FileAccessMode::Write, FileType::TextFile}; + const auto file = IOFile{dump_dir / filename, FileAccessMode::Create, FileType::TextFile}; u64 address = reinterpret_cast(code); u64 code_end = address + codesize; diff --git a/src/shader_recompiler/ir/program.cpp b/src/shader_recompiler/ir/program.cpp index f2f6e34fa..1d03ea9ab 100644 --- a/src/shader_recompiler/ir/program.cpp +++ b/src/shader_recompiler/ir/program.cpp @@ -28,7 +28,7 @@ void DumpProgram(const Program& program, const Info& info, const std::string& ty } const auto ir_filename = fmt::format("{}_{:#018x}.{}irprogram.txt", info.stage, info.pgm_hash, type); - const auto ir_file = IOFile{dump_dir / ir_filename, FileAccessMode::Write, FileType::TextFile}; + const auto ir_file = IOFile{dump_dir / ir_filename, FileAccessMode::Create, FileType::TextFile}; size_t index{0}; std::map inst_to_index; @@ -46,7 +46,7 @@ void DumpProgram(const Program& program, const Info& info, const std::string& ty const auto asl_filename = fmt::format("{}_{:#018x}.{}asl.txt", info.stage, info.pgm_hash, type); const auto asl_file = - IOFile{dump_dir / asl_filename, FileAccessMode::Write, FileType::TextFile}; + IOFile{dump_dir / asl_filename, FileAccessMode::Create, FileType::TextFile}; for (const auto& node : program.syntax_list) { std::string s = IR::DumpASLNode(node, block_to_index, inst_to_index) + '\n'; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index fc9954951..5cd37f335 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -632,7 +632,7 @@ void PipelineCache::DumpShader(std::span code, u64 hash, Shader::Stag std::filesystem::create_directories(dump_dir); } const auto filename = fmt::format("{}.{}", GetShaderName(stage, hash, perm_idx), ext); - const auto file = IOFile{dump_dir / filename, FileAccessMode::Write}; + const auto file = IOFile{dump_dir / filename, FileAccessMode::Create}; file.WriteSpan(code); }