NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
ut_NandFileStream.h
1#ifndef NW4R_UT_NAND_FILE_STREAM_H
2#define NW4R_UT_NAND_FILE_STREAM_H
3#include <nw4r/types_nw4r.h>
4
5#include <nw4r/ut/ut_FileStream.h>
6
7#include <revolution/NAND.h>
8
9namespace nw4r {
10namespace ut {
11
12class NandFileStream : public FileStream {
13public:
14 NW4R_UT_RTTI_DECL(NandFileStream);
15
16public:
17 NandFileStream(const char* pPath, ulong mode);
18 NandFileStream(const NANDFileInfo* pInfo, ulong mode, bool enableClose);
19 virtual ~NandFileStream(); // at 0xC
20
21 bool Open(const char* pPath, ulong mode);
22 bool Open(const NANDFileInfo* pInfo, ulong mode, bool enableClose)
23 DECOMP_DONT_INLINE;
24
25 virtual void Close(); // at 0x10
26
27 virtual s32 Read(void* pDst, ulong size); // at 0x14
28 virtual bool ReadAsync(void* pDst, ulong size, StreamCallback pCallback,
29 void* pCallbackArg); // at 0x18
30
31 virtual void Write(const void* pSrc, ulong size); // at 0x1C
32 virtual bool WriteAsync(const void* pSrc, ulong size,
33 StreamCallback pCallback,
34 void* pCallbackArg); // at 0x20
35
36 virtual void Seek(s32 offset, ulong origin); // at 0x44
37
38 virtual bool IsBusy() const {
39 return mIsBusy;
40 } // at 0x24
41
42 virtual ulong Tell() const {
43 return mFilePosition.Tell();
44 } // at 0x58
45 virtual ulong GetSize() const {
46 return mFilePosition.GetFileSize();
47 } // at 0x40
48
49 virtual bool CanAsync() const {
50 return true;
51 } // at 0x28
52 virtual bool CanSeek() const {
53 return true;
54 } // at 0x50
55 virtual bool CanRead() const {
56 return mCanRead;
57 } // at 0x2C
58 virtual bool CanWrite() const {
59 return mCanWrite;
60 } // at 0x30
61 virtual bool CanCancel() const {
62 return false;
63 } // at 0x54
64
65 virtual ulong GetOffsetAlign() const {
66 return 1;
67 } // at 0x34
68 virtual ulong GetSizeAlign() const {
69 return 32;
70 } // at 0x38
71 virtual ulong GetBufferAlign() const {
72 return 32;
73 } // at 0x3C
74
75private:
77 NANDCommandBlock nandBlock; // at 0x0
78 NANDFileInfo nandInfo; // at 0xB8
79 NandFileStream* stream; // at 0x144
80 };
81
82private:
83 static void NandAsyncCallback_(s32 result, NANDCommandBlock* pBlock);
84
85 void Initialize_();
86
87private:
88 FilePosition mFilePosition; // at 0x14
89 NandFileStreamInfo mFileInfo; // at 0x1C
90 bool mCanRead; // at 0x164
91 bool mCanWrite; // at 0x165
92 volatile bool mIsBusy; // at 0x166
93 bool mCloseOnDestroyFlg; // at 0x167
94 bool mCloseEnableFlg; // at 0x168
95};
96
97} // namespace ut
98} // namespace nw4r
99
100#endif
Debugging library which includes various utilities used by the rest of nw4r.
Definition ut_list.cpp:4