mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
29 lines
964 B
C
29 lines
964 B
C
#pragma once
|
|
|
|
#include "common.h"
|
|
#include "nand.h"
|
|
|
|
#define VRT_NONE 0
|
|
#define VRT_SYSNAND 1
|
|
#define VRT_EMUNAND 2
|
|
|
|
static const char* virtualFileList[] = { // must have a match in virtualFileTemplates[]
|
|
"twln.bin", "twlp.bin", "agbsave.bin", "firm0.bin", "firm1.bin", "ctrnand_fat.bin", "ctrnand_full.bin",
|
|
"nand.bin", "nand_minsize.bin", "nand_hdr.bin", "sector0x96.bin"
|
|
};
|
|
static const u32 virtualFileList_size = sizeof(virtualFileList) / sizeof(char*);
|
|
|
|
typedef struct {
|
|
const char name[32];
|
|
u32 offset; // must be a multiple of 0x200
|
|
u32 size;
|
|
u32 keyslot;
|
|
u32 flags;
|
|
} __attribute__((packed)) VirtualFile;
|
|
|
|
u32 IsVirtualPath(const char* path);
|
|
bool CheckVirtualPath(const char* path);
|
|
bool FindVirtualFile(VirtualFile* vfile, const char* path, u32 size);
|
|
int ReadVirtualFile(const VirtualFile* vfile, u8* buffer, u32 offset, u32 count);
|
|
int WriteVirtualFile(const VirtualFile* vfile, const u8* buffer, u32 offset, u32 count);
|