Merge branch 'main' into fontlib

This commit is contained in:
georgemoralis 2025-04-30 12:44:00 +03:00 committed by GitHub
commit fb6de34027
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 75 additions and 45 deletions

View File

@ -169,7 +169,8 @@ void OnGameLoaded() {
if (type == "mask_jump32") if (type == "mask_jump32")
patchMask = MemoryPatcher::PatchMask::Mask_Jump32; patchMask = MemoryPatcher::PatchMask::Mask_Jump32;
if (type == "mask" || type == "mask_jump32" && !maskOffsetStr.empty()) { if ((type == "mask" || type == "mask_jump32") &&
!maskOffsetStr.empty()) {
maskOffsetValue = std::stoi(maskOffsetStr, 0, 10); maskOffsetValue = std::stoi(maskOffsetStr, 0, 10);
} }

View File

@ -40,6 +40,10 @@ public:
return ORBIS_KERNEL_ERROR_EBADF; return ORBIS_KERNEL_ERROR_EBADF;
} }
virtual size_t pwritev(const Libraries::Kernel::SceKernelIovec* iov, int iovcnt, u64 offset) {
return ORBIS_KERNEL_ERROR_EBADF;
}
virtual s64 lseek(s64 offset, int whence) { virtual s64 lseek(s64 offset, int whence) {
return ORBIS_KERNEL_ERROR_EBADF; return ORBIS_KERNEL_ERROR_EBADF;
} }

View File

