Link jaudio_NES/aictrl.c

This commit is contained in:
Cuyler36
2024-06-03 17:22:36 -04:00
parent 58395b3461
commit 7f001f81e7
8 changed files with 70 additions and 41 deletions
+4 -3
View File
@@ -447,8 +447,9 @@ JAUDIO_BASE = CFLAGS + [
"-enum int",
"-common on"
] + DOL_DEFINES
JAUDIO_SAMPLE = [
"-func_align 32"
JAUDIO_FUNC_ALIGN_32 = [
"-func_align 32",
"-str readonly"
]
JSYSTEM_CFLAGS = ' '.join(JSYSTEM_BASE + LOCAL_CFLAGS)
@@ -467,7 +468,7 @@ EXTERNAL_REL_CFLAGS = ' '.join(BASE_REL_CFLAGS)
PREPROCESS_CFLAGS = ' '.join(PREPROCESSOR_CFLAGS)
FAMICOM_CLFAGS = ' '.join(FAMICOM_BASE + LOCAL_CFLAGS)
JAUDIO_CFLAGS = ' '.join(JAUDIO_BASE + LOCAL_CFLAGS)
JAUDIO_SAMPLE_CFLAGS = ' '.join(JAUDIO_BASE + JAUDIO_SAMPLE + LOCAL_CFLAGS)
JAUDIO_FUNC_ALIGN_32_CFLAGS = ' '.join(JAUDIO_BASE + JAUDIO_FUNC_ALIGN_32 + LOCAL_CFLAGS)
DOL_LDFLAGS = ' '.join([
"-maxerrors 1",
+6
View File
@@ -30,6 +30,12 @@ dvderr.c:
.bss: [0x800e2790, 0x800e2b88]
jaudio_NES/dummyprobe.c:
.text: [0x800083f8, 0x80008400]
jaudio_NES/aictrl.c:
.text: [0x80017e80, 0x80018640]
.rodata: [0x800aa500, 0x800aa518]
.bss: [0x8017cfa0, 0x8017cfc0]
.sbss: [0x802183f0, 0x80218420]
.sdata2: [0x80218da8, 0x80218db8]
jaudio_NES/sample.c:
.text: [0x80018640, 0x80018920]
# jaudio_NES/game64.c: # TODO: finish
+8 -3
View File
@@ -623,15 +623,20 @@ class AsmSource(Source):
rule = "as",
inputs = self.src_path
)
JAUDIO_FUNC_ALIGN_32_TUS = [
"sample.c",
"aictrl.c"
]
class CSource(Source):
def __init__(self, ctx: c.SourceContext, path: str):
if path.startswith("src/static/dolphin/"):
self.cflags = c.SDK_FLAGS
self.cc = c.OCC
elif path.startswith("src/static/jaudio_NES/"):
if path.startswith("src/static/jaudio_NES/sample.c"):
self.cflags = c.JAUDIO_SAMPLE_CFLAGS
if os.path.basename(path) in JAUDIO_FUNC_ALIGN_32_TUS:
self.cflags = c.JAUDIO_FUNC_ALIGN_32_CFLAGS
else:
self.cflags = c.JAUDIO_CFLAGS
self.cc = c.CC
+24 -23
View File
@@ -2,6 +2,8 @@
#define _DOLPHIN_OS
#include "types.h"
#include "dolphin/os/OSAlloc.h"
#include "dolphin/os/OSCache.h"
#include "dolphin/os/OSContext.h"
#include "dolphin/os/OSInterrupt.h"
#include "dolphin/os/OSMessage.h"
@@ -19,47 +21,46 @@ extern void __OSPSInit();
extern void __OSFPRInit();
extern void __OSCacheInit();
void OSPanic(const char *file, int line, const char *message, ...);
void OSPanic(const char* file, int line, const char* message, ...);
void OSVReport(const char* fmt, va_list list);
void OSReport(const char* fmt, ...);
extern void __OSPSInit();
extern void __OSCacheInit();
#define OSErrorLine(line, ...) \
OSPanic(__FILE__, line, __VA_ARGS__)
#define OSErrorLine(line, ...) OSPanic(__FILE__, line, __VA_ARGS__)
#ifdef DOLPHIN_DEBUG
#define DOLPHIN_ASSERTLINE(assertion, line) \
(void) ((assertion) || (OSErrorLine(line, "Failed assertion " #assertion), 0))
#define DOLPHIN_ASSERT(assertion) \
(void) ((assertion) || (OSPanic(__FILE__, __LINE__, "Failed assertion " #assertion), 0))
#define DOLPHIN_ASSERTLINE(assertion, line) \
(void)((assertion) || (OSErrorLine(line, "Failed assertion " #assertion), 0))
#define DOLPHIN_ASSERT(assertion) \
(void)((assertion) || (OSPanic(__FILE__, __LINE__, "Failed assertion " #assertion), 0))
#else
#define DOLPHIN_ASSERTLINE(assertion, line)
#define DOLPHIN_ASSERT(assertion)
#endif
//void OSResetSystem(u32, u32, u32); // goes in reset, but eh
// void OSResetSystem(u32, u32, u32); // goes in reset, but eh
void OSInit(void);
#define OS_CONSOLE_RETAIL4 0x00000004
#define OS_CONSOLE_RETAIL3 0x00000003
#define OS_CONSOLE_RETAIL2 0x00000002
#define OS_CONSOLE_RETAIL1 0x00000001
#define OS_CONSOLE_RETAIL 0x00000000
#define OS_CONSOLE_DEVHW4 0x10000007
#define OS_CONSOLE_DEVHW3 0x10000006
#define OS_CONSOLE_DEVHW2 0x10000005
#define OS_CONSOLE_DEVHW1 0x10000004
#define OS_CONSOLE_MINNOW 0x10000003
#define OS_CONSOLE_ARTHUR 0x10000002
#define OS_CONSOLE_RETAIL4 0x00000004
#define OS_CONSOLE_RETAIL3 0x00000003
#define OS_CONSOLE_RETAIL2 0x00000002
#define OS_CONSOLE_RETAIL1 0x00000001
#define OS_CONSOLE_RETAIL 0x00000000
#define OS_CONSOLE_DEVHW4 0x10000007
#define OS_CONSOLE_DEVHW3 0x10000006
#define OS_CONSOLE_DEVHW2 0x10000005
#define OS_CONSOLE_DEVHW1 0x10000004
#define OS_CONSOLE_MINNOW 0x10000003
#define OS_CONSOLE_ARTHUR 0x10000002
#define OS_CONSOLE_PC_EMULATOR 0x10000001
#define OS_CONSOLE_EMULATOR 0x10000000
#define OS_CONSOLE_EMULATOR 0x10000000
#define OS_CONSOLE_DEVELOPMENT 0x10000000
#define OS_CONSOLE_DEVKIT 0x10000000
#define OS_CONSOLE_TDEVKIT 0x20000000
#define OS_CONSOLE_DEVKIT 0x10000000
#define OS_CONSOLE_TDEVKIT 0x20000000
#define OS_CONSOLE_DEV_MASK 0x10000000
#define OS_CONSOLE_DEV_MASK 0x10000000
u32 OSGetConsoleType();
#define OS_CONSOLE_IS_DEV() ((OSGetConsoleType() & OS_CONSOLE_DEV_MASK) != 0)
+21 -4
View File
@@ -2,14 +2,31 @@
#define OS_ALLOC_H
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
void *OSInitAlloc(void *, void *, int);
typedef int OSHeapHandle;
extern volatile OSHeapHandle __OSCurrHeap;
void* OSAllocFromHeap(int heap, unsigned long size);
void* OSAllocFixed(void* rstart, void* rend);
void OSFreeToHeap(int heap, void* ptr);
int OSSetCurrentHeap(int heap);
void* OSInitAlloc(void* arenaStart, void* arenaEnd, int maxHeaps);
int OSCreateHeap(void* start, void* end);
void OSDestroyHeap(int heap);
void OSAddToHeap(int heap, void* start, void* end);
long OSCheckHeap(int heap);
unsigned long OSReferentSize(void* ptr);
void OSDumpHeap(int heap);
void OSVisitAllocated(void (*visitor)(void*, unsigned long));
#define OSAlloc(size) OSAllocFromHeap(__OSCurrHeap, (size))
#define OSFree(ptr) OSFreeToHeap(__OSCurrHeap, (ptr))
#ifdef __cplusplus
}
#endif
#endif
#endif
+1
View File
@@ -2,6 +2,7 @@
#define AUDIOSTRUCT_H
#include "types.h"
#include "jaudio_NES/audiocommon.h"
#ifdef __cplusplus
extern "C" {
+3 -3
View File
@@ -7,11 +7,11 @@
extern "C" {
#endif
void Probe_Start(void);
void Probe_Finish(void);
extern void Probe_Start(s32 id, const char* label);
extern void Probe_Finish(s32 id);
#ifdef __cplusplus
}
#endif
#endif
#endif
+3 -5
View File
@@ -1,9 +1,7 @@
#include "jaudio_NES/dummyprobe.h"
void Probe_Start(void){
extern void Probe_Start(s32 id, const char* label) {
}
void Probe_Finish(void){
}
extern void Probe_Finish(s32 id) {
}