Decompile few more functions

This commit is contained in:
Luciano Ciccariello 2022-01-03 17:49:16 +00:00
parent 6745e3f0a6
commit de95bed590
12 changed files with 408 additions and 9 deletions

View File

@ -22,17 +22,17 @@ segments:
vram: 0x80010000
subalign: 4
subsegments:
- [0x800, rodata]
- [0x800, data]
- [0x15F4, asm]
- [0x5938, hasm, psxsdk/libapi1]
- [0x5A38, asm]
- [0x5A38, c]
- [0x5E60, c, psxsdk/libetc]
- [0x5E78, asm]
- [0x5E78, c]
- [0x6864, hasm, psxsdk/libc]
- [0x6934, c, psxsdk/fprintf]
- [0x7190, asm]
- [0x7190, c]
- [0x720C, hasm, psxsdk/libcard]
- [0x72A4, asm]
- [0x72A4, c]
- [0x9C14, hasm, psxsdk/libapi2]
- [0x9C24, c, psxsdk/libapi]
- [0x9C54, asm]

View File

@ -546,6 +546,8 @@ SetRoomForegroundLayer = 0x800ED774;
SetRoomBackgroundLayer = 0x800ED90C;
LoadRoomLayer = 0x800ED9F4;
CheckCollision = 0x800EF45C;
IsSpriteOutsideDrawArea = 0x800F54CC;
ScissorSprite = 0x800F57C8;
drawMenuChar = 0x800F678C;
drawMenuInt = 0x800F68F4;
setMenuBackgroundRect = 0x80107330;

View File

@ -546,6 +546,8 @@ SetRoomForegroundLayer = 0x800ED774;
SetRoomBackgroundLayer = 0x800ED90C;
LoadRoomLayer = 0x800ED9F4;
CheckCollision = 0x800EF45C;
IsSpriteOutsideDrawArea = 0x800F54CC;
ScissorSprite = 0x800F57C8;
drawMenuChar = 0x800F678C;
drawMenuInt = 0x800F68F4;
setMenuBackgroundRect = 0x80107330;

View File

@ -2,6 +2,37 @@
#define DRA_H
#include "main.h"
typedef struct {
unsigned int unk0;
unsigned int unk4;
short x0,y0;
short unkC,unkE;
unsigned int unk10;
short x1,y1;
unsigned int unk18;
unsigned int unk1c;
short unk20,unk22;
unsigned int unk24;
unsigned int unk28;
short unk2C,unk2E;
} UnkPoly;
typedef struct
{
unsigned short x;
unsigned short y;
unsigned short w;
unsigned short h;
} Rect;
typedef struct
{
Rect tag, unk1;
int w;
int unk14;
int unk18;
} MenuContext;
extern s32 D_8006C39C;
extern s32 D_8006C3A0;
extern s32 D_80073060;
@ -53,7 +84,11 @@ void func_800F4994(void);
void func_800F4F48(void);
void func_800F4FD0(void);
void func_800F53A4(void);
s32 IsSpriteOutsideDrawArea(s32 x0, s32 x1, s32 y0, s32 y1, MenuContext* a5);
bool ScissorSprite(SPRT* arg0, MenuContext* arg1);
void func_800F5904(void*, s32 x, s32 y, s32 w, u32 h, s32 u, s32 v, s32 unk1, s32 unk2, bool disableTexShade, s32 unk4);
s32 func_800F62E8(s32 arg0);
void drawMenuChar(s32 ch, int x, int y, void* context);
void func_800FABEC(s32 arg0);
void func_800FAC30(void);
s32 func_800FD664(s32 arg0);
@ -67,6 +102,7 @@ void func_80102DEC(s32 arg0);
void func_80103EAC(void);
void func_801071CC(s32, u8, s32);
void func_80107250(s32 arg0, s32 arg1);
void setMenuBackgroundRect(UnkPoly* arg0, s16 x, s16 y, s16 width, s16 height);
void func_8010D584(s16 arg0);
void func_8010E0A8(void);
void func_8010E0B8(void);

View File

@ -1,11 +1,33 @@
#ifndef MAIN_H
#define MAIN_H
#include <psxsdk/libetc.h>
extern s32 D_8003C734;
typedef struct
{
u32 tag;
u8 r0;
u8 g0;
u8 b0;
u8 code;
s16 x0;
s16 y0;
s8 u0;
s8 v0;
u16 clut;
s16 w;
s16 h;
} SPRT;
extern s32 D_8003925C;
extern s32 D_8003C734; /* extern */
extern s32 D_80073080;
extern void func_80015238(s32 arg0);
extern unsigned char func_80019424();
extern unsigned char func_80019434();
extern unsigned char func_80019444();
extern void func_800195C8(s32);
extern void func_800199D0(s32);
extern void func_80021F6C(s16, s16);
#endif

