Skip to content

Commit

Permalink
[data] identify sin fn lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
rpadaki committed Sep 24, 2023
1 parent 96989a1 commit c8a7778
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
32 changes: 16 additions & 16 deletions asm/file_system.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -70,15 +70,15 @@ _08009CBE:
ldrsh r0, [r1, r2]
b _08009CFE
.align 2, 0
_08009CC8: .4byte gUnknown_80B8AE4
_08009CC8: .4byte gFastSinLookup
_08009CCC: .4byte 0x000003ff
_08009CD0:
ldr r0, _08009CD8
ldr r1, _08009CDC
ands r1, r2
b _08009CE6
.align 2, 0
_08009CD8: .4byte gUnknown_80B8AE4
_08009CD8: .4byte gFastSinLookup
_08009CDC: .4byte 0x000003ff
_08009CE0:
ldr r0, _08009CF4
Expand All @@ -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
Expand Down Expand Up @@ -132,15 +132,15 @@ _08009D30:
bics r1, r2
b _08009D72
.align 2, 0
_08009D38: .4byte gUnknown_80B8AE4
_08009D38: .4byte gFastSinLookup
_08009D3C: .4byte 0x000003ff
_08009D40:
ldr r0, _08009D48
ldr r1, _08009D4C
ands r1, r2
b _08009D56
.align 2, 0
_08009D48: .4byte gUnknown_80B8AE4
_08009D48: .4byte gFastSinLookup
_08009D4C: .4byte 0x000003ff
_08009D50:
ldr r0, _08009D64
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions data/data.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
@ END file_system
6 changes: 3 additions & 3 deletions src/data/file_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

// gFastMod3Lookup
// gFastDiv3Lookup
// gUnknown_80B8AE4
// gUnknown_80B92E4
// gFastSinLookup
// gFastUnknownFn1Lookup

static const u32 gUnknown_80B96E4[300] = {
0, 0, 45426, 71998,
Expand Down Expand Up @@ -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");
ALIGNED(4) static const u8 gUnknown_80B9B9C[] = _("not find file [%s]\n");

0 comments on commit c8a7778

Please sign in to comment.