mirror of
https://github.com/zeldaret/st
synced 2026-06-18 15:35:30 -04:00
Make hex number case more consistent (#83)
* consistent hex in vfunc names * consistent hex in code * Actor_c4 -> Actor_C4, Actor_9c -> Actor_9C
This commit is contained in:
+5
-5
@@ -7,11 +7,11 @@ struct _loc_ctype_cmpt __ctype_cmpt = {
|
||||
};
|
||||
|
||||
unsigned short char_coll_table[0x60] = {
|
||||
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x21, 0x22, 0x23,
|
||||
0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x2b, 0x2d, 0x2f, 0x31, 0x33,
|
||||
0x35, 0x37, 0x39, 0x3b, 0x3d, 0x3f, 0x41, 0x43, 0x45, 0x47, 0x49, 0x4b, 0x4d, 0x4f, 0x51, 0x53, 0x55, 0x57, 0x59,
|
||||
0x5b, 0x5d, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x00, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, 0x40,
|
||||
0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e, 0x1d, 0x1e, 0x1f, 0x20,
|
||||
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x21, 0x22, 0x23,
|
||||
0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x2B, 0x2D, 0x2F, 0x31, 0x33,
|
||||
0x35, 0x37, 0x39, 0x3B, 0x3D, 0x3F, 0x41, 0x43, 0x45, 0x47, 0x49, 0x4B, 0x4D, 0x4F, 0x51, 0x53, 0x55, 0x57, 0x59,
|
||||
0x5B, 0x5D, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x00, 0x2C, 0x2E, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3A, 0x3C, 0x3E, 0x40,
|
||||
0x42, 0x44, 0x46, 0x48, 0x4A, 0x4C, 0x4E, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5A, 0x5C, 0x5E, 0x1D, 0x1E, 0x1F, 0x20,
|
||||
};
|
||||
|
||||
struct _loc_coll_cmpt __coll_cmpt = {
|
||||
|
||||
@@ -97,7 +97,7 @@ double x;
|
||||
|
||||
k = 0;
|
||||
if (hx < 0x00100000) { /* x < 2**-1022 */
|
||||
if (((hx & 0x7fffffff) | lx) == 0) {
|
||||
if (((hx & 0x7FFFFFFF) | lx) == 0) {
|
||||
return -two54 / zero; /* log(+-0)=-inf */
|
||||
}
|
||||
if (hx < 0) {
|
||||
@@ -108,16 +108,16 @@ double x;
|
||||
x *= two54; /* subnormal number, scale up x */
|
||||
hx = __HI(x); /* high word of x */
|
||||
}
|
||||
if (hx >= 0x7ff00000) {
|
||||
if (hx >= 0x7FF00000) {
|
||||
return x + x;
|
||||
}
|
||||
k += (hx >> 20) - 1023;
|
||||
hx &= 0x000fffff;
|
||||
i = (hx + 0x95f64) & 0x100000;
|
||||
__HI(x) = hx | (i ^ 0x3ff00000); /* normalize x or x/2 */
|
||||
hx &= 0x000FFFFF;
|
||||
i = (hx + 0x95F64) & 0x100000;
|
||||
__HI(x) = hx | (i ^ 0x3FF00000); /* normalize x or x/2 */
|
||||
k += (i >> 20);
|
||||
f = x - 1.0;
|
||||
if ((0x000fffff & (2 + hx)) < 3) { /* |f| < 2**-20 */
|
||||
if ((0x000FFFFF & (2 + hx)) < 3) { /* |f| < 2**-20 */
|
||||
if (f == zero) {
|
||||
if (k == 0) {
|
||||
return zero;
|
||||
@@ -137,9 +137,9 @@ double x;
|
||||
s = f / (2.0 + f);
|
||||
dk = (double) k;
|
||||
z = s * s;
|
||||
i = hx - 0x6147a;
|
||||
i = hx - 0x6147A;
|
||||
w = z * z;
|
||||
j = 0x6b851 - hx;
|
||||
j = 0x6B851 - hx;
|
||||
t1 = w * (Lg2 + w * (Lg4 + w * Lg6));
|
||||
t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7)));
|
||||
i |= j;
|
||||
|
||||
@@ -74,7 +74,7 @@ double x;
|
||||
|
||||
k = 0;
|
||||
if (hx < 0x00100000) { /* x < 2**-1022 */
|
||||
if (((hx & 0x7fffffff) | lx) == 0) {
|
||||
if (((hx & 0x7FFFFFFF) | lx) == 0) {
|
||||
errno = EDOM;
|
||||
return -two54 / zero;
|
||||
} /* log(+-0)=-inf */
|
||||
@@ -86,12 +86,12 @@ double x;
|
||||
x *= two54; /* subnormal number, scale up x */
|
||||
hx = __HI(x); /* high word of x */
|
||||
}
|
||||
if (hx >= 0x7ff00000) {
|
||||
if (hx >= 0x7FF00000) {
|
||||
return x + x;
|
||||
}
|
||||
k += (hx >> 20) - 1023;
|
||||
i = ((unsigned) k & 0x80000000) >> 31;
|
||||
hx = (hx & 0x000fffff) | ((0x3ff - i) << 20);
|
||||
hx = (hx & 0x000FFFFF) | ((0x3FF - i) << 20);
|
||||
y = (double) (k + i);
|
||||
__HI(x) = hx;
|
||||
z = y * log10_2lo + ivln10 * log(x);
|
||||
|
||||
+29
-29
@@ -118,8 +118,8 @@ double x, y;
|
||||
lx = __LO(x);
|
||||
hy = __HI(y);
|
||||
ly = __LO(y);
|
||||
ix = hx & 0x7fffffff;
|
||||
iy = hy & 0x7fffffff;
|
||||
ix = hx & 0x7FFFFFFF;
|
||||
iy = hy & 0x7FFFFFFF;
|
||||
|
||||
/* y==zero: x**0 = 1 */
|
||||
if ((iy | ly) == 0) {
|
||||
@@ -127,7 +127,7 @@ double x, y;
|
||||
}
|
||||
|
||||
/* +-NaN return x+y */
|
||||
if (ix > 0x7ff00000 || ((ix == 0x7ff00000) && (lx != 0)) || iy > 0x7ff00000 || ((iy == 0x7ff00000) && (ly != 0))) {
|
||||
if (ix > 0x7FF00000 || ((ix == 0x7FF00000) && (lx != 0)) || iy > 0x7FF00000 || ((iy == 0x7FF00000) && (ly != 0))) {
|
||||
return x + y;
|
||||
#ifdef __STDC__
|
||||
errno = EDOM; /* mf-- added to conform to old ANSI standard */
|
||||
@@ -143,8 +143,8 @@ double x, y;
|
||||
if (hx < 0) {
|
||||
if (iy >= 0x43400000) {
|
||||
yisint = 2; /* even integer y */
|
||||
} else if (iy >= 0x3ff00000) {
|
||||
k = (iy >> 20) - 0x3ff; /* exponent */
|
||||
} else if (iy >= 0x3FF00000) {
|
||||
k = (iy >> 20) - 0x3FF; /* exponent */
|
||||
if (k > 20) {
|
||||
j = ly >> (52 - k);
|
||||
if ((j << (52 - k)) == ly) {
|
||||
@@ -161,18 +161,18 @@ double x, y;
|
||||
|
||||
/* special value of y */
|
||||
if (ly == 0) {
|
||||
if (iy == 0x7ff00000) {
|
||||
if (iy == 0x7FF00000) {
|
||||
|
||||
/* y is +-inf */
|
||||
if (((ix - 0x3ff00000) | lx) == 0) {
|
||||
if (((ix - 0x3FF00000) | lx) == 0) {
|
||||
return y - y; /* inf**+-1 is NaN */
|
||||
} else if (ix >= 0x3ff00000) { /* (|x|>1)**+-inf = inf,0 */
|
||||
} else if (ix >= 0x3FF00000) { /* (|x|>1)**+-inf = inf,0 */
|
||||
return (hy >= 0) ? y : zero;
|
||||
} else { /* (|x|<1)**-,+inf = inf,0 */
|
||||
return (hy < 0) ? -y : zero;
|
||||
}
|
||||
}
|
||||
if (iy == 0x3ff00000) {
|
||||
if (iy == 0x3FF00000) {
|
||||
/* y is +-1 */
|
||||
if (hy < 0) {
|
||||
return one / x;
|
||||
@@ -183,7 +183,7 @@ double x, y;
|
||||
if (hy == 0x40000000) {
|
||||
return x * x; /* y is 2 */
|
||||
}
|
||||
if (hy == 0x3fe00000) { /* y is 0.5 */
|
||||
if (hy == 0x3FE00000) { /* y is 0.5 */
|
||||
if (hx >= 0) { /* x >= +0 */
|
||||
return sqrt(x);
|
||||
}
|
||||
@@ -193,13 +193,13 @@ double x, y;
|
||||
ax = fabs(x);
|
||||
/* special value of x */
|
||||
if (lx == 0) {
|
||||
if (ix == 0x7ff00000 || ix == 0 || ix == 0x3ff00000) {
|
||||
if (ix == 0x7FF00000 || ix == 0 || ix == 0x3FF00000) {
|
||||
z = ax; /*x is +-0,+-inf,+-1*/
|
||||
if (hy < 0) {
|
||||
z = one / z; /* z = (1/|x|) */
|
||||
}
|
||||
if (hx < 0) {
|
||||
if (((ix - 0x3ff00000) | yisint) == 0) {
|
||||
if (((ix - 0x3FF00000) | yisint) == 0) {
|
||||
z = (z - z) / (z - z); /* (-1)**non-int is NaN */
|
||||
} else if (yisint == 1) {
|
||||
z = -z; /* (x<0)**odd = -(|x|**odd) */
|
||||
@@ -218,20 +218,20 @@ double x, y;
|
||||
}
|
||||
|
||||
/* |y| is big */
|
||||
if (iy > 0x41e00000) { /* if |y| > 2**31 */
|
||||
if (iy > 0x43f00000) { /* if |y| > 2**64, must o/uflow */
|
||||
if (ix <= 0x3fefffff) {
|
||||
if (iy > 0x41E00000) { /* if |y| > 2**31 */
|
||||
if (iy > 0x43F00000) { /* if |y| > 2**64, must o/uflow */
|
||||
if (ix <= 0x3FEFFFFF) {
|
||||
return (hy < 0) ? big * big : tiny * tiny;
|
||||
}
|
||||
if (ix >= 0x3ff00000) {
|
||||
if (ix >= 0x3FF00000) {
|
||||
return (hy > 0) ? big * big : tiny * tiny;
|
||||
}
|
||||
}
|
||||
/* over/underflow if x is not close to one */
|
||||
if (ix < 0x3fefffff) {
|
||||
if (ix < 0x3FEFFFFF) {
|
||||
return (hy < 0) ? big * big : tiny * tiny;
|
||||
}
|
||||
if (ix > 0x3ff00000) {
|
||||
if (ix > 0x3FF00000) {
|
||||
return (hy > 0) ? big * big : tiny * tiny;
|
||||
}
|
||||
/* now |1-x| is tiny <= 2**-20, suffice to compute
|
||||
@@ -252,10 +252,10 @@ double x, y;
|
||||
n -= 53;
|
||||
ix = __HI(ax);
|
||||
}
|
||||
n += ((ix) >> 20) - 0x3ff;
|
||||
j = ix & 0x000fffff;
|
||||
n += ((ix) >> 20) - 0x3FF;
|
||||
j = ix & 0x000FFFFF;
|
||||
/* determine interval */
|
||||
ix = j | 0x3ff00000; /* normalize ix */
|
||||
ix = j | 0x3FF00000; /* normalize ix */
|
||||
if (j <= 0x3988E) {
|
||||
k = 0; /* |x|<sqrt(3/2) */
|
||||
} else if (j < 0xBB67A) {
|
||||
@@ -323,8 +323,8 @@ double x, y;
|
||||
return s * big * big; /* overflow */
|
||||
}
|
||||
}
|
||||
} else if ((j & 0x7fffffff) >= 0x4090cc00) { /* z <= -1075 */
|
||||
if (((j - 0xc090cc00) | i) != 0) { /* z < -1075 */
|
||||
} else if ((j & 0x7FFFFFFF) >= 0x4090CC00) { /* z <= -1075 */
|
||||
if (((j - 0xC090CC00) | i) != 0) { /* z < -1075 */
|
||||
return s * tiny * tiny; /* underflow */
|
||||
} else {
|
||||
if (p_l <= z - p_h) {
|
||||
@@ -335,15 +335,15 @@ double x, y;
|
||||
/*
|
||||
* compute 2**(p_h+p_l)
|
||||
*/
|
||||
i = j & 0x7fffffff;
|
||||
k = (i >> 20) - 0x3ff;
|
||||
i = j & 0x7FFFFFFF;
|
||||
k = (i >> 20) - 0x3FF;
|
||||
n = 0;
|
||||
if (i > 0x3fe00000) { /* if |z| > 0.5, set n = [z+0.5] */
|
||||
if (i > 0x3FE00000) { /* if |z| > 0.5, set n = [z+0.5] */
|
||||
n = j + (0x00100000 >> (k + 1));
|
||||
k = ((n & 0x7fffffff) >> 20) - 0x3ff; /* new k for n */
|
||||
k = ((n & 0x7FFFFFFF) >> 20) - 0x3FF; /* new k for n */
|
||||
t = zero;
|
||||
__HI(t) = (n & ~(0x000fffff >> k));
|
||||
n = ((n & 0x000fffff) | 0x00100000) >> (20 - k);
|
||||
__HI(t) = (n & ~(0x000FFFFF >> k));
|
||||
n = ((n & 0x000FFFFF) | 0x00100000) >> (20 - k);
|
||||
if (j < 0) {
|
||||
n = -n;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ double x;
|
||||
unsigned i, j;
|
||||
i0 = __HI(x);
|
||||
i1 = __LO(x);
|
||||
j0 = ((i0 >> 20) & 0x7ff) - 0x3ff;
|
||||
j0 = ((i0 >> 20) & 0x7FF) - 0x3FF;
|
||||
if (j0 < 20) {
|
||||
if (j0 < 0) { /* raise inexact if x != 0 */
|
||||
if (huge + x > 0.0) { /* return 0*sign(x) if |x|<1 */
|
||||
@@ -47,12 +47,12 @@ double x;
|
||||
i0 = 0x80000000;
|
||||
i1 = 0;
|
||||
} else if ((i0 | i1) != 0) {
|
||||
i0 = 0x3ff00000;
|
||||
i0 = 0x3FF00000;
|
||||
i1 = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
i = (0x000fffff) >> j0;
|
||||
i = (0x000FFFFF) >> j0;
|
||||
if (((i0 & i) | i1) == 0) {
|
||||
return x; /* x is integral */
|
||||
}
|
||||
@@ -71,7 +71,7 @@ double x;
|
||||
return x; /* x is integral */
|
||||
}
|
||||
} else {
|
||||
i = ((unsigned) (0xffffffff)) >> (j0 - 20);
|
||||
i = ((unsigned) (0xFFFFFFFF)) >> (j0 - 20);
|
||||
if ((i1 & i) == 0) {
|
||||
return x; /* x is integral */
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@ double copysign(x, y)
|
||||
double x, y;
|
||||
#endif
|
||||
{
|
||||
__HI(x) = (__HI(x) & 0x7fffffff) | (__HI(y) & 0x80000000);
|
||||
__HI(x) = (__HI(x) & 0x7FFFFFFF) | (__HI(y) & 0x80000000);
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@ double fabs(x)
|
||||
double x;
|
||||
#endif
|
||||
{
|
||||
__HI(x) &= 0x7fffffff;
|
||||
__HI(x) &= 0x7FFFFFFF;
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -40,20 +40,20 @@ int *eptr;
|
||||
{
|
||||
int hx, ix, lx;
|
||||
hx = __HI(x);
|
||||
ix = 0x7fffffff & hx;
|
||||
ix = 0x7FFFFFFF & hx;
|
||||
lx = __LO(x);
|
||||
*eptr = 0;
|
||||
if (ix >= 0x7ff00000 || ((ix | lx) == 0)) {
|
||||
if (ix >= 0x7FF00000 || ((ix | lx) == 0)) {
|
||||
return x; /* 0,inf,nan */
|
||||
}
|
||||
if (ix < 0x00100000) { /* subnormal */
|
||||
x *= two54;
|
||||
hx = __HI(x);
|
||||
ix = hx & 0x7fffffff;
|
||||
ix = hx & 0x7FFFFFFF;
|
||||
*eptr = -54;
|
||||
}
|
||||
*eptr += (ix >> 20) - 1022;
|
||||
hx = (hx & 0x800fffff) | 0x3fe00000;
|
||||
hx = (hx & 0x800FFFFF) | 0x3FE00000;
|
||||
__HI(x) = hx;
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -26,28 +26,28 @@ double ldexp(double x, int n) {
|
||||
|
||||
hx = __HI(x);
|
||||
lx = __LO(x);
|
||||
k = (hx & 0x7ff00000) >> 20; /* extract exponent */
|
||||
k = (hx & 0x7FF00000) >> 20; /* extract exponent */
|
||||
if (k == 0) { /* 0 or subnormal x */
|
||||
if ((lx | (hx & 0x7fffffff)) == 0) {
|
||||
if ((lx | (hx & 0x7FFFFFFF)) == 0) {
|
||||
return x; /* +-0 */
|
||||
}
|
||||
x *= two54;
|
||||
hx = __HI(x);
|
||||
k = ((hx & 0x7ff00000) >> 20) - 54;
|
||||
k = ((hx & 0x7FF00000) >> 20) - 54;
|
||||
if (n < -50000) {
|
||||
return tiny * x; /*underflow*/
|
||||
}
|
||||
}
|
||||
if (k == 0x7ff) {
|
||||
if (k == 0x7FF) {
|
||||
return x + x; /* NaN or Inf */
|
||||
}
|
||||
k = k + n;
|
||||
if (k > 0x7fe) {
|
||||
if (k > 0x7FE) {
|
||||
return big * copysign(big, x); /* overflow */
|
||||
}
|
||||
if (k > 0) /* normal result */
|
||||
{
|
||||
__HI(x) = (hx & 0x800fffff) | (k << 20);
|
||||
__HI(x) = (hx & 0x800FFFFF) | (k << 20);
|
||||
return x;
|
||||
}
|
||||
if (k <= -54) {
|
||||
@@ -58,7 +58,7 @@ double ldexp(double x, int n) {
|
||||
}
|
||||
}
|
||||
k += 54; /* subnormal result */
|
||||
__HI(x) = (hx & 0x800fffff) | (k << 20);
|
||||
__HI(x) = (hx & 0x800FFFFF) | (k << 20);
|
||||
return x * twom54;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ int __fpclassifyd(double x) {
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
if ((__HI(x) & 0x000FFFFf) || (__LO(x) & 0xFFFFFFFF)) {
|
||||
if ((__HI(x) & 0x000FFFFF) || (__LO(x) & 0xFFFFFFFF)) {
|
||||
return 5;
|
||||
} else {
|
||||
return 3;
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ void *memset(void *dest, int val, int n) {
|
||||
void *memchr(const void *src, int val, int n) {
|
||||
const unsigned char *p;
|
||||
|
||||
unsigned int v = (val & 0xff);
|
||||
unsigned int v = (val & 0xFF);
|
||||
|
||||
for (p = (unsigned char *) src, n++; --n;) {
|
||||
if (*p++ == v) {
|
||||
|
||||
@@ -12,12 +12,12 @@ extern "C" {
|
||||
#define CARD_BACKUP_TYPE_FRAM 3
|
||||
|
||||
#define CARD_BACKUP_TYPE_EEPROM_4KBITS (0x900 | CARD_BACKUP_TYPE_EEPROM)
|
||||
#define CARD_BACKUP_TYPE_EEPROM_64KBITS (0xd00 | CARD_BACKUP_TYPE_EEPROM)
|
||||
#define CARD_BACKUP_TYPE_EEPROM_64KBITS (0xD00 | CARD_BACKUP_TYPE_EEPROM)
|
||||
#define CARD_BACKUP_TYPE_EEPROM_512KBITS (0x1000 | CARD_BACKUP_TYPE_EEPROM)
|
||||
#define CARD_BACKUP_TYPE_FLASH_2MBITS (0x1200 | CARD_BACKUP_TYPE_FLASH)
|
||||
#define CARD_BACKUP_TYPE_FLASH_4MBITS (0x1300 | CARD_BACKUP_TYPE_FLASH)
|
||||
#define CARD_BACKUP_TYPE_FLASH_8MBITS (0x1400 | CARD_BACKUP_TYPE_FLASH)
|
||||
#define CARD_BACKUP_TYPE_FRAM_256KBITS (0xf00 | CARD_BACKUP_TYPE_FRAM)
|
||||
#define CARD_BACKUP_TYPE_FRAM_256KBITS (0xF00 | CARD_BACKUP_TYPE_FRAM)
|
||||
|
||||
// TODO: Find values for these
|
||||
#define CARD_RESULT_SUCCESS 0
|
||||
@@ -36,9 +36,9 @@ void CARD_LockBackup(u16 cardId);
|
||||
void CARD_UnlockBackup(u16 cardId);
|
||||
BOOL CARD_IdentifyBackup(CARDBackupType type);
|
||||
CARDBackupType CARD_GetBackupType();
|
||||
#define CARD_IsBackupEeprom() (CARD_GetBackupType() & 0xff) == CARD_BACKUP_TYPE_EEPROM
|
||||
#define CARD_IsBackupFlash() (CARD_GetBackupType() & 0xff) == CARD_BACKUP_TYPE_FLASH
|
||||
#define CARD_IsBackupFram() (CARD_GetBackupType() & 0xff) == CARD_BACKUP_TYPE_FRAM
|
||||
#define CARD_IsBackupEeprom() (CARD_GetBackupType() & 0xFF) == CARD_BACKUP_TYPE_EEPROM
|
||||
#define CARD_IsBackupFlash() (CARD_GetBackupType() & 0xFF) == CARD_BACKUP_TYPE_FLASH
|
||||
#define CARD_IsBackupFram() (CARD_GetBackupType() & 0xFF) == CARD_BACKUP_TYPE_FRAM
|
||||
BOOL CARD_ReadWriteBackupAsync(u32 offset, void *buf, u32 size, void *, void *, u32, u32, u32, u32);
|
||||
void CARD_WaitBackupAsync(void);
|
||||
CARDResult CARD_GetResultCode(void);
|
||||
|
||||
@@ -51,103 +51,103 @@ inline void G2S_SetBG3Priority(u32 value) {
|
||||
}
|
||||
|
||||
inline void G2_SetBG0Offset(u32 x, u32 y) {
|
||||
REG_BG0OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG0OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2_SetBG1Offset(u32 x, u32 y) {
|
||||
REG_BG1OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG1OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2_SetBG2Offset(u32 x, u32 y) {
|
||||
REG_BG2OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG2OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2_SetBG3Offset(u32 x, u32 y) {
|
||||
REG_BG3OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG3OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG0Offset(u32 x, u32 y) {
|
||||
REG_BG0OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG0OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG1Offset(u32 x, u32 y) {
|
||||
REG_BG1OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG1OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG2Offset(u32 x, u32 y) {
|
||||
REG_BG2OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG2OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG3Offset(u32 x, u32 y) {
|
||||
REG_BG3OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG3OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2_SetBG0Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) {
|
||||
REG_BG0CNT = (REG_BG0CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG0CNT = (REG_BG0CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2_SetBG1Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) {
|
||||
REG_BG1CNT = (REG_BG1CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG1CNT = (REG_BG1CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2_SetBG2Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) {
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2_SetBG3Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) {
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG0Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase,
|
||||
u32) {
|
||||
REG_BG0CNT_SUB = (REG_BG0CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG0CNT_SUB = (REG_BG0CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG1Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase,
|
||||
u32) {
|
||||
REG_BG1CNT_SUB = (REG_BG1CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG1CNT_SUB = (REG_BG1CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG2Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase,
|
||||
u32) {
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG3Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase,
|
||||
u32) {
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2_SetBG2Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2_SetBG3Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG2Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG3Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2_SetBG2ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2_SetBG3ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG2ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG3ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2_SetBG2ControlText(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase) {
|
||||
@@ -287,16 +287,16 @@ inline void G2S_SetBlendAlpha(u32 srcPlane, u32 dstPlane, u32 srcAlpha, u32 dstA
|
||||
}
|
||||
|
||||
inline void G2_GetOBJPosition(GXOamAttr *oam, u32 *x, u32 *y) {
|
||||
*x = (oam->attr01 & 0x1ff0000) >> 16;
|
||||
*y = oam->attr01 & 0xff;
|
||||
*x = (oam->attr01 & 0x1FF0000) >> 16;
|
||||
*y = oam->attr01 & 0xFF;
|
||||
}
|
||||
|
||||
inline void G2_SetOBJPosition(GXOamAttr *oam, u32 x, u32 y) {
|
||||
oam->attr01 = (oam->attr01 & 0xfe00ff00) | (y & 0xff) | (x << 0x17 >> 0x7);
|
||||
oam->attr01 = (oam->attr01 & 0xFE00FF00) | (y & 0xFF) | (x << 0x17 >> 0x7);
|
||||
}
|
||||
|
||||
inline u32 G2_GetOBJCharName(GXOamAttr *oam) {
|
||||
return oam->attr2 & 0x3ff;
|
||||
return oam->attr2 & 0x3FF;
|
||||
}
|
||||
|
||||
inline void G2_SetOBJCharName(volatile GXOamAttr *oam, u32 name) {
|
||||
@@ -304,18 +304,18 @@ inline void G2_SetOBJCharName(volatile GXOamAttr *oam, u32 name) {
|
||||
}
|
||||
|
||||
inline u32 G2_GetOBJColorParam(GXOamAttr *oam) {
|
||||
return (oam->attr2 & 0xf000) >> 0xc;
|
||||
return (oam->attr2 & 0xF000) >> 0xC;
|
||||
}
|
||||
|
||||
// Defined as macro as sometimes `oam` is volatile and other times not
|
||||
#define G2_GetOBJMode(oam) (GXOamMode)(((oam)->attr01 & 0xc00) >> 0xa)
|
||||
#define G2_GetOBJMode(oam) (GXOamMode)(((oam)->attr01 & 0xC00) >> 0xA)
|
||||
// inline GXOamMode G2_GetOBJMode(volatile GXOamAttr *oam) {
|
||||
// return ((oam)->attr01 & 0xc00) >> 0xa;
|
||||
// return ((oam)->attr01 & 0xC00) >> 0xA;
|
||||
// }
|
||||
|
||||
inline void G2_SetOBJMode(GXOamAttr *oam, GXOamMode mode, u32 color) {
|
||||
oam->attr01 = (oam->attr01 & ~0xc00) | (mode << 0xa);
|
||||
oam->attr2 = (oam->attr2 & ~0xf000) | (color << 0xc);
|
||||
oam->attr01 = (oam->attr01 & ~0xC00) | (mode << 0xA);
|
||||
oam->attr2 = (oam->attr2 & ~0xF000) | (color << 0xC);
|
||||
}
|
||||
|
||||
inline void G2_SetOBJPriority(GXOamAttr *oam, u32 prio) {
|
||||
@@ -328,12 +328,12 @@ inline void G2_SetOBJAttr(GXOamAttr *oam, u32 x, u32 y, u32 param4, GXOamMode mo
|
||||
|
||||
// c1ff0cff
|
||||
// 3 bits at 0x8
|
||||
// 4 bits at 0xc
|
||||
// 4 bits at 0xC
|
||||
// 5 bits at 0x19
|
||||
oam->attr01 = (y & 0xff) | (mode << 0xa) | (shape << 0x1e) | ((x << 0x17) >> 0x7);
|
||||
oam->attr01 = (y & 0xFF) | (mode << 0xA) | (shape << 0x1E) | ((x << 0x17) >> 0x7);
|
||||
// f3ff
|
||||
// 2 bits at 0xa
|
||||
oam->attr2 = param10 | (color << 0xc);
|
||||
// 2 bits at 0xA
|
||||
oam->attr2 = param10 | (color << 0xC);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -28,7 +28,7 @@ inline void G3_TexImageParam(GXTexFmt fmt, u32 gen, GXTexSizeS sizeS, GXTexSizeT
|
||||
// S: sizeS
|
||||
// A: addr
|
||||
REG_GFX_FIFO_TEXTURE_PARAM =
|
||||
(fmt << 0x1a) | (addr << 0x3) | (gen << 0x1e) | (sizeS << 0x14) | (sizeT << 0x17) | (color0 << 0x1d);
|
||||
(fmt << 0x1A) | (addr << 0x3) | (gen << 0x1E) | (sizeS << 0x14) | (sizeT << 0x17) | (color0 << 0x1D);
|
||||
}
|
||||
inline void G3_TexPlttBase(u32 addr, GXTexFmt fmt) {
|
||||
REG_GFX_FIFO_TEXTURE_PALETTE = addr >> (4 - (fmt == 2));
|
||||
@@ -54,7 +54,7 @@ inline void G3_Translate(fx32 x, fx32 y, fx32 z) {
|
||||
inline void G3_ViewPort(u32 left, u32 top, u32 right, u32 bottom) {
|
||||
// Unclear how to combine the arguments
|
||||
// left = 0, top = 0, right = 255, bottom = 191 => 0x8000
|
||||
REG_GFX_FIFO_VIEWPORT = 0xbfff0000;
|
||||
REG_GFX_FIFO_VIEWPORT = 0xBFFF0000;
|
||||
}
|
||||
void _G3_Ortho(fx32 top, fx32 bottom, fx32 left, fx32 right, fx32 near, fx32 far, fx32 param7, BOOL param8, void *param9);
|
||||
inline void G3_Ortho(fx32 top, fx32 bottom, fx32 left, fx32 right, fx32 near, fx32 far, void *param7) {
|
||||
|
||||
@@ -8,15 +8,15 @@ extern "C" {
|
||||
#include "nitro/reg.h"
|
||||
#include "nitro/types.h"
|
||||
|
||||
#define GX_POWER_ALL 0x20e
|
||||
#define GX_POWER_ALL 0x20E
|
||||
|
||||
#define GX_DISP_SELECT_MAIN_SUB 0x8000
|
||||
#define GX_DISP_SELECT_SUB_MAIN 0
|
||||
#define GX_DISPMODE_GRAPHICS 1
|
||||
#define GX_DISPMODE_VRAM_C 0xa
|
||||
#define GX_DISPMODE_VRAM_D 0xe
|
||||
#define GX_DISPMODE_VRAM_C 0xA
|
||||
#define GX_DISPMODE_VRAM_D 0xE
|
||||
|
||||
#define GX_VRAM_LCDC_ALL 0x1ff
|
||||
#define GX_VRAM_LCDC_ALL 0x1FF
|
||||
#define GX_VRAM_LCDC_C 0x4
|
||||
#define GX_VRAM_LCDC_D 0x8
|
||||
|
||||
@@ -27,8 +27,8 @@ extern "C" {
|
||||
#define GX_VRAM_BG_128_D ((GXVRamBG) 0x8)
|
||||
#define GX_VRAM_BG_256_AB ((GXVRamBG) 0x3)
|
||||
#define GX_VRAM_BG_384_ABC ((GXVRamBG) 0x7)
|
||||
#define GX_VRAM_BG_384_ABD ((GXVRamBG) 0xb)
|
||||
#define GX_VRAM_BG_512_ABCD ((GXVRamBG) 0xf)
|
||||
#define GX_VRAM_BG_384_ABD ((GXVRamBG) 0xB)
|
||||
#define GX_VRAM_BG_512_ABCD ((GXVRamBG) 0xF)
|
||||
|
||||
#define GX_VRAM_SUB_BG_NONE ((GXVRamBG) 0)
|
||||
#define GX_VRAM_SUB_BG_32_H ((GXVRamBG) 0x80)
|
||||
@@ -140,7 +140,7 @@ extern "C" {
|
||||
|
||||
#define GX_OAM_SHAPE_64x64 0x3
|
||||
|
||||
#define GX_OAM_COLOR_16 0xf
|
||||
#define GX_OAM_COLOR_16 0xF
|
||||
|
||||
#define GX_TEXSIZE_S8 0
|
||||
#define GX_TEXSIZE_S16 0x1
|
||||
@@ -183,7 +183,7 @@ extern "C" {
|
||||
|
||||
#define GX_BEGIN_QUADS 0x1
|
||||
|
||||
#define GX_RGB(r, g, b) ((r) | ((g) << 0x5) | ((b) << 0xa))
|
||||
#define GX_RGB(r, g, b) ((r) | ((g) << 0x5) | ((b) << 0xA))
|
||||
|
||||
#define GX_CAPTURE_SIZE_256x192 -1 // unknown value
|
||||
#define GX_CAPTURE_MODE_A -1 // unknown value
|
||||
@@ -376,11 +376,11 @@ inline u16 GX_GetVCount(void) {
|
||||
}
|
||||
|
||||
inline void GX_SetVisiblePlane(s32 plane) {
|
||||
REG_DISPCNT = (REG_DISPCNT & ~0x1f00) | (plane << 8);
|
||||
REG_DISPCNT = (REG_DISPCNT & ~0x1F00) | (plane << 8);
|
||||
}
|
||||
|
||||
inline void GXS_SetVisiblePlane(s32 plane) {
|
||||
REG_DISPCNT_SUB = (REG_DISPCNT_SUB & ~0x1f00) | (plane << 8);
|
||||
REG_DISPCNT_SUB = (REG_DISPCNT_SUB & ~0x1F00) | (plane << 8);
|
||||
}
|
||||
|
||||
inline void GX_SetBGCharOffset(u32 offset) {
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef struct MBGameRegistry {
|
||||
/* 10 */ const char *iconPaletteFile;
|
||||
/* 14 */ u32 ggid;
|
||||
/* 18 */ u8 numPlayers;
|
||||
/* 19 */ u8 unk_19[0x3c - 0x19];
|
||||
/* 19 */ u8 unk_19[0x3C - 0x19];
|
||||
/* 3c */
|
||||
} MBGameRegistry;
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ extern "C" {
|
||||
#define PAD_ALL (PAD_BUTTON_ALL | PAD_KEY_ALL)
|
||||
|
||||
inline BOOL PAD_DetectFold(void) {
|
||||
return (REG_PAD & 0x8000) >> 0xf;
|
||||
return (REG_PAD & 0x8000) >> 0xF;
|
||||
}
|
||||
|
||||
inline u16 PAD_Read(void) {
|
||||
return ((REG_KEYINPUT | REG_PAD) ^ 0x2fff) & 0x2fff;
|
||||
return ((REG_KEYINPUT | REG_PAD) ^ 0x2FFF) & 0x2FFF;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -16,10 +16,10 @@ extern "C" {
|
||||
#define REG_DISPCAPCNT (*(vu32 *) 0x04000064)
|
||||
#define REG_GFX_STATUS (*(vu32 *) 0x04000600)
|
||||
|
||||
#define REG_DMA ((OSDma *) 0x040000b0)
|
||||
#define REG_DMA0SAD (*(vu32 *) 0x040000b0)
|
||||
#define REG_DMA0DAD (*(vu32 *) 0x040000b4)
|
||||
#define REG_DMA0CNT (*(vu32 *) 0x040000b8)
|
||||
#define REG_DMA ((OSDma *) 0x040000B0)
|
||||
#define REG_DMA0SAD (*(vu32 *) 0x040000B0)
|
||||
#define REG_DMA0DAD (*(vu32 *) 0x040000B4)
|
||||
#define REG_DMA0CNT (*(vu32 *) 0x040000B8)
|
||||
|
||||
#define REG_VRAM_CNT_ABCD (*(vu32 *) 0x04000240)
|
||||
#define REG_VRAM_CNT_A (*(vu8 *) 0x04000240)
|
||||
@@ -60,16 +60,16 @@ extern "C" {
|
||||
#define REG_GFX_FIFO_MATRIX_MODE (*(vu32 *) 0x04000440)
|
||||
#define REG_GFX_FIFO_MATRIX_PUSH (*(vu32 *) 0x04000444)
|
||||
#define REG_GFX_FIFO_MATRIX_POP (*(vu32 *) 0x04000448)
|
||||
#define REG_GFX_FIFO_MATRIX_STORE (*(vu32 *) 0x0400044c)
|
||||
#define REG_GFX_FIFO_MATRIX_STORE (*(vu32 *) 0x0400044C)
|
||||
#define REG_GFX_FIFO_MATRIX_RESTORE (*(vu32 *) 0x04000450)
|
||||
#define REG_GFX_FIFO_MATRIX_IDENTITY (*(vu32 *) 0x04000454)
|
||||
#define REG_GFX_FIFO_MATRIX_TRANSLATE (*(vu32 *) 0x04000470)
|
||||
#define REG_GFX_FIFO_VERTEX_COLOR (*(vu32 *) 0x04000480)
|
||||
#define REG_GFX_FIFO_VERTEX_TEXCOORD (*(vu32 *) 0x04000488)
|
||||
#define REG_GFX_FIFO_VERTEX_16 (*(vu32 *) 0x0400048c)
|
||||
#define REG_GFX_FIFO_POLYGON_ATTR (*(vu32 *) 0x040004a4)
|
||||
#define REG_GFX_FIFO_TEXTURE_PARAM (*(vu32 *) 0x040004a8)
|
||||
#define REG_GFX_FIFO_TEXTURE_PALETTE (*(vu32 *) 0x040004ac)
|
||||
#define REG_GFX_FIFO_VERTEX_16 (*(vu32 *) 0x0400048C)
|
||||
#define REG_GFX_FIFO_POLYGON_ATTR (*(vu32 *) 0x040004A4)
|
||||
#define REG_GFX_FIFO_TEXTURE_PARAM (*(vu32 *) 0x040004A8)
|
||||
#define REG_GFX_FIFO_TEXTURE_PALETTE (*(vu32 *) 0x040004AC)
|
||||
#define REG_GFX_FIFO_POLYGONS_BEGIN (*(vu32 *) 0x04000500)
|
||||
#define REG_GFX_FIFO_POLYGONS_END (*(vu32 *) 0x04000504)
|
||||
#define REG_GFX_FIFO_SWAP_BUFFERS (*(vu32 *) 0x04000540)
|
||||
@@ -84,32 +84,32 @@ extern u32 __DTCM_LO;
|
||||
|
||||
#define _REG_DISPCNT(base) (*(u32 *) ((base) | 0x0))
|
||||
#define _REG_BG0CNT(base) (*(vu16 *) ((base) | 0x8))
|
||||
#define _REG_BG1CNT(base) (*(vu16 *) ((base) | 0xa))
|
||||
#define _REG_BG2CNT(base) (*(vu16 *) ((base) | 0xc))
|
||||
#define _REG_BG3CNT(base) (*(vu16 *) ((base) | 0xe))
|
||||
#define _REG_BG1CNT(base) (*(vu16 *) ((base) | 0xA))
|
||||
#define _REG_BG2CNT(base) (*(vu16 *) ((base) | 0xC))
|
||||
#define _REG_BG3CNT(base) (*(vu16 *) ((base) | 0xE))
|
||||
#define _REG_BG0OFS(base) (*(u32 *) ((base) | 0x10))
|
||||
#define _REG_BG1OFS(base) (*(u32 *) ((base) | 0x14))
|
||||
#define _REG_BG2OFS(base) (*(u32 *) ((base) | 0x18))
|
||||
#define _REG_BG3OFS(base) (*(u32 *) ((base) | 0x1c))
|
||||
#define _REG_BG3OFS(base) (*(u32 *) ((base) | 0x1C))
|
||||
#define _REG_BG2PA(base) (*(u16 *) ((base) | 0x20))
|
||||
#define _REG_BG2PB(base) (*(u16 *) ((base) | 0x22))
|
||||
#define _REG_BG2PC(base) (*(u16 *) ((base) | 0x24))
|
||||
#define _REG_BG2PD(base) (*(u16 *) ((base) | 0x26))
|
||||
#define _REG_BG2X(base) (*(u32 *) ((base) | 0x28))
|
||||
#define _REG_BG2Y(base) (*(u32 *) ((base) | 0x2c))
|
||||
#define _REG_BG2Y(base) (*(u32 *) ((base) | 0x2C))
|
||||
#define _REG_BG3PA(base) (*(u16 *) ((base) | 0x30))
|
||||
#define _REG_BG3PB(base) (*(u16 *) ((base) | 0x32))
|
||||
#define _REG_BG3PC(base) (*(u16 *) ((base) | 0x34))
|
||||
#define _REG_BG3PD(base) (*(u16 *) ((base) | 0x36))
|
||||
#define _REG_BG3X(base) (*(u32 *) ((base) | 0x38))
|
||||
#define _REG_BG3Y(base) (*(u32 *) ((base) | 0x3c))
|
||||
#define _REG_BG3Y(base) (*(u32 *) ((base) | 0x3C))
|
||||
#define _REG_WININ(base) (*(u16 *) ((base) | 0x48))
|
||||
#define _REG_WINOUT(base) (*(u16 *) ((base) | 0x4a))
|
||||
#define _REG_MOSAIC(base) (*(u8 *) ((base) | 0x4c))
|
||||
#define _REG_OBJMOSAIC(base) (*(u8 *) ((base) | 0x4d))
|
||||
#define _REG_WINOUT(base) (*(u16 *) ((base) | 0x4A))
|
||||
#define _REG_MOSAIC(base) (*(u8 *) ((base) | 0x4C))
|
||||
#define _REG_OBJMOSAIC(base) (*(u8 *) ((base) | 0x4D))
|
||||
#define _REG_BLDCNT(base) (*(u16 *) ((base) | 0x50))
|
||||
#define _REG_BLDALPHA(base) (*(u16 *) ((base) | 0x52))
|
||||
#define _REG_MASTER_BRIGHT(base) (*(u16 *) ((base) | 0x6c))
|
||||
#define _REG_MASTER_BRIGHT(base) (*(u16 *) ((base) | 0x6C))
|
||||
|
||||
#define REG_DISPCNT _REG_DISPCNT(_MAIN_REG_BASE)
|
||||
#define REG_BG0CNT _REG_BG0CNT(_MAIN_REG_BASE)
|
||||
@@ -169,7 +169,7 @@ extern u32 __DTCM_LO;
|
||||
#define REG_BLDALPHA_SUB _REG_BLDALPHA(_SUB_REG_BASE)
|
||||
#define REG_MASTER_BRIGHT_SUB _REG_MASTER_BRIGHT(_SUB_REG_BASE)
|
||||
|
||||
#define REG_04FFF200 (*(vu32 *) 0x04fff200)
|
||||
#define REG_04FFF200 (*(vu32 *) 0x04FFF200)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -10,7 +10,7 @@ extern "C" {
|
||||
#define SND_COMMAND_NOBLOCK 0
|
||||
#define SND_COMMAND_BLOCK 1
|
||||
|
||||
#define SND_TIMER_CLOCK 0xffb0ff
|
||||
#define SND_TIMER_CLOCK 0xFFB0FF
|
||||
|
||||
#define SND_WAVE_FORMAT_PCM16 1
|
||||
|
||||
@@ -22,13 +22,13 @@ typedef void (*SNDAlarmCallback)(void *arg);
|
||||
|
||||
typedef u32 SNDCommandType;
|
||||
enum SNDCommandType_ {
|
||||
SNDCommandType_StartTimer = 0xc,
|
||||
SNDCommandType_SetupChannelPcm = 0xe,
|
||||
SNDCommandType_StartTimer = 0xC,
|
||||
SNDCommandType_SetupChannelPcm = 0xE,
|
||||
SNDCommandType_SetupAlarm = 0x12,
|
||||
SNDCommandType_SetChannelVolume = 0x14,
|
||||
SNDCommandType_SetChannelPan = 0x15,
|
||||
SNDCommandType_LockChannel = 0x1a,
|
||||
SNDCommandType_Unk_1d = 0x1d,
|
||||
SNDCommandType_LockChannel = 0x1A,
|
||||
SNDCommandType_Unk_1d = 0x1D,
|
||||
};
|
||||
|
||||
typedef struct SNDCommand {
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define WM_SYSTEM_BUF_SIZE 0xf00
|
||||
#define WM_SYSTEM_BUF_SIZE 0xF00
|
||||
|
||||
#define WM_ERRCODE_SUCCESS 0
|
||||
#define WM_ERRCODE_FAILED 0x1
|
||||
#define WM_ERRCODE_ILLEGAL_STATE 0x3
|
||||
#define WM_ERRCODE_OPERATING 0x2
|
||||
#define WM_ERRCODE_TIMEOUT 0x9
|
||||
#define WM_ERRCODE_NO_ENTRY 0xb // may swap value with WM_ERRCODE_OVER_MAX_ENTRY
|
||||
#define WM_ERRCODE_OVER_MAX_ENTRY 0xc
|
||||
#define WM_ERRCODE_SEND_FAILED 0xf
|
||||
#define WM_ERRCODE_NO_ENTRY 0xB // may swap value with WM_ERRCODE_OVER_MAX_ENTRY
|
||||
#define WM_ERRCODE_OVER_MAX_ENTRY 0xC
|
||||
#define WM_ERRCODE_SEND_FAILED 0xF
|
||||
|
||||
#define WM_STATECODE_PARENT_START 0x0
|
||||
#define WM_STATECODE_PARENT_FOUND 0x5
|
||||
#define WM_STATECODE_MP_START 0xa
|
||||
#define WM_STATECODE_MP_START 0xA
|
||||
#define WM_STATECODE_CONNECTED 0x7
|
||||
#define WM_STATECODE_BEACON_LOST 0x8
|
||||
#define WM_STATECODE_DISCONNECTED 0x9
|
||||
@@ -47,7 +47,7 @@ typedef struct WMParentParam {
|
||||
/* 14 */ u16 KS_Flag;
|
||||
/* 16 */ u16 CS_Flag;
|
||||
/* 18 */ u16 beaconPeriod;
|
||||
/* 1a */ u8 unk_1a[0x32 - 0x1a];
|
||||
/* 1a */ u8 unk_1a[0x32 - 0x1A];
|
||||
/* 32 */ u16 channel;
|
||||
/* 34 */ u16 parentMaxSize;
|
||||
/* 36 */ u16 childMaxSize;
|
||||
@@ -59,7 +59,7 @@ typedef struct WMScanParam {
|
||||
/* 04 */ u16 channel;
|
||||
/* 06 */ u16 maxChannelTime;
|
||||
/* 08 */ u8 bssid[WM_SIZE_BSSID];
|
||||
/* 0e */ u8 unk_0e[0x20 - 0x0e];
|
||||
/* 0e */ u8 unk_0e[0x20 - 0x0E];
|
||||
/* 20 */
|
||||
} WMScanParam;
|
||||
|
||||
@@ -101,7 +101,7 @@ typedef struct WMPortRecvCallback {
|
||||
/* 00 */ u8 unk_00[0x02 - 0x00];
|
||||
/* 02 */ WMErrCode errcode;
|
||||
/* 04 */ WMStateCode state;
|
||||
/* 08 */ u8 unk_08[0x0c - 0x08];
|
||||
/* 08 */ u8 unk_08[0x0C - 0x08];
|
||||
/* 0c */ void *data;
|
||||
/* 10 */ u16 length;
|
||||
/* 14 */
|
||||
@@ -118,7 +118,7 @@ typedef struct WMStartParentCallback {
|
||||
/* 02 */ WMErrCode errcode;
|
||||
/* 04 */ u8 unk_04[0x08 - 0x04];
|
||||
/* 08 */ WMStateCode state;
|
||||
/* 0a */ u8 unk_0a[0x10 - 0x0a];
|
||||
/* 0a */ u8 unk_0a[0x10 - 0x0A];
|
||||
/* 10 */ u16 aid;
|
||||
} WMStartParentCallback;
|
||||
|
||||
@@ -134,16 +134,16 @@ typedef struct WMStartScanCallback {
|
||||
/* 02 */ WMErrCode errcode;
|
||||
/* 04 */ u8 unk_04[0x08 - 0x04];
|
||||
/* 08 */ WMStateCode state;
|
||||
/* 0a */ u8 unk_0a[0x3c - 0x0a];
|
||||
/* 0a */ u8 unk_0a[0x3C - 0x0A];
|
||||
/* 3c */ WMGameInfo gameInfo;
|
||||
} WMStartScanCallback;
|
||||
|
||||
typedef struct WMPortSendCallback {
|
||||
/* 00 */ u8 unk_00[0x02 - 0x00];
|
||||
/* 02 */ WMErrCode errcode;
|
||||
/* 04 */ u8 unk_04[0x0c - 0x04];
|
||||
/* 04 */ u8 unk_04[0x0C - 0x04];
|
||||
/* 0c */ u16 destBitmap;
|
||||
/* 0e */ u8 unk_0e[0x10 - 0x0e];
|
||||
/* 0e */ u8 unk_0e[0x10 - 0x0E];
|
||||
/* 10 */ u16 sentBitmap;
|
||||
/* 12 */ u8 unk_12[0x14 - 0x12];
|
||||
/* 14 */ void *data;
|
||||
@@ -160,7 +160,7 @@ typedef struct WMMeasureChannelCallback {
|
||||
|
||||
typedef struct WMStatus {
|
||||
WMStateCode state;
|
||||
u8 unk[0x7cc];
|
||||
u8 unk[0x7CC];
|
||||
} WMStatus;
|
||||
|
||||
WMErrCode WM_Initialize(void *buf, void (*callback)(void *arg), u32 param3);
|
||||
|
||||
@@ -37,12 +37,12 @@ typedef struct G3d_BoneMtxStruct_ {
|
||||
/* 00 */ u32 flag;
|
||||
/* 04 */ u8 mUnk_04[0x24];
|
||||
/* 28 */ Mat3p rot;
|
||||
/* 58 */ u8 mUnk_58[0xc];
|
||||
/* 58 */ u8 mUnk_58[0xC];
|
||||
/* 64 */
|
||||
} G3d_BoneMtxStruct;
|
||||
|
||||
typedef enum {
|
||||
G3D_ANIMBIND_UNK = 0xff,
|
||||
G3D_ANIMBIND_UNK = 0xFF,
|
||||
G3D_ANIMBIND_EXISTS = 0x100,
|
||||
G3D_ANIMBIND_OFF = 0x200
|
||||
} G3d_AnimationBinds;
|
||||
@@ -165,7 +165,7 @@ typedef struct G3d_MaterialAnimation_ {
|
||||
/* 38 */
|
||||
} G3d_MaterialAnimation;
|
||||
|
||||
#define G3D_TEXIMAGE_PARM_TEX_COORD_MODE 0xc0000000
|
||||
#define G3D_TEXIMAGE_PARM_TEX_COORD_MODE 0xC0000000
|
||||
|
||||
extern void *G3d_gScaleHandlers[3];
|
||||
extern void *G3d_gSRTTransformHandlers[3];
|
||||
|
||||
@@ -11,10 +11,10 @@ typedef enum {
|
||||
G3D_SBC_CMD_007 = 0x7,
|
||||
G3D_SBC_CMD_008 = 0x8,
|
||||
G3D_SBC_CMD_SKN = 0x9,
|
||||
G3D_SBC_CMD_00A = 0xa,
|
||||
G3D_SBC_CMD_SCL = 0xb,
|
||||
G3D_SBC_CMD_00C = 0xc,
|
||||
G3D_SBC_CMD_00D = 0xd
|
||||
G3D_SBC_CMD_00A = 0xA,
|
||||
G3D_SBC_CMD_SCL = 0xB,
|
||||
G3D_SBC_CMD_00C = 0xC,
|
||||
G3D_SBC_CMD_00D = 0xD
|
||||
} G3d_SBC_Commands;
|
||||
|
||||
typedef enum {
|
||||
@@ -91,7 +91,7 @@ static inline void G3d_RestoreMtx_inline(u32 idx) {
|
||||
}
|
||||
|
||||
static inline void G3d_MtxMult33_inline(const Mat3p *m) {
|
||||
PushGeometryCommand(0x1a, (u32 *) m, 9);
|
||||
PushGeometryCommand(0x1A, (u32 *) m, 9);
|
||||
}
|
||||
|
||||
static inline void G3d_MtxMult43_inline(const Mat4x3p *m) {
|
||||
@@ -107,5 +107,5 @@ static inline void G3d_Scale_inline(fx32 x, fx32 y, fx32 z) {
|
||||
vec.x = x;
|
||||
vec.y = y;
|
||||
vec.z = z;
|
||||
PushGeometryCommand(0x1b, (u32 *) &vec, 3);
|
||||
PushGeometryCommand(0x1B, (u32 *) &vec, 3);
|
||||
}
|
||||
|
||||
+48
-48
@@ -37,8 +37,8 @@ extern UnkStruct_027e037c data_027e0208;
|
||||
#include <nitro/mi.h>
|
||||
#include <nitro/reg.h>
|
||||
|
||||
#define G3D_SBC_CMD_MASK 0x1f
|
||||
#define G3D_SBC_FLG_MASK 0xe0
|
||||
#define G3D_SBC_CMD_MASK 0x1F
|
||||
#define G3D_SBC_FLG_MASK 0xE0
|
||||
#define GX_ST(s, t) ((u32) ((u16) (s16) (s >> 8) | ((u16) (s16) (t >> 8) << 16)))
|
||||
#define GX_PACK_TEXCOORD_PARAM(s, t) (GX_ST((s), (t)))
|
||||
|
||||
@@ -185,7 +185,7 @@ void G3d_SBCRender_007(G3d_RenderState *renderState, u32 opCode) {
|
||||
|
||||
// clang-format off
|
||||
static u32 funcArgs[] = {
|
||||
0x1b171012, // MTX_POP | MTX_MODE | MTX_LOAD_4x3 | MTX_SCALE
|
||||
0x1B171012, // MTX_POP | MTX_MODE | MTX_LOAD_4x3 | MTX_SCALE
|
||||
1, // MTX_MODE = Position
|
||||
2, 0x1000, 0, 0, // Identity MTX
|
||||
0, 0x1000, 0, 0,
|
||||
@@ -282,15 +282,15 @@ void G3d_SBCRender_007(G3d_RenderState *renderState, u32 opCode) {
|
||||
Stream32(&funcArgs[1], ®_GFX_FIFO, 8); // MTX_MODE = Position
|
||||
Stream32(func_0200c270(), ®_GFX_FIFO, 0x30);
|
||||
|
||||
REG_GFX_FIFO = 0x1b19; // MTX_MULT_4x3 | MTX_SCALE
|
||||
Stream32(&funcArgs[3], ®_GFX_FIFO, 0x3c); // Identity MTX
|
||||
REG_GFX_FIFO = 0x1B19; // MTX_MULT_4x3 | MTX_SCALE
|
||||
Stream32(&funcArgs[3], ®_GFX_FIFO, 0x3C); // Identity MTX
|
||||
} else if (data_027e0208.flags & 2) {
|
||||
REG_GFX_FIFO = 0x171012; // MTX_POP | MTX_MODE | MTX_LOAD_4x3
|
||||
Stream32(&funcArgs[1], ®_GFX_FIFO, 8); // MTX_MODE = Position
|
||||
Stream32(func_0200c198(), ®_GFX_FIFO, 0x30);
|
||||
|
||||
REG_GFX_FIFO = 0x1b19; // MTX_MULT_4x3 | MTX_SCALE
|
||||
Stream32(&funcArgs[3], ®_GFX_FIFO, 0x3c); // Identity MTX
|
||||
REG_GFX_FIFO = 0x1B19; // MTX_MULT_4x3 | MTX_SCALE
|
||||
Stream32(&funcArgs[3], ®_GFX_FIFO, 0x3C); // Identity MTX
|
||||
} else {
|
||||
Stream32(&funcArgs, ®_GFX_FIFO, 0x48); // MTX_POP | MTX_MODE | MTX_LOAD_4x3 | MTX_SCALE
|
||||
}
|
||||
@@ -324,7 +324,7 @@ void G3d_SBCRender_008(G3d_RenderState *renderState, u32 opCode) {
|
||||
|
||||
// clang-format off
|
||||
static u32 funcArgs[] = {
|
||||
0x1b171012, // MTX_POP | MTX_MODE | MTX_LOAD_4x3 | MTX_SCALE
|
||||
0x1B171012, // MTX_POP | MTX_MODE | MTX_LOAD_4x3 | MTX_SCALE
|
||||
1, // MTX_MODE = Position
|
||||
2, 0x1000, 0, 0, // Identity MTX
|
||||
0, 0x1000, 0, 0,
|
||||
@@ -432,15 +432,15 @@ void G3d_SBCRender_008(G3d_RenderState *renderState, u32 opCode) {
|
||||
Stream32(&funcArgs[1], ®_GFX_FIFO, 8); // MTX_MODE = Position
|
||||
Stream32(func_0200c270(), ®_GFX_FIFO, 0x30);
|
||||
|
||||
REG_GFX_FIFO = 0x1b19; // MTX_MULT_4x3 | MTX_SCALE
|
||||
Stream32(&funcArgs[3], ®_GFX_FIFO, 0x3c); // Identity MTX
|
||||
REG_GFX_FIFO = 0x1B19; // MTX_MULT_4x3 | MTX_SCALE
|
||||
Stream32(&funcArgs[3], ®_GFX_FIFO, 0x3C); // Identity MTX
|
||||
} else if (data_027e0208.flags & 2) {
|
||||
REG_GFX_FIFO = 0x171012; // MTX_POP | MTX_MODE | MTX_LOAD_4x3
|
||||
Stream32(&funcArgs[1], ®_GFX_FIFO, 8); // MTX_MODE = Position
|
||||
Stream32(func_0200c198(), ®_GFX_FIFO, 0x30);
|
||||
|
||||
REG_GFX_FIFO = 0x1b19; // MTX_MULT_4x3 | MTX_SCALE
|
||||
Stream32(&funcArgs[3], ®_GFX_FIFO, 0x3c); // Identity MTX
|
||||
REG_GFX_FIFO = 0x1B19; // MTX_MULT_4x3 | MTX_SCALE
|
||||
Stream32(&funcArgs[3], ®_GFX_FIFO, 0x3C); // Identity MTX
|
||||
} else {
|
||||
Stream32(&funcArgs, ®_GFX_FIFO, 0x48); // MTX_POP | MTX_MODE | MTX_LOAD_4x3 | MTX_SCALE
|
||||
}
|
||||
@@ -505,17 +505,17 @@ void G3d_SBCRender_SKN(G3d_RenderState *renderState, u32) {
|
||||
}
|
||||
|
||||
if (i != 0) {
|
||||
mtxStruct.mtx2.xColumn.x += (weight * mat3x->xColumn.x) >> 0xc;
|
||||
mtxStruct.mtx2.xColumn.y += (weight * mat3x->xColumn.y) >> 0xc;
|
||||
mtxStruct.mtx2.xColumn.z += (weight * mat3x->xColumn.z) >> 0xc;
|
||||
mtxStruct.mtx2.xColumn.x += (weight * mat3x->xColumn.x) >> 0xC;
|
||||
mtxStruct.mtx2.xColumn.y += (weight * mat3x->xColumn.y) >> 0xC;
|
||||
mtxStruct.mtx2.xColumn.z += (weight * mat3x->xColumn.z) >> 0xC;
|
||||
|
||||
mtxStruct.mtx2.yColumn.x += (weight * mat3x->yColumn.x) >> 0xc;
|
||||
mtxStruct.mtx2.yColumn.y += (weight * mat3x->yColumn.y) >> 0xc;
|
||||
mtxStruct.mtx2.yColumn.z += (weight * mat3x->yColumn.z) >> 0xc;
|
||||
mtxStruct.mtx2.yColumn.x += (weight * mat3x->yColumn.x) >> 0xC;
|
||||
mtxStruct.mtx2.yColumn.y += (weight * mat3x->yColumn.y) >> 0xC;
|
||||
mtxStruct.mtx2.yColumn.z += (weight * mat3x->yColumn.z) >> 0xC;
|
||||
|
||||
mtxStruct.mtx2.zColumn.x += (weight * mat3x->zColumn.x) >> 0xc;
|
||||
mtxStruct.mtx2.zColumn.y += (weight * mat3x->zColumn.y) >> 0xc;
|
||||
mtxStruct.mtx2.zColumn.z += (weight * mat3x->zColumn.z) >> 0xc;
|
||||
mtxStruct.mtx2.zColumn.x += (weight * mat3x->zColumn.x) >> 0xC;
|
||||
mtxStruct.mtx2.zColumn.y += (weight * mat3x->zColumn.y) >> 0xC;
|
||||
mtxStruct.mtx2.zColumn.z += (weight * mat3x->zColumn.z) >> 0xC;
|
||||
}
|
||||
|
||||
if (!unk) {
|
||||
@@ -527,21 +527,21 @@ void G3d_SBCRender_SKN(G3d_RenderState *renderState, u32) {
|
||||
|
||||
weight = *(termPtr + 2) << 4;
|
||||
|
||||
mtxStruct.mtx1.xColumn.x += (weight * mat4x->xColumn.x) >> 0xc;
|
||||
mtxStruct.mtx1.xColumn.y += (weight * mat4x->xColumn.y) >> 0xc;
|
||||
mtxStruct.mtx1.xColumn.z += (weight * mat4x->xColumn.z) >> 0xc;
|
||||
mtxStruct.mtx1.xColumn.x += (weight * mat4x->xColumn.x) >> 0xC;
|
||||
mtxStruct.mtx1.xColumn.y += (weight * mat4x->xColumn.y) >> 0xC;
|
||||
mtxStruct.mtx1.xColumn.z += (weight * mat4x->xColumn.z) >> 0xC;
|
||||
|
||||
mtxStruct.mtx1.yColumn.x += (weight * mat4x->yColumn.x) >> 0xc;
|
||||
mtxStruct.mtx1.yColumn.y += (weight * mat4x->yColumn.y) >> 0xc;
|
||||
mtxStruct.mtx1.yColumn.z += (weight * mat4x->yColumn.z) >> 0xc;
|
||||
mtxStruct.mtx1.yColumn.x += (weight * mat4x->yColumn.x) >> 0xC;
|
||||
mtxStruct.mtx1.yColumn.y += (weight * mat4x->yColumn.y) >> 0xC;
|
||||
mtxStruct.mtx1.yColumn.z += (weight * mat4x->yColumn.z) >> 0xC;
|
||||
|
||||
mtxStruct.mtx1.zColumn.x += (weight * mat4x->zColumn.x) >> 0xc;
|
||||
mtxStruct.mtx1.zColumn.y += (weight * mat4x->zColumn.y) >> 0xc;
|
||||
mtxStruct.mtx1.zColumn.z += (weight * mat4x->zColumn.z) >> 0xc;
|
||||
mtxStruct.mtx1.zColumn.x += (weight * mat4x->zColumn.x) >> 0xC;
|
||||
mtxStruct.mtx1.zColumn.y += (weight * mat4x->zColumn.y) >> 0xC;
|
||||
mtxStruct.mtx1.zColumn.z += (weight * mat4x->zColumn.z) >> 0xC;
|
||||
|
||||
mtxStruct.mtx1.wColumn.x += (weight * mat4x->wColumn.x) >> 0xc;
|
||||
mtxStruct.mtx1.wColumn.y += (weight * mat4x->wColumn.y) >> 0xc;
|
||||
mtxStruct.mtx1.wColumn.z += (weight * mat4x->wColumn.z) >> 0xc;
|
||||
mtxStruct.mtx1.wColumn.x += (weight * mat4x->wColumn.x) >> 0xC;
|
||||
mtxStruct.mtx1.wColumn.y += (weight * mat4x->wColumn.y) >> 0xC;
|
||||
mtxStruct.mtx1.wColumn.z += (weight * mat4x->wColumn.z) >> 0xC;
|
||||
|
||||
termPtr += 3;
|
||||
mat3x = &data_02046c80.mUnk_1400[jntIndex].mtx2;
|
||||
@@ -551,17 +551,17 @@ void G3d_SBCRender_SKN(G3d_RenderState *renderState, u32) {
|
||||
;
|
||||
}
|
||||
}
|
||||
mtxStruct.mtx2.xColumn.x += (weight * mat3x->xColumn.x) >> 0xc;
|
||||
mtxStruct.mtx2.xColumn.y += (weight * mat3x->xColumn.y) >> 0xc;
|
||||
mtxStruct.mtx2.xColumn.z += (weight * mat3x->xColumn.z) >> 0xc;
|
||||
mtxStruct.mtx2.xColumn.x += (weight * mat3x->xColumn.x) >> 0xC;
|
||||
mtxStruct.mtx2.xColumn.y += (weight * mat3x->xColumn.y) >> 0xC;
|
||||
mtxStruct.mtx2.xColumn.z += (weight * mat3x->xColumn.z) >> 0xC;
|
||||
|
||||
mtxStruct.mtx2.yColumn.x += (weight * mat3x->yColumn.x) >> 0xc;
|
||||
mtxStruct.mtx2.yColumn.y += (weight * mat3x->yColumn.y) >> 0xc;
|
||||
mtxStruct.mtx2.yColumn.z += (weight * mat3x->yColumn.z) >> 0xc;
|
||||
mtxStruct.mtx2.yColumn.x += (weight * mat3x->yColumn.x) >> 0xC;
|
||||
mtxStruct.mtx2.yColumn.y += (weight * mat3x->yColumn.y) >> 0xC;
|
||||
mtxStruct.mtx2.yColumn.z += (weight * mat3x->yColumn.z) >> 0xC;
|
||||
|
||||
mtxStruct.mtx2.zColumn.x += (weight * mat3x->zColumn.x) >> 0xc;
|
||||
mtxStruct.mtx2.zColumn.y += (weight * mat3x->zColumn.y) >> 0xc;
|
||||
mtxStruct.mtx2.zColumn.z += (weight * mat3x->zColumn.z) >> 0xc;
|
||||
mtxStruct.mtx2.zColumn.x += (weight * mat3x->zColumn.x) >> 0xC;
|
||||
mtxStruct.mtx2.zColumn.y += (weight * mat3x->zColumn.y) >> 0xC;
|
||||
mtxStruct.mtx2.zColumn.z += (weight * mat3x->zColumn.z) >> 0xC;
|
||||
|
||||
func_02024a30((const Mat4x3p *) &mtxStruct.mtx2);
|
||||
REG_GFX_FIFO_MATRIX_MODE = 1; // Position
|
||||
@@ -630,7 +630,7 @@ void G3d_SBCRender_SCL(G3d_RenderState *renderState, u32 opCode) {
|
||||
} else {
|
||||
scaleVector.x = scaleVector.y = scaleVector.z = renderState->downScale;
|
||||
}
|
||||
PushGeometryCommand(0x1b, &scaleVector.x, 3); // MTX_SCALE
|
||||
PushGeometryCommand(0x1B, &scaleVector.x, 3); // MTX_SCALE
|
||||
}
|
||||
renderState->currentCmd += 1;
|
||||
}
|
||||
@@ -643,7 +643,7 @@ void G3d_SBCRender_00C(G3d_RenderState *renderState, u32) {
|
||||
u32 mtxModeTex;
|
||||
|
||||
if ((renderState->matAnim->teximage_params & G3D_TEXIMAGE_PARM_TEX_COORD_MODE) != 0x80000000) { // Normal source
|
||||
static u32 funcArgs[] = {0x2a, 0};
|
||||
static u32 funcArgs[] = {0x2A, 0};
|
||||
renderState->matAnim->teximage_params &= ~G3D_TEXIMAGE_PARM_TEX_COORD_MODE;
|
||||
renderState->matAnim->teximage_params |= 0x80000000; // Normal source
|
||||
|
||||
@@ -777,9 +777,9 @@ void G3d_SBCRender_00D(G3d_RenderState *renderState, u32) {
|
||||
num = 30;
|
||||
PushGeometryCommand(0x13, &num, 1); // MTX_STORE
|
||||
|
||||
if ((renderState->matAnim->teximage_params & 0xc0000000) != (3 << 30)) {
|
||||
static u32 cmd[] = {0x2a, 0};
|
||||
renderState->matAnim->teximage_params &= ~0xc0000000;
|
||||
if ((renderState->matAnim->teximage_params & 0xC0000000) != (3 << 30)) {
|
||||
static u32 cmd[] = {0x2A, 0};
|
||||
renderState->matAnim->teximage_params &= ~0xC0000000;
|
||||
renderState->matAnim->teximage_params |= 3 << 30;
|
||||
|
||||
cmd[1] = renderState->matAnim->teximage_params;
|
||||
@@ -876,7 +876,7 @@ void G3d_SBCRender_00D(G3d_RenderState *renderState, u32) {
|
||||
u32 tmp;
|
||||
|
||||
if (data_027e0208.flags & 1) {
|
||||
PushGeometryCommand(0x1c, &gGeomTranslation, 3); // MTX_TRANS
|
||||
PushGeometryCommand(0x1C, &gGeomTranslation, 3); // MTX_TRANS
|
||||
G3d_MtxMult33_inline(&gGeomMatrix); // MTX_MULT_3x3
|
||||
G3d_MtxMult43_inline(&m); // MTX_MULT_4x3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user