portx64: audio system changes

This commit is contained in:
Raf committed 2024-07-30 16:57:17 +08:00
1 parent 32faea2b95
commit ef4b60d384
6 files changed
+29 -8

No files matched your search

+11 -1
View File
@@ -256,7 +256,7 @@ typedef struct {
ALOscStop stopOsc;
ALSeqMarker *loopStart;
ALSeqMarker *loopEnd;
s32 loopCount; /* -1 = loop forever, 0 = no loop */
intptr_t loopCount; /* -1 = loop forever, 0 = no loop */
u8 unk88;
u8 unk89;
} N_ALSeqPlayer;
@@ -284,9 +284,19 @@ typedef struct {
ALOscInit initOsc;
ALOscUpdate updateOsc;
ALOscStop stopOsc;
#ifdef PLATFORM_64BIT
s32 _pad1_;
f32 unk7c;
s32 _pad2_;
f32 unk80;
#else
f32 unk7c;
f32 unk80;
#endif
void *queue;
u8 unk88;
u8 unk89;
} N_ALCSPlayer;
+1
View File
@@ -8,6 +8,7 @@
void psStop(void)
{
if (g_SndDisabled) return;
s32 i;
for (i = 0; i < (IS4MB() ? 30 : 40); i++) {
+3
View File
@@ -7,6 +7,9 @@ struct mp3decfourbytes {
u8 bytes[2];
s8 unk02;
s8 unk03;
#ifdef PLATFORM_64BIT
u32 _pad_;
#endif
};
struct asistream_scalefac {
+4 -4
View File
@@ -47,8 +47,8 @@ Acmd *n_alFxPull(s32 sampleOffset, Acmd *p, s32 arg2)
for (i = 0; i < r->section_count; i++) {
d = &r->delay[i]; /* get the ALDelay structure */
in_ptr = &r->input[j][-d->input];
out_ptr = &r->input[j][-d->output];
in_ptr = &r->input[j][(s32)-d->input];
out_ptr = &r->input[j][(s32)-d->output];
if (var8009c346[arg2] && var8009c344[arg2]) {
d->ffcoef = -d->ffcoef;
@@ -253,7 +253,7 @@ Acmd *_n_loadOutputBuffer(ALFx *r, ALDelay *d, s32 arg2, s32 buff, Acmd *p)
fincount = d->rs->delta + (fratio * (f32)incount);
count = (s32) fincount;
d->rs->delta = fincount - (f32)count;
out_ptr = &r->input[arg2][-(d->output - d->rsdelta)];
out_ptr = &r->input[arg2][(s32)-(d->output - d->rsdelta)];
ramalign = ((intptr_t)out_ptr & 0x7) >> 1;
ptr = _n_loadBuffer(r, arg2, out_ptr - ramalign, rbuff, count + ramalign, ptr);
@@ -265,7 +265,7 @@ Acmd *_n_loadOutputBuffer(ALFx *r, ALDelay *d, s32 arg2, s32 buff, Acmd *p)
d->rs->first = 0;
d->rsdelta += count - incount;
} else {
out_ptr = &r->input[arg2][-d->output];
out_ptr = &r->input[arg2][(s32)-d->output];
ptr = _n_loadBuffer(r, arg2, out_ptr, buff, FIXED_SAMPLE, ptr);
}
+7 -3
View File
@@ -105,6 +105,8 @@ s32 var8005dddc = 0;
u8 *g_SndGuardStringPtr = NULL;
uintptr_t* g_SeqRomAddrs;
enum audioconfig_e {
AUDIOCONFIG_00,
AUDIOCONFIG_01,
@@ -1526,8 +1528,10 @@ void sndInit(void)
dmaExec(g_SeqTable, (romptr_t) REF_SEG _sequencesSegmentRomStart, (len + 0xf) & ~0xf);
// Promote segment-relative offsets to ROM addresses
g_SeqRomAddrs = mempAlloc(g_SeqTable->count * sizeof(uintptr_t), MEMPOOL_PERMANENT);
for (i = 0; i < g_SeqTable->count; i++) {
g_SeqTable->entries[i].romaddr += (romptr_t) REF_SEG _sequencesSegmentRomStart;
g_SeqRomAddrs[i] = g_SeqTable->entries[i].romaddr + (romptr_t) REF_SEG _sequencesSegmentRomStart;
}
synconfig.maxVVoices = 44;
@@ -1639,7 +1643,7 @@ bool seqPlay(struct seqinstance *seq, s32 tracknum)
return false;
}
if (g_SeqTable->entries[seq->tracknum].romaddr < 0x10000) {
if (g_SeqRomAddrs[seq->tracknum] < 0x10000) {
return false;
}
@@ -1688,7 +1692,7 @@ bool seqPlay(struct seqinstance *seq, s32 tracknum)
binstart = seq->data;
zipstart = binstart + binlen - ziplen;
dmaExec(zipstart, g_SeqTable->entries[seq->tracknum].romaddr, ziplen);
dmaExec(zipstart, g_SeqRomAddrs[seq->tracknum], ziplen);
ziplen = rzipInflate(zipstart, binstart, scratch);
}
+3
View File
@@ -107,6 +107,9 @@ typedef struct ALParam_s {
} yetstillmoredata;
s32 unk1c;
s32 unk20;
#ifdef PLATFORM_64BIT
u8 _pad_[8];
#endif
} ALParam;
typedef struct {