diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE deleted file mode 100644 index a3083633a5..0000000000 --- a/.github/ISSUE_TEMPLATE +++ /dev/null @@ -1,14 +0,0 @@ - - - -### What happens? - - -### What *should* happen? - - -### What hardware, operating system, and PPSSPP version? On desktop and mobile phone, GPU matters for graphical issues. -### Please test newest version in https://buildbot.orphis.net/ppsspp/ - diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000000..837cb61c75 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,34 @@ +--- +name: Bug, crash, or compatibility issue +about: Choose this if something doesn't work and no other template applies. +labels: needs triage +--- + + + +### What happens? + + +### What *should* happen? + + +### What are you using? +#### What hardware / device and operating system? + +#### What graphics card (GPU) or mobile phone model? + +#### What PPSSPP version (standalone/official), and did it work before? + +#### Which game or games? + + + +#### Checklist + + - [ ] Test in the [latest git build](https://buildbot.orphis.net/ppsspp/) in case it's already fixed. + - [ ] [Search for other reports](https://github.com/hrydgard/ppsspp/search?q=my+issue&type=issues) of the same issue. + - [ ] Try resetting settings or older versions and include if the issue is related. + - [ ] Include logs or screenshots of issue. diff --git a/.github/ISSUE_TEMPLATE/build.md b/.github/ISSUE_TEMPLATE/build.md new file mode 100644 index 0000000000..6c565b95d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/build.md @@ -0,0 +1,28 @@ +--- +name: Building or contributing +about: Choose for issues building PPSSPP on certain platforms or with certain toolsets. +labels: needs triage +--- + + +### What platform, compiler, and build tools? + + +### What happens (don't forget logs)? + + +### What are you using? +#### What hardware / device and operating system? + +#### What PPSSPP version (standalone/official), and did it work before? + + +#### Checklist + + - [ ] Test in the [latest git build](https://buildbot.orphis.net/ppsspp/) in case it's already fixed. + - [ ] Don't forget `git submodule update --init --recursive`. + - [ ] [Search for other reports](https://github.com/hrydgard/ppsspp/search?q=my+issue&type=issues) of the same issue. + - [ ] Try deleting the build directory and starting fresh. + - [ ] Include logs and help us reproduce. + - [ ] Check GitHub Actions, which builds every merge and PR. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..6f478bb9da --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: true +contact_links: + - name: Forums for questions and help + url: https://forums.ppsspp.org/ + about: 'Please ask questions here or on Discord. Includes multiplayer resources, texture packs, cheats, and performance tips.' + - name: Compatibility list + url: http://report.ppsspp.org/games + about: Look here for user reports on best settings and compatibility. + - name: Translations + url: https://github.com/hrydgard/ppsspp-lang + about: Look here to contribute translations to PPSSPP. diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 0000000000..6a82a5f328 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,30 @@ +--- +name: New feature or behavior change +about: Choose when something isn't broken, but you want it to be better. +labels: needs triage +--- + + + +### What should happen? + + +### Who would benefit from it? + + +### What's it specific to (remove if not)? +#### Hardware, device, or operating system? + +#### Specific games? + + +### Does anything else have a similar feature? + + +#### Checklist + + - [ ] Check the [latest git build](https://buildbot.orphis.net/ppsspp/) in case it's already implemented. + - [ ] [Search for other requests](https://github.com/hrydgard/ppsspp/search?q=my+issue&type=issues) of the same feature. diff --git a/.github/ISSUE_TEMPLATE/graphics.md b/.github/ISSUE_TEMPLATE/graphics.md new file mode 100644 index 0000000000..9de08270e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/graphics.md @@ -0,0 +1,43 @@ +--- +name: Graphics or rendering issue +about: Choose when something is drawing wrong. +labels: needs triage +--- + + + +### What happens? + + + +### What *should* happen? + + +### Include a GE frame capture + + + +### What are you using? +#### What hardware / device and operating system? + +#### What graphics card (GPU) or mobile phone model? + +#### What PPSSPP version (standalone/official), and did it work before? + +#### Which game or games? + + +#### Graphics backend (Vulkan, OpenGL, etc.)? + + +#### Checklist + + - [ ] Test in the [latest git build](https://buildbot.orphis.net/ppsspp/) in case it's already fixed. + - [ ] [Search for other reports](https://github.com/hrydgard/ppsspp/search?q=my+issue&type=issues) of the same issue. + - [ ] Try resetting settings or older versions and include if the issue is related. + - [ ] Try changing graphics settings to determine if one causes the bug. + - [ ] Include logs or screenshots of issue. diff --git a/.github/ISSUE_TEMPLATE/performance.md b/.github/ISSUE_TEMPLATE/performance.md new file mode 100644 index 0000000000..569e37c68a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/performance.md @@ -0,0 +1,42 @@ +--- +name: Slowdown or performance problem +about: Choose when things got slower from a previous version or a specific scene runs really poorly. +labels: needs triage +--- + + + +### What games and where in them does it happen? + + + +### What speed are you getting with PPSSPP speed display enabled? + + +### Include a GE frame capture and debug stats + + + +### What are you using? +#### What hardware / device and operating system? + +#### What graphics card (GPU) or mobile phone model? + +#### What PPSSPP version (standalone/official), and did it work before? + +#### Graphics backend (Vulkan, OpenGL, etc.)? + + +#### Checklist + + - [ ] Test in the [latest git build](https://buildbot.orphis.net/ppsspp/) in case it's already fixed. + - [ ] [Search for other reports](https://github.com/hrydgard/ppsspp/search?q=my+issue&type=issues) of the same issue. + - [ ] Try resetting settings or older versions and include if the issue is related. + - [ ] Try changing graphics settings to determine if one causes the slowdown. + - [ ] Include logs of screenshots of issue. diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 0000000000..d8eb6547cc --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,29 @@ + + + +### What happens? + + +### What *should* happen? + + +### What are you using? +#### What hardware / device and operating system? + +#### What graphics card (GPU) or mobile phone model? + +#### What PPSSPP version (standalone/official), and did it work before? + +#### Which game or games? + + + +#### Checklist + + - [ ] Test in the [latest git build](https://buildbot.orphis.net/ppsspp/) in case it's already fixed. + - [ ] [Search for other reports](https://github.com/hrydgard/ppsspp/search?q=my+issue&type=issues) of the same issue. + - [ ] Try resetting settings or older versions and include if the issue is related. + - [ ] Include logs or screenshots of issue. diff --git a/CMakeLists.txt b/CMakeLists.txt index 48c65cb2a6..01cc70d475 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -219,7 +219,7 @@ if(USING_EGL) add_definitions(-DUSING_EGL) endif() if(USING_FBDEV) - add_definitions(-DUSING_FBDEV) + add_definitions(-DUSING_FBDEV -DEGL_NO_X11) endif() if(USING_GLES2) add_definitions(-DUSING_GLES2) @@ -1831,7 +1831,11 @@ set(CoreExtraLibs ${CoreExtraLibs} armips) # target_link_libraries(native X11-xcb X11) #endif() -set(GlslangLibs glslang OGLCompiler OSDependent SPIRV SPVRemapper spirv-cross-glsl) +set(GlslangLibs glslang OGLCompiler OSDependent SPIRV spirv-cross-glsl) + +if (ENABLE_SPVREMAPPER) + list(APPEND GlslangLibs SPVRemapper) +endif() if(WIN32) set(GlslangLibs ${GlslangLibs} spirv-cross-hlsl) @@ -1882,7 +1886,7 @@ if(USE_MINIUPNPC) add_definitions(-fPIC) endif() - add_definitions(-DMINIUPNP_STATICLIB) + add_definitions(-DWITH_UPNP -DMINIUPNP_STATICLIB) set(MINIUPNP_DIR "ext/miniupnp/miniupnpc") include_directories(${CMAKE_CURRENT_BINARY_DIR}) configure_file(${MINIUPNP_DIR}/miniupnpcstrings.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h) # by default miniupnp repo doesn't contains miniupnpcstrings.h and need to be generated diff --git a/Core/Config.cpp b/Core/Config.cpp index 2bad098cbc..fc5dfc6fe3 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1070,6 +1070,7 @@ static ConfigSetting debuggerSettings[] = { ConfigSetting("ShowGpuProfile", &g_Config.bShowGpuProfile, false, false), ConfigSetting("SkipDeadbeefFilling", &g_Config.bSkipDeadbeefFilling, false), ConfigSetting("FuncHashMap", &g_Config.bFuncHashMap, false), + ConfigSetting("MemInfoDetailed", &g_Config.bDebugMemInfoDetailed, false), ConfigSetting("DrawFrameGraph", &g_Config.bDrawFrameGraph, false), ConfigSetting(false), diff --git a/Core/Config.h b/Core/Config.h index 1a1f234ae6..77f9b85b91 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -482,6 +482,7 @@ public: // Double edged sword: much easier debugging, but not accurate. bool bSkipDeadbeefFilling; bool bFuncHashMap; + bool bDebugMemInfoDetailed; bool bDrawFrameGraph; // Volatile development settings diff --git a/Core/Debugger/MemBlockInfo.cpp b/Core/Debugger/MemBlockInfo.cpp index ef3f1ec239..5fa8c70517 100644 --- a/Core/Debugger/MemBlockInfo.cpp +++ b/Core/Debugger/MemBlockInfo.cpp @@ -16,20 +16,25 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include + +#include + #include "Common/Log.h" #include "Common/Serialize/Serializer.h" #include "Common/Serialize/SerializeFuncs.h" +#include "Core/Config.h" #include "Core/CoreTiming.h" #include "Core/Debugger/Breakpoints.h" #include "Core/Debugger/MemBlockInfo.h" #include "Core/MIPS/MIPS.h" +#include "Common/StringUtils.h" class MemSlabMap { public: MemSlabMap(); ~MemSlabMap(); - bool Mark(uint32_t addr, uint32_t size, uint64_t ticks, uint32_t pc, bool allocated, const std::string &tag); + bool Mark(uint32_t addr, uint32_t size, uint64_t ticks, uint32_t pc, bool allocated, const char *tag); bool Find(MemBlockFlags flags, uint32_t addr, uint32_t size, std::vector &results); void Reset(); void DoState(PointerWrap &p); @@ -41,7 +46,7 @@ private: uint64_t ticks = 0; uint32_t pc = 0; bool allocated = false; - std::string tag; + char tag[32]{}; Slab *prev = nullptr; Slab *next = nullptr; @@ -57,7 +62,7 @@ private: // Returns the new slab after size. Slab *Split(Slab *slab, uint32_t size); void MergeAdjacent(Slab *slab); - bool Same(const Slab *a, const Slab *b) const; + static inline bool Same(const Slab *a, const Slab *b); void Merge(Slab *a, Slab *b); void FillHeads(Slab *slab); @@ -72,7 +77,7 @@ struct PendingNotifyMem { uint32_t size; uint64_t ticks; uint32_t pc; - std::string tag; + char tag[32]; }; static constexpr size_t MAX_PENDING_NOTIFIES = 512; @@ -91,7 +96,7 @@ MemSlabMap::~MemSlabMap() { Clear(); } -bool MemSlabMap::Mark(uint32_t addr, uint32_t size, uint64_t ticks, uint32_t pc, bool allocated, const std::string &tag) { +bool MemSlabMap::Mark(uint32_t addr, uint32_t size, uint64_t ticks, uint32_t pc, bool allocated, const char *tag) { uint32_t end = addr + size; Slab *slab = FindSlab(addr); Slab *firstMatch = nullptr; @@ -108,8 +113,8 @@ bool MemSlabMap::Mark(uint32_t addr, uint32_t size, uint64_t ticks, uint32_t pc, slab->ticks = ticks; slab->pc = pc; } - if (!tag.empty()) - slab->tag = tag; + if (tag) + truncate_cpy(slab->tag, tag); // Move on to the next one. if (firstMatch == nullptr) @@ -130,7 +135,7 @@ bool MemSlabMap::Find(MemBlockFlags flags, uint32_t addr, uint32_t size, std::ve Slab *slab = FindSlab(addr); bool found = false; while (slab != nullptr && slab->start < end) { - if (slab->pc != 0 || !slab->tag.empty()) { + if (slab->pc != 0 || strlen(slab->tag)) { results.push_back({ flags, slab->start, slab->end - slab->start, slab->ticks, slab->pc, slab->tag, slab->allocated }); found = true; } @@ -194,7 +199,7 @@ void MemSlabMap::DoState(PointerWrap &p) { } void MemSlabMap::Slab::DoState(PointerWrap &p) { - auto s = p.Section("MemSlabMapSlab", 1); + auto s = p.Section("MemSlabMapSlab", 1, 2); if (!s) return; @@ -203,7 +208,13 @@ void MemSlabMap::Slab::DoState(PointerWrap &p) { Do(p, ticks); Do(p, pc); Do(p, allocated); - Do(p, tag); + if (s >= 2) { + Do(p, tag); + } else { + std::string stringTag; + Do(p, stringTag); + truncate_cpy(tag, stringTag.c_str()); + } } void MemSlabMap::Clear() { @@ -242,7 +253,7 @@ MemSlabMap::Slab *MemSlabMap::Split(Slab *slab, uint32_t size) { next->ticks = slab->ticks; next->pc = slab->pc; next->allocated = slab->allocated; - next->tag = slab->tag; + truncate_cpy(next->tag, slab->tag); next->prev = slab; next->next = slab->next; @@ -257,6 +268,16 @@ MemSlabMap::Slab *MemSlabMap::Split(Slab *slab, uint32_t size) { return next; } +bool MemSlabMap::Same(const Slab *a, const Slab *b) { + if (a->allocated != b->allocated) + return false; + if (a->pc != b->pc) + return false; + if (strcmp(a->tag, b->tag)) + return false; + return true; +} + void MemSlabMap::MergeAdjacent(Slab *slab) { while (slab->next != nullptr && Same(slab, slab->next)) { Merge(slab, slab->next); @@ -266,16 +287,6 @@ void MemSlabMap::MergeAdjacent(Slab *slab) { } } -bool MemSlabMap::Same(const Slab *a, const Slab *b) const { - if (a->allocated != b->allocated) - return false; - if (a->pc != b->pc) - return false; - if (a->tag != b->tag) - return false; - return true; -} - void MemSlabMap::Merge(Slab *a, Slab *b) { if (a->next == b) { _assert_(a->end == b->start); @@ -330,14 +341,14 @@ void FlushPendingMemInfo() { allocMap.Mark(info.start, info.size, info.ticks, info.pc, true, info.tag); } else if (info.flags & MemBlockFlags::FREE) { // Maintain the previous allocation tag for debugging. - allocMap.Mark(info.start, info.size, info.ticks, 0, false, ""); - suballocMap.Mark(info.start, info.size, info.ticks, 0, false, ""); + allocMap.Mark(info.start, info.size, info.ticks, 0, false, nullptr); + suballocMap.Mark(info.start, info.size, info.ticks, 0, false, nullptr); } if (info.flags & MemBlockFlags::SUB_ALLOC) { suballocMap.Mark(info.start, info.size, info.ticks, info.pc, true, info.tag); } else if (info.flags & MemBlockFlags::SUB_FREE) { // Maintain the previous allocation tag for debugging. - suballocMap.Mark(info.start, info.size, info.ticks, 0, false, ""); + suballocMap.Mark(info.start, info.size, info.ticks, 0, false, nullptr); } if (info.flags & MemBlockFlags::TEXTURE) { textureMap.Mark(info.start, info.size, info.ticks, info.pc, true, info.tag); @@ -349,24 +360,27 @@ void FlushPendingMemInfo() { pendingNotifies.clear(); } -void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const std::string &tag) { - NotifyMemInfoPC(flags, start, size, currentMIPS->pc, tag); -} - -void NotifyMemInfoPC(MemBlockFlags flags, uint32_t start, uint32_t size, uint32_t pc, const std::string &tag) { +void NotifyMemInfoPC(MemBlockFlags flags, uint32_t start, uint32_t size, uint32_t pc, const char *tagStr, size_t strLength) { if (size == 0) { return; } // Clear the uncached and kernel bits. start &= ~0xC0000000; - PendingNotifyMem info{ flags, start, size }; - info.ticks = CoreTiming::GetTicks(); - info.pc = pc; - info.tag = tag; - bool needFlush = false; - { + // When the setting is off, we skip smaller info to keep things fast. + if (g_Config.bDebugMemInfoDetailed || size >= 0x100) { + PendingNotifyMem info{ flags, start, size }; + info.ticks = CoreTiming::GetTicks(); + info.pc = pc; + + size_t copyLength = strLength; + if (copyLength >= sizeof(info.tag)) { + copyLength = sizeof(info.tag) - 1; + } + memcpy(info.tag, tagStr, copyLength); + info.tag[copyLength] = 0; + std::lock_guard guard(pendingMutex); pendingNotifies.push_back(info); needFlush = pendingNotifies.size() > MAX_PENDING_NOTIFIES; @@ -377,12 +391,16 @@ void NotifyMemInfoPC(MemBlockFlags flags, uint32_t start, uint32_t size, uint32_ } if (flags & MemBlockFlags::WRITE) { - CBreakPoints::ExecMemCheck(start, true, size, pc, tag.c_str()); + CBreakPoints::ExecMemCheck(start, true, size, pc, tagStr); } else if (flags & MemBlockFlags::READ) { - CBreakPoints::ExecMemCheck(start, false, size, pc, tag.c_str()); + CBreakPoints::ExecMemCheck(start, false, size, pc, tagStr); } } +void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const char *str, size_t strLength) { + NotifyMemInfoPC(flags, start, size, currentMIPS->pc, str, strLength); +} + std::vector FindMemInfo(uint32_t start, uint32_t size) { FlushPendingMemInfo(); start &= ~0xC0000000; diff --git a/Core/Debugger/MemBlockInfo.h b/Core/Debugger/MemBlockInfo.h index fa851ffdfe..e46bea8c87 100644 --- a/Core/Debugger/MemBlockInfo.h +++ b/Core/Debugger/MemBlockInfo.h @@ -18,6 +18,7 @@ #pragma once #include +#include #include #include #include "Common/Common.h" @@ -46,8 +47,18 @@ struct MemBlockInfo { bool allocated; }; -void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const std::string &tag); -void NotifyMemInfoPC(MemBlockFlags flags, uint32_t start, uint32_t size, uint32_t pc, const std::string &tag); +void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const char *str, size_t strLength); + +// This lets us avoid calling strlen on string constants, instead the string length (including null, +// so we have to subtract 1) is computed at compile time. +template +inline void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const char(&str)[count]) { + NotifyMemInfo(flags, start, size, str, count - 1); +} + +inline void NotifyMemInfo(MemBlockFlags flags, uint32_t start, uint32_t size, const char *str) { + NotifyMemInfo(flags, start, size, str, strlen(str)); +} std::vector FindMemInfo(uint32_t start, uint32_t size); std::vector FindMemInfoByFlag(MemBlockFlags flags, uint32_t start, uint32_t size); diff --git a/Core/Dialog/PSPNetconfDialog.cpp b/Core/Dialog/PSPNetconfDialog.cpp index 4202f905af..0528be972b 100644 --- a/Core/Dialog/PSPNetconfDialog.cpp +++ b/Core/Dialog/PSPNetconfDialog.cpp @@ -243,7 +243,7 @@ void PSPNetconfDialog::DisplayMessage(std::string text1, std::string text2a, std } int PSPNetconfDialog::Update(int animSpeed) { - if (GetStatus() != SCE_UTILITY_STATUS_RUNNING) { + if (ReadStatus() != SCE_UTILITY_STATUS_RUNNING) { return SCE_ERROR_UTILITY_INVALID_STATUS; } @@ -464,7 +464,7 @@ int PSPNetconfDialog::Update(int animSpeed) { EndDraw(); } - if (GetStatus() == SCE_UTILITY_STATUS_FINISHED || pendingStatus == SCE_UTILITY_STATUS_FINISHED) + if (ReadStatus() == SCE_UTILITY_STATUS_FINISHED || pendingStatus == SCE_UTILITY_STATUS_FINISHED) Memory::Memcpy(requestAddr, &request, request.common.size, "NetConfDialogParam"); return 0; diff --git a/Core/ELF/ElfReader.cpp b/Core/ELF/ElfReader.cpp index 917bcb48f1..69328d49e2 100644 --- a/Core/ELF/ElfReader.cpp +++ b/Core/ELF/ElfReader.cpp @@ -445,7 +445,8 @@ int ElfReader::LoadInto(u32 loadAddress, bool fromTop) if (bRelocate) { DEBUG_LOG(LOADER,"Relocatable module"); - entryPoint += vaddr; + if (entryPoint != (u32)-1) + entryPoint += vaddr; } else { DEBUG_LOG(LOADER,"Prerelocated executable"); } diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index cd98ce0b00..b6b270d916 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -2085,16 +2085,6 @@ int KernelStartModule(SceUID moduleId, u32 argsize, u32 argAddr, u32 returnValue entryAddr = module->nm.module_start_func; if (module->nm.module_start_thread_attr != 0) attribute = module->nm.module_start_thread_attr; - } else if (entryAddr == (u32)-1 || entryAddr == module->memoryBlockAddr - 1) { - if (smoption) { - // TODO: Does sceKernelStartModule() really give an error when no entry only if you pass options? - attribute = smoption->attribute; - } else { - // TODO: Why are we just returning the module ID in this case? - WARN_LOG(SCEMODULE, "sceKernelStartModule(): module has no start or entry func"); - module->nm.status = MODULE_STATUS_STARTED; - return moduleId; - } } if (Memory::IsValidAddress(entryAddr)) { @@ -2110,6 +2100,8 @@ int KernelStartModule(SceUID moduleId, u32 argsize, u32 argAddr, u32 returnValue stacksize = module->nm.module_start_thread_stacksize; } + // TODO: Why do we skip smoption->attribute here? + SceUID threadID = __KernelCreateThread(module->nm.name, moduleId, entryAddr, priority, stacksize, attribute, 0, (module->nm.attribute & 0x1000) != 0); __KernelStartThreadValidate(threadID, argsize, argAddr); __KernelSetThreadRA(threadID, NID_MODULERETURN); @@ -2117,7 +2109,7 @@ int KernelStartModule(SceUID moduleId, u32 argsize, u32 argAddr, u32 returnValue if (needsWait) { *needsWait = true; } - } else if (entryAddr == 0) { + } else if (entryAddr == 0 || entryAddr == (u32)-1) { INFO_LOG(SCEMODULE, "sceKernelStartModule(%d,asize=%08x,aptr=%08x,retptr=%08x): no entry address", moduleId, argsize, argAddr, returnValueAddr); module->nm.status = MODULE_STATUS_STARTED; } else { diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index c224b8f7be..c88a11dd60 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -1629,7 +1629,7 @@ static int sceNetAdhocPdpRecv(int id, void *addr, void * port, void *buf, void * socket->nonblocking = flag; // Valid Arguments - if (saddr != NULL && port != NULL && buf != NULL && len != NULL && *len > 0) { + if (saddr != NULL && port != NULL && buf != NULL && len != NULL) { #ifndef PDP_DIRTY_MAGIC // Schedule Timeout Removal //if (flag == 1) timeout = 0; @@ -1686,7 +1686,7 @@ static int sceNetAdhocPdpRecv(int id, void *addr, void * port, void *buf, void * memcpy(buf, dummyPeekBuf64k, std::min(received, *len)); if (received != SOCKET_ERROR && *len < received) { - WARN_LOG(SCENET, "sceNetAdhocPdpRecv[%i:%u]: Peeked %u/%u bytes from %s:%u\n", id, getLocalPort(pdpsocket.id), received, *len, ip2str(sin.sin_addr).c_str(), ntohs(sin.sin_port)); + INFO_LOG(SCENET, "sceNetAdhocPdpRecv[%i:%u]: Peeked %u/%u bytes from %s:%u\n", id, getLocalPort(pdpsocket.id), received, *len, ip2str(sin.sin_addr).c_str(), ntohs(sin.sin_port)); *len = received; // Peer MAC diff --git a/Core/MemMap.cpp b/Core/MemMap.cpp index f69a46db6e..521c241e3c 100644 --- a/Core/MemMap.cpp +++ b/Core/MemMap.cpp @@ -459,7 +459,7 @@ void Write_Opcode_JIT(const u32 _Address, const Opcode& _Value) Memory::WriteUnchecked_U32(_Value.encoding, _Address); } -void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength, const std::string &tag) { +void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength, const char *tag) { if (IsValidRange(_Address, _iLength)) { uint8_t *ptr = GetPointerUnchecked(_Address); memset(ptr, _iValue, _iLength); @@ -468,7 +468,7 @@ void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength, const std: Write_U8(_iValue, (u32)(_Address + i)); } - NotifyMemInfo(MemBlockFlags::WRITE, _Address, _iLength, tag); + NotifyMemInfo(MemBlockFlags::WRITE, _Address, _iLength, tag, strlen(tag)); } } // namespace diff --git a/Core/MemMapHelpers.h b/Core/MemMapHelpers.h index 0983abdf9b..f67ab9aa86 100644 --- a/Core/MemMapHelpers.h +++ b/Core/MemMapHelpers.h @@ -17,6 +17,8 @@ #pragma once +#include + #include "Common/CommonTypes.h" #include "Core/Debugger/MemBlockInfo.h" #include "Core/MemMap.h" @@ -28,31 +30,34 @@ extern MIPSState *currentMIPS; namespace Memory { -inline void Memcpy(const u32 to_address, const void *from_data, const u32 len, const std::string &tag = "Memcpy") { +inline void Memcpy(const u32 to_address, const void *from_data, const u32 len, const char *tag = "Memcpy") { u8 *to = GetPointer(to_address); if (to) { memcpy(to, from_data, len); - NotifyMemInfo(MemBlockFlags::WRITE, to_address, len, tag); + size_t tagLen = strlen(tag); + NotifyMemInfo(MemBlockFlags::WRITE, to_address, len, tag, tagLen); } // if not, GetPointer will log. } -inline void Memcpy(void *to_data, const u32 from_address, const u32 len, const std::string &tag = "Memcpy") { +inline void Memcpy(void *to_data, const u32 from_address, const u32 len, const char *tag = "Memcpy") { const u8 *from = GetPointer(from_address); if (from) { memcpy(to_data, from, len); - NotifyMemInfo(MemBlockFlags::READ, from_address, len, tag); + size_t tagLen = strlen(tag); + NotifyMemInfo(MemBlockFlags::READ, from_address, len, tag, tagLen); } // if not, GetPointer will log. } -inline void Memcpy(const u32 to_address, const u32 from_address, const u32 len, const std::string &tag = "Memcpy") { +inline void Memcpy(const u32 to_address, const u32 from_address, const u32 len, const char *tag = "Memcpy") { Memcpy(GetPointer(to_address), from_address, len); - NotifyMemInfo(MemBlockFlags::READ, from_address, len, tag); - NotifyMemInfo(MemBlockFlags::WRITE, to_address, len, tag); + size_t tagLen = strlen(tag); + NotifyMemInfo(MemBlockFlags::READ, from_address, len, tag, tagLen); + NotifyMemInfo(MemBlockFlags::WRITE, to_address, len, tag, tagLen); } -void Memset(const u32 _Address, const u8 _Data, const u32 _iLength, const std::string &tag = "Memset"); +void Memset(const u32 _Address, const u8 _Data, const u32 _iLength, const char *tag = "Memset"); template void ReadStruct(u32 address, T *ptr) diff --git a/Core/Util/PortManager.cpp b/Core/Util/PortManager.cpp index a8ef97e034..06e1968716 100644 --- a/Core/Util/PortManager.cpp +++ b/Core/Util/PortManager.cpp @@ -68,7 +68,7 @@ PortManager::~PortManager() { void PortManager::Terminate() { VERBOSE_LOG(SCENET, "PortManager::Terminate()"); if (urls) { -#if !PPSSPP_PLATFORM(SWITCH) +#ifdef WITH_UPNP FreeUPNPUrls(urls); #endif free(urls); @@ -88,7 +88,7 @@ void PortManager::Terminate() { } bool PortManager::Initialize(const unsigned int timeout) { -#if !PPSSPP_PLATFORM(SWITCH) +#ifdef WITH_UPNP // Windows: Assuming WSAStartup already called beforehand struct UPNPDev* devlist; struct UPNPDev* dev; @@ -184,7 +184,7 @@ bool PortManager::Initialize(const unsigned int timeout) { auto n = GetI18NCategory("Networking"); host->NotifyUserMessage(n->T("Unable to find UPnP device"), 2.0f, 0x0000ff); m_InitState = UPNP_INITSTATE_NONE; -#endif // !PPSSPP_PLATFORM(SWITCH) +#endif // WITH_UPNP return false; } @@ -193,7 +193,7 @@ int PortManager::GetInitState() { } bool PortManager::Add(const char* protocol, unsigned short port, unsigned short intport) { -#if !PPSSPP_PLATFORM(SWITCH) +#ifdef WITH_UPNP char port_str[16]; char intport_str[16]; int r; @@ -242,11 +242,11 @@ bool PortManager::Add(const char* protocol, unsigned short port, unsigned short return true; #else return false; -#endif // !PPSSPP_PLATFORM(SWITCH) +#endif // WITH_UPNP } bool PortManager::Remove(const char* protocol, unsigned short port) { -#if !PPSSPP_PLATFORM(SWITCH) +#ifdef WITH_UPNP char port_str[16]; INFO_LOG(SCENET, "PortManager::Remove(%s, %d)", protocol, port); @@ -273,11 +273,11 @@ bool PortManager::Remove(const char* protocol, unsigned short port) { return true; #else return false; -#endif // !PPSSPP_PLATFORM(SWITCH) +#endif // WITH_UPNP } bool PortManager::Restore() { -#if !PPSSPP_PLATFORM(SWITCH) +#ifdef WITH_UPNP int r; VERBOSE_LOG(SCENET, "PortManager::Restore()"); if (urls == NULL || urls->controlURL == NULL || urls->controlURL[0] == '\0') @@ -319,11 +319,11 @@ bool PortManager::Restore() { return true; #else return false; -#endif // !PPSSPP_PLATFORM(SWITCH) +#endif // WITH_UPNP } bool PortManager::Clear() { -#if !PPSSPP_PLATFORM(SWITCH) +#ifdef WITH_UPNP int r; int i = 0; char index[6]; @@ -377,11 +377,11 @@ bool PortManager::Clear() { return true; #else return false; -#endif // !PPSSPP_PLATFORM(SWITCH) +#endif // WITH_UPNP } bool PortManager::RefreshPortList() { -#if !PPSSPP_PLATFORM(SWITCH) +#ifdef WITH_UPNP int r; int i = 0; char index[6]; @@ -434,7 +434,7 @@ bool PortManager::RefreshPortList() { return true; #else return false; -#endif // !PPSSPP_PLATFORM(SWITCH) +#endif // WITH_UPNP } int upnpService(const unsigned int timeout) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index a56ff5958d..436a5d719a 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -1296,14 +1296,16 @@ void FramebufferManagerCommon::ResizeFramebufFBO(VirtualFramebuffer *vfb, int w, } shaderManager_->DirtyLastShader(); - char tag[256]; - snprintf(tag, sizeof(tag), "FB_%08x_%08x_%dx%d_%s", vfb->fb_address, vfb->z_address, w, h, GeBufferFormatToString(vfb->format)); + char tag[128]; + size_t len = snprintf(tag, sizeof(tag), "FB_%08x_%08x_%dx%d_%s", vfb->fb_address, vfb->z_address, w, h, GeBufferFormatToString(vfb->format)); vfb->fbo = draw_->CreateFramebuffer({ vfb->renderWidth, vfb->renderHeight, 1, 1, true, tag }); if (Memory::IsVRAMAddress(vfb->fb_address) && vfb->fb_stride != 0) { - NotifyMemInfo(MemBlockFlags::ALLOC, vfb->fb_address, ColorBufferByteSize(vfb), tag); + NotifyMemInfo(MemBlockFlags::ALLOC, vfb->fb_address, ColorBufferByteSize(vfb), tag, len); } if (Memory::IsVRAMAddress(vfb->z_address) && vfb->z_stride != 0) { - NotifyMemInfo(MemBlockFlags::ALLOC, vfb->z_address, vfb->fb_stride * vfb->height * sizeof(uint16_t), std::string("Z_") + tag); + char buf[128]; + size_t len = snprintf(buf, sizeof(buf), "Z_%s", tag); + NotifyMemInfo(MemBlockFlags::ALLOC, vfb->z_address, vfb->fb_stride * vfb->height * sizeof(uint16_t), buf, len); } if (old.fbo) { INFO_LOG(FRAMEBUF, "Resizing FBO for %08x : %dx%dx%s", vfb->fb_address, w, h, GeBufferFormatToString(vfb->format)); diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 5fdf5d18a6..83b4ff14cf 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -1323,7 +1323,9 @@ void TextureCacheCommon::DecodeTextureLevel(u8 *out, int outPitch, GETextureForm const u8 *texptr = Memory::GetPointer(texaddr); const uint32_t byteSize = (textureBitsPerPixel[format] * bufw * h) / 8; - NotifyMemInfo(MemBlockFlags::TEXTURE, texaddr, byteSize, StringFromFormat("Texture_%08x_%dx%d_%s", texaddr, w, h, GeTextureFormatToString(format, clutformat))); + char buf[128]; + size_t len = snprintf(buf, sizeof(buf), "Tex_%08x_%dx%d_%s", texaddr, w, h, GeTextureFormatToString(format, clutformat)); + NotifyMemInfo(MemBlockFlags::TEXTURE, texaddr, byteSize, buf, len); switch (format) { case GE_TFMT_CLUT4: diff --git a/GPU/Common/VertexDecoderFake.cpp b/GPU/Common/VertexDecoderFake.cpp index 6e170f93b9..709d0647e8 100644 --- a/GPU/Common/VertexDecoderFake.cpp +++ b/GPU/Common/VertexDecoderFake.cpp @@ -15,11 +15,11 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -//TODO: Doesn't build, FIXME! -#if 0 - #include "ppsspp_config.h" #include "Common/CPUDetect.h" +#if !PPSSPP_ARCH(MIPS) +#include "Common/FakeEmitter.h" +#endif #include "Core/Config.h" #include "Core/Reporting.h" #include "GPU/GPUState.h" @@ -44,18 +44,16 @@ static const JitLookup jitLookup[] = { {&VertexDecoder::Step_WeightsU16Skin, &VertexDecoderJitCache::Jit_WeightsU16Skin}, {&VertexDecoder::Step_WeightsFloatSkin, &VertexDecoderJitCache::Jit_WeightsFloatSkin}, - {&VertexDecoder::Step_TcU8, &VertexDecoderJitCache::Jit_TcU8}, - {&VertexDecoder::Step_TcU16, &VertexDecoderJitCache::Jit_TcU16}, + {&VertexDecoder::Step_TcU8ToFloat, &VertexDecoderJitCache::Jit_TcU8ToFloat}, + {&VertexDecoder::Step_TcU16ToFloat, &VertexDecoderJitCache::Jit_TcU16ToFloat}, {&VertexDecoder::Step_TcFloat, &VertexDecoderJitCache::Jit_TcFloat}, - {&VertexDecoder::Step_TcU16Double, &VertexDecoderJitCache::Jit_TcU16Double}, {&VertexDecoder::Step_TcU8Prescale, &VertexDecoderJitCache::Jit_TcU8Prescale}, {&VertexDecoder::Step_TcU16Prescale, &VertexDecoderJitCache::Jit_TcU16Prescale}, {&VertexDecoder::Step_TcFloatPrescale, &VertexDecoderJitCache::Jit_TcFloatPrescale}, - {&VertexDecoder::Step_TcU16Through, &VertexDecoderJitCache::Jit_TcU16Through}, + {&VertexDecoder::Step_TcU16ThroughToFloat, &VertexDecoderJitCache::Jit_TcU16ThroughToFloat}, {&VertexDecoder::Step_TcFloatThrough, &VertexDecoderJitCache::Jit_TcFloatThrough}, - {&VertexDecoder::Step_TcU16ThroughDouble, &VertexDecoderJitCache::Jit_TcU16ThroughDouble}, {&VertexDecoder::Step_NormalS8, &VertexDecoderJitCache::Jit_NormalS8}, {&VertexDecoder::Step_NormalS16, &VertexDecoderJitCache::Jit_NormalS16}, @@ -127,27 +125,21 @@ void VertexDecoderJitCache::Jit_WeightsU16Skin() { void VertexDecoderJitCache::Jit_WeightsFloatSkin() { } -void VertexDecoderJitCache::Jit_TcU8() { +void VertexDecoderJitCache::Jit_TcU8ToFloat() { } -void VertexDecoderJitCache::Jit_TcU16() { +void VertexDecoderJitCache::Jit_TcU16ToFloat() { } void VertexDecoderJitCache::Jit_TcFloat() { } -void VertexDecoderJitCache::Jit_TcU16Through() { +void VertexDecoderJitCache::Jit_TcU16ThroughToFloat() { } void VertexDecoderJitCache::Jit_TcFloatThrough() { } -void VertexDecoderJitCache::Jit_TcU16Double() { -} - -void VertexDecoderJitCache::Jit_TcU16ThroughDouble() { -} - void VertexDecoderJitCache::Jit_TcU8Prescale() { } @@ -272,5 +264,3 @@ void VertexDecoderJitCache::Jit_NormalFloatMorph() { bool VertexDecoderJitCache::CompileStep(const VertexDecoder &dec, int step) { return false; } - -#endif diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index eae65ce59f..3fc4f661c7 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -867,7 +867,7 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) { } char texName[128]{}; - snprintf(texName, sizeof(texName), "texture_%08x_%s", entry->addr, GeTextureFormatToString((GETextureFormat)entry->format, gstate.getClutPaletteFormat())); + snprintf(texName, sizeof(texName), "tex_%08x_%s", entry->addr, GeTextureFormatToString((GETextureFormat)entry->format, gstate.getClutPaletteFormat())); image->SetTag(texName); bool allocSuccess = image->CreateDirect(cmdInit, allocator_, w * scaleFactor, h * scaleFactor, maxLevelToGenerate + 1, actualFmt, imageLayout, usage, mapping); diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index cc8739cf29..5466ddb024 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,5 +1,6 @@ + + +