/*---------------------------------------------------------------------------* Project: Horizon File: pl_SharedFont.h Copyright (C)2010 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: 25126 $ *---------------------------------------------------------------------------*/ #ifndef NN_PL_CTR_PL_SHAREDFONT_H_ #define NN_PL_CTR_PL_SHAREDFONT_H_ #include #include #include #include namespace nn { namespace pl { namespace CTR { /*! @name 共有フォント @{ */ /*! @brief 共有フォントの種類を表します。 */ enum SharedFontType { SHARED_FONT_TYPE_NULL, SHARED_FONT_TYPE_STD, //!< 日米欧フォント SHARED_FONT_TYPE_CN, //!< 中国フォント SHARED_FONT_TYPE_KR, //!< 韓国フォント SHARED_FONT_TYPE_TW //!< 台湾フォント }; /*! @brief 共有フォントのロード状態を表します。 */ enum SharedFontLoadState { SHARED_FONT_LOAD_STATE_NULL, SHARED_FONT_LOAD_STATE_LOADING, //!< ロード中 SHARED_FONT_LOAD_STATE_LOADED, //!< ロード済 SHARED_FONT_LOAD_STATE_FAILED, //!< ロード失敗 SHARED_FONT_LOAD_STATE_MAX_BIT = (1u << 31) }; namespace detail { // 共有フォント用共有メモリのサイズ: 3,236 MB const size_t SHAREDFONT_MEMORY_SIZE = 1024 * 4 * 809; struct SharedFontBufferHeader { util::SizedEnum4 state; util::SizedEnum4 type; size_t size; bit8 padding[116]; }; struct SharedFontBuffer { SharedFontBufferHeader header; // 128 byte アライメントが必要 bit8 font[SHAREDFONT_MEMORY_SIZE - sizeof(SharedFontBufferHeader)]; }; } /*! @brief 共有フォントを使用可能にします。 @return 処理結果を返します。 */ nn::Result InitializeSharedFont(); /*! @brief 共有フォントのアドレスを取得します。 @return 共有フォントのアドレスを返します。 */ void* GetSharedFontAddress(); /*! @brief 共有フォントのサイズを取得します。 @return 共有フォントのサイズを返します。 */ size_t GetSharedFontSize(); /*! @brief 共有フォントの種類を取得します。 @return 共有フォントの種類を返します。 */ SharedFontType GetSharedFontType(); /*! @brief 共有フォントのロード状態を取得します。 @return 共有フォントのロード状態を返します。 */ SharedFontLoadState GetSharedFontLoadState(); /*! @} */ } // end of namespace CTR } // end of namespace pl } // end of namespace nn #endif // ifndef NN_PL_CTR_PL_SHAREDFONT_H_