File tree Expand file tree Collapse file tree 1 file changed +4
-41
lines changed Expand file tree Collapse file tree 1 file changed +4
-41
lines changed Original file line number Diff line number Diff line change @@ -58,48 +58,11 @@ void ZSort_RDPCMD( u32, u32 _w1 )
5858 }
5959}
6060
61- // RSP command VRCPL
62- static
61+ inline
6362int Calc_invw (int _w) {
64- int count, neg;
65- union {
66- s32 W;
67- u32 UW;
68- s16 HW[2 ];
69- u16 UHW[2 ];
70- } Result;
71- Result.W = _w;
72- if (Result.UW == 0 ) {
73- Result.UW = 0x7FFFFFFF ;
74- } else {
75- if (Result.W < 0 ) {
76- neg = TRUE ;
77- if (Result.UHW [1 ] == 0xFFFF && Result.HW [0 ] < 0 ) {
78- Result.W = ~Result.W + 1 ;
79- } else {
80- Result.W = ~Result.W ;
81- }
82- } else {
83- neg = FALSE ;
84- }
85- for (count = 31 ; count > 0 ; --count) {
86- if ((Result.W & (1 << count))) {
87- Result.W &= (0xFFC00000 >> (31 - count) );
88- count = 0 ;
89- }
90- }
91- Result.W = 0x7FFFFFFF / Result.W ;
92- for (count = 31 ; count > 0 ; --count) {
93- if ((Result.W & (1 << count))) {
94- Result.W &= (0xFFFF8000 >> (31 - count) );
95- count = 0 ;
96- }
97- }
98- if (neg == TRUE ) {
99- Result.W = ~Result.W ;
100- }
101- }
102- return Result.W ;
63+ if (_w == 0 )
64+ return 0x7FFFFFFF ;
65+ return 0x7FFFFFFF / _w;
10366}
10467
10568static
You can’t perform that action at this time.
0 commit comments