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@792 385bec56-5757-e545-9c3a-d8741f4650f1
119 lines
2.9 KiB
C++
119 lines
2.9 KiB
C++
/*---------------------------------------------------------------------------*
|
||
Project: Horizon
|
||
File: Util.h
|
||
|
||
Copyright 2009 Nintendo. 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 UTIL_H_
|
||
#define UTIL_H_
|
||
|
||
#include <string>
|
||
#include <nn.h>
|
||
#include <nn/cfg/CTR/cfg_ApiSys.h>
|
||
#include <nn/mcu.h>
|
||
#include <nn/nwm.h>
|
||
|
||
#include "VersionDetect.h"
|
||
|
||
namespace common
|
||
{
|
||
|
||
class Util
|
||
{
|
||
public:
|
||
|
||
Util();
|
||
virtual ~Util();
|
||
|
||
void InitializeForBackup();
|
||
void InitializeForRestore();
|
||
|
||
void FinalizeForBackup();
|
||
void FinalizeForRestore();
|
||
|
||
// 無線状態をONにする
|
||
void SetWifiOn();
|
||
|
||
// 無線状態をOFFにする
|
||
void SetWifiOff();
|
||
|
||
// 無線状態を取得する
|
||
bool IsWifiOn();
|
||
|
||
// ACアダプタが接続されているかどうか
|
||
bool IsAdapterConnected();
|
||
|
||
// バッテリ残量が10%未満かどうか
|
||
bool IsBatteryLower();
|
||
|
||
// CUPメジャーバージョンを返す
|
||
u8 GetCupMajorVersion();
|
||
|
||
// CUPマイナーバージョンを返す
|
||
u8 GetCupMinorVersion();
|
||
|
||
// CUPマイクロバージョンを返す
|
||
u8 GetCupMicroVersion();
|
||
|
||
// NUPバージョンを返す
|
||
u8 GetNupVersion();
|
||
|
||
// MCUプロセスに接続するためのハンドルを返す
|
||
nn::Handle GetMcuHandle();
|
||
|
||
// バッテリ残量を0~100で返す
|
||
u32 GetBatteryRemain();
|
||
|
||
// リージョンコードを返す
|
||
nn::cfg::CTR::CfgRegionCode GetRegion();
|
||
|
||
// リージョンコードを3文字のアルファベットに置き換えた文字列を返す
|
||
const char* GetRegionCodeA3();
|
||
|
||
// バージョン情報を取得する
|
||
void GetVersionData(common::VerDef* version);
|
||
|
||
// 現在の描画先ディスプレイを返す
|
||
// target NN_GX_DISPLAY0 または NN_GX_DISPLAY1
|
||
// flip 上下画面を入れ替えているかどうか
|
||
static u32 GetRenderTarget(u32 target, bool flip = false);
|
||
|
||
private:
|
||
void Initialize();
|
||
void Finalize();
|
||
void ReadIvs(u8 cupMajorVersion);
|
||
|
||
// バージョン情報
|
||
common::VerDef m_VerData;
|
||
|
||
// mcu接続のためのハンドル
|
||
nn::Handle m_McuSession;
|
||
|
||
// MCUへのポインタ
|
||
nn::mcu::CTR::HwCheck* mp_Mcu;
|
||
|
||
NN_PADDING2;
|
||
// リージョン
|
||
nn::cfg::CTR::CfgRegionCode m_Region;
|
||
|
||
// バッテリ残量
|
||
u8 m_BatteryRemain;
|
||
|
||
};
|
||
|
||
nn::Result InitializeNetwork(void);
|
||
nn::Result FinalizeNetwork(void);
|
||
|
||
}
|
||
|
||
#endif /* UTIL_H_ */
|