NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
NWC24Download.h
1#ifndef RVL_SDK_NWC24_DOWNLOAD_H
2#define RVL_SDK_NWC24_DOWNLOAD_H
3#include <revolution/FS.h>
4#include <revolution/NWC24/NWC24Types.h>
5#include <types.h>
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10#define NWC24_DL_TASK_MAX 120
11#define NWC24_DL_SUBTASK_MAX 32
12
13typedef enum {
14 NWC24_DLTYPE_MULTIPART_V1,
15 NWC24_DLTYPE_OCTETSTREAM_V1,
16 NWC24_DLTYPE_MULTIPART_V2,
17 NWC24_DLTYPE_OCTETSTREAM_V2
18} NWC24DlType;
19
20typedef enum {
21 NWC24_DL_STTYPE_NONE,
22 NWC24_DL_STTYPE_INCREMENT,
23 NWC24_DL_STTYPE_TIME_HOUR,
24 NWC24_DL_STTYPE_TIME_DAYOFWEEK,
25 NWC24_DL_STTYPE_TIME_DAY
26} NWC24DlSubTaskType;
27
28typedef enum {
29 NWC24_DL_STFLAG_TRAILING_FILENAME = (1 << 0),
30 NWC24_DL_STFLAG_TRAILING_URL = (1 << 1),
31 NWC24_DL_STFLAG_INTELLIGENT_UPDATE = (1 << 8),
32 NWC24_DL_STFLAG_RETICENT_UPDATE = (1 << 9)
33} NWC24DlSubTaskFlags;
34
35typedef struct NWC24DlEntry {
36 u32 app; // at 0x0
37 u32 nextTime; // at 0x4
38 u32 lastAccess; // at 0x8
39 u8 flags; // at 0xC
40 char UNK_0xD[0x10 - 0xD];
42
43#pragma pack(push, 1)
44typedef struct NWC24DlHeader {
45 u32 magic; // at 0x0
46 u32 version; // at 0x4
47 char UNK_0x8[0x10 - 0x8];
48 u16 maxSubTasks; // at 0x10
49 u16 privateTasks; // at 0x12
50 u16 maxTasks; // at 0x14
51 char UNK_0x16[0x80 - 0x16];
52 NWC24DlEntry entries[NWC24_DL_TASK_MAX]; // at 0x80
54#pragma pack(pop)
55
56#pragma pack(push, 1)
57typedef struct NWC24DlTask {
58 u16 id; // at 0x0
59 u8 type; // at 0x2
60 u8 priority; // at 0x3
61 u32 flags; // at 0x4
62 u32 appId; // at 0x8
63 u32 titleIdHi; // at 0xC
64 u32 titleIdLo; // at 0x10
65 u16 groupId; // at 0x14
66 char UNK_0x16[0x2];
67 s16 count; // at 0x18
68 s16 errorCount; // at 0x1A
69 u16 interval; // at 0x1C
70 u16 margin; // at 0x1E
71 u32 lastError; // at 0x20
72 u8 subTaskCounter; // at 0x24
73 u8 subTaskType; // at 0x25
74 u8 subTaskFlags; // at 0x26
75 char UNK_0x27[0x1];
76 u32 subTaskMask; // at 0x28
77 u32 serverInterval; // at 0x2C
78 u32 lastUpdate; // at 0x30
79 u32 lastUpdateSubTask[NWC24_DL_SUBTASK_MAX]; // at 0x34
80 char url[236]; // at 0xB4
81 char fileName[FS_MAX_PATH]; // at 0x1A0
82 char UNK_0x1E0[0x1F8 - 0x1E0];
83 u32 userParam; // at 0x1F8
84 u8 optFlags; // at 0x1FC
85 u8 rootCaId; // at 0x1FD
86 char UNK_0x1FE[0x200 - 0x1FE];
88#pragma pack(pop)
89
90NWC24Err NWC24CheckDlTask(NWC24DlTask* task);
91NWC24Err NWC24DeleteDlTaskForced(NWC24DlTask* task);
92NWC24Err NWC24GetDlTask(NWC24DlTask* task, u16 i);
93NWC24Err NWC24iOpenDlTaskList(void);
94NWC24Err NWC24iCloseDlTaskList(void);
95NWC24DlHeader* NWC24iGetCachedDlHeader(void);
96NWC24Err NWC24iCheckHeaderConsistency(NWC24DlHeader* header,
97 BOOL clear) DECOMP_DONT_INLINE;
98NWC24Err NWC24iLoadDlHeader(void);
99
100#ifdef __cplusplus
101}
102#endif
103#endif