@ -877,7 +877,7 @@ s32 PS4_SYSV_ABI sceKernelGetdirentries(s32 fd, char* buf, s32 nbytes, s64* base
return result; return result;
} }
s64 PS4_SYSV_ABI posix_pwrite(s32 fd, void* buf, size_t nbytes, s64 offset) { s64 PS4_SYSV_ABI posix_pwritev(s32 fd, const SceKernelIovec* iov, s32 iovcnt, s64 offset) {
if (offset < 0) { if (offset < 0) {
*__Error() = POSIX_EINVAL; *__Error() = POSIX_EINVAL;
return -1; return -1;
@ -893,7 +893,7 @@ s64 PS4_SYSV_ABI posix_pwrite(s32 fd, void* buf, size_t nbytes, s64 offset) {
std::scoped_lock lk{file->m_mutex}; std::scoped_lock lk{file->m_mutex};
if (file->type == Core::FileSys::FileType::Device) { if (file->type == Core::FileSys::FileType::Device) {
s64 result = file->device->pwrite(buf, nbytes, offset); s64 result = file->device->pwritev(iov, iovcnt, offset);
if (result < 0) { if (result < 0) {
ErrSceToPosix(result); ErrSceToPosix(result);
return -1; return -1;
@ -908,7 +908,16 @@ s64 PS4_SYSV_ABI posix_pwrite(s32 fd, void* buf, size_t nbytes, s64 offset) {
*__Error() = POSIX_EIO; *__Error() = POSIX_EIO;
return -1; return -1;
} }
return file->f.WriteRaw<u8>(buf, nbytes); size_t total_written = 0;
for (int i = 0; i < iovcnt; i++) {
total_written += file->f.WriteRaw<u8>(iov[i].iov_base, iov[i].iov_len);
}
return total_written;
}
s64 PS4_SYSV_ABI posix_pwrite(s32 fd, void* buf, size_t nbytes, s64 offset) {
SceKernelIovec iovec{buf, nbytes};
return posix_pwritev(fd, &iovec, 1, offset);
} }
s64 PS4_SYSV_ABI sceKernelPwrite(s32 fd, void* buf, size_t nbytes, s64 offset) { s64 PS4_SYSV_ABI sceKernelPwrite(s32 fd, void* buf, size_t nbytes, s64 offset) {
@ -920,6 +929,15 @@ s64 PS4_SYSV_ABI sceKernelPwrite(s32 fd, void* buf, size_t nbytes, s64 offset) {
return result; return result;
} }
s64 PS4_SYSV_ABI sceKernelPwritev(s32 fd, const SceKernelIovec* iov, s32 iovcnt, s64 offset) {
s64 result = posix_pwritev(fd, iov, iovcnt, offset);
if (result < 0) {
LOG_ERROR(Kernel_Fs, "error = {}", *__Error());
return ErrnoToSceKernelError(*__Error());
}
return result;
}
s32 PS4_SYSV_ABI posix_unlink(const char* path) { s32 PS4_SYSV_ABI posix_unlink(const char* path) {
if (path == nullptr) { if (path == nullptr) {
*__Error() = POSIX_EINVAL; *__Error() = POSIX_EINVAL;
@ -1017,7 +1035,10 @@ void RegisterFileSystem(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("sfKygSjIbI8", "libkernel", 1, "libkernel", 1, 1, getdirentries); LIB_FUNCTION("sfKygSjIbI8", "libkernel", 1, "libkernel", 1, 1, getdirentries);
LIB_FUNCTION("taRWhTJFTgE", "libkernel", 1, "libkernel", 1, 1, sceKernelGetdirentries); LIB_FUNCTION("taRWhTJFTgE", "libkernel", 1, "libkernel", 1, 1, sceKernelGetdirentries);
LIB_FUNCTION("C2kJ-byS5rM", "libkernel", 1, "libkernel", 1, 1, posix_pwrite); LIB_FUNCTION("C2kJ-byS5rM", "libkernel", 1, "libkernel", 1, 1, posix_pwrite);
LIB_FUNCTION("FCcmRZhWtOk", "libScePosix", 1, "libkernel", 1, 1, posix_pwritev);
LIB_FUNCTION("FCcmRZhWtOk", "libkernel", 1, "libkernel", 1, 1, posix_pwritev);
LIB_FUNCTION("nKWi-N2HBV4", "libkernel", 1, "libkernel", 1, 1, sceKernelPwrite); LIB_FUNCTION("nKWi-N2HBV4", "libkernel", 1, "libkernel", 1, 1, sceKernelPwrite);
LIB_FUNCTION("mBd4AfLP+u8", "libkernel", 1, "libkernel", 1, 1, sceKernelPwritev);
LIB_FUNCTION("AUXVxWeJU-A", "libkernel", 1, "libkernel", 1, 1, sceKernelUnlink); LIB_FUNCTION("AUXVxWeJU-A", "libkernel", 1, "libkernel", 1, 1, sceKernelUnlink);
} }

View File

@ -1387,7 +1387,7 @@ void CheatsPatches::applyPatch(const QString& patchName, bool enabled) {
if (type == "mask_jump32") if (type == "mask_jump32")
patchMask = MemoryPatcher::PatchMask::Mask_Jump32; patchMask = MemoryPatcher::PatchMask::Mask_Jump32;
if (type == "mask" || type == "mask_jump32" && !maskOffsetStr.toStdString().empty()) { if ((type == "mask" || type == "mask_jump32") && !maskOffsetStr.toStdString().empty()) {
maskOffsetValue = std::stoi(maskOffsetStr.toStdString(), 0, 10); maskOffsetValue = std::stoi(maskOffsetStr.toStdString(), 0, 10);
} }

View File

@ -384,23 +384,23 @@
</message> </message>
<message> <message>
<source>Nothing</source> <source>Nothing</source>
<translation>Không có </translation> <translation>Không chạy đưc</translation>
</message> </message>
<message> <message>
<source>Boots</source> <source>Boots</source>
<translation>Giày ng</translation> <translation>Chạy đưc</translation>
</message> </message>
<message> <message>
<source>Menus</source> <source>Menus</source>
<translation>Menu</translation> <translation>Vào đưc menu</translation>
</message> </message>
<message> <message>
<source>Ingame</source> <source>Ingame</source>
<translation>Trong game</translation> <translation>Vào đưc trò chơi</translation>
</message> </message>
<message> <message>
<source>Playable</source> <source>Playable</source>
<translation>Có thể chơi</translation> <translation>Chơi đưc</translation>
</message> </message>
</context> </context>
<context> <context>
@ -411,7 +411,7 @@
</message> </message>
<message> <message>
<source>D-Pad</source> <source>D-Pad</source>
<translation type="unfinished">D-Pad</translation> <translation>D-Pad</translation>
</message> </message>
<message> <message>
<source>Up</source> <source>Up</source>
@ -447,7 +447,7 @@
</message> </message>
<message> <message>
<source>Common Config</source> <source>Common Config</source>
<translation type="unfinished">Common Config</translation> <translation>Cài Đt Chung</translation>
</message> </message>
<message> <message>
<source>Use per-game configs</source> <source>Use per-game configs</source>
@ -551,26 +551,26 @@
</message> </message>
<message> <message>
<source>Save</source> <source>Save</source>
<translation type="unfinished">Save</translation> <translation>Lưu</translation>
</message> </message>
<message> <message>
<source>Apply</source> <source>Apply</source>
<translation type="unfinished">Apply</translation> <translation>Áp dụng</translation>
</message> </message>
<message> <message>
<source>Restore Defaults</source> <source>Restore Defaults</source>
<translation type="unfinished">Restore Defaults</translation> <translation>Khôi Phục Mặc Đnh</translation>
</message> </message>
<message> <message>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished">Cancel</translation> <translation>Hủy</translation>
</message> </message>
</context> </context>
<context> <context>
<name>EditorDialog</name> <name>EditorDialog</name>
<message> <message>
<source>Edit Keyboard + Mouse and Controller input bindings</source> <source>Edit Keyboard + Mouse and Controller input bindings</source>
<translation type="unfinished">Edit Keyboard + Mouse and Controller input bindings</translation> <translation>Tùy chỉnh phím đưc gán cho Bàn phím + Chuột Tay cầm</translation>
</message> </message>
<message> <message>
<source>Use Per-Game configs</source> <source>Use Per-Game configs</source>
@ -578,7 +578,7 @@
</message> </message>
<message> <message>
<source>Error</source> <source>Error</source>
<translation type="unfinished">Error</translation> <translation>Lỗi</translation>
</message> </message>
<message> <message>
<source>Could not open the file for reading</source> <source>Could not open the file for reading</source>
@ -590,15 +590,15 @@
</message> </message>
<message> <message>
<source>Save Changes</source> <source>Save Changes</source>
<translation type="unfinished">Save Changes</translation> <translation>Lưu Thay Đi</translation>
</message> </message>
<message> <message>
<source>Do you want to save changes?</source> <source>Do you want to save changes?</source>
<translation type="unfinished">Do you want to save changes?</translation> <translation>Bạn muốn lưu thay đi?</translation>
</message> </message>
<message> <message>
<source>Help</source> <source>Help</source>
<translation type="unfinished">Help</translation> <translation>Trợ giúp</translation>
</message> </message>
<message> <message>
<source>Do you want to reset your custom default config to the original default config?</source> <source>Do you want to reset your custom default config to the original default config?</source>
@ -706,15 +706,15 @@
</message> </message>
<message> <message>
<source>h</source> <source>h</source>
<translation type="unfinished">h</translation> <translation>giờ</translation>
</message> </message>
<message> <message>
<source>m</source> <source>m</source>
<translation type="unfinished">m</translation> <translation>phút</translation>
</message> </message>
<message> <message>
<source>s</source> <source>s</source>
<translation type="unfinished">s</translation> <translation>giây</translation>
</message> </message>
<message> <message>
<source>Compatibility is untested</source> <source>Compatibility is untested</source>
@ -722,23 +722,23 @@
</message> </message>
<message> <message>
<source>Game does not initialize properly / crashes the emulator</source> <source>Game does not initialize properly / crashes the emulator</source>
<translation type="unfinished">Game does not initialize properly / crashes the emulator</translation> <translation>Trò chơi không đưc khởi chạy đúng cách / khiến giả lập bị văng</translation>
</message> </message>
<message> <message>
<source>Game boots, but only displays a blank screen</source> <source>Game boots, but only displays a blank screen</source>
<translation type="unfinished">Game boots, but only displays a blank screen</translation> <translation>Trò chơi thể khởi chạy, nhưng chẳng hiện cả</translation>
</message> </message>
<message> <message>
<source>Game displays an image but does not go past the menu</source> <source>Game displays an image but does not go past the menu</source>
<translation type="unfinished">Game displays an image but does not go past the menu</translation> <translation>Trò chơi hiển thị đưc hình nh, nhưng không thể tiếp tục từ menu</translation>
</message> </message>
<message> <message>
<source>Game has game-breaking glitches or unplayable performance</source> <source>Game has game-breaking glitches or unplayable performance</source>
<translation type="unfinished">Game has game-breaking glitches or unplayable performance</translation> <translation>Trò chơi lỗi nh hưởng đến trải nghiệm, hoặc hiệu năng khi chơi không n đnh</translation>
</message> </message>
<message> <message>
<source>Game can be completed with playable performance and no major glitches</source> <source>Game can be completed with playable performance and no major glitches</source>
<translation type="unfinished">Game can be completed with playable performance and no major glitches</translation> <translation>Trò chơi thể đưc hoàn thành từ đu đến cuối, hiệu năng n đnh không lỗi nh hưởng đến trải nghiệm</translation>
</message> </message>
<message> <message>
<source>Click to see details on github</source> <source>Click to see details on github</source>
@ -1170,19 +1170,19 @@
</message> </message>
<message> <message>
<source>Save</source> <source>Save</source>
<translation type="unfinished">Save</translation> <translation>Lưu</translation>
</message> </message>
<message> <message>
<source>Apply</source> <source>Apply</source>
<translation type="unfinished">Apply</translation> <translation>Áp dụng</translation>
</message> </message>
<message> <message>
<source>Restore Defaults</source> <source>Restore Defaults</source>
<translation type="unfinished">Restore Defaults</translation> <translation>Khôi Phục Mặc Đnh</translation>
</message> </message>
<message> <message>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished">Cancel</translation> <translation>Hủy</translation>
</message> </message>
</context> </context>
<context> <context>
@ -1193,7 +1193,7 @@
</message> </message>
<message> <message>
<source>Boot Game</source> <source>Boot Game</source>
<translation type="unfinished">Boot Game</translation> <translation>Khởi Chạy Trò Chơi</translation>
</message> </message>
<message> <message>
<source>Check for Updates</source> <source>Check for Updates</source>
@ -1201,7 +1201,7 @@
</message> </message>
<message> <message>
<source>About shadPS4</source> <source>About shadPS4</source>
<translation type="unfinished">About shadPS4</translation> <translation>Thông Tin Về shadPS4</translation>
</message> </message>
<message> <message>
<source>Configure...</source> <source>Configure...</source>
@ -1213,23 +1213,23 @@
</message> </message>
<message> <message>
<source>Open shadPS4 Folder</source> <source>Open shadPS4 Folder</source>
<translation type="unfinished">Open shadPS4 Folder</translation> <translation>Mở Thư Mục Của shadPS4</translation>
</message> </message>
<message> <message>
<source>Exit</source> <source>Exit</source>
<translation type="unfinished">Exit</translation> <translation>Thoát</translation>
</message> </message>
<message> <message>
<source>Exit shadPS4</source> <source>Exit shadPS4</source>
<translation type="unfinished">Exit shadPS4</translation> <translation>Thoát shadPS4</translation>
</message> </message>
<message> <message>
<source>Exit the application.</source> <source>Exit the application.</source>
<translation type="unfinished">Exit the application.</translation> <translation>Thoát ng dụng.</translation>
</message> </message>
<message> <message>
<source>Show Game List</source> <source>Show Game List</source>
<translation type="unfinished">Show Game List</translation> <translation>Hiển Thị Danh Sách Trò Chơi</translation>
</message> </message>
<message> <message>
<source>Game List Refresh</source> <source>Game List Refresh</source>

View File

@ -696,14 +696,19 @@ void Rasterizer::BindTextures(const Shader::Info& stage, Shader::Backend::Bindin
void Rasterizer::BeginRendering(const GraphicsPipeline& pipeline, RenderState& state) { void Rasterizer::BeginRendering(const GraphicsPipeline& pipeline, RenderState& state) {
int cb_index = 0; int cb_index = 0;
for (auto& [image_id, desc] : cb_descs) { for (auto attach_idx = 0u; attach_idx < state.num_color_attachments; ++attach_idx) {
if (state.color_attachments[attach_idx].imageView == VK_NULL_HANDLE) {
continue;
}
auto& [image_id, desc] = cb_descs[cb_index++];
if (auto& old_img = texture_cache.GetImage(image_id); old_img.binding.needs_rebind) { if (auto& old_img = texture_cache.GetImage(image_id); old_img.binding.needs_rebind) {
auto& view = texture_cache.FindRenderTarget(desc); auto& view = texture_cache.FindRenderTarget(desc);
ASSERT(view.image_id != image_id); ASSERT(view.image_id != image_id);
image_id = bound_images.emplace_back(view.image_id); image_id = bound_images.emplace_back(view.image_id);
auto& image = texture_cache.GetImage(view.image_id); auto& image = texture_cache.GetImage(view.image_id);
state.color_attachments[cb_index].imageView = *view.image_view; state.color_attachments[attach_idx].imageView = *view.image_view;
state.color_attachments[cb_index].imageLayout = image.last_state.layout; state.color_attachments[attach_idx].imageLayout = image.last_state.layout;
const auto mip = view.info.range.base.level; const auto mip = view.info.range.base.level;
state.width = std::min<u32>(state.width, std::max(image.info.size.width >> mip, 1u)); state.width = std::min<u32>(state.width, std::max(image.info.size.width >> mip, 1u));
@ -722,8 +727,7 @@ void Rasterizer::BeginRendering(const GraphicsPipeline& pipeline, RenderState& s
desc.view_info.range); desc.view_info.range);
} }
image.usage.render_target = 1u; image.usage.render_target = 1u;
state.color_attachments[cb_index].imageLayout = image.last_state.layout; state.color_attachments[attach_idx].imageLayout = image.last_state.layout;
++cb_index;
} }
if (db_desc) { if (db_desc) {