/*---------------------------------------------------------------------------* Project: Horizon File: gr_Viewport.cpp 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: 25760 $ *---------------------------------------------------------------------------*/ #include #include namespace nn { namespace gr { namespace CTR { u32* Viewport::MakeCommand( u32* command ) { // コマンドに積む値に変換します u32 width24 = Float32ToFloat24( width / 2.f ); u32 width31 = Float32ToFloat31( 2.f / width ) << 1; u32 height24 = Float32ToFloat24( height / 2.f ); u32 height31 = Float32ToFloat31( 2.f / height ) << 1; // コマンドに積みます *command++ = width24; *command++ = PICA_CMD_HEADER_SINGLE_BE( PICA_REG_VIEWPORT_WIDTH1, 0x7 ); *command++ = width31; *command++ = PICA_CMD_HEADER_SINGLE( PICA_REG_VIEWPORT_WIDTH2 ); *command++ = height24; *command++ = PICA_CMD_HEADER_SINGLE_BE( PICA_REG_VIEWPORT_HEIGHT1, 0x7 ); *command++ = height31; *command++ = PICA_CMD_HEADER_SINGLE( PICA_REG_VIEWPORT_HEIGHT2 ); *command++ = PICA_CMD_DATA_VIEWPORT_XY( x, y ); *command++ = PICA_CMD_HEADER_SINGLE( PICA_REG_VIEWPORT_XY ); return command; } } // namespace CTR } // namespace gr } // namespace nn