diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2020-05-23 16:42:42 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2020-05-23 16:42:42 -0400 |
commit | d1063c084aeac60c98b40c3ef1ea36c9bfbd273a (patch) | |
tree | 7262e604d9f671d61bc2a60d806dd2bbd0bfbef2 /arm9/lib/src | |
parent | 67669f6daf3bfe989eaad9322f5ea5706ee572e2 (diff) |
Finish distributing rom2_2.s
Diffstat (limited to 'arm9/lib/src')
-rw-r--r-- | arm9/lib/src/FX_atan.c | 132 | ||||
-rw-r--r-- | arm9/lib/src/GX_load3d.c | 45 |
2 files changed, 167 insertions, 10 deletions
diff --git a/arm9/lib/src/FX_atan.c b/arm9/lib/src/FX_atan.c index 979895a8..9a936fa0 100644 --- a/arm9/lib/src/FX_atan.c +++ b/arm9/lib/src/FX_atan.c @@ -2,7 +2,137 @@ #include "main.h" #include "fx.h" -extern fx16 FX_AtanTable_[]; +const fx16 FX_AtanTable_[] = { + FX16_CONST(0.0), + FX16_CONST(0.019775390625), + FX16_CONST(0.039794921875), + FX16_CONST(0.0595703125), + FX16_CONST(0.07958984375), + FX16_CONST(0.099365234375), + FX16_CONST(0.119384765625), + FX16_CONST(0.13916015625), + FX16_CONST(0.158935546875), + FX16_CONST(0.1787109375), + FX16_CONST(0.198486328125), + FX16_CONST(0.21826171875), + FX16_CONST(0.238037109375), + FX16_CONST(0.2578125), + FX16_CONST(0.27734375), + FX16_CONST(0.297119140625), + FX16_CONST(0.316650390625), + FX16_CONST(0.336181640625), + FX16_CONST(0.355712890625), + FX16_CONST(0.375244140625), + FX16_CONST(0.394775390625), + FX16_CONST(0.4140625), + FX16_CONST(0.433349609375), + FX16_CONST(0.45263671875), + FX16_CONST(0.471923828125), + FX16_CONST(0.4912109375), + FX16_CONST(0.51025390625), + FX16_CONST(0.529296875), + FX16_CONST(0.54833984375), + FX16_CONST(0.5673828125), + FX16_CONST(0.586181640625), + FX16_CONST(0.60498046875), + FX16_CONST(0.623779296875), + FX16_CONST(0.642578125), + FX16_CONST(0.6611328125), + FX16_CONST(0.6796875), + FX16_CONST(0.6982421875), + FX16_CONST(0.716552734375), + FX16_CONST(0.73486328125), + FX16_CONST(0.753173828125), + FX16_CONST(0.771240234375), + FX16_CONST(0.789306640625), + FX16_CONST(0.807373046875), + FX16_CONST(0.8251953125), + FX16_CONST(0.843017578125), + FX16_CONST(0.86083984375), + FX16_CONST(0.878662109375), + FX16_CONST(0.89599609375), + FX16_CONST(0.91357421875), + FX16_CONST(0.930908203125), + FX16_CONST(0.9482421875), + FX16_CONST(0.965576171875), + FX16_CONST(0.982666015625), + FX16_CONST(0.999755859375), + FX16_CONST(1.0166015625), + FX16_CONST(1.033447265625), + FX16_CONST(1.05029296875), + FX16_CONST(1.06689453125), + FX16_CONST(1.08349609375), + FX16_CONST(1.099853515625), + FX16_CONST(1.1162109375), + FX16_CONST(1.132568359375), + FX16_CONST(1.148681640625), + FX16_CONST(1.164794921875), + FX16_CONST(1.1806640625), + FX16_CONST(1.196533203125), + FX16_CONST(1.21240234375), + FX16_CONST(1.22802734375), + FX16_CONST(1.24365234375), + FX16_CONST(1.259033203125), + FX16_CONST(1.2744140625), + FX16_CONST(1.28955078125), + FX16_CONST(1.3046875), + FX16_CONST(1.31982421875), + FX16_CONST(1.334716796875), + FX16_CONST(1.349609375), + FX16_CONST(1.364501953125), + FX16_CONST(1.379150390625), + FX16_CONST(1.3935546875), + FX16_CONST(1.408203125), + FX16_CONST(1.42236328125), + FX16_CONST(1.436767578125), + FX16_CONST(1.450927734375), + FX16_CONST(1.46484375), + FX16_CONST(1.47900390625), + FX16_CONST(1.49267578125), + FX16_CONST(1.506591796875), + FX16_CONST(1.520263671875), + FX16_CONST(1.53369140625), + FX16_CONST(1.547119140625), + FX16_CONST(1.560546875), + FX16_CONST(1.57373046875), + FX16_CONST(1.5869140625), + FX16_CONST(1.60009765625), + FX16_CONST(1.613037109375), + FX16_CONST(1.6259765625), + FX16_CONST(1.638671875), + FX16_CONST(1.6513671875), + FX16_CONST(1.663818359375), + FX16_CONST(1.676513671875), + FX16_CONST(1.688720703125), + FX16_CONST(1.701171875), + FX16_CONST(1.71337890625), + FX16_CONST(1.7255859375), + FX16_CONST(1.737548828125), + FX16_CONST(1.74951171875), + FX16_CONST(1.76123046875), + FX16_CONST(1.77294921875), + FX16_CONST(1.78466796875), + FX16_CONST(1.79638671875), + FX16_CONST(1.807861328125), + FX16_CONST(1.819091796875), + FX16_CONST(1.83056640625), + FX16_CONST(1.841796875), + FX16_CONST(1.852783203125), + FX16_CONST(1.864013671875), + FX16_CONST(1.874755859375), + FX16_CONST(1.8857421875), + FX16_CONST(1.896484375), + FX16_CONST(1.9072265625), + FX16_CONST(1.91796875), + FX16_CONST(1.928466796875), + FX16_CONST(1.93896484375), + FX16_CONST(1.94921875), + FX16_CONST(1.95947265625), + FX16_CONST(1.9697265625), + FX16_CONST(1.97998046875), + FX16_CONST(1.989990234375), + FX16_CONST(2.0), +}; ARM_FUNC u16 FX_Atan(fx32 x){ if (x >= 0) diff --git a/arm9/lib/src/GX_load3d.c b/arm9/lib/src/GX_load3d.c index a407eb59..efab53ae 100644 --- a/arm9/lib/src/GX_load3d.c +++ b/arm9/lib/src/GX_load3d.c @@ -4,24 +4,51 @@ extern u32 GXi_DmaId; -struct _TexStartAddrTable +static u32 sTexLCDCBlk1 = 0; +static u32 sSzTexBlk1 = 0; +static u32 sTexLCDCBlk2 = 0; +static s32 sTex = 0; + +static const struct { u16 blk1; // 12 bit shift u16 blk2; // 12 bit shift u16 szBlk1; // 12 bit shift +} sTexStartAddrTable[16] = { + {0, 0, 0}, + {0x06800000 >> 12, 0, 0}, + {0x06820000 >> 12, 0, 0}, + {0x06800000 >> 12, 0, 0}, + {0x06840000 >> 12, 0, 0}, + {0x06800000 >> 12, 0x06840000 >> 12, 0x00020000 >> 12}, + {0x06820000 >> 12, 0, 0}, + {0x06800000 >> 12, 0, 0}, + {0x06860000 >> 12, 0, 0}, + {0x06800000 >> 12, 0x06860000 >> 12, 0x00020000 >> 12}, + {0x06820000 >> 12, 0x06860000 >> 12, 0x00020000 >> 12}, + {0x06800000 >> 12, 0x06860000 >> 12, 0x00040000 >> 12}, + {0x06840000 >> 12, 0, 0}, + {0x06800000 >> 12, 0x06840000 >> 12, 0x00020000 >> 12}, + {0x06820000 >> 12, 0, 0}, + {0x06800000 >> 12, 0, 0}, }; -extern const struct _TexStartAddrTable sTexStartAddrTable[16]; - -extern const u16 sTexPlttStartAddrTable[8]; -static u32 sTexLCDCBlk2 = 0; -static s32 sTex = 0; -static u32 sClrImgLCDCBlk = 0; static s32 sTexPltt = 0; static u32 sTexPlttLCDCBlk = 0; -static u32 sTexLCDCBlk1 = 0; + +static const u16 sTexPlttStartAddrTable[8] = { + 0, + 0x06880000 >> 12, + 0x06890000 >> 12, + 0x06880000 >> 12, + 0x06894000 >> 12, + 0, + 0x06890000 >> 12, + 0x06880000 >> 12 +}; + static s32 sClrImg = 0; -static u32 sSzTexBlk1 = 0; +static u32 sClrImgLCDCBlk = 0; ARM_FUNC void GX_BeginLoadTex(){ u32 temp = GX_ResetBankForTex(); |