diff --git a/config/splat.us.main.yaml b/config/splat.us.main.yaml index 5c0789be5..7fd62a22d 100644 --- a/config/splat.us.main.yaml +++ b/config/splat.us.main.yaml @@ -35,7 +35,7 @@ segments: - [0x8F8, .rodata, psxsdk/libgpu/prim] - [0x9C8, .rodata, psxsdk/libgpu/sys] - [0xBC4, rodata, psxsdk/libapi/a22] # aVsyncTimeout - - [0xC08, .rodata, psxsdk/libapi/l10] + - [0xC08, .rodata, psxsdk/libetc/intr] - [0xC40, .rodata, psxsdk/libetc/intr_dma] - [0xC6C, .rodata, psxsdk/libc/sprintf] - [0xD48, .rodata, psxsdk/libcd/event] @@ -78,7 +78,8 @@ segments: - [0x5AD8, asm, psxsdk/libapi/a20] - [0x5AE8, asm, psxsdk/libapi/a21] - [0x5AF8, asm, psxsdk/libapi/a22] - - [0x5CEC, c, psxsdk/libapi/l10] + - [0x5CEC, asm, psxsdk/libapi/l10] + - [0x5CFC, c, psxsdk/libetc/intr] - [0x640C, asm, psxsdk/libapi/c114] - [0x641C, asm, psxsdk/libapi/a23] - [0x642C, asm, psxsdk/libapi/a24] diff --git a/include/psxsdk/libetc.h b/include/psxsdk/libetc.h index 2448aadf0..b3e796556 100644 --- a/include/psxsdk/libetc.h +++ b/include/psxsdk/libetc.h @@ -2,9 +2,9 @@ #define LIBETC_H struct Callbacks { - void (*unk0)(void); + const char* rcsid; /* "$Id: intr.c,v 1.73 1995/11/10 05:29:40 suzu Exp $" */ void* (*DMACallback)(int dma, void (*func)()); - void (*unk8)(void); + void* (*InterruptCallback)(int irq, void (*f)()); int (*ResetCallback)(void); int (*StopCallback)(void); int (*VSyncCallbacks)(int ch, void (*f)()); @@ -30,4 +30,4 @@ void PadInit(int mode); u_long PadRead(int id); void PadStop(void); -#endif \ No newline at end of file +#endif diff --git a/src/main/psxsdk/libapi/l10.c b/src/main/psxsdk/libapi/l10.c deleted file mode 100644 index 85c012aa1..000000000 --- a/src/main/psxsdk/libapi/l10.c +++ /dev/null @@ -1,49 +0,0 @@ - -#include -#include - -INCLUDE_ASM("main/nonmatchings/psxsdk/libapi/l10", ChangeClearRCnt); - -int ResetCallback(void) { return D_8002D340->ResetCallback(); } - -INCLUDE_ASM("main/nonmatchings/psxsdk/libapi/l10", InterruptCallback); - -void* DMACallback(int dma, void (*func)()) { - return D_8002D340->DMACallback(dma, func); -} - -INCLUDE_ASM("main/nonmatchings/psxsdk/libapi/l10", VSyncCallback); - -int VSyncCallbacks(int ch, void (*f)()) { - return D_8002D340->VSyncCallbacks(ch, f); -} - -int StopCallback(void) { return D_8002D340->StopCallback(); } - -int RestartCallback(void) { return D_8002D340->RestartCallback(); } - -int CheckCallback(void) { return D_8002C2BA; } - -INCLUDE_ASM("main/nonmatchings/psxsdk/libapi/l10", GetIntrMask); - -INCLUDE_ASM("main/nonmatchings/psxsdk/libapi/l10", SetIntrMask); - -INCLUDE_ASM("main/nonmatchings/psxsdk/libapi/l10", startIntr); - -INCLUDE_ASM("main/nonmatchings/psxsdk/libapi/l10", trapIntr); - -INCLUDE_ASM("main/nonmatchings/psxsdk/libapi/l10", setIntr); - -INCLUDE_ASM("main/nonmatchings/psxsdk/libapi/l10", stopIntr); - -INCLUDE_ASM("main/nonmatchings/psxsdk/libapi/l10", restartIntr); - -void memclr(int* ptr, int size) { - int i; - int* e = ptr; - - for (i = size - 1; i != -1; i--) { - *e = 0; - e++; - } -} diff --git a/src/main/psxsdk/libetc/intr.c b/src/main/psxsdk/libetc/intr.c new file mode 100644 index 000000000..00d9c6d3c --- /dev/null +++ b/src/main/psxsdk/libetc/intr.c @@ -0,0 +1,49 @@ + +#include +#include + +int ResetCallback(void) { return D_8002D340->ResetCallback(); } + +void InterruptCallback(int irq, void (*f)()) { + D_8002D340->InterruptCallback(irq, f); +} + +void* DMACallback(int dma, void (*func)()) { + return D_8002D340->DMACallback(dma, func); +} + +int VSyncCallback(void (*f)()) { D_8002D340->VSyncCallbacks(0, f); } + +int VSyncCallbacks(int ch, void (*f)()) { + return D_8002D340->VSyncCallbacks(ch, f); +} + +int StopCallback(void) { return D_8002D340->StopCallback(); } + +int RestartCallback(void) { return D_8002D340->RestartCallback(); } + +int CheckCallback(void) { return D_8002C2BA; } + +INCLUDE_ASM("main/nonmatchings/psxsdk/libetc/intr", GetIntrMask); + +INCLUDE_ASM("main/nonmatchings/psxsdk/libetc/intr", SetIntrMask); + +INCLUDE_ASM("main/nonmatchings/psxsdk/libetc/intr", startIntr); + +INCLUDE_ASM("main/nonmatchings/psxsdk/libetc/intr", trapIntr); + +INCLUDE_ASM("main/nonmatchings/psxsdk/libetc/intr", setIntr); + +INCLUDE_ASM("main/nonmatchings/psxsdk/libetc/intr", stopIntr); + +INCLUDE_ASM("main/nonmatchings/psxsdk/libetc/intr", restartIntr); + +void memclr(int* ptr, int size) { + int i; + int* e = ptr; + + for (i = size - 1; i != -1; i--) { + *e = 0; + e++; + } +}