View File

@ -16,7 +16,7 @@ extern long erase(char *);
extern long Krom2RawAdd(unsigned long);
extern void ChangeClearPAD(long);
extern void StopPAD(void);
// PAD_init2
int PAD_init2(s32/*??*/, s32 */*??*/);
// PAD_dr
extern void FlushCache(void);
extern void DeliverEvent(unsigned long, unsigned long);

25
include/psxsdk/libetc.h Normal file
View File

@ -0,0 +1,25 @@
#ifndef LIBETC_H
#define LIBETC_H
struct Callbacks
{
void (*unk0)(void);
void* (*DMACallback)(int dma, void (*func)());
void (*unk8)(void);
int (*ResetCallback)(void);
int (*StopCallback)(void);
int (*VSyncCallbacks)(int ch, void (*f)());
int (*RestartCallback)(void);
};
extern u16 D_8002C2BA;
extern struct Callbacks *D_8002D340;
int ResetCallback(void);
int VSyncCallback(void (*f)());
int VSyncCallbacks(int ch, void (*f)());
int StopCallback(void);
int RestartCallback(void);
u16 CheckCallback(void);
#endif

View File

@ -338,15 +338,18 @@ INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F53D4);
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F548C);
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F54CC);
INCLUDE_ASM("asm/dra/nonmatchings/42398", IsSpriteOutsideDrawArea);
// https://decomp.me/scratch/3ZEVB
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F5530);
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F564C);
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F57C8);
INCLUDE_ASM("asm/dra/nonmatchings/42398", ScissorSprite);
// https://decomp.me/scratch/J7S3a
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F5904);
// https://decomp.me/scratch/DP2LU
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F5A90);
@ -381,6 +384,9 @@ INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F6618);
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F66BC);
INCLUDE_ASM("asm/dra/nonmatchings/42398", drawMenuChar);
// void drawMenuChar(s32 ch, int x, int y, void* context) {
// func_800F5904(context, x, y, 8, 8, (ch & 0xF) * 8, (u32) (ch & 0xF0) >> 1, 0x196, 0x1E, 1, 0);
// }
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_800F67EC);
@ -783,18 +789,25 @@ INCLUDE_ASM("asm/dra/nonmatchings/42398", func_801072DC);
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_801072FC);
INCLUDE_ASM("asm/dra/nonmatchings/42398", setMenuBackgroundRect);
// https://decomp.me/scratch/GPSfb
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_80107360);
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_801073C0);
// void func_801073C0(void) {
// func_800195C8(0);
// func_800199D0(0);
// }
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_801073E8);
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_80107460);
INCLUDE_ASM("asm/dra/nonmatchings/42398", CopyMapOverlayCallback);
// https://decomp.me/scratch/1AWN1
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_80107614);
//https://decomp.me/scratch/U0IGY
INCLUDE_ASM("asm/dra/nonmatchings/42398", func_80107750);

60
src/main/5A38.c Normal file
View File

@ -0,0 +1,60 @@
#include "common.h"
#include <psxsdk/libetc.h>
#include <psxsdk/libapi.h>
#include <main.h>
INCLUDE_ASM("asm/main/nonmatchings/5A38", func_80015238);
// void func_80015238(s32 arg0) {
// D_80073080 = arg0;
// D_8003925C = -1;
// ResetCallback();
// PAD_init2(0x20000001, &D_8003925C);
// ChangeClearPAD(0);
// }
INCLUDE_ASM("asm/main/nonmatchings/5A38", func_80015288);
INCLUDE_ASM("asm/main/nonmatchings/5A38", func_800152B8);
INCLUDE_ASM("asm/main/nonmatchings/5A38", StopPAD);
INCLUDE_ASM("asm/main/nonmatchings/5A38", PAD_init2);
INCLUDE_ASM("asm/main/nonmatchings/5A38", PAD_dr);
INCLUDE_ASM("asm/main/nonmatchings/5A38", VSync);
INCLUDE_ASM("asm/main/nonmatchings/5A38", VSyncWait);
INCLUDE_ASM("asm/main/nonmatchings/5A38", ChangeClearRCnt);
int ResetCallback(void) {
return D_8002D340->ResetCallback();
}
INCLUDE_ASM("asm/main/nonmatchings/5A38", InterruptCallback);
void *DMACallback(int dma, void (*func)()) {
return D_8002D340->DMACallback(dma, func);
}
INCLUDE_ASM("asm/main/nonmatchings/5A38", VSyncCallback);
// int VSyncCallback(void (*f)()) {
// return 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();
}
u16 CheckCallback(void) {
return D_8002C2BA;
}

