Mercurial > hg > CbC > old > device
comparison test/ps2.c @ 748:c2c709727221
i64 continue... basic.s assembled.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 13 Nov 2010 22:39:40 +0900 |
parents | fe0a971a6666 |
children | 6b93d95a1564 |
comparison
equal
deleted
inserted
replaced
747:d4bc10fe7362 | 748:c2c709727221 |
---|---|
50 struct objNode *child; | 50 struct objNode *child; |
51 } ObjNode, *ObjNodePtr; | 51 } ObjNode, *ObjNodePtr; |
52 | 52 |
53 INLINE void draw(ObjNode *this, FMATRIX m, FMATRIX n) | 53 INLINE void draw(ObjNode *this, FMATRIX m, FMATRIX n) |
54 { | 54 { |
55 printf("work %g ",m[1][1]); | 55 printf("#0054:work %g ",m[1][1]); |
56 printf("base %g\n",n[1][1]); | 56 printf("#0055:base %g\n",n[1][1]); |
57 m[1][1] += -0.7; | 57 m[1][1] += -0.7; |
58 n[1][1] += 0.7; | 58 n[1][1] += 0.7; |
59 } | 59 } |
60 | 60 |
61 ObjNode c = { | 61 ObjNode c = { |
74 bzero(&work,sizeof(work)); work[1][1] = 0.33; | 74 bzero(&work,sizeof(work)); work[1][1] = 0.33; |
75 | 75 |
76 if(!this) return; | 76 if(!this) return; |
77 if(this->mtd) this->mtd( this ); | 77 if(this->mtd) this->mtd( this ); |
78 if(this->draw) this->draw( this, work, base ); | 78 if(this->draw) this->draw( this, work, base ); |
79 printf("offset draw %d\n",((char*)(&this->draw) - ((char*)&this->object))); | 79 printf("#0078:offset draw %d\n",((char*)(&this->draw) - ((char*)&this->object))); |
80 printf("offset next %d\n",((char*)(&this->next) - ((char*)&this->object))); | 80 printf("#0079:offset next %d\n",((char*)(&this->next) - ((char*)&this->object))); |
81 | 81 |
82 if(this->child) graphic_ObjNode_draw( this->child, work ); | 82 if(this->child) graphic_ObjNode_draw( this->child, work ); |
83 if(this->next) graphic_ObjNode_draw( this->next, base ); | 83 if(this->next) graphic_ObjNode_draw( this->next, base ); |
84 return; | 84 return; |
85 } | 85 } |
86 | 86 |
87 | 87 |
88 INLINE void ps2_vu0_unit_matrix(ps2_vu0_fmatrix m) | 88 INLINE void ps2_vu0_unit_matrix(ps2_vu0_fmatrix m) |
89 { | 89 { |
90 printf("%g\n",m[1][1]); | 90 printf("#0089:%g\n",m[1][1]); |
91 m[1][1] = -0.5; | 91 m[1][1] = -0.5; |
92 } | 92 } |
93 | 93 |
94 | 94 |
95 #define mod16(a) (((int)(&a))%16) | 95 #define mod16(a) (((int)(&a))%16) |
100 FMATRIX n; | 100 FMATRIX n; |
101 int k = i; | 101 int k = i; |
102 FMATRIX o; | 102 FMATRIX o; |
103 if (i==0) return i; | 103 if (i==0) return i; |
104 #ifdef OFFSET | 104 #ifdef OFFSET |
105 printf("offset %d\n",((char*)a) - ((char*)(&m))); | 105 printf("#0104:offset %d\n",((char*)a) - ((char*)(&m))); |
106 #endif | 106 #endif |
107 printf("%d %d %d\n",mod16(m),mod16(n),mod16(o)); | 107 printf("#0106:%d %d %d\n",mod16(m),mod16(n),mod16(o)); |
108 align16(i-1,m,n); | 108 align16(i-1,m,n); |
109 return k; | 109 return k; |
110 } | 110 } |
111 | 111 |
112 int | 112 int |
115 FMATRIX1 n; | 115 FMATRIX1 n; |
116 int k = i; | 116 int k = i; |
117 FMATRIX1 o; | 117 FMATRIX1 o; |
118 if (i==0) return i; | 118 if (i==0) return i; |
119 #ifdef OFFSET | 119 #ifdef OFFSET |
120 printf("offset %d\n",((char*)a) - ((char*)(&m))); | 120 printf("#0119:offset %d\n",((char*)a) - ((char*)(&m))); |
121 #endif | 121 #endif |
122 printf("%d %d %d\n",mod16(m),mod16(n),mod16(o)); | 122 printf("#0121:%d %d %d\n",mod16(m),mod16(n),mod16(o)); |
123 align16_1(i-1,m,n); | 123 align16_1(i-1,m,n); |
124 return k; | 124 return k; |
125 } | 125 } |
126 | 126 |
127 | 127 |
132 int i; | 132 int i; |
133 int aligned = 10; | 133 int aligned = 10; |
134 | 134 |
135 m[1][1] = 0.5; | 135 m[1][1] = 0.5; |
136 ps2_vu0_unit_matrix(m); | 136 ps2_vu0_unit_matrix(m); |
137 printf("%g %d\n",m[1][1],aligned); | 137 printf("#0136:%g %d\n",m[1][1],aligned); |
138 align16(2,m,m); | 138 align16(2,m,m); |
139 align16_1(2,m,m); | 139 align16_1(2,m,m); |
140 graphic_ObjNode_draw( &p, m); | 140 graphic_ObjNode_draw( &p, m); |
141 | 141 |
142 printf("sizeof(aligns)==%d %d\n", | 142 printf("#0141:sizeof(aligns)==%d %d\n", |
143 sizeof(aligns),sizeof(aligns1)); | 143 sizeof(aligns),sizeof(aligns1)); |
144 printf("sizeof(aligns)/sizeof(void *)==%d\n", | 144 printf("#0143:sizeof(aligns)/sizeof(void *)==%d\n", |
145 sizeof(aligns)/sizeof(void *)); | 145 sizeof(aligns)/sizeof(void *)); |
146 | 146 |
147 for(i=0;i<sizeof(aligns)/sizeof(void *);i++) { | 147 for(i=0;i<sizeof(aligns)/sizeof(void *);i++) { |
148 printf("align10%d %d\n",i,mod16(aligns[i])); | 148 printf("#0147:align10%d %d\n",i,mod16(aligns[i])); |
149 } | 149 } |
150 | 150 |
151 } | 151 } |
152 | 152 |
153 | 153 |