Skip to content

Commit

Permalink
Sync MusyX source
Browse files Browse the repository at this point in the history
  • Loading branch information
Antidote committed Dec 19, 2023
1 parent 0c302d2 commit 081a2fe
Show file tree
Hide file tree
Showing 39 changed files with 1,228 additions and 636 deletions.
10 changes: 5 additions & 5 deletions config/GM8E01_00/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4248,7 +4248,7 @@ musyx/runtime/s_data.c:
.bss start:0x8055EC60 end:0x8055F260
.sbss start:0x805A9AD8 end:0x805A9AE0

musyx/runtime/dolphin/hw_dspctrl.c:
musyx/runtime/hw_dspctrl.c:
.text start:0x803AACFC end:0x803AE110
.rodata start:0x803D8A68 end:0x803D8AC0
.data start:0x803F3FA8 end:0x803F3FC0
Expand Down Expand Up @@ -4284,23 +4284,23 @@ musyx/runtime/snd_service.c:
.data start:0x803F4278 end:0x803F4A80
.sdata start:0x805A8BD0 end:0x805A8BD8

musyx/runtime/dolphin/hardware.c:
musyx/runtime/hardware.c:
.text start:0x803B2F4C end:0x803B3F70
.rodata start:0x803D8BD0 end:0x803D8CD0
.sdata start:0x805A8BD8 end:0x805A8BE8
.sbss start:0x805A9B40 end:0x805A9B50
.sdata2 start:0x805AF398 end:0x805AF3B0

musyx/runtime/dolphin/dsp_import.c:
musyx/runtime/dsp_import.c:
.data start:0x803F4A80 end:0x803F6460
.sdata start:0x805A8BE8 end:0x805A8BF0

musyx/runtime/dolphin/hw_aramdma.c:
musyx/runtime/hw_aramdma.c:
.text start:0x803B3F70 end:0x803B4C3C
.bss start:0x80566F90 end:0x805678A0
.sbss start:0x805A9B50 end:0x805A9B70

musyx/runtime/dolphin/hw_dolphin.c:
musyx/runtime/hw_dolphin.c:
.text start:0x803B4C3C end:0x803B5134
.bss start:0x805678A0 end:0x80569900
.sbss start:0x805A9B70 end:0x805A9B98
Expand Down
11 changes: 6 additions & 5 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"-gccinc",
"-inline deferred,noauto",
"-common on",
"-DMUSY_TARGET=MUSY_TARGET_DOLPHIN"
]

cflags_musyx = [
Expand Down Expand Up @@ -1194,17 +1195,17 @@ def Rel(lib_name, objects):
Object(Matching, "musyx/runtime/synth_vsamples.c"),
Object(Matching, "musyx/runtime/synth_dbtab.c"),
Object(Matching, "musyx/runtime/s_data.c"),
Object(NonMatching, "musyx/runtime/dolphin/hw_dspctrl.c"),
Object(NonMatching, "musyx/runtime/hw_dspctrl.c"),
Object(Matching, "musyx/runtime/hw_volconv.c"),
Object(Matching, "musyx/runtime/snd3d.c"),
Object(Matching, "musyx/runtime/snd_init.c"),
Object(Matching, "musyx/runtime/snd_math.c"),
Object(NonMatching, "musyx/runtime/snd_midictrl.c"),
Object(Matching, "musyx/runtime/snd_service.c"),
Object(Matching, "musyx/runtime/dolphin/hardware.c"),
Object(Matching, "musyx/runtime/dolphin/hw_aramdma.c"),
Object(Matching, "musyx/runtime/dolphin/dsp_import.c"),
Object(Matching, "musyx/runtime/dolphin/hw_dolphin.c"),
Object(Matching, "musyx/runtime/hardware.c"),
Object(Matching, "musyx/runtime/hw_aramdma.c"),
Object(Matching, "musyx/runtime/dsp_import.c"),
Object(Matching, "musyx/runtime/hw_dolphin.c"),
Object(Matching, "musyx/runtime/hw_memory.c"),
Object(Matching, "musyx/runtime/hw_lib_dummy.c"),
Object(Matching, "musyx/runtime/CheapReverb/creverb_fx.c"),
Expand Down
2 changes: 1 addition & 1 deletion include/musyx/adsr.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extern "C" {
#endif
u32 adsrHandleLowPrecision(ADSR_VARS* adsr, u16* adsr_start, u16* adsr_delta);
bool adsrRelease(ADSR_VARS* adsr);

u32 adsrConvertTimeCents(s32 tc);
#ifdef __cplusplus
}
#endif
Expand Down
17 changes: 15 additions & 2 deletions include/musyx/assert.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef _ASSERT
#define _ASSERT
#include "musyx/version.h"
#include "musyx/platform.h"
#include "musyx/version.h"


#if MUSY_TARGET == MUSY_TARGET_DOLPHIN
extern void OSPanic(const char* file, int line, const char* msg, ...);
Expand All @@ -15,9 +16,21 @@ extern void OSReport(const char* msg, ...);
#endif
#elif MUSY_TARGET == MUSY_TARGET_PC
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

static inline void panic(const char* file, int line, const char* msg, ...) {
va_list list;
va_start(list);
vprintf(msg, list);
va_end(list);
printf(" in \"%s\" on line %d.\n", file, line);
abort();
}

#ifndef MUSY_PANIC
#define MUSY_PANIC assert
#define MUSY_PANIC panic
#endif
#ifndef MUSY_REPORT
#define MUSY_REPORT printf
Expand Down
4 changes: 4 additions & 0 deletions include/musyx/dsp_import.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef _MUSYX_DSP_IMPORT
#define _MUSYX_DSP_IMPORT

#include "musyx/platform.h"
#if MUSY_TARGET == MUSY_TARGET_DOLPHIN
#include "musyx/musyx.h"

#ifdef __cplusplus
Expand All @@ -14,4 +16,6 @@ extern u16 dspSlaveLength;
}
#endif

