2021-08-24 15:46:20 +00:00
|
|
|
/*
|
2022-01-09 01:15:50 +00:00
|
|
|
Copyright 2016-2022 melonDS team
|
2021-08-24 15:46:20 +00:00
|
|
|
|
|
|
|
This file is part of melonDS.
|
|
|
|
|
|
|
|
melonDS is free software: you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
|
|
|
Software Foundation, either version 3 of the License, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
melonDS is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with melonDS. If not, see http://www.gnu.org/licenses/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DSI_NAND_H
|
|
|
|
#define DSI_NAND_H
|
|
|
|
|
|
|
|
#include "types.h"
|
2021-08-26 16:59:07 +00:00
|
|
|
#include "NDS_Header.h"
|
2023-07-08 20:17:30 +00:00
|
|
|
#include "DSi_TMD.h"
|
2021-08-24 15:46:20 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace DSi_NAND
|
|
|
|
{
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
TitleData_PublicSav,
|
|
|
|
TitleData_PrivateSav,
|
|
|
|
TitleData_BannerSav,
|
|
|
|
};
|
|
|
|
|
2022-09-23 20:53:23 +00:00
|
|
|
bool Init(u8* es_keyY);
|
2021-08-24 15:46:20 +00:00
|
|
|
void DeInit();
|
|
|
|
|
2023-08-18 20:50:57 +00:00
|
|
|
Platform::FileHandle* GetFile();
|
2022-09-23 20:53:23 +00:00
|
|
|
|
2021-08-24 15:46:20 +00:00
|
|
|
void GetIDs(u8* emmc_cid, u64& consoleid);
|
|
|
|
|
2021-08-30 18:26:49 +00:00
|
|
|
void ReadHardwareInfo(u8* dataS, u8* dataN);
|
|
|
|
|
|
|
|
void ReadUserData(u8* data);
|
2021-11-20 11:09:13 +00:00
|
|
|
void PatchUserData();
|
2021-08-24 15:46:20 +00:00
|
|
|
|
|
|
|
void ListTitles(u32 category, std::vector<u32>& titlelist);
|
|
|
|
bool TitleExists(u32 category, u32 titleid);
|
2021-08-26 16:59:07 +00:00
|
|
|
void GetTitleInfo(u32 category, u32 titleid, u32& version, NDSHeader* header, NDSBanner* banner);
|
2023-07-08 20:17:30 +00:00
|
|
|
bool ImportTitle(const char* appfile, const DSi_TMD::TitleMetadata& tmd, bool readonly);
|
|
|
|
bool ImportTitle(const u8* app, size_t appLength, const DSi_TMD::TitleMetadata& tmd, bool readonly);
|
2021-08-24 15:46:20 +00:00
|
|
|
void DeleteTitle(u32 category, u32 titleid);
|
|
|
|
|
|
|
|
u32 GetTitleDataMask(u32 category, u32 titleid);
|
|
|
|
bool ImportTitleData(u32 category, u32 titleid, int type, const char* file);
|
|
|
|
bool ExportTitleData(u32 category, u32 titleid, int type, const char* file);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // DSI_NAND_H
|