Skip to content

Commit 001630f

Browse files
authored
Merge pull request #133 from Kelebek1/various
various
2 parents 0032bf8 + 57f97b1 commit 001630f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+5239
-1901
lines changed

include/functions.h

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include "ultra64.h"
55

6+
f32 __sinf(f32);
7+
68
void func_80057FD0(void *, int);
79
s32 func_8005A990(OSPiHandle *);
810

include/global.h

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define _COMMON_H
33

44
#include <ultra64.h>
5+
#include <PR/sched.h>
56

67
typedef unsigned int uintptr_t;
78

@@ -13,6 +14,7 @@ typedef unsigned int uintptr_t;
1314
#include "sections.h"
1415
#include "gfx.h"
1516
#include "color.h"
17+
#include "sound.h"
1618
#include "math.h"
1719

1820
typedef struct unk_D_86002F58_004_000_00C_028 {

include/sound.h

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef _SOUND_H
2+
#define _SOUND_H
3+
4+
#include <ultra64.h>
5+
#include <PR/libaudio.h>
6+
7+
typedef struct SoundBank {
8+
/* 0x00 */ char header_name[16]; // N64 PtrTablesV2\x0
9+
/* 0x10 */ u32 flags;
10+
/* 0x14 */ char wbk_name[12];
11+
/* 0x20 */ s32 count;
12+
/* 0x24 */ char* basenote;
13+
/* 0x28 */ f32* detune;
14+
/* 0x2C */ ALWaveTable** wave_list;
15+
} SoundBank; // size = 0x30
16+
17+
#endif

include/variables.h

+4-7
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ extern struct Vec3s D_8006F05C;
116116
extern struct Vec3f D_8006F064;
117117

118118
typedef struct unk_D_8006FF00 {
119-
/* 0x00 */ char unk_00[0x10];
119+
/* 0x00 */ char unk_00[0x4];
120+
/* 0x04 */ char* name;
121+
/* 0x08 */ char unk_08[0x8];
120122
/* 0x10 */ s16 unk_10;
121123
/* 0x12 */ s16 unk_12;
122124
/* 0x14 */ char unk_14[0x8];
@@ -143,11 +145,6 @@ extern unk_D_800AC870* D_800AC870;
143145

144146
extern Gfx D_8006F498[];
145147

146-
extern f32 D_80077DD4;
147-
extern f32 D_80077DD8;
148-
extern f32 D_80077DDC;
149-
extern f32 D_80077DE0;
150-
extern s8 D_80077DE4;
151148
extern s32 D_80078E60;
152149
extern s32 D_80078E64;
153150
extern s32 D_80078E68;
@@ -191,6 +188,6 @@ extern u8 D_87B000D0;
191188
extern u8 D_87B000D4;
192189

193190
extern s32 D_800FC820;
194-
extern s32 D_800FF9C0;
191+
extern u8* D_800FF9C0;
195192

196193
#endif

linker_scripts/us/symbol_addrs.txt

+19
Original file line numberDiff line numberDiff line change
@@ -271,3 +271,22 @@ CHORUS_PARAMS_N = 0x80079488;
271271
FLANGE_PARAMS_N = 0x800794B0;
272272
NULL_PARAMS_N = 0x800794D8;
273273
n_eqpower = 0x80078600;
274+
frameSize = 0x800FCAC8;
275+
curAcmdList = 0x80077DB8;
276+
maxRSPCmds = 0x800FCAD0;
277+
minFrameSize = 0x800FCAC4;
278+
maxFrameSize = 0x800FCACC;
279+
dmaBuffs = 0x800FCAF8;
280+
dmaState = 0x800FCAB8; // size:0xC
281+
__am = 0x800FC830; // size:0x288
282+
lastInfo = 0x80077DBC;
283+
min_only_one = 0x80077DC0;
284+
audFrameCt = 0x80077DB0;
285+
dmaBufferLen = 0x800FCB04;
286+
audDMAIOMesgBuf = 0x800FCAFC;
287+
nextDMA = 0x80077DB4;
288+
audDMAMessageBuf = 0x800FCB00;
289+
rspbootTextStart = 0x80065FC0;
290+
aspMainTextStart = 0x80067420;
291+
aspMainDataStart = 0x8007EA70;
292+
audDMAMessageQ = 0x800FCAE0;

linker_scripts/us/symbol_addrs_code.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1257,11 +1257,11 @@ func_8003C2F8 = 0x8003C2F8; // type:func
12571257
func_8003C35C = 0x8003C35C; // type:func
12581258
func_8003C3A0 = 0x8003C3A0; // type:func
12591259
func_8003C408 = 0x8003C408; // type:func
1260-
func_8003C540 = 0x8003C540; // type:func
1261-
func_8003C8DC = 0x8003C8DC; // type:func
1260+
amCreateAudioMgr = 0x8003C540; // type:func
1261+
__amDMA = 0x8003C8DC; // type:func
12621262
func_8003CADC = 0x8003CADC; // type:func
1263-
func_8003D128 = 0x8003D128; // type:func
1264-
func_8003D160 = 0x8003D160; // type:func
1263+
__amDmaNew = 0x8003D128; // type:func
1264+
__clearAudioDMA = 0x8003D160; // type:func
12651265
func_8003D264 = 0x8003D264; // type:func
12661266
func_8003D2B8 = 0x8003D2B8; // type:func
12671267
func_8003D32C = 0x8003D32C; // type:func

src/19840.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
#include "global.h"
21
#include "19840.h"
2+
#include "src/18480.h"
3+
#include "src/1C720.h"
4+
#include "src/3FB0.h"
5+
#include "src/dma.h"
6+
#include "src/memmap.h"
7+
#include "src/memory.h"
8+
#include "src/util.h"
39

410
#pragma GLOBAL_ASM("asm/us/nonmatchings/19840/func_80018C40.s")
511

src/1CF30.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
#include "include/string.h"
44
#include "src/3FB0.h"
55
#include "src/6A40.h"
6+
#include "src/20470.h"
67
#include "src/6BC0.h"
78
#include "src/E890.h"
89
#include "src/memory.h"
910
#include "stdarg.h"
1011
#include "lib/ultralib/src/libc/xstdio.h"
1112

1213
extern Gfx D_8006F4C0[];
13-
extern Gfx D_8006F610[];
1414
extern Gfx D_8006F710[];
1515
extern Gfx D_8006F750[];
1616
extern Gfx D_8006F768[];
@@ -66,48 +66,48 @@ void func_8001C6AC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s
6666
func_8001C330(arg0, arg1, arg2, arg3, 0, 0, 0x400, 0x400, arg6);
6767
}
6868

69-
void func_8001C8C4(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6) {
69+
void func_8001C8C4(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6) {
7070
gDPLoadTextureBlock(gDisplayListHead++, arg4, G_IM_FMT_RGBA, G_IM_SIZ_32b, arg5, arg3, 0,
7171
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
7272
G_TX_NOLOD);
7373

7474
func_8001C330(arg0, arg1, arg2, arg3, 0, 0, 0x400, 0x400, arg6);
7575
}
7676

77-
void func_8001CADC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6) {
77+
void func_8001CADC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6) {
7878
gDPLoadTextureBlock(gDisplayListHead++, arg4, G_IM_FMT_IA, G_IM_SIZ_8b, arg5, arg3, 0, G_TX_NOMIRROR | G_TX_CLAMP,
7979
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
8080
func_8001C330(arg0, arg1, arg2, arg3, 0, 0, 0x400, 0x400, arg6);
8181
}
8282

83-
void func_8001CCF8(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6) {
83+
void func_8001CCF8(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6) {
8484
gDPLoadTextureBlock(gDisplayListHead++, arg4, G_IM_FMT_IA, G_IM_SIZ_16b, arg5, arg3, 0, G_TX_NOMIRROR | G_TX_CLAMP,
8585
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
8686
func_8001C330(arg0, arg1, arg2, arg3, 0, 0, 0x400, 0x400, arg6);
8787
}
8888

89-
void func_8001CF10(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6) {
89+
void func_8001CF10(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6) {
9090
gDPLoadTextureBlock_4b(gDisplayListHead++, arg4, G_IM_FMT_I, arg5, arg3, 0, G_TX_NOMIRROR | G_TX_CLAMP,
9191
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
9292

9393
func_8001C330(arg0, arg1, arg2, arg3, 0, 0, 0x400, 0x400, arg6);
9494
}
9595

96-
void func_8001D12C(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6) {
96+
void func_8001D12C(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6) {
9797
gDPLoadTextureBlock(gDisplayListHead++, arg4, G_IM_FMT_I, G_IM_SIZ_8b, arg5, arg3, 0, G_TX_NOMIRROR | G_TX_CLAMP,
9898
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
9999

100100
func_8001C330(arg0, arg1, arg2, arg3, 0, 0, 0x400, 0x400, arg6);
101101
}
102102

103-
void func_8001D348(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6) {
103+
void func_8001D348(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6) {
104104
gDPLoadTextureBlock(gDisplayListHead++, arg4, G_IM_FMT_I, G_IM_SIZ_16b, arg5, arg3, 0, G_TX_NOMIRROR | G_TX_CLAMP,
105105
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
106106

107107
func_8001C330(arg0, arg1, arg2, arg3, 0, 0, 0x400, 0x400, arg6);
108108
}
109109

110-
void func_8001D560(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, u32* arg5, s16 arg6, s32 arg7) {
110+
void func_8001D560(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, u8* arg5, s16 arg6, s32 arg7) {
111111
gDPLoadTextureBlock(gDisplayListHead++, arg4, G_IM_FMT_RGBA, G_IM_SIZ_16b, arg6, arg3, 0,
112112
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
113113
G_TX_NOLOD);
@@ -315,9 +315,9 @@ u8 func_8001E730(u16 arg0) {
315315
u8 var_v1 = 0;
316316

317317
if ((arg0 >= 0x20) && (arg0 < 0x80)) {
318-
var_v1 = ((u8*)D_8006F630)[arg0 + 0];
318+
var_v1 = ((u8*)D_8006F630)[arg0];
319319
} else if ((arg0 >= 0xA0) && (arg0 < 0x100)) {
320-
var_v1 = ((u8*)D_8006F610)[arg0 + 0];
320+
var_v1 = ((u8*)D_8006F608)[sizeof(Gfx) + arg0];
321321
}
322322

323323
return var_v1;

src/1CF30.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ void func_8001C4E4(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s
88
void func_8001C560(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, u8 arg6);
99
void func_8001C604(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, u8 arg6, u8 arg7);
1010
void func_8001C6AC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6);
11-
void func_8001C8C4(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6);
12-
void func_8001CADC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6);
13-
void func_8001CCF8(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6);
14-
void func_8001CF10(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6);
15-
void func_8001D12C(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6);
16-
void func_8001D348(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, s16 arg5, s32 arg6);
17-
void func_8001D560(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u32* arg4, u32* arg5, s16 arg6, s32 arg7);
11+
void func_8001C8C4(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6);
12+
void func_8001CADC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6);
13+
void func_8001CCF8(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6);
14+
void func_8001CF10(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6);
15+
void func_8001D12C(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6);
16+
void func_8001D348(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, s16 arg5, s32 arg6);
17+
void func_8001D560(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8* arg4, u8* arg5, s16 arg6, s32 arg7);
1818
void func_8001D924(u8* arg0);
1919
void func_8001DBDC(u32 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4);
2020
void func_8001E000(s16 arg0, s16 arg1, s16 arg2, f32 arg3, Vtx* arg4, u32 arg5);

0 commit comments

Comments
 (0)