1// ---------------------------------------------------------------------------
2//  Project:  NintendoWare
3//  File:     CalcColor.vsh
4//
5//  Copyright (C)2009-2010 Nintendo Co., Ltd.  All rights reserved.
6//
7//  These coded instructions, statements, and computer programs contain
8//  proprietary information of Nintendo of America Inc. and/or Nintendo
9//  Company Ltd., and are protected by Federal copyright law.  They may
10//  not be disclosed to third parties or copied or duplicated in any form,
11//  in whole or in part, without the prior written consent of Nintendo.
12//
13//  $Revision:$
14// ---------------------------------------------------------------------------
15
16#include "ShaderConfig.h"
17#include "VertexShader.h"
18
19    //------------------------------------------
20    // �J���[
21    //------------------------------------------
22
23l_calc_color:
24    // ���_�J���[�̓X�P�[���l���O�ȊO�Ȃ瑶�݂��܂��B
25    mov     TEMP0.y,    nw_attribute_scale0._W
26    cmp     NEQ, NEQ,   TEMP0.xy,       CONST_0
27
28    // ��ɑS�ẴJ���[�� 1 �����Ă���
29    mov     TEMP_COLO.xyzw,      CONST_1
30
31    ifc 0, 1, COND_MODE_STA1 // ���_�J���[���L���ȏꍇ
32        // ifb�̃W�����v�ɂ��X�g�[���΍�̂��߂ɐ�ɒl������Ă����B
33        mul     TEMP0.xyzw,  nw_color.xyzw,       nw_attribute_scale0._W
34        ifb nw_is_vertex_alpha_enable
35            mov     TEMP_COLO.w,      TEMP0.w
36        endif
37        mul     TEMP_COLO.xyz,      TEMP0.xyz,      nw_vertex_color_scale
38    endif
39
40    callb nw_is_hemi_sphere_lighting, l_calc_hemisphere_lighting // �������C�g���L���ȏꍇ
41
42    max     o_Color,    TEMP_COLO,          CONST_0
43    ret
44