early-access version 1627

This commit is contained in:
pineappleEA 2021-04-24 09:06:02 +02:00
parent 2d74f1f391
commit 4fc347c9ac
3 changed files with 14 additions and 7 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 1625. This is the source code for early-access 1627.
## Legal Notice ## Legal Notice

View file

@ -44,6 +44,12 @@ public:
ProgramMetadata(); ProgramMetadata();
~ProgramMetadata(); ~ProgramMetadata();
ProgramMetadata(const ProgramMetadata&) = default;
ProgramMetadata& operator=(const ProgramMetadata&) = default;
ProgramMetadata(ProgramMetadata&&) = default;
ProgramMetadata& operator=(ProgramMetadata&&) = default;
/// Gets a default ProgramMetadata configuration, should only be used for homebrew formats where /// Gets a default ProgramMetadata configuration, should only be used for homebrew formats where
/// we do not have an NPDM file /// we do not have an NPDM file
static ProgramMetadata GetDefault(); static ProgramMetadata GetDefault();

View file

@ -46,7 +46,7 @@ struct hash<Service::LM::LogPacketHeaderEntry> {
boost::hash_combine(seed, k.severity); boost::hash_combine(seed, k.severity);
boost::hash_combine(seed, k.verbosity); boost::hash_combine(seed, k.verbosity);
return seed; return seed;
}; }
}; };
} // namespace std } // namespace std
@ -95,7 +95,7 @@ private:
std::memcpy(&header, data.data(), sizeof(LogPacketHeader)); std::memcpy(&header, data.data(), sizeof(LogPacketHeader));
offset += sizeof(LogPacketHeader); offset += sizeof(LogPacketHeader);
LogPacketHeaderEntry entry{ const LogPacketHeaderEntry entry{
.pid = header.pid, .pid = header.pid,
.tid = header.tid, .tid = header.tid,
.severity = header.severity, .severity = header.severity,
@ -105,16 +105,17 @@ private:
if (True(header.flags & LogPacketFlags::Head)) { if (True(header.flags & LogPacketFlags::Head)) {
std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader)); std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader));
std::memcpy(tmp.data(), data.data() + offset, tmp.size()); std::memcpy(tmp.data(), data.data() + offset, tmp.size());
entries[entry] = std::move(tmp); entries.insert_or_assign(entry, std::move(tmp));
} else { } else {
const auto entry_iter = entries.find(entry);
// Append to existing entry // Append to existing entry
if (!entries.contains(entry)) { if (entry_iter == entries.cend()) {
LOG_ERROR(Service_LM, "Log entry does not exist!"); LOG_ERROR(Service_LM, "Log entry does not exist!");
return; return;
} }
std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader));
auto& existing_entry = entries[entry]; auto& existing_entry = entry_iter->second;
const auto base = existing_entry.size(); const auto base = existing_entry.size();
existing_entry.resize(base + (data.size() - sizeof(LogPacketHeader))); existing_entry.resize(base + (data.size() - sizeof(LogPacketHeader)));
std::memcpy(existing_entry.data() + base, data.data() + offset, std::memcpy(existing_entry.data() + base, data.data() + offset,