mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 10:35:03 +00:00
Merge branch 'main' into http-part2
This commit is contained in:
commit
1aaf981fe6
@ -169,7 +169,8 @@ void OnGameLoaded() {
|
||||
if (type == "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);
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,10 @@ public:
|
||||
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) {
|
||||
return ORBIS_KERNEL_ERROR_EBADF;
|
||||
}
|
||||
|
@ -877,7 +877,7 @@ s32 PS4_SYSV_ABI sceKernelGetdirentries(s32 fd, char* buf, s32 nbytes, s64* base
|
||||
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) {
|
||||
*__Error() = POSIX_EINVAL;
|
||||
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};
|
||||
|
||||
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) {
|
||||
ErrSceToPosix(result);
|
||||
return -1;
|
||||
@ -908,7 +908,16 @@ s64 PS4_SYSV_ABI posix_pwrite(s32 fd, void* buf, size_t nbytes, s64 offset) {
|
||||
*__Error() = POSIX_EIO;
|
||||
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) {
|
||||
@ -920,6 +929,15 @@ s64 PS4_SYSV_ABI sceKernelPwrite(s32 fd, void* buf, size_t nbytes, s64 offset) {
|
||||
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) {
|
||||
if (path == nullptr) {
|
||||
*__Error() = POSIX_EINVAL;
|
||||
@ -1017,7 +1035,10 @@ void RegisterFileSystem(Core::Loader::SymbolsResolver* sym) {
|
||||
LIB_FUNCTION("sfKygSjIbI8", "libkernel", 1, "libkernel", 1, 1, getdirentries);
|
||||
LIB_FUNCTION("taRWhTJFTgE", "libkernel", 1, "libkernel", 1, 1, sceKernelGetdirentries);
|
||||
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("mBd4AfLP+u8", "libkernel", 1, "libkernel", 1, 1, sceKernelPwritev);
|
||||
LIB_FUNCTION("AUXVxWeJU-A", "libkernel", 1, "libkernel", 1, 1, sceKernelUnlink);
|
||||
}
|
||||
|
||||
|
@ -1387,7 +1387,7 @@ void CheatsPatches::applyPatch(const QString& patchName, bool enabled) {
|
||||
if (type == "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);
|
||||
}
|
||||
|
||||
|
@ -384,23 +384,23 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Nothing</source>
|
||||
<translation>Không có gì</translation>
|
||||
<translation>Không chạy được</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Boots</source>
|
||||
<translation>Giày ủng</translation>
|
||||
<translation>Chạy được</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Menus</source>
|
||||
<translation>Menu</translation>
|
||||
<translation>Vào được menu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ingame</source>
|
||||
<translation>Trong game</translation>
|
||||
<translation>Vào được trò chơi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Playable</source>
|
||||
<translation>Có thể chơi</translation>
|
||||
<translation>Chơi được</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -411,7 +411,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>D-Pad</source>
|
||||
<translation type="unfinished">D-Pad</translation>
|
||||
<translation>D-Pad</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Up</source>
|
||||
@ -447,7 +447,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Common Config</source>
|
||||
<translation type="unfinished">Common Config</translation>
|
||||
<translation>Cài Đặt Chung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use per-game configs</source>
|
||||
@ -551,26 +551,26 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Save</source>
|
||||
<translation type="unfinished">Save</translation>
|
||||
<translation>Lưu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Apply</source>
|
||||
<translation type="unfinished">Apply</translation>
|
||||
<translation>Áp dụng</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Restore Defaults</source>
|
||||
<translation type="unfinished">Restore Defaults</translation>
|
||||
<translation>Khôi Phục Mặc Định</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished">Cancel</translation>
|
||||
<translation>Hủy</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditorDialog</name>
|
||||
<message>
|
||||
<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 và Tay cầm</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Per-Game configs</source>
|
||||
@ -578,7 +578,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Error</source>
|
||||
<translation type="unfinished">Error</translation>
|
||||
<translation>Lỗi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Could not open the file for reading</source>
|
||||
@ -590,15 +590,15 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Save Changes</source>
|
||||
<translation type="unfinished">Save Changes</translation>
|
||||
<translation>Lưu Thay Đổi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you want to save changes?</source>
|
||||
<translation type="unfinished">Do you want to save changes?</translation>
|
||||
<translation>Bạn có muốn lưu thay đổi?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Help</source>
|
||||
<translation type="unfinished">Help</translation>
|
||||
<translation>Trợ giúp</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you want to reset your custom default config to the original default config?</source>
|
||||
@ -706,15 +706,15 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>h</source>
|
||||
<translation type="unfinished">h</translation>
|
||||
<translation>giờ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>m</source>
|
||||
<translation type="unfinished">m</translation>
|
||||
<translation>phút</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>s</source>
|
||||
<translation type="unfinished">s</translation>
|
||||
<translation>giây</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Compatibility is untested</source>
|
||||
@ -722,23 +722,23 @@
|
||||
</message>
|
||||
<message>
|
||||
<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>
|
||||
<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 có thể khởi chạy, nhưng chẳng hiện gì cả</translation>
|
||||
</message>
|
||||
<message>
|
||||
<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>
|
||||
<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 có 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>
|
||||
<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 có thể được hoàn thành từ đầu đến cuối, hiệu năng ổn định và không có lỗi ảnh hưởng đến trải nghiệm</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click to see details on github</source>
|
||||
@ -1170,19 +1170,19 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Save</source>
|
||||
<translation type="unfinished">Save</translation>
|
||||
<translation>Lưu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Apply</source>
|
||||
<translation type="unfinished">Apply</translation>
|
||||
<translation>Áp dụng</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Restore Defaults</source>
|
||||
<translation type="unfinished">Restore Defaults</translation>
|
||||
<translation>Khôi Phục Mặc Định</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished">Cancel</translation>
|
||||
<translation>Hủy</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -1193,7 +1193,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Boot Game</source>
|
||||
<translation type="unfinished">Boot Game</translation>
|
||||
<translation>Khởi Chạy Trò Chơi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Check for Updates</source>
|
||||
@ -1201,7 +1201,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>About shadPS4</source>
|
||||
<translation type="unfinished">About shadPS4</translation>
|
||||
<translation>Thông Tin Về shadPS4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Configure...</source>
|
||||
@ -1213,23 +1213,23 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Open shadPS4 Folder</source>
|
||||
<translation type="unfinished">Open shadPS4 Folder</translation>
|
||||
<translation>Mở Thư Mục Của shadPS4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Exit</source>
|
||||
<translation type="unfinished">Exit</translation>
|
||||
<translation>Thoát</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Exit shadPS4</source>
|
||||
<translation type="unfinished">Exit shadPS4</translation>
|
||||
<translation>Thoát shadPS4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Exit the application.</source>
|
||||
<translation type="unfinished">Exit the application.</translation>
|
||||
<translation>Thoát ứng dụng.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<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>
|
||||
<source>Game List Refresh</source>
|
||||
|
@ -696,14 +696,19 @@ void Rasterizer::BindTextures(const Shader::Info& stage, Shader::Backend::Bindin
|
||||
|
||||
void Rasterizer::BeginRendering(const GraphicsPipeline& pipeline, RenderState& state) {
|
||||
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) {
|
||||
auto& view = texture_cache.FindRenderTarget(desc);
|
||||
ASSERT(view.image_id != image_id);
|
||||
image_id = bound_images.emplace_back(view.image_id);
|
||||
auto& image = texture_cache.GetImage(view.image_id);
|
||||
state.color_attachments[cb_index].imageView = *view.image_view;
|
||||
state.color_attachments[cb_index].imageLayout = image.last_state.layout;
|
||||
state.color_attachments[attach_idx].imageView = *view.image_view;
|
||||
state.color_attachments[attach_idx].imageLayout = image.last_state.layout;
|
||||
|
||||
const auto mip = view.info.range.base.level;
|
||||
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);
|
||||
}
|
||||
image.usage.render_target = 1u;
|
||||
state.color_attachments[cb_index].imageLayout = image.last_state.layout;
|
||||
++cb_index;
|
||||
state.color_attachments[attach_idx].imageLayout = image.last_state.layout;
|
||||
}
|
||||
|
||||
if (db_desc) {
|
||||
|
Loading…
Reference in New Issue
Block a user