mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2024-11-26 22:40:33 +00:00
Correct the split of libapi/l10.c (#1099)
Correct the split of libapi/l10.c and decompile few trivial functions in it.
This commit is contained in:
parent
9b94a39773
commit
e6046aa106
@ -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]
|
||||
|
@ -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
|
||||
#endif
|
||||
|
@ -1,49 +0,0 @@
|
||||
|
||||
#include <game.h>
|
||||
#include <psxsdk/libetc.h>
|
||||
|
||||
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++;
|
||||
}
|
||||
}
|
49
src/main/psxsdk/libetc/intr.c
Normal file
49
src/main/psxsdk/libetc/intr.c
Normal file
@ -0,0 +1,49 @@
|
||||
|
||||
#include <game.h>
|
||||
#include <psxsdk/libetc.h>
|
||||
|
||||
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++;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user