mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@651 385bec56-5757-e545-9c3a-d8741f4650f1
103 lines
3.1 KiB
C++
103 lines
3.1 KiB
C++
/*!
|
|
@file sysFile.h
|
|
@brief ファイルアクセス
|
|
*/
|
|
#ifndef SYS_FILE_H_
|
|
#define SYS_FILE_H_
|
|
|
|
#include <nn/fs/fs_ApiSysSaveData.h>
|
|
|
|
namespace sys
|
|
{
|
|
|
|
class File
|
|
{
|
|
public:
|
|
File(){}
|
|
~File(){}
|
|
|
|
static u8* read( const char* fileName, u32* size, bool device = false, bool prefix = true );
|
|
static u8* read( const wchar_t* fileName, u32* size, bool device = false, bool prefix = true );
|
|
|
|
static void readMsetFile( u8* pSaveData, const size_t size, int type );
|
|
static void readMsetExtFile( u8* pSaveData, const size_t size, int type );
|
|
|
|
#ifndef NW_RELEASE
|
|
static void setDebugPrintFlag( bool flag ){ smDebugPrintFlag = flag; }
|
|
#endif
|
|
|
|
static u8* readLZ( const char* fileName, u32* size );
|
|
static u8* mountShare( const char* name, nn::ProgramId tit_id, int data_num, int files, int dirs );
|
|
|
|
static void initializeMsetSys();
|
|
static void finalizeMsetSys();
|
|
|
|
enum
|
|
{
|
|
eSysSaveDataTypeDsi = 0,
|
|
eSysSaveDataTypeBoss,
|
|
|
|
eSysSaveDataTypeNum
|
|
};
|
|
|
|
enum
|
|
{
|
|
eExtSaveDataTypeDsi = 0,
|
|
|
|
eExtSaveDataTypeNum
|
|
};
|
|
|
|
enum
|
|
{
|
|
eExtResultSuccess,
|
|
eExtResultNeedCreate,
|
|
// これ以降は失敗
|
|
eExtResultNotFreeError, // 空き容量が足りない
|
|
eExtResultDefaultError
|
|
};
|
|
static int checkMsetExt(); // マウントできるかどうか
|
|
static int initializeMsetExt();
|
|
static void finalizeMsetExt();
|
|
|
|
static void saveMmenSys( const u8* saveData, const size_t size );
|
|
static void saveMsetSys( const u8* saveData, const size_t size, int type );
|
|
static void saveMsetExt( const u8* saveData, const size_t size, int type );
|
|
|
|
static nn::fs::SystemSaveDataId getMmenSaveDataId();
|
|
static nn::fs::SystemSaveDataId getMsetSaveDataId();
|
|
static nn::fs::ExtSaveDataId getMsetExtSaveDataId();
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
static const char* getMmenSysArcName() { return mMmenSysArcName; }
|
|
static const char* getMsetSysArcName() { return mMsetSysArcName; }
|
|
static const char* getMsetExtArcName() { return mMsetExtArcName; }
|
|
static const wchar_t* getMmenSysSaveDataPath() { return mMmenSysSaveDataPath; }
|
|
static const wchar_t* getMsetSysSaveDataPath( int type ) { return mMsetSysSaveDataPath[ type ]; }
|
|
static const wchar_t* getMsetExtSaveDataPath( int type ) { return mMsetExtSaveDataPath[ type ]; }
|
|
|
|
enum
|
|
{
|
|
eMsetSaveDataSize = 64 * 1024,
|
|
eMsetExtSaveDataSize = 120 * 1024
|
|
};
|
|
|
|
private:
|
|
|
|
static void debug_print_();
|
|
|
|
#ifndef NW_RELEASE
|
|
static bool smDebugPrintFlag;
|
|
#endif
|
|
|
|
static const char* mMmenSysArcName;
|
|
static const wchar_t* mMmenSysSaveDataPath;
|
|
static const char* mMsetSysArcName;
|
|
static const wchar_t* mMsetSysSaveDataPath[ eSysSaveDataTypeNum ];
|
|
static const char* mMsetExtArcName;
|
|
static const wchar_t* mMsetExtSaveDataPath[ eExtSaveDataTypeNum ];
|
|
};
|
|
|
|
}
|
|
#endif
|