#endif

#endif // _MUSYX_DSP_IMPORT
22 changes: 14 additions & 8 deletions include/musyx/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _MUSYX_HARDWARE

#include "musyx/musyx.h"
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
Expand All @@ -14,11 +15,10 @@ extern SND_HOOKS salHooks;

extern u32 dspHRTFOn;

extern u16* dspCmdList;
extern s16* dspCmdList;
extern u16 dspCmdFirstSize;
extern u8 dspScale2IndexTab[1024];


u32 hwFrq2Pitch(u32 frq);
void hwOff(s32 vid);
bool hwIsStudioActive(u8 studio);
Expand All @@ -29,6 +29,8 @@ void hwInitSamplePlayback(u32 v, u16 smpID, void* newsmp, u32 set_defadsr, u32 p
u32 callbackUserValue, u32 setSRC, u8 itdMode);
void hwSetVolume(u32 v, u8 table, float vol, u32 pan, u32 span, float auxa, float auxb);
void hwSetPitch(u32 v, u16 speed);
void hwInitIrq();
void hwExitIrq();
void hwEnableIrq();
void hwDisableIrq();
void* hwTransAddr(void* samples);
Expand All @@ -46,8 +48,8 @@ u16 hwGetSampleID(u32 voice);
u8 hwGetSampleType(u32 voice);
void hwChangeStudioMix(u8 studio, u32 isMaster);
void hwSetStreamLoopPS(u32 voice, u8 ps);
void hwFlushStream(void* base, u32 offset, u32 bytes, unsigned char hwStreamHandle,
void (*callback)(u32), u32 user);
void hwFlushStream(void* base, u32 offset, u32 bytes, u8 hwStreamHandle, void (*callback)(size_t),
u32 user);
void hwSetSaveSampleCallback(ARAMUploadCallback callback, unsigned long chunckSize);
void hwSyncSampleMem();
void hwSetAUXProcessingCallbacks(u8 studio, SND_AUX_CALLBACK auxA, void* userA,
Expand All @@ -67,7 +69,7 @@ void hwDisableHRTF();
void hwStart(u32 v, u8 studio);
void hwKeyOff(u32 v);
void hwFrameDone();
void hwActivateStudio(u8 studio, u32 isMaster, SND_STUDIO_TYPE type);
void hwActivateStudio(u8 studio, bool isMaster, SND_STUDIO_TYPE type);
void hwDeactivateStudio(u8);
void hwSetPriority(u32 v, u32 prio);
u32 hwIsActive(u32);
Expand All @@ -82,13 +84,17 @@ void hwIRQLeaveCritical();

extern u32 aramSize;
extern u8* aramBase;
unsigned long aramGetStreamBufferAddress(unsigned char id, unsigned long* len);
u32 aramGetStreamBufferAddress(u8 id, u32* len);
void aramUploadData(void* mram, u32 aram, u32 len, u32 highPrio, void (*callback)(u32), u32 user);
void aramInit(u32 length);
void aramExit();
size_t aramGetStreamBufferAddress(u8 id, size_t* len);
void aramUploadData(void* mram, u32 aram, u32 len, u32 highPrio, void (*callback)(size_t), u32 user);
void aramFreeStreamBuffer(u8 id);
void* aramStoreData(void* src, u32 len);
void aramRemoveData(void* aram, u32 len);
u8 aramAllocateStreamBuffer(u32 len);
unsigned long aramGetZeroBuffer();
void aramSetUploadCallback(ARAMUploadCallback callback, u32 chunckSize);
void aramSyncTransferQueue();

#ifdef __cplusplus
}
Expand Down
Loading

0 comments on commit 081a2fe

Please sign in to comment.