1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     gr_Utility.cpp
4 
5   Copyright (C)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   $Rev: 25895 $
14  *---------------------------------------------------------------------------*/
15 
16 #include <nn/gr/CTR/gr_Utility.h>
17 
18 namespace nn
19 {
20     namespace gr
21     {
22         namespace CTR
23         {
24 
25             // ARMコードでコンパイルします
26             #include <nn/hw/ARM/code32.h>
27 
28             //--------------------------------------------------------------------------------
CopyMtx34WithHeader(f32 *,const nn::math::MTX34 *,u32)29             asm void CopyMtx34WithHeader(
30                 f32*                   /* dst */,
31                 const nn::math::MTX34* /* src */,
32                 u32                    /* header */ )
33             {
34                 VLDMIA      r1!,{s0-s11}
35                 STR         r2,[r0,#4]
36                 VSTR.F32    s0,[r0,#16]
37                 VSTR.F32    s1,[r0,#12]
38                 VSTR.F32    s2,[r0,#8]
39                 VSTR.F32    s3,[r0,#0]
40                 VSTR.F32    s4,[r0,#32]
41                 VSTR.F32    s5,[r0,#28]
42                 VSTR.F32    s6,[r0,#24]
43                 VSTR.F32    s7,[r0,#20]
44                 VSTR.F32    s8,[r0,#48]
45                 VSTR.F32    s9,[r0,#44]
46                 VSTR.F32    s10,[r0,#40]
47                 VSTR.F32    s11,[r0,#36]
48                 BX      lr
49             }
50 
51             //--------------------------------------------------------------------------------
52 
CopyMtx44WithHeader(f32 *,const nn::math::MTX44 *,u32)53             asm void CopyMtx44WithHeader(
54                 f32*                    /* dst */,
55                 const nn::math::MTX44*  /* src */,
56                 u32                     /* header */ )
57             {
58                 VLDMIA      r1!,{s0-s15}
59                 STR     r2,[r0,#4]
60                 VSTR.F32    s0,[r0,#16]
61                 VSTR.F32    s1,[r0,#12]
62                 VSTR.F32    s2,[r0,#8]
63                 VSTR.F32    s3,[r0,#0]
64                 VSTR.F32    s4,[r0,#32]
65                 VSTR.F32    s5,[r0,#28]
66                 VSTR.F32    s6,[r0,#24]
67                 VSTR.F32    s7,[r0,#20]
68                 VSTR.F32    s8,[r0,#48]
69                 VSTR.F32    s9,[r0,#44]
70                 VSTR.F32    s10,[r0,#40]
71                 VSTR.F32    s11,[r0,#36]
72                 VSTR.F32    s12,[r0,#64]
73                 VSTR.F32    s13,[r0,#60]
74                 VSTR.F32    s14,[r0,#56]
75                 VSTR.F32    s15,[r0,#52]
76                 BX      lr
77             }
78 
79             // 元の設定に戻します
80             #include <nn/hw/ARM/codereset.h>
81 
82         } // namespace CTR
83     } // namespace gr
84 } // namespace nn
85