Implement & link jaudio_NES/melody.c

This commit is contained in:
Cuyler36
2024-06-05 17:59:34 -04:00
parent d934bd11ad
commit 45effcf14f
14 changed files with 792 additions and 23 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ extern s8 sAdo_GetRhythmDelay(u32 id);
extern void sAdo_GetRhythmInfo(TempoBeat_c* rhythm);
extern void sAdo_SetRhythmInfo(TempoBeat_c* rhythm);
extern int sAdo_InstCountGet();
extern s8 sAdo_InstCountGet();
extern void sAdo_RhythmPos(u32 id, u8 haniwa_id, const xyz_t* pos);
+3
View File
@@ -13,6 +13,9 @@ extern "C" {
#define AUDIO_ARAM_SIZE 0x400000 /* 4MB */
#define AUDIO_ARAM_HEAP_SIZE 0xC000
#define NA_MAKE_COMMAND(a0, a1, a2, a3) \
(u32)((((a0) & 0xFF) << 24) | (((a1) & 0xFF) << 16) | (((a2) & 0xFF) << 8) | (((a3) & 0xFF) << 0))
typedef enum DSPBUF_EVENTS {
DSPBUF_EVENTS_0 = 0,
DSPBUF_EVENTS_1 = 1,
+18 -9
View File
@@ -172,14 +172,18 @@ typedef struct envp_ {
/* sizeof(group) == 0x160 */
typedef struct group_ {
struct flags_ {
/* 0x000 */ u32 flag0 : 1;
/* 0x000 */ u32 flag0 : 1;
} flags;
/* 0x004 */ u8 state;
/* 0x005 */ u8 unk4;
/* 0x006 */ u8 unk5;
/* 0x007 */ u16 tempo;
/* 0x00C */ u8 unkC[0xD4];
/* 0x008 */ u16 tempo;
/* 0x00A */ u8 unkA;
/* 0x00B */ u8 unkB;
/* 0x00C */ u8 unkC[0x018 - 0x00C];
/* 0x018 */ u16* unk18;
/* 0x01C */ u8 unk1C[0x0E0 - 0x01C];
/* 0x0E0 */ int unkE0;
/* 0x0E4 */ u8 E4[0x77];
/* 0x15B */ s8 unk15B;
@@ -188,18 +192,23 @@ typedef struct group_ {
/* sizeof(AudioGlobals) == 0x92b0 */
typedef struct AudioGlobals {
/* 0x0000 */ u8 unk0[0x3788];
/* 0x0000 */ u8 unk0[0x2850 - 0x0000];
/* 0x2850 */ ArcHeader* seq_header;
/* 0x2854 */ ArcHeader* bank_header;
/* 0x2858 */ ArcHeader* wave_header;
/* 0x285C */ ArcHeader* data_header;
/* 0x2860 */ u16* map_header;
/* 0x2864 */ u8 unk2864[0x3788 - 0x2864];
/* 0x3788 */ group groups[5];
/* 0x3E68 */ u8 unk3E68[0x5448];
} AudioGlobals;
/* sizeof(sub) >= 0xCD */
typedef struct sub_ {
/* 0x00 */ s8 unk0[0xCB];
/* 0xCB */ s8 unkCB;
/* 0xCD */ s8 unkCC;
} sub;
/* 0x00 */ s8 unk0[0xCB];
/* 0xCB */ s8 unkCB;
/* 0xCD */ s8 unkCC;
} sub;
typedef union SOUNDID_ {
struct {
+1
View File
@@ -62,6 +62,7 @@ extern u8 Na_CheckRestartReady();
extern void Na_Restart();
extern u8 sou_now_bgm_handle;
extern u8 sou_chime_status;
#ifdef __cplusplus
}
+11
View File
@@ -0,0 +1,11 @@
#ifndef GAME64_CPP_H
#define GAME64_CPP_H
#include "types.h"
#include "jaudio_NES/game64.h"
/* C++ linkage */
extern u8 angle2pan(u16 angle, f32 dist);
extern f32 distance2vol(f32 distance);
#endif
+9 -3
View File
@@ -2,14 +2,20 @@
#define MELODY_H
#include "types.h"
#include "jaudio_NES/audiocommon.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void Na_Inst(u16, u8*);
extern void Na_FurnitureInst(u32, u8, u8*, u16, f32);
extern int Na_InstCountGet();
extern void Na_MelodyInit(void);
extern void Na_Inst(u16 inst, u8* pData);
extern s8 Na_InstCountGet(void);
extern s16 Na_MelodyGetSubTrackNum(s16 inst);
extern void Na_FurnitureInst(u32 id, u8 inst, u8* melody, u16 angle, f32 dist);
extern void Na_MelodyVoice(s16 voice);
extern u32 na_melody_id_hist[];
#ifdef __cplusplus
}
+4 -5
View File
@@ -5,13 +5,9 @@
#include "jaudio_NES/audiostruct.h"
#include "PR/mbi.h"
#define NA_MAKE_COMMAND(a0, a1, a2, a3) \
(u32)((((a0)&0xFF) << 24) | (((a1)&0xFF) << 16) | (((a2)&0xFF) << 8) | (((a3)&0xFF) << 0))
extern s32 CreateAudioTask(Acmd* cmds, s16* pSamples, u32 nSamples, s32 param_4);
extern void Nap_SetU16(u32 command , u16 value);
extern void Nap_SetU16(u32 command, u16 value);
extern void Nap_SetU8(u32 command, u8 value);
extern void Nap_SetS8(u32 command, s8 value);
extern void Nap_SetF32(u32 command, f32 value);
@@ -20,6 +16,9 @@ extern void Nap_SetS32(u32 command, s32 value);
extern s8 Nap_ReadSubPort(s32, s32, s32);
extern s8 Nap_ReadGrpPort(s32, s32);
extern s32 Nap_SendStart(void);
extern void Nap_WaitVsync(void);
extern s32 Nap_GetRandom();
#endif
+1
View File
@@ -4,5 +4,6 @@
#include "types.h"
extern void Nas_InitAudio(u64* acmdBuf, s32 acmdBufSize);
extern void Nas_FastCopy(u8* SrcAddr, u8* DestAdd, size_t size, s32 medium);
#endif