1//
2//------------------------------------------------------------
3// Copyright(c) 2009-2010 by Digital Media Professionals Inc.
4// All rights reserved.
5//------------------------------------------------------------
6// This source code is the confidential and proprietary
7// of Digital Media Professionals Inc.
8//------------------------------------------------------------
9//
10
11//------------------------------------------
12//  related cmp
13//------------------------------------------
14#define CMP_MODE_EQ         0
15#define CMP_MODE_NE         1
16#define CMP_MODE_LT         2
17#define CMP_MODE_LE         3
18#define CMP_MODE_GT         4
19#define CMP_MODE_GE         5
20
21//------------------------------------------
22//  related condition
23//------------------------------------------
24#define COND_MODE_OR        0
25#define COND_MODE_AND       1
26#define COND_MODE_STA0      2
27#define COND_MODE_STA1      3
28
29//------------------------------------------
30//  related status reg
31//------------------------------------------
32#define STAT0_0             0
33#define STAT0_1             1
34#define STAT1_0             0
35#define STAT1_1             1
36
37// Input registers map
38#define aPosition           v0
39#define aTexCoord           v1
40
41#define uProjection         c0
42#define uModelView          c4
43
44// Constant registers map
45#define CONST               c95     // 0.0 0.5 1.0 3.0
46
47#define EQ                  0
48#define NEQ                 1
49#define LESS                2
50#define LEQ                 3
51#define GT                  4
52#define GEQ                 5
53
54// Temporary registers map
55#define TEMP0               r0
56#define TEMP1               r1
57#define TEMP2               r2
58#define TEMP3               r3
59#define TEMP4               r4
60
61#define TEMP_TEX0           r10
62#define TEMP_TEX1           r11
63#define TEMP_TEX2           r12
64#define TEMP_TEX3           r13
65#define TEMP_TANG           r13
66#define TEMP_NORM           r14
67#define TEMP_VIEW           r15
68#define TEMP_POS            r12
69
70// Constant registers
71def     CONST,              0.0, 0.5, 1.0, 3.0
72
73#pragma bind_symbol(aPosition.xyzw,v0,v0)
74#pragma bind_symbol(aTexCoord.xyz,v1,v1)
75
76#pragma output_map (position, o0)
77#pragma output_map (texture0, o1.xy)
78#pragma output_map (texture1, o2.xy)
79
80#pragma bind_symbol(uProjection,c0,c3)
81#pragma bind_symbol(uModelView,c4,c7)
82
83l_position:
84    m4x4    TEMP_VIEW,          aPosition,          uModelView
85	m4x4    o0,          TEMP_VIEW,          uProjection
86    ret
87    nop
88
89main:
90    call    l_position
91    mov     o1, aTexCoord
92    mov     o2, aTexCoord
93    end
94endmain:
95