mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-07 12:03:27 -04:00
jaudio_NES: implement & link effect
This commit is contained in:
@@ -19,6 +19,7 @@ extern "C" {
|
||||
#define AUDIO_GROUP_MAX 5
|
||||
#define AUDIO_SUBTRACK_NUM 16
|
||||
#define AUDIO_NOTE_MAX 128
|
||||
#define AUDIO_SUBTRACK_NOTE_NUM 4
|
||||
|
||||
#define AUDIO_TATUMS_PER_BEAT 48
|
||||
|
||||
@@ -30,6 +31,12 @@ extern "C" {
|
||||
#define AUDIO_MUTE_FLAG_STOP_NOTE (1 << 6)
|
||||
#define AUDIO_MUTE_FLAG_STOP_SCRIPT (1 << 7)
|
||||
|
||||
#define ADSR_DISABLE 0
|
||||
#define ADSR_HANG -1
|
||||
#define ADSR_GOTO -2
|
||||
#define ADSR_RESTART -3
|
||||
#define ADSR_SPECIAL4 -4 // TODO: figure this out
|
||||
|
||||
#define NA_MAKE_COMMAND(a0, a1, a2, a3) \
|
||||
(u32)((((a0) & 0xFF) << 24) | (((a1) & 0xFF) << 16) | (((a2) & 0xFF) << 8) | (((a3) & 0xFF) << 0))
|
||||
|
||||
|
||||
@@ -180,11 +180,16 @@ typedef struct envdat_ {
|
||||
|
||||
/* sizeof(envp) == 0x20 */
|
||||
typedef struct envp_ {
|
||||
/* 0x00 */ u8 unused : 1;
|
||||
/* 0x00 */ u8 hang : 1;
|
||||
/* 0x00 */ u8 decay : 1;
|
||||
/* 0x00 */ u8 release : 1;
|
||||
/* 0x00 */ u8 status : 4;
|
||||
union {
|
||||
struct {
|
||||
/* 0x00 */ u8 unused : 1;
|
||||
/* 0x00 */ u8 hang : 1;
|
||||
/* 0x00 */ u8 decay : 1;
|
||||
/* 0x00 */ u8 release : 1;
|
||||
/* 0x00 */ u8 status : 4;
|
||||
} flags;
|
||||
u8 as_byte;
|
||||
} state;
|
||||
|
||||
/* 0x01 */ u8 envelope_idx;
|
||||
/* 0x02 */ s16 delay;
|
||||
@@ -444,6 +449,15 @@ typedef struct macro_ {
|
||||
/* 0x19 */ s8 value;
|
||||
} macro;
|
||||
|
||||
typedef union subtrack_updates {
|
||||
struct {
|
||||
/* 0x01 */ u8 frequency_scale : 1;
|
||||
/* 0x01 */ u8 volume : 1;
|
||||
/* 0x01 */ u8 pan : 1;
|
||||
} flags;
|
||||
/* 0x01 */ u8 as_byte;
|
||||
} subtrack_updates;
|
||||
|
||||
/* SubTrack struct */
|
||||
/* sizeof(sub) == 0xE0 */
|
||||
typedef struct sub_ {
|
||||
@@ -455,16 +469,7 @@ typedef struct sub_ {
|
||||
/* 0x00 */ u8 stereo_effects : 1;
|
||||
/* 0x00 */ u8 large_notes : 1;
|
||||
/* 0x00 */ u8 unused : 1;
|
||||
|
||||
union {
|
||||
struct {
|
||||
/* 0x01 */ u8 frequency_scale : 1;
|
||||
/* 0x01 */ u8 volume : 1;
|
||||
/* 0x01 */ u8 pan : 1;
|
||||
} flags;
|
||||
/* 0x01 */ u8 as_byte;
|
||||
} changes;
|
||||
|
||||
/* 0x01 */ subtrack_updates changes;
|
||||
/* 0x02 */ u8 note_alloc_policy;
|
||||
/* 0x03 */ u8 mute_flags;
|
||||
/* 0x04 */ u8 target_reverb_vol;
|
||||
@@ -580,15 +585,15 @@ struct note_ {
|
||||
|
||||
union {
|
||||
struct {
|
||||
/* 0x0A */ u16 bit0 : 1;
|
||||
/* 0x0A */ u16 bit1 : 1;
|
||||
/* 0x0A */ u16 skip_volume_update : 1;
|
||||
/* 0x0A */ u16 skip_freq_scale_update : 1;
|
||||
/* 0x0A */ u16 bit2 : 1;
|
||||
/* 0x0A */ u16 use_vibrato : 1;
|
||||
/* 0x0A */ u16 add_subtrack_transposition : 1;
|
||||
/* 0x0A */ u16 bit5 : 1;
|
||||
/* 0x0A */ u16 bit6 : 1;
|
||||
/* 0x0A */ u16 bit7 : 1;
|
||||
/* 0x0B */ u16 bit8 : 1;
|
||||
/* 0x0B */ u16 skip_pan_update : 1;
|
||||
/* 0x0B */ u16 bit9 : 1;
|
||||
/* 0x0B */ u16 bitA : 1;
|
||||
/* 0x0B */ u16 bitB : 1;
|
||||
|
||||
@@ -12,5 +12,6 @@ extern u8 DEFAULT_VTABLE[];
|
||||
extern u8 DEFAULT_GTABLE[];
|
||||
|
||||
extern u8 BDB_SEQDATA[];
|
||||
extern s16* WAVEMEM_TABLE[];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
extern void Nas_ChannelModInit(channel* ch);
|
||||
extern void Nas_SweepInit(channel* ch);
|
||||
|
||||
extern void Nas_EnvInit(envp* env, envdat* data, s16* vol_out);
|
||||
extern void Nas_ChannelModulation(channel* channel);
|
||||
extern void Nas_MainCtrl(group* grp);
|
||||
extern f32 Nas_EnvProcess(envp* process);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user