47
src/main/5E78.c Normal file
View File

@ -0,0 +1,47 @@
#include "common.h"
INCLUDE_ASM("asm/main/nonmatchings/5E78", SetIntrMask);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015694);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015770);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015958);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015AAC);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015B58);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015BE0);
INCLUDE_ASM("asm/main/nonmatchings/5E78", _96_remove);
INCLUDE_ASM("asm/main/nonmatchings/5E78", ReturnFromException);
INCLUDE_ASM("asm/main/nonmatchings/5E78", ResetEntryInt);
INCLUDE_ASM("asm/main/nonmatchings/5E78", HookEntryInt);
INCLUDE_ASM("asm/main/nonmatchings/5E78", EnterCriticalSection);
INCLUDE_ASM("asm/main/nonmatchings/5E78", ExitCriticalSection);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015C6C);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015CC4);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015D3C);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015D68);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015D94);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015DE4);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80015F68);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_80016010);
INCLUDE_ASM("asm/main/nonmatchings/5E78", func_8001603C);
INCLUDE_ASM("asm/main/nonmatchings/5E78", GsGetWorkBase_1);

5
src/main/7190.c Normal file
View File

@ -0,0 +1,5 @@
#include "common.h"
INCLUDE_ASM("asm/main/nonmatchings/7190", memchr);
INCLUDE_ASM("asm/main/nonmatchings/7190", func_800169A0);

187
src/main/72A4.c Normal file
View File

@ -0,0 +1,187 @@
#include "common.h"
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016AA4);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016ADC);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016B7C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016BB4);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016BE8);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016C1C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016C54);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016C78);
INCLUDE_ASM("asm/main/nonmatchings/72A4", rsin);
INCLUDE_ASM("asm/main/nonmatchings/72A4", sin_1);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016D68);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetFogNear);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016E6C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016EEC);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80016F7C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017008);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017078);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017134);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_8001721C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", CompMatrix);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_8001741C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017528);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_8001760C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetMulMatrix);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017804);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017964);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017994);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017AB8);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017B58);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017BF8);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017C40);
INCLUDE_ASM("asm/main/nonmatchings/72A4", ReadColorMatrix);
INCLUDE_ASM("asm/main/nonmatchings/72A4", TransMatrix);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_80017D0C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetRotMatrix);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetLightMatrix);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetColorMatrix);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetTransMatrix);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetVertex0);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetVertex1);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetVertex2);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetVertexTri);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetRGBfifo);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetIR123);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetIR0);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetSZfifo3);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetSZfifo4);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetSXSYfifo);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetRii);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetMAC123);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetData32);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetDQA);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetDQB);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetBackColor);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetFarColor);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetGeomOffset);
INCLUDE_ASM("asm/main/nonmatchings/72A4", SetGeomScreen);
INCLUDE_ASM("asm/main/nonmatchings/72A4", LocalLight);
INCLUDE_ASM("asm/main/nonmatchings/72A4", DpqColor);
INCLUDE_ASM("asm/main/nonmatchings/72A4", NormalColor);
INCLUDE_ASM("asm/main/nonmatchings/72A4", NormalColor3);
INCLUDE_ASM("asm/main/nonmatchings/72A4", NormalColorDpq);
INCLUDE_ASM("asm/main/nonmatchings/72A4", NormalColorDpq3);
INCLUDE_ASM("asm/main/nonmatchings/72A4", NormalColorCol);
INCLUDE_ASM("asm/main/nonmatchings/72A4", NormalColorCol3);
INCLUDE_ASM("asm/main/nonmatchings/72A4", ColorDpq);
INCLUDE_ASM("asm/main/nonmatchings/72A4", ColorCol);
INCLUDE_ASM("asm/main/nonmatchings/72A4", AverageSZ3);
INCLUDE_ASM("asm/main/nonmatchings/72A4", AverageSZ4);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotTransPers);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotTransPers3);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotTrans);
INCLUDE_ASM("asm/main/nonmatchings/72A4", NormalClip);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotTransPers4);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotAverage3);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotAverage4);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotAverageNclip3);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotAverageNclip4);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotAverageNclipColorCol3);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotMatrix);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotMatrixYXZ);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotMatrixX);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotMatrixY);
INCLUDE_ASM("asm/main/nonmatchings/72A4", RotMatrixZ);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_800190AC);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_8001922C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_8001929C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", FlushCache);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_800192DC);
INCLUDE_ASM("asm/main/nonmatchings/72A4", CdInit);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_8001939C);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_800193C4);
INCLUDE_ASM("asm/main/nonmatchings/72A4", func_800193EC);