mirror of
https://github.com/Dark98/threeSD.git
synced 2026-07-03 16:49:04 +00:00
Add support for title.db, and use title.db to augment TMD finding
Also added support for system title CIA building, and fixed various minor issues. Also moved MakeMagic to Common.
This commit is contained in:
@@ -175,7 +175,7 @@ bool CIABuilder::AddContent(u16 content_id, NCCHContainer& ncch) {
|
||||
file->SetHashEnabled(false);
|
||||
|
||||
// DLCs do not have a meta
|
||||
if (tmd_chunk.index != TMDContentIndex::Main || (tmd.GetTitleID() & 0x0004008c'00000000)) {
|
||||
if (tmd_chunk.index != TMDContentIndex::Main || (tmd.GetTitleID() >> 32) == 0x0004008c) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
|
||||
namespace Core {
|
||||
|
||||
constexpr u32 MakeMagic(char a, char b, char c, char d) {
|
||||
return a | b << 8 | c << 16 | d << 24;
|
||||
}
|
||||
|
||||
static const int kMaxSections = 8; ///< Maximum number of sections (files) in an ExeFs
|
||||
static const int kBlockSize = 0x200; ///< Size of ExeFS blocks (in bytes)
|
||||
|
||||
|
||||
@@ -4,15 +4,12 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "core/ncch/smdh.h"
|
||||
|
||||
namespace Core {
|
||||
|
||||
constexpr u32 MakeMagic(char a, char b, char c, char d) {
|
||||
return a | b << 8 | c << 16 | d << 24;
|
||||
}
|
||||
|
||||
// 8x8 Z-Order coordinate from 2D coordinates
|
||||
static constexpr u32 MortonInterleave(u32 x, u32 y) {
|
||||
constexpr u32 xlut[] = {0x00, 0x01, 0x04, 0x05, 0x10, 0x11, 0x14, 0x15};
|
||||
|
||||
@@ -207,6 +207,13 @@ const TitleMetadata::ContentChunk& TitleMetadata::GetContentChunkByID(u32 conten
|
||||
return *it;
|
||||
}
|
||||
|
||||
bool TitleMetadata::HasContentID(u32 content_id) const {
|
||||
const auto it =
|
||||
std::find_if(tmd_chunks.begin(), tmd_chunks.end(),
|
||||
[content_id](const ContentChunk& chunk) { return chunk.id == content_id; });
|
||||
return it != tmd_chunks.end();
|
||||
}
|
||||
|
||||
void TitleMetadata::AddContentChunk(const ContentChunk& chunk) {
|
||||
tmd_chunks.push_back(chunk);
|
||||
}
|
||||
|
||||
@@ -127,6 +127,7 @@ public:
|
||||
|
||||
ContentChunk& GetContentChunkByID(u32 content_id);
|
||||
const ContentChunk& GetContentChunkByID(u32 content_id) const;
|
||||
bool HasContentID(u32 content_id) const;
|
||||
|
||||
void SetTitleID(u64 title_id);
|
||||
void SetTitleType(u32 type);
|
||||
|
||||
Reference in New Issue
Block a user