2021-03-09 19:06:34 +00:00
|
|
|
// Copyright 2021 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2021-03-09 19:06:34 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <optional>
|
|
|
|
#include <string>
|
2021-03-09 19:54:59 +00:00
|
|
|
#include <vector>
|
2021-03-09 19:06:34 +00:00
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
namespace DiscIO
|
|
|
|
{
|
2021-03-09 19:54:59 +00:00
|
|
|
class FileInfo;
|
2021-03-09 19:06:34 +00:00
|
|
|
struct Partition;
|
|
|
|
class Volume;
|
|
|
|
|
2021-03-09 19:54:59 +00:00
|
|
|
constexpr u64 MINI_DVD_SIZE = 1459978240; // GameCube
|
|
|
|
constexpr u64 SL_DVD_SIZE = 4699979776; // Wii retail
|
|
|
|
constexpr u64 SL_DVD_R_SIZE = 4707319808; // Wii RVT-R
|
|
|
|
constexpr u64 DL_DVD_SIZE = 8511160320; // Wii retail
|
|
|
|
constexpr u64 DL_DVD_R_SIZE = 8543666176; // Wii RVT-R
|
|
|
|
|
2021-03-09 20:06:57 +00:00
|
|
|
constexpr u32 GAMECUBE_DISC_MAGIC = 0xC2339F3D;
|
|
|
|
constexpr u32 WII_DISC_MAGIC = 0x5D1C9EA3;
|
|
|
|
|
2021-03-09 19:06:34 +00:00
|
|
|
constexpr u32 PARTITION_DATA = 0;
|
|
|
|
constexpr u32 PARTITION_UPDATE = 1;
|
|
|
|
constexpr u32 PARTITION_CHANNEL = 2; // Mario Kart Wii, Wii Fit, Wii Fit Plus, Rabbids Go Home
|
|
|
|
constexpr u32 PARTITION_INSTALL = 3; // Dragon Quest X only
|
|
|
|
|
|
|
|
std::string NameForPartitionType(u32 partition_type, bool include_prefix);
|
|
|
|
|
|
|
|
std::optional<u64> GetApploaderSize(const Volume& volume, const Partition& partition);
|
|
|
|
std::optional<u64> GetBootDOLOffset(const Volume& volume, const Partition& partition);
|
|
|
|
std::optional<u32> GetBootDOLSize(const Volume& volume, const Partition& partition, u64 dol_offset);
|
|
|
|
std::optional<u64> GetFSTOffset(const Volume& volume, const Partition& partition);
|
|
|
|
std::optional<u64> GetFSTSize(const Volume& volume, const Partition& partition);
|
2021-03-09 19:54:59 +00:00
|
|
|
|
|
|
|
u64 GetBiggestReferencedOffset(const Volume& volume);
|
|
|
|
u64 GetBiggestReferencedOffset(const Volume& volume, const std::vector<Partition>& partitions);
|
|
|
|
} // namespace DiscIO
|