mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-24 18:16:55 +01:00
Fix incorrect streamout buffer index in GS + refactor various code (#258)
This commit is contained in:
parent
4a3d02db55
commit
03f5967408
@ -577,7 +577,7 @@ namespace CafeSystem
|
|||||||
const auto file = fsc_open(rpxPath.c_str(), FSC_ACCESS_FLAG::OPEN_FILE | FSC_ACCESS_FLAG::READ_PERMISSION, &status);
|
const auto file = fsc_open(rpxPath.c_str(), FSC_ACCESS_FLAG::OPEN_FILE | FSC_ACCESS_FLAG::READ_PERMISSION, &status);
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
_pathToExecutable = rpxPath;
|
_pathToExecutable = std::move(rpxPath);
|
||||||
fsc_close(file);
|
fsc_close(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ sint32 fsc_mount(std::string_view mountPath, std::string_view targetPath, fscDev
|
|||||||
}
|
}
|
||||||
node->device = fscDevice;
|
node->device = fscDevice;
|
||||||
node->ctx = ctx;
|
node->ctx = ctx;
|
||||||
node->deviceTargetPath = targetPathWithSlash;
|
node->deviceTargetPath = std::move(targetPathWithSlash);
|
||||||
fscLeave();
|
fscLeave();
|
||||||
return FSC_STATUS_OK;
|
return FSC_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
@ -1020,9 +1020,9 @@ bool GraphicPack2::Deactivate()
|
|||||||
m_upscaling_shader_ud.reset();
|
m_upscaling_shader_ud.reset();
|
||||||
m_downscaling_shader_ud.reset();
|
m_downscaling_shader_ud.reset();
|
||||||
|
|
||||||
m_output_shader_source = "";
|
m_output_shader_source.clear();
|
||||||
m_upscaling_shader_source = "";
|
m_upscaling_shader_source.clear();
|
||||||
m_downscaling_shader_source = "";
|
m_downscaling_shader_source.clear();
|
||||||
|
|
||||||
if (HasCustomVSyncFrequency())
|
if (HasCustomVSyncFrequency())
|
||||||
{
|
{
|
||||||
|
@ -101,7 +101,7 @@ namespace Espresso
|
|||||||
|
|
||||||
struct BOField
|
struct BOField
|
||||||
{
|
{
|
||||||
BOField() {};
|
BOField() = default;
|
||||||
BOField(uint8 bo) : bo(bo) {};
|
BOField(uint8 bo) : bo(bo) {};
|
||||||
|
|
||||||
bool conditionInverted() const
|
bool conditionInverted() const
|
||||||
|
@ -10,7 +10,7 @@ class PPCFunctionBoundaryTracker
|
|||||||
public:
|
public:
|
||||||
struct PPCRange_t
|
struct PPCRange_t
|
||||||
{
|
{
|
||||||
PPCRange_t() {};
|
PPCRange_t() = default;
|
||||||
PPCRange_t(uint32 _startAddress) : startAddress(_startAddress) {};
|
PPCRange_t(uint32 _startAddress) : startAddress(_startAddress) {};
|
||||||
|
|
||||||
uint32 startAddress{};
|
uint32 startAddress{};
|
||||||
|
@ -197,7 +197,7 @@ struct raLivenessLocation_t
|
|||||||
bool isRead;
|
bool isRead;
|
||||||
bool isWrite;
|
bool isWrite;
|
||||||
|
|
||||||
raLivenessLocation_t() {};
|
raLivenessLocation_t() = default;
|
||||||
|
|
||||||
raLivenessLocation_t(sint32 index, bool isRead, bool isWrite)
|
raLivenessLocation_t(sint32 index, bool isRead, bool isWrite)
|
||||||
: index(index), isRead(isRead), isWrite(isWrite) {};
|
: index(index), isRead(isRead), isWrite(isWrite) {};
|
||||||
|
@ -29,7 +29,7 @@ class IntervalTree2
|
|||||||
|
|
||||||
struct InternalRange
|
struct InternalRange
|
||||||
{
|
{
|
||||||
InternalRange() {};
|
InternalRange() = default;
|
||||||
InternalRange(TRangeData _rangeBegin, TRangeData _rangeEnd) : rangeBegin(_rangeBegin), rangeEnd(_rangeEnd) { cemu_assert_debug(_rangeBegin < _rangeEnd); };
|
InternalRange(TRangeData _rangeBegin, TRangeData _rangeEnd) : rangeBegin(_rangeBegin), rangeEnd(_rangeEnd) { cemu_assert_debug(_rangeBegin < _rangeEnd); };
|
||||||
|
|
||||||
TRangeData rangeBegin;
|
TRangeData rangeBegin;
|
||||||
|
@ -208,7 +208,7 @@ LatteParsedGSCopyShader* LatteGSCopyShaderParser_parse(uint8* programData, uint3
|
|||||||
uint32 bufferIndex;
|
uint32 bufferIndex;
|
||||||
if (cf_inst23_7 == GPU7_CF_INST_MEM_STREAM0_WRITE)
|
if (cf_inst23_7 == GPU7_CF_INST_MEM_STREAM0_WRITE)
|
||||||
bufferIndex = 0;
|
bufferIndex = 0;
|
||||||
else if (cf_inst23_7 == GPU7_CF_INST_MEM_STREAM0_WRITE)
|
else if (cf_inst23_7 == GPU7_CF_INST_MEM_STREAM1_WRITE)
|
||||||
bufferIndex = 1;
|
bufferIndex = 1;
|
||||||
else
|
else
|
||||||
cemu_assert_debug(false);
|
cemu_assert_debug(false);
|
||||||
|
@ -493,17 +493,18 @@ bool LatteMRT::UpdateCurrentFBO()
|
|||||||
|
|
||||||
sint32 colorAttachmentWidth;
|
sint32 colorAttachmentWidth;
|
||||||
sint32 colorAttachmentHeight;
|
sint32 colorAttachmentHeight;
|
||||||
|
|
||||||
LatteTexture_getSize(colorAttachmentView->baseTexture, &colorAttachmentWidth, &colorAttachmentHeight, nullptr, colorAttachmentView->firstMip);
|
LatteTexture_getSize(colorAttachmentView->baseTexture, &colorAttachmentWidth, &colorAttachmentHeight, nullptr, colorAttachmentView->firstMip);
|
||||||
|
|
||||||
// set effective size
|
// set effective size
|
||||||
sint32 effectiveWidth, effectiveHeight;
|
sint32 effectiveWidth, effectiveHeight;
|
||||||
LatteTexture_getEffectiveSize(colorAttachmentView->baseTexture, &effectiveWidth, &effectiveHeight, nullptr, colorAttachmentView->firstMip);
|
LatteTexture_getEffectiveSize(colorAttachmentView->baseTexture, &effectiveWidth, &effectiveHeight, nullptr, colorAttachmentView->firstMip);
|
||||||
if( rtEffectiveSize->width == 0 && rtEffectiveSize->height == 0 )
|
if (rtEffectiveSize->width == 0 && rtEffectiveSize->height == 0)
|
||||||
{
|
{
|
||||||
rtEffectiveSize->width = effectiveWidth;
|
rtEffectiveSize->width = effectiveWidth;
|
||||||
rtEffectiveSize->height = effectiveHeight;
|
rtEffectiveSize->height = effectiveHeight;
|
||||||
}
|
}
|
||||||
else if( rtEffectiveSize->width != effectiveWidth && rtEffectiveSize->height != effectiveHeight )
|
else if (rtEffectiveSize->width != effectiveWidth && rtEffectiveSize->height != effectiveHeight)
|
||||||
{
|
{
|
||||||
#ifndef PUBLIC_RELEASE
|
#ifndef PUBLIC_RELEASE
|
||||||
forceLog_printf("Color buffer size mismatch (%dx%d). Effective size: %dx%d Real size: %dx%d Mismatching texture: %08x %dx%d fmt %04x", rtEffectiveSize->width, rtEffectiveSize->height, effectiveWidth, effectiveHeight, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, colorAttachmentView->baseTexture->physAddress, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, (uint32)colorAttachmentView->baseTexture->format);
|
forceLog_printf("Color buffer size mismatch (%dx%d). Effective size: %dx%d Real size: %dx%d Mismatching texture: %08x %dx%d fmt %04x", rtEffectiveSize->width, rtEffectiveSize->height, effectiveWidth, effectiveHeight, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, colorAttachmentView->baseTexture->physAddress, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, (uint32)colorAttachmentView->baseTexture->format);
|
||||||
|
@ -609,7 +609,7 @@ void LatteShaderCache_loadOrCompileSeparableShader(LatteDecompilerShader* shader
|
|||||||
|
|
||||||
bool LatteShaderCache_readSeparableVertexShader(MemStreamReader& streamReader, uint8 version)
|
bool LatteShaderCache_readSeparableVertexShader(MemStreamReader& streamReader, uint8 version)
|
||||||
{
|
{
|
||||||
std::unique_ptr<LatteContextRegister> lcr(new LatteContextRegister());
|
auto lcr = std::make_unique<LatteContextRegister>();
|
||||||
if (version != 1)
|
if (version != 1)
|
||||||
return false;
|
return false;
|
||||||
uint64 shaderBaseHash = streamReader.readBE<uint64>();
|
uint64 shaderBaseHash = streamReader.readBE<uint64>();
|
||||||
@ -658,7 +658,7 @@ bool LatteShaderCache_readSeparableGeometryShader(MemStreamReader& streamReader,
|
|||||||
{
|
{
|
||||||
if (version != 1)
|
if (version != 1)
|
||||||
return false;
|
return false;
|
||||||
std::unique_ptr<LatteContextRegister> lcr(new LatteContextRegister());
|
auto lcr = std::make_unique<LatteContextRegister>();
|
||||||
uint64 shaderBaseHash = streamReader.readBE<uint64>();
|
uint64 shaderBaseHash = streamReader.readBE<uint64>();
|
||||||
uint64 shaderAuxHash = streamReader.readBE<uint64>();
|
uint64 shaderAuxHash = streamReader.readBE<uint64>();
|
||||||
uint32 vsRingParameterCount = streamReader.readBE<uint16>();
|
uint32 vsRingParameterCount = streamReader.readBE<uint16>();
|
||||||
@ -698,7 +698,7 @@ bool LatteShaderCache_readSeparablePixelShader(MemStreamReader& streamReader, ui
|
|||||||
{
|
{
|
||||||
if (version != 1)
|
if (version != 1)
|
||||||
return false;
|
return false;
|
||||||
std::unique_ptr<LatteContextRegister> lcr(new LatteContextRegister());
|
auto lcr = std::make_unique<LatteContextRegister>();
|
||||||
uint64 shaderBaseHash = streamReader.readBE<uint64>();
|
uint64 shaderBaseHash = streamReader.readBE<uint64>();
|
||||||
uint64 shaderAuxHash = streamReader.readBE<uint64>();
|
uint64 shaderAuxHash = streamReader.readBE<uint64>();
|
||||||
bool usesGeometryShader = streamReader.readBE<uint8>() != 0;
|
bool usesGeometryShader = streamReader.readBE<uint8>() != 0;
|
||||||
|
@ -214,6 +214,10 @@ void VulkanPipelineStableCache::LoadPipelineFromCache(std::span<uint8> fileData)
|
|||||||
if (!DeserializePipeline(streamReader, *cachedPipeline))
|
if (!DeserializePipeline(streamReader, *cachedPipeline))
|
||||||
{
|
{
|
||||||
// failed to deserialize
|
// failed to deserialize
|
||||||
|
s_spinlockSharedInternal.acquire();
|
||||||
|
delete lcr;
|
||||||
|
delete cachedPipeline;
|
||||||
|
s_spinlockSharedInternal.release();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// restored register view from compacted state
|
// restored register view from compacted state
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
struct VulkanPipelineHash
|
struct VulkanPipelineHash
|
||||||
{
|
{
|
||||||
VulkanPipelineHash() {};
|
VulkanPipelineHash() = default;
|
||||||
VulkanPipelineHash(uint64 h0, uint64 h1) : h0(h0), h1(h1) {};
|
VulkanPipelineHash(uint64 h0, uint64 h1) : h0(h0), h1(h1) {};
|
||||||
|
|
||||||
uint64 h0;
|
uint64 h0;
|
||||||
|
@ -243,6 +243,7 @@ bool RPLLoader_ProcessHeaders(std::string_view moduleName, uint8* rplData, uint3
|
|||||||
if (fileinfoSection->sectionSize < sizeof(RPLFileInfoData))
|
if (fileinfoSection->sectionSize < sizeof(RPLFileInfoData))
|
||||||
{
|
{
|
||||||
cemuLog_force("RPLLoader: FILEINFO section size is below expected size");
|
cemuLog_force("RPLLoader: FILEINFO section size is below expected size");
|
||||||
|
delete rplLoaderContext;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1963,7 +1964,7 @@ void RPLLoader_AddDependency(const char* name)
|
|||||||
if (rplLoader_currentTlsModuleIndex == 0x7FFF)
|
if (rplLoader_currentTlsModuleIndex == 0x7FFF)
|
||||||
cemuLog_force("RPLLoader: Exhausted TLS module indices pool");
|
cemuLog_force("RPLLoader: Exhausted TLS module indices pool");
|
||||||
// convert name to path/filename if it isn't already one
|
// convert name to path/filename if it isn't already one
|
||||||
if (strstr(name, "."))
|
if (strchr(name, '.'))
|
||||||
{
|
{
|
||||||
strcpy_s(newDependency->filepath, name);
|
strcpy_s(newDependency->filepath, name);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ template <typename T>
|
|||||||
class PPCConcurrentQueue
|
class PPCConcurrentQueue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PPCConcurrentQueue() {}
|
PPCConcurrentQueue() = default;
|
||||||
PPCConcurrentQueue(const PPCConcurrentQueue&) = delete;
|
PPCConcurrentQueue(const PPCConcurrentQueue&) = delete;
|
||||||
PPCConcurrentQueue& operator=(const PPCConcurrentQueue&) = delete;
|
PPCConcurrentQueue& operator=(const PPCConcurrentQueue&) = delete;
|
||||||
|
|
||||||
|
@ -54,9 +54,7 @@ namespace coreinit
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
~OSHostThread()
|
~OSHostThread() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
OSThread_t* m_thread;
|
OSThread_t* m_thread;
|
||||||
Fiber m_fiber;
|
Fiber m_fiber;
|
||||||
@ -1223,7 +1221,7 @@ namespace coreinit
|
|||||||
{
|
{
|
||||||
struct DeallocatorQueueEntry
|
struct DeallocatorQueueEntry
|
||||||
{
|
{
|
||||||
DeallocatorQueueEntry() {};
|
DeallocatorQueueEntry() = default;
|
||||||
DeallocatorQueueEntry(OSThread_t* thread, MEMPTR<void> stack, MEMPTR<void> deallocatorFunc) : thread(thread), stack(stack), deallocatorFunc(deallocatorFunc) {};
|
DeallocatorQueueEntry(OSThread_t* thread, MEMPTR<void> stack, MEMPTR<void> deallocatorFunc) : thread(thread), stack(stack), deallocatorFunc(deallocatorFunc) {};
|
||||||
|
|
||||||
OSThread_t* thread{};
|
OSThread_t* thread{};
|
||||||
|
@ -835,8 +835,11 @@ namespace H264
|
|||||||
auto asyncTask = std::async(std::launch::async, _async_H264DECEnd, executeDoneEvent.GetPointer(), session, ctx, &results);
|
auto asyncTask = std::async(std::launch::async, _async_H264DECEnd, executeDoneEvent.GetPointer(), session, ctx, &results);
|
||||||
coreinit::OSWaitEvent(executeDoneEvent);
|
coreinit::OSWaitEvent(executeDoneEvent);
|
||||||
_ReleaseDecoderSession(session);
|
_ReleaseDecoderSession(session);
|
||||||
|
if (!results.empty())
|
||||||
|
{
|
||||||
for (auto& itr : results)
|
for (auto& itr : results)
|
||||||
H264DoFrameOutputCallback(ctx, itr);
|
H264DoFrameOutputCallback(ctx, itr);
|
||||||
|
}
|
||||||
return H264DEC_STATUS::SUCCESS;
|
return H264DEC_STATUS::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,6 @@ void MetaInfo::ParseDirectory(const fs::path& filename)
|
|||||||
|
|
||||||
bool MetaInfo::ParseFile(const fs::path& filename)
|
bool MetaInfo::ParseFile(const fs::path& filename)
|
||||||
{
|
{
|
||||||
const auto extension = filename.extension();
|
|
||||||
if (filename.filename() != "meta.xml")
|
if (filename.filename() != "meta.xml")
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -287,7 +287,6 @@ void TitleInfo::CalcUID()
|
|||||||
m_uid = 0;
|
m_uid = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::error_code ec;
|
|
||||||
// get absolute normalized path
|
// get absolute normalized path
|
||||||
fs::path normalizedPath;
|
fs::path normalizedPath;
|
||||||
if (m_fullPath.is_relative())
|
if (m_fullPath.is_relative())
|
||||||
|
@ -78,9 +78,9 @@ void CafeTitleList::LoadCacheFile()
|
|||||||
cacheEntry.titleVersion = titleVersion;
|
cacheEntry.titleVersion = titleVersion;
|
||||||
cacheEntry.titleDataFormat = format;
|
cacheEntry.titleDataFormat = format;
|
||||||
cacheEntry.region = region;
|
cacheEntry.region = region;
|
||||||
cacheEntry.titleName = name;
|
cacheEntry.titleName = std::move(name);
|
||||||
cacheEntry.path = _utf8ToPath(path);
|
cacheEntry.path = _utf8ToPath(path);
|
||||||
cacheEntry.subPath = sub_path;
|
cacheEntry.subPath = std::move(sub_path);
|
||||||
cacheEntry.group_id = group_id;
|
cacheEntry.group_id = group_id;
|
||||||
cacheEntry.app_type = app_type;
|
cacheEntry.app_type = app_type;
|
||||||
|
|
||||||
@ -482,7 +482,7 @@ void CafeTitleList::AddTitle(TitleInfo* titleInfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sTLList.emplace_back(titleInfo);
|
sTLList.emplace_back(titleInfo);
|
||||||
sTLMap.insert(std::pair(titleInfo->GetAppTitleId(), titleInfo));
|
sTLMap.emplace(titleInfo->GetAppTitleId(), titleInfo);
|
||||||
// send out notification
|
// send out notification
|
||||||
CafeTitleListCallbackEvent evt;
|
CafeTitleListCallbackEvent evt;
|
||||||
evt.eventType = CafeTitleListCallbackEvent::TYPE::TITLE_DISCOVERED;
|
evt.eventType = CafeTitleListCallbackEvent::TYPE::TITLE_DISCOVERED;
|
||||||
|
@ -287,7 +287,10 @@ uint8* _fileCache_compressFileData(const uint8* fileData, uint32 fileSize, sint3
|
|||||||
Bytef* compressedData = (Bytef*)malloc(4 + compressedLen);
|
Bytef* compressedData = (Bytef*)malloc(4 + compressedLen);
|
||||||
int zret = compress2(compressedData + 4, &compressedLen, uncompressedInput, uncompressedLen, 4); // level 4 has good compression to performance ratio
|
int zret = compress2(compressedData + 4, &compressedLen, uncompressedInput, uncompressedLen, 4); // level 4 has good compression to performance ratio
|
||||||
if (zret != Z_OK)
|
if (zret != Z_OK)
|
||||||
|
{
|
||||||
|
free(compressedData);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
}
|
||||||
compressedData[0] = ((uint32)fileSize >> 24) & 0xFF;
|
compressedData[0] = ((uint32)fileSize >> 24) & 0xFF;
|
||||||
compressedData[1] = ((uint32)fileSize >> 16) & 0xFF;
|
compressedData[1] = ((uint32)fileSize >> 16) & 0xFF;
|
||||||
compressedData[2] = ((uint32)fileSize >> 8) & 0xFF;
|
compressedData[2] = ((uint32)fileSize >> 8) & 0xFF;
|
||||||
|
@ -967,7 +967,7 @@ void DownloadManager::setPackageError(Package* package, std::string errorMsg)
|
|||||||
if (package->state.hasError)
|
if (package->state.hasError)
|
||||||
return; // dont overwrite already set error message
|
return; // dont overwrite already set error message
|
||||||
package->state.hasError = true;
|
package->state.hasError = true;
|
||||||
package->state.errorMsg = errorMsg;
|
package->state.errorMsg = std::move(errorMsg);
|
||||||
reportPackageStatus(package);
|
reportPackageStatus(package);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1216,7 +1216,6 @@ void DownloadManager::asyncPackageDownloadContentFile(Package* package, uint16 i
|
|||||||
void DownloadManager::asyncPackageVerifyFile(Package* package, uint16 index, bool isCheckState)
|
void DownloadManager::asyncPackageVerifyFile(Package* package, uint16 index, bool isCheckState)
|
||||||
{
|
{
|
||||||
uint8 tmdContentHash[32];
|
uint8 tmdContentHash[32];
|
||||||
std::string filePathStr;
|
|
||||||
// get titleId, contentId and file path
|
// get titleId, contentId and file path
|
||||||
std::unique_lock<std::recursive_mutex> _l(m_mutex);
|
std::unique_lock<std::recursive_mutex> _l(m_mutex);
|
||||||
uint64 titleId = package->titleId;
|
uint64 titleId = package->titleId;
|
||||||
|
@ -446,7 +446,7 @@ public:
|
|||||||
std::unique_lock<std::recursive_mutex> _l(m_mutex);
|
std::unique_lock<std::recursive_mutex> _l(m_mutex);
|
||||||
m_packageList.clear();
|
m_packageList.clear();
|
||||||
m_statusCode = DLMGR_STATUS_CODE::UNINITIALIZED;
|
m_statusCode = DLMGR_STATUS_CODE::UNINITIALIZED;
|
||||||
m_statusMessage = "";
|
m_statusMessage.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -355,7 +355,6 @@ namespace NAPI
|
|||||||
|
|
||||||
std::string_view host = tokenNode.child_value("host");
|
std::string_view host = tokenNode.child_value("host");
|
||||||
std::string_view nex_password = tokenNode.child_value("nex_password");
|
std::string_view nex_password = tokenNode.child_value("nex_password");
|
||||||
std::string_view pid = tokenNode.child_value("pid");
|
|
||||||
std::string_view port = tokenNode.child_value("port");
|
std::string_view port = tokenNode.child_value("port");
|
||||||
std::string_view token = tokenNode.child_value("token");
|
std::string_view token = tokenNode.child_value("token");
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ namespace NAPI
|
|||||||
// ticketVersion starts at 0 and increments every time the ticket is updated (e.g. for AOC content, when purchasing additional DLC packages)
|
// ticketVersion starts at 0 and increments every time the ticket is updated (e.g. for AOC content, when purchasing additional DLC packages)
|
||||||
const char* tivValue = tivNode.child_value();
|
const char* tivValue = tivNode.child_value();
|
||||||
const char* tivValueEnd = tivValue + strlen(tivValue);
|
const char* tivValueEnd = tivValue + strlen(tivValue);
|
||||||
const char* tivValueSeparator = std::strstr(tivValue, ".");
|
const char* tivValueSeparator = std::strchr(tivValue, '.');
|
||||||
if (tivValueSeparator == nullptr)
|
if (tivValueSeparator == nullptr)
|
||||||
tivValueSeparator = tivValueEnd;
|
tivValueSeparator = tivValueEnd;
|
||||||
|
|
||||||
|
@ -739,7 +739,7 @@ nexService* nex_establishSecureConnection(uint32 authServerIp, uint16 authServer
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
// auth info
|
// auth info
|
||||||
std::unique_ptr<authServerInfo_t> authServerInfo(new authServerInfo_t);
|
auto authServerInfo = std::make_unique<authServerInfo_t>();
|
||||||
// decrypt ticket
|
// decrypt ticket
|
||||||
RC4Ctx_t rc4Ticket;
|
RC4Ctx_t rc4Ticket;
|
||||||
RC4_initCtx(&rc4Ticket, kerberosKey, 16);
|
RC4_initCtx(&rc4Ticket, kerberosKey, 16);
|
||||||
|
@ -7,10 +7,7 @@
|
|||||||
class nexGameKey : public nexType
|
class nexGameKey : public nexType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nexGameKey()
|
nexGameKey() = default;
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
nexGameKey(uint64 titleId, uint16 ukn)
|
nexGameKey(uint64 titleId, uint16 ukn)
|
||||||
{
|
{
|
||||||
@ -175,10 +172,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
nexPrincipalBasicInfo(uint32 principalId, char* nnid, const nexMiiV2& mii)
|
nexPrincipalBasicInfo(uint32 principalId, char* nnid, const nexMiiV2& mii)
|
||||||
|
: principalId(principalId), mii(mii)
|
||||||
{
|
{
|
||||||
this->principalId = principalId;
|
|
||||||
strcpy(this->nnid, nnid);
|
strcpy(this->nnid, nnid);
|
||||||
this->mii = mii;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nexPrincipalBasicInfo(nexPacketBuffer* pb)
|
nexPrincipalBasicInfo(nexPacketBuffer* pb)
|
||||||
@ -218,10 +214,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
nexNNAInfo(uint8 countryCode, uint8 countrySubCode, const nexPrincipalBasicInfo& principalBasicInfo)
|
nexNNAInfo(uint8 countryCode, uint8 countrySubCode, const nexPrincipalBasicInfo& principalBasicInfo)
|
||||||
|
: countryCode(countryCode), countrySubCode(countrySubCode), principalInfo(principalBasicInfo)
|
||||||
{
|
{
|
||||||
this->countryCode = countryCode;
|
|
||||||
this->countrySubCode = countrySubCode;
|
|
||||||
this->principalInfo = principalBasicInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nexNNAInfo(nexPacketBuffer* pb)
|
nexNNAInfo(nexPacketBuffer* pb)
|
||||||
@ -250,10 +244,7 @@ public:
|
|||||||
class nexPrincipalPreference : public nexType
|
class nexPrincipalPreference : public nexType
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nexPrincipalPreference()
|
nexPrincipalPreference() = default;
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
nexPrincipalPreference(uint8 ukn0, uint8 ukn1, uint8 ukn2)
|
nexPrincipalPreference(uint8 ukn0, uint8 ukn1, uint8 ukn2)
|
||||||
{
|
{
|
||||||
|
@ -222,7 +222,7 @@ public:
|
|||||||
if (this->currentIndex + bufferLength > this->size)
|
if (this->currentIndex + bufferLength > this->size)
|
||||||
{
|
{
|
||||||
readOutOfBounds = true;
|
readOutOfBounds = true;
|
||||||
outputStr = std::string("");
|
outputStr.clear();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
sint32 copiedLength = bufferLength;
|
sint32 copiedLength = bufferLength;
|
||||||
|
@ -43,7 +43,7 @@ class FileStream
|
|||||||
void writeLine(const char* str);
|
void writeLine(const char* str);
|
||||||
|
|
||||||
~FileStream();
|
~FileStream();
|
||||||
FileStream() {};
|
FileStream() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FileStream(HANDLE hFile);
|
FileStream(HANDLE hFile);
|
||||||
|
@ -557,7 +557,7 @@ void CemuConfig::SetGameListCustomName(uint64 titleId, std::string customName)
|
|||||||
return;
|
return;
|
||||||
gameEntry = CreateGameEntry(titleId);
|
gameEntry = CreateGameEntry(titleId);
|
||||||
}
|
}
|
||||||
gameEntry->custom_name = customName;
|
gameEntry->custom_name = std::move(customName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CemuConfig::AddRecentlyLaunchedFile(std::wstring_view file)
|
void CemuConfig::AddRecentlyLaunchedFile(std::wstring_view file)
|
||||||
|
@ -168,7 +168,6 @@ GameProfileWindow::GameProfileWindow(wxWindow* parent, uint64_t title_id)
|
|||||||
{
|
{
|
||||||
profile_sizer->Add(new wxStaticText(panel, wxID_ANY, fmt::format("{} {}", _("Controller").ToStdString(), (i + 1))), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
profile_sizer->Add(new wxStaticText(panel, wxID_ANY, fmt::format("{} {}", _("Controller").ToStdString(), (i + 1))), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
|
||||||
|
|
||||||
wxArrayString m_controller_profileChoices;
|
|
||||||
m_controller_profile[i] = new wxComboBox(panel, wxID_ANY,"", wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_DROPDOWN| wxCB_READONLY);
|
m_controller_profile[i] = new wxComboBox(panel, wxID_ANY,"", wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_DROPDOWN| wxCB_READONLY);
|
||||||
m_controller_profile[i]->SetMinSize(wxSize(250, -1));
|
m_controller_profile[i]->SetMinSize(wxSize(250, -1));
|
||||||
m_controller_profile[i]->Bind(wxEVT_COMBOBOX_DROPDOWN, &GameProfileWindow::OnControllerProfileDropdown, this);
|
m_controller_profile[i]->Bind(wxEVT_COMBOBOX_DROPDOWN, &GameProfileWindow::OnControllerProfileDropdown, this);
|
||||||
|
@ -213,7 +213,6 @@ void GameUpdateWindow::ThreadWork()
|
|||||||
create_directories(targetDir);
|
create_directories(targetDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto target_path = fs::path(m_target_path);
|
|
||||||
for (auto& path : m_source_paths)
|
for (auto& path : m_source_paths)
|
||||||
{
|
{
|
||||||
if (m_thread_state == ThreadCanceled)
|
if (m_thread_state == ThreadCanceled)
|
||||||
|
@ -843,7 +843,7 @@ void GeneralSettings2::StoreConfig()
|
|||||||
config.tv_volume = m_tv_volume->GetValue();
|
config.tv_volume = m_tv_volume->GetValue();
|
||||||
config.pad_volume = m_pad_volume->GetValue();
|
config.pad_volume = m_pad_volume->GetValue();
|
||||||
|
|
||||||
config.tv_device = L"";
|
config.tv_device.clear();
|
||||||
const auto tv_device = m_tv_device->GetSelection();
|
const auto tv_device = m_tv_device->GetSelection();
|
||||||
if (tv_device != wxNOT_FOUND && tv_device != 0 && m_tv_device->HasClientObjectData())
|
if (tv_device != wxNOT_FOUND && tv_device != 0 && m_tv_device->HasClientObjectData())
|
||||||
{
|
{
|
||||||
@ -852,7 +852,7 @@ void GeneralSettings2::StoreConfig()
|
|||||||
config.tv_device = device_description->GetDescription()->GetIdentifier();
|
config.tv_device = device_description->GetDescription()->GetIdentifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
config.pad_device = L"";
|
config.pad_device.clear();
|
||||||
const auto pad_device = m_pad_device->GetSelection();
|
const auto pad_device = m_pad_device->GetSelection();
|
||||||
if (pad_device != wxNOT_FOUND && pad_device != 0 && m_pad_device->HasClientObjectData())
|
if (pad_device != wxNOT_FOUND && pad_device != 0 && m_pad_device->HasClientObjectData())
|
||||||
{
|
{
|
||||||
|
@ -343,7 +343,7 @@ void wxTitleManagerList::OnConvertToCompressedFormat(uint64 titleId)
|
|||||||
if (!GetConfig().game_paths.empty())
|
if (!GetConfig().game_paths.empty())
|
||||||
defaultDir = GetConfig().game_paths.front();
|
defaultDir = GetConfig().game_paths.front();
|
||||||
// get the short name, which we will use as a suggested default file name
|
// get the short name, which we will use as a suggested default file name
|
||||||
std::string defaultFileName = shortName;
|
std::string defaultFileName = std::move(shortName);
|
||||||
boost::replace_all(defaultFileName, "/", "");
|
boost::replace_all(defaultFileName, "/", "");
|
||||||
boost::replace_all(defaultFileName, "\\", "");
|
boost::replace_all(defaultFileName, "\\", "");
|
||||||
|
|
||||||
@ -474,7 +474,7 @@ void wxTitleManagerList::OnConvertToCompressedFormat(uint64 titleId)
|
|||||||
{
|
{
|
||||||
std::string temporaryMountPath = TitleInfo::GetUniqueTempMountingPath();
|
std::string temporaryMountPath = TitleInfo::GetUniqueTempMountingPath();
|
||||||
titleInfo->Mount(temporaryMountPath.c_str(), "", FSC_PRIORITY_BASE);
|
titleInfo->Mount(temporaryMountPath.c_str(), "", FSC_PRIORITY_BASE);
|
||||||
bool r = RecursivelyAddFiles(fmt::format("{:016x}_v{}/", titleInfo->GetAppTitleId(), titleInfo->GetAppTitleVersion()), temporaryMountPath.c_str());
|
bool r = RecursivelyAddFiles(fmt::format("{:016x}_v{}/", titleInfo->GetAppTitleId(), titleInfo->GetAppTitleVersion()), temporaryMountPath);
|
||||||
titleInfo->Unmount(temporaryMountPath.c_str());
|
titleInfo->Unmount(temporaryMountPath.c_str());
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ void DumpCtrl::GoToAddressDialog()
|
|||||||
m_lastGotoOffset = result;
|
m_lastGotoOffset = result;
|
||||||
CenterOffset(result);
|
CenterOffset(result);
|
||||||
}
|
}
|
||||||
catch (const std::exception ex)
|
catch (const std::exception& ex)
|
||||||
{
|
{
|
||||||
wxMessageBox(ex.what(), _("Error"), wxOK | wxCENTRE | wxICON_ERROR, this);
|
wxMessageBox(ex.what(), _("Error"), wxOK | wxCENTRE | wxICON_ERROR, this);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ SymbolListCtrl::SymbolListCtrl(wxWindow* parent, const wxWindowID& id, const wxP
|
|||||||
Bind(wxEVT_LIST_ITEM_ACTIVATED, &SymbolListCtrl::OnLeftDClick, this);
|
Bind(wxEVT_LIST_ITEM_ACTIVATED, &SymbolListCtrl::OnLeftDClick, this);
|
||||||
Bind(wxEVT_LIST_ITEM_RIGHT_CLICK, &SymbolListCtrl::OnRightClick, this);
|
Bind(wxEVT_LIST_ITEM_RIGHT_CLICK, &SymbolListCtrl::OnRightClick, this);
|
||||||
|
|
||||||
m_list_filter = "";
|
m_list_filter.Clear();
|
||||||
|
|
||||||
OnGameLoaded();
|
OnGameLoaded();
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ void SymbolListCtrl::OnGameLoaded()
|
|||||||
new_entry.first->second.searchName += new_entry.first->second.libName;
|
new_entry.first->second.searchName += new_entry.first->second.libName;
|
||||||
new_entry.first->second.searchName.MakeLower();
|
new_entry.first->second.searchName.MakeLower();
|
||||||
|
|
||||||
if (m_list_filter == "")
|
if (m_list_filter.IsEmpty())
|
||||||
new_entry.first->second.visible = true;
|
new_entry.first->second.visible = true;
|
||||||
else if (new_entry.first->second.searchName.Contains(m_list_filter))
|
else if (new_entry.first->second.searchName.Contains(m_list_filter))
|
||||||
new_entry.first->second.visible = true;
|
new_entry.first->second.visible = true;
|
||||||
@ -149,7 +149,7 @@ void SymbolListCtrl::ChangeListFilter(std::string filter)
|
|||||||
size_t visible_entries = m_data.size();
|
size_t visible_entries = m_data.size();
|
||||||
for (auto& [address, symbol] : m_data)
|
for (auto& [address, symbol] : m_data)
|
||||||
{
|
{
|
||||||
if (m_list_filter == "")
|
if (m_list_filter.IsEmpty())
|
||||||
symbol.visible = true;
|
symbol.visible = true;
|
||||||
else if (symbol.searchName.Contains(m_list_filter))
|
else if (symbol.searchName.Contains(m_list_filter))
|
||||||
symbol.visible = true;
|
symbol.visible = true;
|
||||||
|
@ -11,7 +11,7 @@ public:
|
|||||||
void ChangeListFilter(std::string filter);
|
void ChangeListFilter(std::string filter);
|
||||||
private:
|
private:
|
||||||
struct SymbolItem {
|
struct SymbolItem {
|
||||||
SymbolItem() {}
|
SymbolItem() = default;
|
||||||
SymbolItem(wxString name, wxString libName, wxString searchName, bool visible) : name(name), libName(libName), searchName(searchName), visible(visible) {}
|
SymbolItem(wxString name, wxString libName, wxString searchName, bool visible) : name(name), libName(libName), searchName(searchName), visible(visible) {}
|
||||||
|
|
||||||
|
|
||||||
|
@ -568,8 +568,6 @@ void InputSettings2::on_profile_text_changed(wxCommandEvent& event)
|
|||||||
|
|
||||||
auto& page_data = get_current_page_data();
|
auto& page_data = get_current_page_data();
|
||||||
|
|
||||||
const auto selection = page_data.m_emulated_controller->GetStringSelection();
|
|
||||||
|
|
||||||
// load_bttn, save_bttn, delete_bttn, profile_status
|
// load_bttn, save_bttn, delete_bttn, profile_status
|
||||||
const auto text = event.GetString();
|
const auto text = event.GetString();
|
||||||
const auto text_str = from_wxString(text);
|
const auto text_str = from_wxString(text);
|
||||||
|
@ -189,7 +189,7 @@ public:
|
|||||||
// update provider if settings are different from default provider
|
// update provider if settings are different from default provider
|
||||||
void update_provider(std::shared_ptr<TProvider> provider)
|
void update_provider(std::shared_ptr<TProvider> provider)
|
||||||
{
|
{
|
||||||
m_provider = provider;
|
m_provider = std::move(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -104,9 +104,7 @@ struct Quat
|
|||||||
class MotionSample
|
class MotionSample
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MotionSample()
|
MotionSample() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
MotionSample(float acc[3], float accAcceleration, float gyro[3], float orientation[3],
|
MotionSample(float acc[3], float accAcceleration, float gyro[3], float orientation[3],
|
||||||
float quaternion[4]
|
float quaternion[4]
|
||||||
|
@ -289,7 +289,7 @@ namespace ZpIR
|
|||||||
// IR register constant definition stored in basic block
|
// IR register constant definition stored in basic block
|
||||||
struct IRRegConstDef
|
struct IRRegConstDef
|
||||||
{
|
{
|
||||||
IRRegConstDef() {};
|
IRRegConstDef() = default;
|
||||||
// todo - support for constants with more than one element?
|
// todo - support for constants with more than one element?
|
||||||
|
|
||||||
IRRegConstDef& setU32(uint32 v) { value_u32 = v; type = DataType::U32; return *this; };
|
IRRegConstDef& setU32(uint32 v) { value_u32 = v; type = DataType::U32; return *this; };
|
||||||
@ -513,7 +513,7 @@ namespace ZpIR
|
|||||||
LOC_TYPE_ATTRIBUTE = 3,
|
LOC_TYPE_ATTRIBUTE = 3,
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
ShaderImportLocation() {}
|
ShaderImportLocation() = default;
|
||||||
ShaderImportLocation(LocationSymbolName loc)
|
ShaderImportLocation(LocationSymbolName loc)
|
||||||
{
|
{
|
||||||
uint64 v = (uint64)loc;
|
uint64 v = (uint64)loc;
|
||||||
@ -598,7 +598,7 @@ namespace ZpIR
|
|||||||
LOC_TYPE_OUTPUT = 2,
|
LOC_TYPE_OUTPUT = 2,
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
ShaderExportLocation() {}
|
ShaderExportLocation() = default;
|
||||||
ShaderExportLocation(LocationSymbolName loc)
|
ShaderExportLocation(LocationSymbolName loc)
|
||||||
{
|
{
|
||||||
uint64 v = (uint64)loc;
|
uint64 v = (uint64)loc;
|
||||||
|
@ -12,9 +12,7 @@ class DualStringBuffer
|
|||||||
public:
|
public:
|
||||||
DualStringBuffer() : m_offsetBegin(N / 2), m_offsetEnd(N / 2) { }
|
DualStringBuffer() : m_offsetBegin(N / 2), m_offsetEnd(N / 2) { }
|
||||||
|
|
||||||
~DualStringBuffer()
|
~DualStringBuffer() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static_assert(sizeof(char) == sizeof(uint8));
|
static_assert(sizeof(char) == sizeof(uint8));
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class IntervalBucketContainer
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
IntervalBucketContainer() {};
|
IntervalBucketContainer() = default;
|
||||||
|
|
||||||
// range is defined as inclusive rangeStart and exclusive rangeEnd
|
// range is defined as inclusive rangeStart and exclusive rangeEnd
|
||||||
void addRange(TAddr rangeStart, TAddr rangeEnd, TData* data)
|
void addRange(TAddr rangeStart, TAddr rangeEnd, TData* data)
|
||||||
|
@ -13,10 +13,7 @@ public:
|
|||||||
size_t lastIterationIndex;
|
size_t lastIterationIndex;
|
||||||
}rangeEntry_t;
|
}rangeEntry_t;
|
||||||
|
|
||||||
RangeStore()
|
RangeStore() = default;
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t getBucket(_ADDR addr)
|
size_t getBucket(_ADDR addr)
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,7 @@ template<size_t N>
|
|||||||
class SmallBitset
|
class SmallBitset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SmallBitset() {};
|
SmallBitset() = default;
|
||||||
static_assert(N <= 32);
|
static_assert(N <= 32);
|
||||||
|
|
||||||
bool test(size_t index) const
|
bool test(size_t index) const
|
||||||
|
@ -166,9 +166,7 @@ namespace ska
|
|||||||
: distance_from_desired(distance_from_desired)
|
: distance_from_desired(distance_from_desired)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
~sherwood_v3_entry()
|
~sherwood_v3_entry() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
static sherwood_v3_entry* empty_default_table()
|
static sherwood_v3_entry* empty_default_table()
|
||||||
{
|
{
|
||||||
static sherwood_v3_entry result[min_lookups] = { {}, {}, {}, {special_end_value} };
|
static sherwood_v3_entry result[min_lookups] = { {}, {}, {}, {special_end_value} };
|
||||||
@ -297,9 +295,7 @@ namespace ska
|
|||||||
using pointer = value_type*;
|
using pointer = value_type*;
|
||||||
using const_pointer = const value_type*;
|
using const_pointer = const value_type*;
|
||||||
|
|
||||||
sherwood_v3_table()
|
sherwood_v3_table() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
explicit sherwood_v3_table(size_type bucket_count, const ArgumentHash& hash = ArgumentHash(), const ArgumentEqual& equal = ArgumentEqual(), const ArgumentAlloc& alloc = ArgumentAlloc())
|
explicit sherwood_v3_table(size_type bucket_count, const ArgumentHash& hash = ArgumentHash(), const ArgumentEqual& equal = ArgumentEqual(), const ArgumentAlloc& alloc = ArgumentAlloc())
|
||||||
: EntryAlloc(alloc), Hasher(hash), Equal(equal)
|
: EntryAlloc(alloc), Hasher(hash), Equal(equal)
|
||||||
{
|
{
|
||||||
@ -1324,9 +1320,7 @@ namespace ska
|
|||||||
using mapped_type = V;
|
using mapped_type = V;
|
||||||
|
|
||||||
using Table::Table;
|
using Table::Table;
|
||||||
flat_hash_map()
|
flat_hash_map() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
inline V& operator[](const K& key)
|
inline V& operator[](const K& key)
|
||||||
{
|
{
|
||||||
@ -1442,9 +1436,7 @@ namespace ska
|
|||||||
using key_type = T;
|
using key_type = T;
|
||||||
|
|
||||||
using Table::Table;
|
using Table::Table;
|
||||||
flat_hash_set()
|
flat_hash_set() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
std::pair<typename Table::iterator, bool> emplace(Args &&... args)
|
std::pair<typename Table::iterator, bool> emplace(Args &&... args)
|
||||||
|
Loading…
Reference in New Issue
Block a user