From c8a777822483603f99648662da77253e7c032a3a Mon Sep 17 00:00:00 2001 From: Roshan Padaki Date: Sun, 24 Sep 2023 00:06:16 -0400 Subject: [PATCH] [data] identify sin fn lookup --- asm/file_system.s | 32 ++++++++++++++++---------------- data/data.s | 12 +++++++----- src/data/file_system.h | 6 +++--- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/asm/file_system.s b/asm/file_system.s index c8831a991..820615be5 100644 --- a/asm/file_system.s +++ b/asm/file_system.s @@ -57,7 +57,7 @@ _08009CA8: ands r1, r2 b _08009CBE .align 2, 0 -_08009CB0: .4byte gUnknown_80B8AE4 +_08009CB0: .4byte gFastSinLookup _08009CB4: .4byte 0x000003ff _08009CB8: ldr r0, _08009CC8 @@ -70,7 +70,7 @@ _08009CBE: ldrsh r0, [r1, r2] b _08009CFE .align 2, 0 -_08009CC8: .4byte gUnknown_80B8AE4 +_08009CC8: .4byte gFastSinLookup _08009CCC: .4byte 0x000003ff _08009CD0: ldr r0, _08009CD8 @@ -78,7 +78,7 @@ _08009CD0: ands r1, r2 b _08009CE6 .align 2, 0 -_08009CD8: .4byte gUnknown_80B8AE4 +_08009CD8: .4byte gFastSinLookup _08009CDC: .4byte 0x000003ff _08009CE0: ldr r0, _08009CF4 @@ -92,7 +92,7 @@ _08009CE6: negs r0, r0 b _08009CFE .align 2, 0 -_08009CF4: .4byte gUnknown_80B8AE4 +_08009CF4: .4byte gFastSinLookup _08009CF8: .4byte 0x000003ff _08009CFC: movs r0, 0 @@ -132,7 +132,7 @@ _08009D30: bics r1, r2 b _08009D72 .align 2, 0 -_08009D38: .4byte gUnknown_80B8AE4 +_08009D38: .4byte gFastSinLookup _08009D3C: .4byte 0x000003ff _08009D40: ldr r0, _08009D48 @@ -140,7 +140,7 @@ _08009D40: ands r1, r2 b _08009D56 .align 2, 0 -_08009D48: .4byte gUnknown_80B8AE4 +_08009D48: .4byte gFastSinLookup _08009D4C: .4byte 0x000003ff _08009D50: ldr r0, _08009D64 @@ -154,7 +154,7 @@ _08009D56: negs r0, r0 b _08009D86 .align 2, 0 -_08009D64: .4byte gUnknown_80B8AE4 +_08009D64: .4byte gFastSinLookup _08009D68: .4byte 0x000003ff _08009D6C: ldr r0, _08009D7C @@ -167,7 +167,7 @@ _08009D72: ldrsh r0, [r1, r2] b _08009D86 .align 2, 0 -_08009D7C: .4byte gUnknown_80B8AE4 +_08009D7C: .4byte gFastSinLookup _08009D80: .4byte 0x000003ff _08009D84: movs r0, 0 @@ -685,7 +685,7 @@ _0800A0E2: ldr r0, [r1] b _0800A252 .align 2, 0 -_0800A0EC: .4byte gUnknown_80B92E4 +_0800A0EC: .4byte gFastUnknownFn1Lookup _0800A0F0: adds r1, r2, 0 cmp r2, 0 @@ -714,7 +714,7 @@ _0800A112: movs r0, 0x40 b _0800A250 .align 2, 0 -_0800A120: .4byte gUnknown_80B92E4 +_0800A120: .4byte gFastUnknownFn1Lookup _0800A124: negs r3, r3 cmp r2, r3 @@ -741,7 +741,7 @@ _0800A146: movs r0, 0x80 b _0800A250 .align 2, 0 -_0800A154: .4byte gUnknown_80B92E4 +_0800A154: .4byte gFastUnknownFn1Lookup _0800A158: adds r1, r2, 0 cmp r2, 0 @@ -770,7 +770,7 @@ _0800A17A: adds r0, 0x40 b _0800A252 .align 2, 0 -_0800A188: .4byte gUnknown_80B92E4 +_0800A188: .4byte gFastUnknownFn1Lookup _0800A18C: negs r2, r2 cmp r3, 0 @@ -795,7 +795,7 @@ _0800A1AA: lsls r0, 1 b _0800A250 .align 2, 0 -_0800A1B8: .4byte gUnknown_80B92E4 +_0800A1B8: .4byte gFastUnknownFn1Lookup _0800A1BC: adds r1, r2, 0 cmp r2, 0 @@ -824,7 +824,7 @@ _0800A1DE: adds r0, 0xC0 b _0800A252 .align 2, 0 -_0800A1EC: .4byte gUnknown_80B92E4 +_0800A1EC: .4byte gFastUnknownFn1Lookup _0800A1F0: negs r3, r3 cmp r2, r3 @@ -851,7 +851,7 @@ _0800A212: adds r0, 0x80 b _0800A252 .align 2, 0 -_0800A220: .4byte gUnknown_80B92E4 +_0800A220: .4byte gFastUnknownFn1Lookup _0800A224: adds r0, r2, 0 cmp r0, 0 @@ -886,7 +886,7 @@ _0800A254: pop {r1} bx r1 .align 2, 0 -_0800A258: .4byte gUnknown_80B92E4 +_0800A258: .4byte gFastUnknownFn1Lookup thumb_func_end sub_800A0B0 thumb_func_start sub_800A25C diff --git a/data/data.s b/data/data.s index d94856dc6..59af57694 100644 --- a/data/data.s +++ b/data/data.s @@ -1960,8 +1960,9 @@ x = 0 x = x + 1 .endr - .global gUnknown_80B8AE4 -gUnknown_80B8AE4: @ 80B8AE4 +@ gFastSinLookup[i] = floor(256 * sin(iπ / 2048)) + .global gFastSinLookup +gFastSinLookup: @ 80B8AE4 .2byte 0, 0, 0, 1, 1, 1, 2, 2 .2byte 3, 3, 3, 4, 4, 5, 5, 5 .2byte 6, 6, 7, 7, 7, 8, 8, 9 @@ -2091,8 +2092,9 @@ gUnknown_80B8AE4: @ 80B8AE4 .2byte 255, 255, 255, 255, 255, 255, 255, 255 .2byte 255, 255, 255, 255, 255, 255, 255, 255 - .global gUnknown_80B92E4 -gUnknown_80B92E4: @ 80B92E4 +@ Need to figure out what function this actually is. + .global gFastUnknownFn1Lookup +gFastUnknownFn1Lookup: @ 80B92E4 .4byte 0, 0, 0, 0, 0, 0, 0, 1 .4byte 1, 1, 1, 1, 1, 2, 2, 2 .4byte 2, 2, 2, 3, 3, 3, 3, 3 @@ -2126,4 +2128,4 @@ gUnknown_80B92E4: @ 80B92E4 .4byte 30, 30, 30, 30, 31, 31, 31, 31 .4byte 31, 31, 31, 31, 31, 31, 31, 31 -@ END file_system \ No newline at end of file +@ END file_system diff --git a/src/data/file_system.h b/src/data/file_system.h index 332f96ae2..c83e09ef6 100644 --- a/src/data/file_system.h +++ b/src/data/file_system.h @@ -2,8 +2,8 @@ // gFastMod3Lookup // gFastDiv3Lookup -// gUnknown_80B8AE4 -// gUnknown_80B92E4 +// gFastSinLookup +// gFastUnknownFn1Lookup static const u32 gUnknown_80B96E4[300] = { 0, 0, 45426, 71998, @@ -84,4 +84,4 @@ static const u32 gUnknown_80B96E4[300] = { }; ALIGNED(4) static const u8 gUnknown_80B9B94[] = _("pksdir0"); -ALIGNED(4) static const u8 gUnknown_80B9B9C[] = _("not find file [%s]\n"); \ No newline at end of file +ALIGNED(4) static const u8 gUnknown_80B9B9C[] = _("not find file [%s]\n");