wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
storage.h
Go to the documentation of this file.
1#pragma once
2#include <wut.h>
3
11#ifdef __cplusplus
12
13#include <cstring>
14
15namespace nn {
16namespace spm {
17
23
24using StorageIndex = uint64_t;
25
27{
28 VolumeId() = default;
29
30 VolumeId(char const* id){
31 strncpy(this->id, id, sizeof(this->id));
32 }
33
40 int32_t
41 Compare(VolumeId const& other) const
42 asm("Compare__Q3_2nn3spm8VolumeIdCFRCQ3_2nn3spm8VolumeId");
43
44 char id[16];
45};
46WUT_CHECK_SIZE(VolumeId, 0x10);
47
49{
51 WUT_UNKNOWN_BYTES(0x04);
53};
54WUT_CHECK_OFFSET(StorageListItem, 0x00, index);
55WUT_CHECK_OFFSET(StorageListItem, 0x0c, type);
56WUT_CHECK_SIZE(StorageListItem, 0x10);
57
59{
61 char path[0x280];
66 WUT_UNKNOWN_BYTES(4);
69};
70WUT_CHECK_OFFSET(StorageInfo, 0x000, path);
71WUT_CHECK_OFFSET(StorageInfo, 0x280, connection_type_string);
72WUT_CHECK_OFFSET(StorageInfo, 0x288, format_string);
73WUT_CHECK_OFFSET(StorageInfo, 0x294, type);
74WUT_CHECK_OFFSET(StorageInfo, 0x298, volumeId);
75WUT_CHECK_SIZE(StorageInfo, 0x2a8);
76
77void
79 asm("Initialize__Q2_2nn3spmFv");
80
81void
83 asm("Finalize__Q2_2nn3spmFv");
84
85void
86SetAutoFatal(bool enabled)
87 asm("SetAutoFatal__Q2_2nn3spmFb");
88
95int32_t
97 asm("SetExtendedStorage__Q2_2nn3spmFQ3_2nn3spm12StorageIndex");
98
102void
104 asm("SetDefaultExtendedStorageVolumeId__Q2_2nn3spmFRCQ3_2nn3spm8VolumeId");
105
109void
111 asm("GetDefaultExtendedStorageVolumeId__Q2_2nn3spmFv");
112
113bool
115 asm("GetPreviousExtendedStorageVolumeId__Q2_2nn3spmFPbPQ3_2nn3spm8VolumeId");
116
117bool
118FindStorageByVolumeId(StorageIndex* outIndex, VolumeId const& volumeId)
119 asm("FindStorageByVolumeId__Q2_2nn3spmFPQ3_2nn3spm12StorageIndexRCQ3_2nn3spm8VolumeId");
120
121int32_t
123 asm("GetExtendedStorageIndex__Q2_2nn3spmFPQ3_2nn3spm12StorageIndex");
124
125int32_t
126GetStorageList(StorageListItem* items, uint32_t maxNumItems)
127 asm("GetStorageList__Q2_2nn3spmFPQ3_2nn3spm15StorageListItemUi");
128
129int32_t
131 asm("GetStorageInfo__Q2_2nn3spmFPQ3_2nn3spm11StorageInfoQ3_2nn3spm12StorageIndex");
132
139int32_t
140ReadRawStorageHead512(StorageIndex* index, char* outBuffer)
141 asm("ReadRawStorageHead512__Q2_2nn3spmFQ3_2nn3spm12StorageIndexPc");
142
151int32_t
152IsStorageMaybePcFormatted(bool* isPcFormatted, StorageIndex* index)
153 asm("IsStorageMaybePcFormatted__Q2_2nn3spmFPbQ3_2nn3spm12StorageIndex");
154
163int32_t
164IsStorageMaybeWfsFormatted(bool* isWfsFormatted, StorageIndex* index)
165 asm("IsStorageMaybeWfsFormatted__Q2_2nn3spmFPbQ3_2nn3spm12StorageIndex");
166
167};
168};
169
170#endif
171
char connection_type_string[8]
The connection type (e.g. "usb")
Definition storage.h:63
int32_t ReadRawStorageHead512(StorageIndex *index, char *outBuffer) asm("ReadRawStorageHead512__Q2_2nn3spmFQ3_2nn3spm12StorageIndexPc")
Reads the first 512 bytes of the storage head into the buffer.
VolumeId volumeId
Definition storage.h:68
uint64_t StorageIndex
Definition storage.h:24
int32_t IsStorageMaybePcFormatted(bool *isPcFormatted, StorageIndex *index) asm("IsStorageMaybePcFormatted__Q2_2nn3spmFPbQ3_2nn3spm12StorageIndex")
void SetAutoFatal(bool enabled) asm("SetAutoFatal__Q2_2nn3spmFb")
int32_t SetExtendedStorage(StorageIndex *index) asm("SetExtendedStorage__Q2_2nn3spmFQ3_2nn3spm12StorageIndex")
Sets the storage drive which should be used for extended storage.
void Finalize() asm("Finalize__Q2_2nn3spmFv")
int32_t IsStorageMaybeWfsFormatted(bool *isWfsFormatted, StorageIndex *index) asm("IsStorageMaybeWfsFormatted__Q2_2nn3spmFPbQ3_2nn3spm12StorageIndex")
StorageIndex index
Definition storage.h:50
char format_string[8]
The drive format (e.g. "raw" / "wfs")
Definition storage.h:65
char path[0x280]
The mount path (e.g. "/vol/storage_usb01")
Definition storage.h:61
int32_t GetStorageInfo(StorageInfo *outInfo, StorageIndex *index) asm("GetStorageInfo__Q2_2nn3spmFPQ3_2nn3spm11StorageInfoQ3_2nn3spm12StorageIndex")
bool FindStorageByVolumeId(StorageIndex *outIndex, VolumeId const &volumeId) asm("FindStorageByVolumeId__Q2_2nn3spmFPQ3_2nn3spm12StorageIndexRCQ3_2nn3spm8VolumeId")
void GetDefaultExtendedStorageVolumeId(VolumeId *id) asm("GetDefaultExtendedStorageVolumeId__Q2_2nn3spmFv")
Gets the id of the default extended storage drive.
bool GetPreviousExtendedStorageVolumeId(bool *, VolumeId *outVolumeId) asm("GetPreviousExtendedStorageVolumeId__Q2_2nn3spmFPbPQ3_2nn3spm8VolumeId")
StorageType
Definition storage.h:19
@ STORAGE_TYPE_RAW
Definition storage.h:20
@ STORAGE_TYPE_WFS
Definition storage.h:21
int32_t GetExtendedStorageIndex(StorageIndex *outIndex) asm("GetExtendedStorageIndex__Q2_2nn3spmFPQ3_2nn3spm12StorageIndex")
void Initialize() asm("Initialize__Q2_2nn3spmFv")
void SetDefaultExtendedStorageVolumeId(VolumeId const &id) asm("SetDefaultExtendedStorageVolumeId__Q2_2nn3spmFRCQ3_2nn3spm8VolumeId")
Sets the id of the default extended storage drive.
int32_t GetStorageList(StorageListItem *items, uint32_t maxNumItems) asm("GetStorageList__Q2_2nn3spmFPQ3_2nn3spm15StorageListItemUi")
Definition ac_cpp.h:16
int32_t Compare(VolumeId const &other) const asm("Compare__Q3_2nn3spm8VolumeIdCFRCQ3_2nn3spm8VolumeId")
Compares this VolumeId with another one.
VolumeId(char const *id)
Definition storage.h:30
VolumeId()=default