Debian Codegraph @

Source/Core/DiscIO/VolumeDisc.h

raw symbols SCIP
1 // Copyright 2020 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <array>
7 #include <optional>
8 #include <string>
9
10 #include "Common/CommonTypes.h"
11 #include "Common/Crypto/SHA1.h"
12 #include "DiscIO/Volume.h"
13
14 namespace DiscIO
15 {
16 class VolumeDisc : public Volume
17 {
18 public:
19 struct BootID
20 {
21 u32 magic; // 0x00 (Always BTID)
22 std::array<uint32_t, 3> unknown0;
23 std::array<uint32_t, 4> unknown1;
24 std::array<char, 4> mediaboard_type; // 0x20 (GCAM for Triforce)
25 uint32_t unknown2;
26 uint16_t year; // 0x28
27 uint8_t month; // 0x2A
28 uint8_t day; // 0x2B
29 uint8_t video_mode; // 0x2C unknown bitmask, resolutions + horizontal/vertical
30 uint8_t unknown3;
31 uint8_t type_3_compatible; // 0x2E (Type-3 compatible titles have this set to 1)
32 uint8_t unknown4;
33 std::array<char, 8> game_id; // 0x30
34 uint32_t region_flags; // 0x38
35 std::array<uint32_t, 9> unknown6;
36 std::array<char, 0x20> manufacturer; // 0x60
37 std::array<char, 0x20> game_name; // 0x80
38 std::array<char, 0x20> game_executable; // 0xA0
39 std::array<char, 0x20> test_executable; // 0xC0
40 std::array<std::array<char, 0x20>, 8> credit_types; // 0xE0
41 };
42
43 std::string GetGameID(const Partition& partition = PARTITION_NONE) const override;
44 Country GetCountry(const Partition& partition = PARTITION_NONE) const override;
45 std::string GetMakerID(const Partition& partition = PARTITION_NONE) const override;
46 std::optional<u16> GetRevision(const Partition& partition = PARTITION_NONE) const override;
47 std::string GetInternalName(const Partition& partition = PARTITION_NONE) const override;
48 std::string GetApploaderDate(const Partition& partition) const override;
49 std::optional<u8> GetDiscNumber(const Partition& partition = PARTITION_NONE) const override;
50 bool IsNKit() const override;
51
52 protected:
53 Region RegionCodeToRegion(std::optional<u32> region_code) const;
54 void AddGamePartitionToSyncHash(Common::SHA1::Context* context) const;
55 };
56
57 static_assert(sizeof(VolumeDisc::BootID) == 480);
58
59 } // namespace DiscIO