Pushed the final changes that got audio working!

This commit is contained in:
MeltyPlayer
2022-11-06 20:22:00 -06:00
parent 7bd0cc9a2c
commit 3a4115e8f6
17 changed files with 274 additions and 371 deletions
+7 -1
View File
@@ -439,10 +439,14 @@ typedef short ENVMIX_STATE[40];
* s parameter to this command is the source in DRAM.
*/
#define aLoadBuffer(pkt, s) \
{ \
{ \
DEBUG_PRINT("aLoadBuffer()"); \
DEBUG_PRINT("- getting pkt"); \
Acmd *_a = (Acmd *)pkt; \
\
DEBUG_PRINT("- setting first word"); \
_a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8); \
DEBUG_PRINT("- setting second word"); \
_a->words.w1 = (uintptr_t)(s); \
}
@@ -558,6 +562,8 @@ typedef short ENVMIX_STATE[40];
*/
#define aSetBuffer(pkt, f, i, o, c) \
{ \
DEBUG_PRINT("aSetBuffer()"); \
DEBUG_PRINT("- getting pkt"); \
Acmd *_a = (Acmd *)pkt; \
\
_a->words.w0 = (_SHIFTL(A_SETBUFF, 24, 8) | _SHIFTL(f, 16, 8) | \
+7 -35
View File
@@ -2,49 +2,21 @@
#define _ULTRA64_LIBAUDIO_H_
#include "abi.h"
#include <stdlib.h>
typedef struct
{
u8 *offset;
s32 len;
#ifdef VERSION_SH
s8 medium;
s8 magic; // tbl: 0x04, otherwise: 0x03
// for ctl (else zeros):
union {
// unused, just for clarification (big endian)
struct {
u8 bank;
u8 ff;
u8 numInstruments;
u8 numDrums;
} as_u8;
// used
struct {
s16 bankAndFf;
s16 numInstrumentsAndDrums;
} as_s16;
} ctl;
#endif
u8 *offset __attribute__((aligned (8)));
s32 len __attribute__((aligned (8)));
} ALSeqData;
typedef struct
{
#ifndef VERSION_SH
s16 revision;
#endif
s16 seqCount;
#ifdef VERSION_SH
s16 unk2;
u8 *data;
#if !IS_64_BIT
s32 pad[2];
#endif
#endif
unsigned short revision;
unsigned short seqCount;
unsigned int pad;
ALSeqData seqArray[1];
} ALSeqFile;
} __attribute__((aligned (16))) ALSeqFile;
void alSeqFileNew(ALSeqFile *f, u8 *base);
+1 -1
View File
@@ -10,6 +10,6 @@
#define IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
#endif
#define DOUBLE_SIZE_ON_64_BIT(size) ((size) * (sizeof(void *) / 4))
#define DOUBLE_SIZE_ON_64_BIT(size) ((size) * 2)
#endif // PLATFORM_INFO_H