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@553 385bec56-5757-e545-9c3a-d8741f4650f1
89 lines
3.2 KiB
C++
89 lines
3.2 KiB
C++
/*---------------------------------------------------------------------------*
|
|
Project: Horizon
|
|
File: RegionIdModifier.h
|
|
|
|
Copyright (C)2011 Nintendo Co., Ltd. All rights reserved.
|
|
|
|
These coded instructions, statements, and computer programs contain
|
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
|
Company Ltd., and are protected by Federal copyright law. They may
|
|
not be disclosed to third parties or copied or duplicated in any form,
|
|
in whole or in part, without the prior written consent of Nintendo.
|
|
|
|
$Rev:$
|
|
*---------------------------------------------------------------------------*/
|
|
#ifndef _REGION_ID_MODIFIER_H_
|
|
#define _REGION_ID_MODIFIER_H_
|
|
|
|
#if defined(__ARMCC_VERSION)
|
|
#include <nn.h>
|
|
#else
|
|
#include <cstddef>
|
|
#include "types.h"
|
|
#endif
|
|
|
|
struct PathList
|
|
{
|
|
wchar_t path[32];
|
|
};
|
|
|
|
//! @brief データ移行ツールで破壊した地域idを修正するためのクラスです
|
|
class RegionIdModifier
|
|
{
|
|
public:
|
|
//! @brief パラメータを与えて初期化します。
|
|
//! @param[in] id SimpleAddressの上位16ビット
|
|
//! @param[in] nupVersion NUPバージョン
|
|
//! @param[in] regionCode リージョン
|
|
//! @param[in] regionName 地域名
|
|
RegionIdModifier(u16 id, u8 nupVersion, u8 regionCode, const wchar_t* regionName);
|
|
~RegionIdModifier() {};
|
|
|
|
//! @brief 正しいIDかどうか
|
|
bool IsValid();
|
|
|
|
//! @brief バージョン、リージョンに応じたディレクトリパスの配列を取得します
|
|
//! @return パス名。バージョン・リージョンが正しくない場合はNULL
|
|
const PathList* GetDirectoryPath();
|
|
|
|
//! @brief バージョン、リージョンに応じたディレクトリパス数を取得します
|
|
size_t GetDirectoryPathNum();
|
|
|
|
//! @brief 国idに応じたファイル名を取得します
|
|
const wchar_t* GetFileName();
|
|
|
|
//! @brief バージョン、リージョン、国idに応じたファイルパスの配列を取得します
|
|
const PathList* GetFilePath();
|
|
|
|
//! @brief バージョン、リージョン、国idに応じたファイルパス数を取得します
|
|
size_t GetFilePathNum();
|
|
|
|
//! @brief 与えられたバッファから正しい地域idを取得します
|
|
//! @param[in] buf 展開済みの地域データの入ったバッファ
|
|
//! @param[in] size バッファサイズ
|
|
//! @param[out] id 正しいid
|
|
//! @return 正しいidが見つかったかどうか
|
|
bool GetValidRegionId(void* buf , size_t size, u8* id);
|
|
|
|
private:
|
|
//! @brief SimpleAddressの上位16ビット
|
|
// 上位8ビットが国id,下位8ビットが地域
|
|
u16 m_Id;
|
|
|
|
//! @brief NUPバージョン番号
|
|
u8 m_NupVersion;
|
|
//! @brief リージョンコード
|
|
u8 m_RegionCode;
|
|
//! @brief 地域名
|
|
wchar_t m_RegionName[64];
|
|
|
|
//! @brief ファイル名を保存するバッファ
|
|
wchar_t m_FileNameBuf[32];
|
|
//! @brief ディレクトリパスを保存するバッファ
|
|
PathList m_DirectoryPathBuf[3];
|
|
//! @brief ファイルパスを保存するバッファ
|
|
PathList m_FilePathBuf[3];
|
|
};
|
|
|
|
#endif // _REGION_ID_MODIFIER_H_
|