-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
173 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "libsnd_i.h" | ||
|
||
void _SsUtResolveADSR(u16 arg0, u16 arg1, struct Unk* arg2) { | ||
arg2->unkA = arg0 & 0x8000; | ||
arg2->unkC = arg1 & 0x8000; | ||
arg2->unk10 = arg1 & 0x4000; | ||
arg2->unkE = arg1 & 0x20; | ||
arg2->unk0 = (arg0 >> 8) & 0x7F; | ||
arg2->unk2 = (arg0 >> 4) & 0xF; | ||
arg2->unk4 = arg0 & 0xF; | ||
arg2->unk6 = (arg1 >> 6) & 0x7F; | ||
arg2->unk8 = arg1 & 0x1F; | ||
} | ||
|
||
void _SsUtBuildADSR(struct Unk* arg0, s16* arg1, s16* arg2) { | ||
u16 temp_t1; | ||
u16 var_v0; | ||
s16 temp4; | ||
s16 temp5; | ||
if (arg0->unkC != 0) { | ||
temp_t1 = 0x8000; | ||
} else { | ||
temp_t1 = 0; | ||
} | ||
|
||
if (arg0->unkA != 0) { | ||
var_v0 = 0x8000; | ||
} else { | ||
var_v0 = 0; | ||
} | ||
|
||
if (arg0->unk10 != 0) { | ||
temp_t1 = temp_t1 | 0x4000; | ||
} | ||
temp4 = var_v0 | ((arg0->unk0 << 8) & 0x7F00) | ((arg0->unk2 << 4) & 0xF0) | | ||
(arg0->unk4 & 0xF); | ||
temp5 = temp_t1 | ((arg0->unk6 << 6) & 0x1FC0) | (arg0->unk8 & 0x1F); | ||
temp_t1 = temp5; | ||
*arg1 = temp4; | ||
*arg2 = temp_t1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#ifndef SND_DEFS_H | ||
#define SND_DEFS_H | ||
|
||
#include "../types.h" | ||
|
||
typedef void (*SndSsMarkCallbackProc)(short seq_no, short sep_no, short data); | ||
|
||
struct SeqStruct { | ||
u8 unk0; | ||
u8 pad1[3]; | ||
u8* read_pos; | ||
u8* next_sep_pos; /* 0x8 */ | ||
u8* loop_pos; /* 0xC */ | ||
u8 unk10; | ||
u8 unk11; | ||
u8 channel; | ||
u8 unk13; | ||
u8 unk14; | ||
u8 unk15; | ||
u8 unk16; | ||
u8 panpot[16]; | ||
u8 unk27; | ||
u8 unk28; | ||
u8 unk29; | ||
u8 unk2a; | ||
u8 unk2b; | ||
u8 programs[16]; | ||
u8 unk3C; | ||
u8 pad3D; | ||
s16 unk3E; | ||
s16 unk40; | ||
s16 unk42; | ||
s16 unk44; | ||
s16 unk46; | ||
s16 unk48; | ||
s16 unk4a; | ||
s16 unk4c; | ||
s16 vol[16]; | ||
s16 unk6E; | ||
s16 unk70; | ||
s16 unk72; | ||
u16 unk74; | ||
s16 unk76; | ||
s16 unk78; | ||
s16 unk7A; | ||
s32 unk7c; | ||
u32 unk80; | ||
s32 unk84; | ||
s32 delta_value; | ||
s32 unk8c; | ||
s32 unk90; | ||
s32 unk94; | ||
s32 unk98; | ||
s32 unk9C; | ||
s32 unkA0; | ||
u32 unkA4; | ||
s16 padA6; | ||
s16 padaa; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include "ssinit.h" | ||
|
||
s32 _snd_openflag; | ||
s32 VBLANK_MINUS; | ||
SndSsMarkCallbackProc _SsMarkCallback[32][16]; | ||
struct SeqStruct* _ss_score[32]; | ||
s16 _snd_seq_s_max; | ||
s16 _snd_seq_t_max; | ||
s32 _snd_ev_flag; | ||
|
||
static short D_80032EC0[] = { | ||
0x0000, 0x0000, 0x1000, 0x3000, 0x00BF, 0x0000, 0x0000, 0x0000}; | ||
|
||
static short D_80032ED0[] = { | ||
0x3FFF, 0x3FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, | ||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}; | ||
|
||
void _SsInit(void) { | ||
u16* var_a2; | ||
int i, j; | ||
|
||
var_a2 = (u16*)0x1F801C00; | ||
for (i = 0; i < 24; i++) { | ||
for (j = 0; j < 8; j++) { | ||
*var_a2++ = D_80032EC0[j]; | ||
} | ||
} | ||
|
||
var_a2 = (u16*)0x1F801D80; | ||
for (i = 0; i < 16; i++) { | ||
*var_a2++ = D_80032ED0[i]; | ||
} | ||
|
||
SpuVmInit(24); | ||
|
||
for (j = 0; j < 32; j++) { | ||
for (i = 0; i < 16; i++) { | ||
_SsMarkCallback[j][i] = 0; | ||
} | ||
} | ||
|
||
VBLANK_MINUS = 0x3C; | ||
_snd_openflag = 0; | ||
_snd_ev_flag = 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "../types.h" | ||
#include "snd_defs.h" | ||
|
||
extern s32 dummy_0; | ||
extern s32 dummy_1; | ||
extern s32 dummy_2; | ||
extern s32 dummy_3; | ||
extern s32 dummy_4; | ||
extern s32 dummy_5; | ||
extern s32 dummy_6; | ||
extern s32 dummy_7; | ||
extern s32 dummy_8; | ||
extern s32 dummy_9; | ||
extern s32 dummy_10; | ||
extern SndSsMarkCallbackProc _SsMarkCallback[32][16]; /* #11 */ | ||
extern struct SeqStruct* _ss_score[32]; /* #12 */ | ||
extern s32 VBLANK_MINUS; /* #13 */ | ||
extern s32 _snd_openflag; /* #14 */ | ||
extern s16 _snd_seq_s_max; /* #15 */ | ||
extern s16 _snd_seq_t_max; /* #16 */ | ||
extern s32 _snd_ev_flag; /* #17 */ |