add Vi and Cont funcs

This commit is contained in:
M0liusX 2022-12-08 21:17:20 -06:00
parent e4876dfcf0
commit 4ff5e79541
19 changed files with 1158 additions and 618 deletions

View File

@ -401,7 +401,7 @@ void func_800601D4(s32);
void func_800790C0(void);
s32 func_8005DFB8(s32);
void func_80060198(void);
void func_8008B6A0(s32);
void osViBlack(s32);
void func_80060398(s32);
void func_80075CCC(s32, ...);
u16 ReadImgPackand(s32, s32, s32);

View File

@ -21,7 +21,7 @@ obj->coords.y = vec3f.y; \
obj->coords.z = vec3f.z;
#endif
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
#define ARRLEN(x) ((s32)(sizeof(x) / sizeof(x[0])))
#define ALIGNED(x) __attribute__((aligned(x)))

View File

@ -190,7 +190,16 @@ segments:
- [0x8BDC0, c, "../src/lib/2.0I/io/aigetlen"] # -O0
- [0x8BDD0, c, "../src/lib/2.0I/io/aisetnextbuf"] # -O0
- [0x8BE70, c, "../src/lib/2.0I/io/sptask"] # -O0
- [0x8C0B0, c] # -O0?
- [0x8C0B0, c, "../src/lib/2.0I/io/sptaskyield"] # -O0
- [0x8C0D0, c, "../src/lib/2.0I/io/sptaskyielded"] # -O0
- [0x8C120, c, "../src/lib/2.0I/io/vigetcurrframebuf"] # -O0
- [0x8C160, c, "../src/lib/2.0I/io/vigetnextframebuf"] # -O0
- [0x8C1A0, c, "../src/lib/2.0I/io/visetevent"] # -O0
- [0x8C200, c, "../src/lib/2.0I/io/visetmode"] # -O0
- [0x8C250, c, "../src/lib/2.0I/io/viswapbuf"] # -O0
- [0x8C2A0, c, "../src/lib/2.0I/io/viblack"] # -O0
- [0x8C300, c, "../src/lib/2.0I/io/controller"] # -O0
- [0x8C610, c] # -O0?
- [0xA2080, c] # -O0?
- [0xA21C0, c] # -O0?
- [0xA29F0, c] # -O0?
@ -276,7 +285,8 @@ segments:
- [0xC7090, bin] # TODO: Figure this out
- [0xC70D0, .data, "../src/lib/2.0I/audio/sl"]
- [0xC70E0, .data, "../src/lib/2.0I/io/aisetnextbuf"]
- [0xC70F0, bin] # TODO: Figure this out
- [0xC70F0, .data, "../src/lib/2.0I/io/controller"]
- [0xC7100, bin] # TODO: Figure this out
# 2.0I N64 lib .rodata sections
# - [0xCBC60, .rodata, 4D770]
@ -293,6 +303,7 @@ segments:
# 2.0I N64 lib .bss sections
- [0xCDA50, .bss, "../src/padding/bss_padding_1d330"] # TODO: Figure this out
- [0xCDA50, .bss, "../src/lib/2.0I/io/sptask"]
- [0xCDA50, .bss, "../src/lib/2.0I/io/controller"]
- type: code
start: 0xCDA50
vram: 0x800F65E0

View File

@ -1,613 +0,0 @@
#include "common.h"
INCLUDE_ASM(s32, "8C0B0", func_8008B4B0);
INCLUDE_ASM(s32, "8C0B0", func_8008B4D0);
INCLUDE_ASM(s32, "8C0B0", func_8008B520);
INCLUDE_ASM(s32, "8C0B0", func_8008B560);
INCLUDE_ASM(s32, "8C0B0", func_8008B5A0);
INCLUDE_ASM(s32, "8C0B0", func_8008B600);
INCLUDE_ASM(s32, "8C0B0", func_8008B650);
INCLUDE_ASM(s32, "8C0B0", func_8008B6A0);
INCLUDE_ASM(s32, "8C0B0", func_8008B700);
INCLUDE_ASM(s32, "8C0B0", func_8008B89C);
INCLUDE_ASM(s32, "8C0B0", func_8008B950);
INCLUDE_ASM(s32, "8C0B0", func_8008BA10);
INCLUDE_ASM(s32, "8C0B0", func_8008BA70);
INCLUDE_ASM(s32, "8C0B0", func_8008BBEC);
INCLUDE_ASM(s32, "8C0B0", func_8008BC90);
INCLUDE_ASM(s32, "8C0B0", func_8008BD50);
INCLUDE_ASM(s32, "8C0B0", func_8008BE40);
INCLUDE_ASM(s32, "8C0B0", func_8008BEB0);
INCLUDE_ASM(s32, "8C0B0", func_8008BF50);
INCLUDE_ASM(s32, "8C0B0", func_8008BFA4);
INCLUDE_ASM(s32, "8C0B0", func_8008C010);
INCLUDE_ASM(s32, "8C0B0", bcopy);
INCLUDE_ASM(s32, "8C0B0", bzero);
INCLUDE_ASM(s32, "8C0B0", func_8008C400);
INCLUDE_ASM(s32, "8C0B0", func_8008C438);
INCLUDE_ASM(s32, "8C0B0", func_8008C45C);
INCLUDE_ASM(s32, "8C0B0", sprintf);
INCLUDE_ASM(s32, "8C0B0", func_8008C4E8);
INCLUDE_ASM(s32, "8C0B0", func_8008C520);
INCLUDE_ASM(s32, "8C0B0", func_8008C534);
INCLUDE_ASM(s32, "8C0B0", func_8008C550);
INCLUDE_ASM(s32, "8C0B0", func_8008C6C0);
INCLUDE_ASM(s32, "8C0B0", func_8008CB88);
INCLUDE_ASM(s32, "8C0B0", func_8008CBFC);
INCLUDE_ASM(s32, "8C0B0", func_8008CCFC);
INCLUDE_ASM(s32, "8C0B0", func_8008D558);
INCLUDE_ASM(s32, "8C0B0", func_8008D6E8);
INCLUDE_ASM(s32, "8C0B0", func_8008D778);
INCLUDE_ASM(s32, "8C0B0", func_8008D7B0);
INCLUDE_ASM(s32, "8C0B0", func_8008D934);
INCLUDE_ASM(s32, "8C0B0", func_8008DE08);
INCLUDE_ASM(s32, "8C0B0", func_8008DED8);
INCLUDE_ASM(s32, "8C0B0", func_8008E0D8);
INCLUDE_ASM(s32, "8C0B0", func_8008E900);
INCLUDE_ASM(s32, "8C0B0", func_8008E96C);
INCLUDE_ASM(s32, "8C0B0", func_8008E9BC);
INCLUDE_ASM(s32, "8C0B0", func_8008EA20);
INCLUDE_ASM(s32, "8C0B0", func_8008EA74);
INCLUDE_ASM(s32, "8C0B0", func_8008EB48);
INCLUDE_ASM(s32, "8C0B0", func_8008EBB8);
INCLUDE_ASM(s32, "8C0B0", func_8008EBD4);
INCLUDE_ASM(s32, "8C0B0", func_8008EC18);
INCLUDE_ASM(s32, "8C0B0", func_8008ED3C);
INCLUDE_ASM(s32, "8C0B0", func_8008EDEC);
INCLUDE_ASM(s32, "8C0B0", func_8008EE98);
INCLUDE_ASM(s32, "8C0B0", func_8008EEEC);
INCLUDE_ASM(s32, "8C0B0", func_8008EF6C);
INCLUDE_ASM(s32, "8C0B0", func_8008F020);
INCLUDE_ASM(s32, "8C0B0", func_8008F110);
INCLUDE_ASM(s32, "8C0B0", func_8008F150);
INCLUDE_ASM(s32, "8C0B0", alSynNew);
INCLUDE_ASM(s32, "8C0B0", func_8008F4BC);
INCLUDE_ASM(s32, "8C0B0", __allocParam);
INCLUDE_ASM(s32, "8C0B0", func_8008F698);
INCLUDE_ASM(s32, "8C0B0", func_8008F6B0);
INCLUDE_ASM(s32, "8C0B0", _freePVoice);
INCLUDE_ASM(s32, "8C0B0", func_8008F744);
INCLUDE_ASM(s32, "8C0B0", _timeToSamples);
INCLUDE_ASM(s32, "8C0B0", func_8008F7D8);
INCLUDE_ASM(s32, "8C0B0", func_8008F830);
INCLUDE_ASM(s32, "8C0B0", func_8008F950);
INCLUDE_ASM(s32, "8C0B0", func_8008FAD0);
INCLUDE_ASM(s32, "8C0B0", func_8008FB50);
INCLUDE_ASM(s32, "8C0B0", func_8008FCE8);
INCLUDE_ASM(s32, "8C0B0", func_8008FD70);
INCLUDE_ASM(s32, "8C0B0", func_8008FED8);
INCLUDE_ASM(s32, "8C0B0", func_8008FF80);
INCLUDE_ASM(s32, "8C0B0", func_80090120);
INCLUDE_ASM(s32, "8C0B0", func_800901A8);
INCLUDE_ASM(s32, "8C0B0", func_80090244);
INCLUDE_ASM(s32, "8C0B0", func_80090300);
INCLUDE_ASM(s32, "8C0B0", func_800904F0);
INCLUDE_ASM(s32, "8C0B0", func_80090550);
INCLUDE_ASM(s32, "8C0B0", func_800905B0);
INCLUDE_ASM(s32, "8C0B0", func_800906F4);
INCLUDE_ASM(s32, "8C0B0", func_80090940);
INCLUDE_ASM(s32, "8C0B0", func_80090C4C);
INCLUDE_ASM(s32, "8C0B0", func_80090D70);
INCLUDE_ASM(s32, "8C0B0", func_80090F1C);
INCLUDE_ASM(s32, "8C0B0", func_80090F90);
INCLUDE_ASM(s32, "8C0B0", func_80091120);
INCLUDE_ASM(s32, "8C0B0", func_80091230);
INCLUDE_ASM(s32, "8C0B0", func_80091428);
INCLUDE_ASM(s32, "8C0B0", func_80091500);
INCLUDE_ASM(s32, "8C0B0", func_80091600);
INCLUDE_ASM(s32, "8C0B0", func_80091A40);
INCLUDE_ASM(s32, "8C0B0", func_80091AA0);
INCLUDE_ASM(s32, "8C0B0", func_80091C40);
INCLUDE_ASM(s32, "8C0B0", func_80091CB0);
INCLUDE_ASM(s32, "8C0B0", func_80091E40);
INCLUDE_ASM(s32, "8C0B0", func_80091F10);
INCLUDE_ASM(s32, "8C0B0", __osSpRawStartDma);
INCLUDE_ASM(s32, "8C0B0", func_80092050);
INCLUDE_ASM(s32, "8C0B0", func_800921F0);
INCLUDE_ASM(s32, "8C0B0", func_80092390);
INCLUDE_ASM(s32, "8C0B0", func_80092500);
INCLUDE_ASM(s32, "8C0B0", func_80092810);
INCLUDE_ASM(s32, "8C0B0", func_80092830);
INCLUDE_ASM(s32, "8C0B0", func_80092DBC);
INCLUDE_ASM(s32, "8C0B0", __osEnqueueAndYield);
INCLUDE_ASM(s32, "8C0B0", __osEnqueueThread);
INCLUDE_ASM(s32, "8C0B0", __osPopThread);
INCLUDE_ASM(s32, "8C0B0", __osDispatchThread);
INCLUDE_ASM(s32, "8C0B0", __osCleanupThread);
INCLUDE_ASM(s32, "8C0B0", osGetMemSize);
INCLUDE_ASM(s32, "8C0B0", osInitialize);
INCLUDE_ASM(s32, "8C0B0", func_80093468);
INCLUDE_ASM(s32, "8C0B0", __osDisableInt);
INCLUDE_ASM(s32, "8C0B0", __osRestoreInt);
INCLUDE_ASM(s32, "8C0B0", func_800935B0);
INCLUDE_ASM(s32, "8C0B0", func_80093660);
INCLUDE_ASM(s32, "8C0B0", guNormalize);
INCLUDE_ASM(s32, "8C0B0", func_80093770);
INCLUDE_ASM(s32, "8C0B0", osGetCount);
INCLUDE_ASM(s32, "8C0B0", func_80093790);
INCLUDE_ASM(s32, "8C0B0", __osProbeTLB);
INCLUDE_ASM(s32, "8C0B0", func_80093860);
INCLUDE_ASM(s32, "8C0B0", func_80093870);
INCLUDE_ASM(s32, "8C0B0", func_800938C0);
INCLUDE_ASM(s32, "8C0B0", func_80093920);
INCLUDE_ASM(s32, "8C0B0", func_800939C0);
INCLUDE_ASM(s32, "8C0B0", func_80093E04);
INCLUDE_ASM(s32, "8C0B0", func_800941A0);
INCLUDE_ASM(s32, "8C0B0", func_8009434C);
INCLUDE_ASM(s32, "8C0B0", func_800944D0);
INCLUDE_ASM(s32, "8C0B0", func_800945AC);
INCLUDE_ASM(s32, "8C0B0", func_800945E0);
INCLUDE_ASM(s32, "8C0B0", func_80094720);
INCLUDE_ASM(s32, "8C0B0", func_80094750);
INCLUDE_ASM(s32, "8C0B0", func_8009493C);
INCLUDE_ASM(s32, "8C0B0", func_80094A00);
INCLUDE_ASM(s32, "8C0B0", func_80094AE8);
INCLUDE_ASM(s32, "8C0B0", func_80094C50);
INCLUDE_ASM(s32, "8C0B0", func_80094CB8);
INCLUDE_ASM(s32, "8C0B0", func_80094D20);
INCLUDE_ASM(s32, "8C0B0", func_80094DB0);
INCLUDE_ASM(s32, "8C0B0", func_80094EC4);
INCLUDE_ASM(s32, "8C0B0", func_80094ECC);
INCLUDE_ASM(s32, "8C0B0", func_80094EE8);
INCLUDE_ASM(s32, "8C0B0", func_80094F04);
INCLUDE_ASM(s32, "8C0B0", func_80094F18);
INCLUDE_ASM(s32, "8C0B0", func_80094F48);
INCLUDE_ASM(s32, "8C0B0", func_80094F98);
INCLUDE_ASM(s32, "8C0B0", func_80094FF0);
INCLUDE_ASM(s32, "8C0B0", func_80095000);
INCLUDE_ASM(s32, "8C0B0", __osAiDeviceBusy);
INCLUDE_ASM(s32, "8C0B0", __osSpDeviceBusy);
INCLUDE_ASM(s32, "8C0B0", func_800950E0);
INCLUDE_ASM(s32, "8C0B0", __osSpSetStatus);
INCLUDE_ASM(s32, "8C0B0", __osSpSetPc);
INCLUDE_ASM(s32, "8C0B0", func_80095130);
INCLUDE_ASM(s32, "8C0B0", func_80095240);
INCLUDE_ASM(s32, "8C0B0", func_80095250);
INCLUDE_ASM(s32, "8C0B0", func_800952A4);
INCLUDE_ASM(s32, "8C0B0", func_80095310);
INCLUDE_ASM(s32, "8C0B0", func_80095340);
INCLUDE_ASM(s32, "8C0B0", bcmp);
INCLUDE_ASM(s32, "8C0B0", _Printf);
INCLUDE_ASM(s32, "8C0B0", func_800959E0);
INCLUDE_ASM(s32, "8C0B0", func_80095EA0);
INCLUDE_ASM(s32, "8C0B0", func_80095F44);
INCLUDE_ASM(s32, "8C0B0", func_800963DC);
INCLUDE_ASM(s32, "8C0B0", func_80096494);
INCLUDE_ASM(s32, "8C0B0", func_80096544);
INCLUDE_ASM(s32, "8C0B0", func_800965D0);
INCLUDE_ASM(s32, "8C0B0", func_8009662C);
INCLUDE_ASM(s32, "8C0B0", func_80096688);
INCLUDE_ASM(s32, "8C0B0", func_800966D0);
INCLUDE_ASM(s32, "8C0B0", func_80096BD0);
INCLUDE_ASM(s32, "8C0B0", func_80096CA4);
INCLUDE_ASM(s32, "8C0B0", func_80096F78);
INCLUDE_ASM(s32, "8C0B0", func_80097058);
INCLUDE_ASM(s32, "8C0B0", func_8009707C);
INCLUDE_ASM(s32, "8C0B0", func_800972FC);
INCLUDE_ASM(s32, "8C0B0", func_80097380);
INCLUDE_ASM(s32, "8C0B0", func_800976F4);
INCLUDE_ASM(s32, "8C0B0", func_80097708);
INCLUDE_ASM(s32, "8C0B0", func_800978F8);
INCLUDE_ASM(s32, "8C0B0", func_80097B10);
INCLUDE_ASM(s32, "8C0B0", func_80097C80);
INCLUDE_ASM(s32, "8C0B0", func_80097DF0);
INCLUDE_ASM(s32, "8C0B0", func_80097E8C);
INCLUDE_ASM(s32, "8C0B0", func_80097F20);
INCLUDE_ASM(s32, "8C0B0", func_80097FC8);
INCLUDE_ASM(s32, "8C0B0", func_80097FF0);
INCLUDE_ASM(s32, "8C0B0", func_80098024);
INCLUDE_ASM(s32, "8C0B0", func_80098068);
INCLUDE_ASM(s32, "8C0B0", func_80098354);
INCLUDE_ASM(s32, "8C0B0", func_800984B8);
INCLUDE_ASM(s32, "8C0B0", func_80098684);
INCLUDE_ASM(s32, "8C0B0", func_8009873C);
INCLUDE_ASM(s32, "8C0B0", func_80098A80);
INCLUDE_ASM(s32, "8C0B0", func_80098C80);
INCLUDE_ASM(s32, "8C0B0", func_80098EA0);
INCLUDE_ASM(s32, "8C0B0", func_80098F0C);
INCLUDE_ASM(s32, "8C0B0", func_80098F90);
INCLUDE_ASM(s32, "8C0B0", func_80099350);
INCLUDE_ASM(s32, "8C0B0", func_800994C0);
INCLUDE_ASM(s32, "8C0B0", func_80099630);
INCLUDE_ASM(s32, "8C0B0", func_80099A90);
INCLUDE_ASM(s32, "8C0B0", func_80099BE8);
INCLUDE_ASM(s32, "8C0B0", func_80099D50);
INCLUDE_ASM(s32, "8C0B0", func_80099E40);
INCLUDE_ASM(s32, "8C0B0", func_80099ED4);
INCLUDE_ASM(s32, "8C0B0", func_80099F60);
INCLUDE_ASM(s32, "8C0B0", func_80099FB0);
INCLUDE_ASM(s32, "8C0B0", func_8009A000);
INCLUDE_ASM(s32, "8C0B0", func_8009A050);
INCLUDE_ASM(s32, "8C0B0", func_8009A090);
INCLUDE_ASM(s32, "8C0B0", func_8009A0E0);
INCLUDE_ASM(s32, "8C0B0", func_8009A100);
INCLUDE_ASM(s32, "8C0B0", func_8009A120);
INCLUDE_ASM(s32, "8C0B0", func_8009A370);
INCLUDE_ASM(s32, "8C0B0", func_8009A7B0);
INCLUDE_ASM(s32, "8C0B0", func_8009A848);
INCLUDE_ASM(s32, "8C0B0", func_8009ADF0);
INCLUDE_ASM(s32, "8C0B0", func_8009AE74);
INCLUDE_ASM(s32, "8C0B0", func_8009AFB0);
INCLUDE_ASM(s32, "8C0B0", func_8009AFD0);
INCLUDE_ASM(s32, "8C0B0", func_8009B0A8);
INCLUDE_ASM(s32, "8C0B0", func_8009B150);
INCLUDE_ASM(s32, "8C0B0", func_8009B308);
INCLUDE_ASM(s32, "8C0B0", func_8009B420);
INCLUDE_ASM(s32, "8C0B0", func_8009B590);
INCLUDE_ASM(s32, "8C0B0", func_8009B618);
INCLUDE_ASM(s32, "8C0B0", func_8009B674);
INCLUDE_ASM(s32, "8C0B0", func_8009B6F0);
INCLUDE_ASM(s32, "8C0B0", func_8009B770);
INCLUDE_ASM(s32, "8C0B0", func_8009B810);
INCLUDE_ASM(s32, "8C0B0", func_8009B840);
INCLUDE_ASM(s32, "8C0B0", func_8009B848);
INCLUDE_ASM(s32, "8C0B0", func_8009B850);
INCLUDE_ASM(s32, "8C0B0", func_8009B960);
INCLUDE_ASM(s32, "8C0B0", func_8009BA30);
INCLUDE_ASM(s32, "8C0B0", func_8009BAA4);
INCLUDE_ASM(s32, "8C0B0", func_8009BAD8);
INCLUDE_ASM(s32, "8C0B0", func_8009BBD4);
INCLUDE_ASM(s32, "8C0B0", func_8009BCA0);
INCLUDE_ASM(s32, "8C0B0", func_8009BE10);
INCLUDE_ASM(s32, "8C0B0", func_8009BE30);
INCLUDE_ASM(s32, "8C0B0", func_8009BE70);
INCLUDE_ASM(s32, "8C0B0", func_8009BF90);
INCLUDE_ASM(s32, "8C0B0", func_8009C090);
INCLUDE_ASM(s32, "8C0B0", func_8009C0A0);
INCLUDE_ASM(s32, "8C0B0", func_8009C100);
INCLUDE_ASM(s32, "8C0B0", func_8009C160);
INCLUDE_ASM(s32, "8C0B0", func_8009C240);
INCLUDE_ASM(s32, "8C0B0", HuGuLookAtF);
INCLUDE_ASM(s32, "8C0B0", func_8009C6E0);
INCLUDE_ASM(s32, "8C0B0", func_8009C770);
INCLUDE_ASM(s32, "8C0B0", func_8009CD20);
INCLUDE_ASM(s32, "8C0B0", func_8009CDB0);
INCLUDE_ASM(s32, "8C0B0", func_8009D840);
INCLUDE_ASM(s32, "8C0B0", func_8009D920);
INCLUDE_ASM(s32, "8C0B0", func_8009DAD0);
INCLUDE_ASM(s32, "8C0B0", func_8009DB50);
INCLUDE_ASM(s32, "8C0B0", func_8009DD10);
INCLUDE_ASM(s32, "8C0B0", func_8009DD90);
INCLUDE_ASM(s32, "8C0B0", func_8009DFF0);
INCLUDE_ASM(s32, "8C0B0", func_8009E060);
INCLUDE_ASM(s32, "8C0B0", func_8009E360);
INCLUDE_ASM(s32, "8C0B0", func_8009E7E0);
INCLUDE_ASM(s32, "8C0B0", func_8009E8F0);
INCLUDE_ASM(s32, "8C0B0", func_8009EA40);
INCLUDE_ASM(s32, "8C0B0", func_8009EB50);
INCLUDE_ASM(s32, "8C0B0", func_8009ECB0);
INCLUDE_ASM(s32, "8C0B0", func_8009EEC0);
INCLUDE_ASM(s32, "8C0B0", func_8009F2D0);
INCLUDE_ASM(s32, "8C0B0", func_8009F530);
INCLUDE_ASM(s32, "8C0B0", func_8009F9B0);
INCLUDE_ASM(s32, "8C0B0", func_8009FD40);
INCLUDE_ASM(s32, "8C0B0", func_800A0270);
INCLUDE_ASM(s32, "8C0B0", func_800A03B0);
INCLUDE_ASM(s32, "8C0B0", func_800A0730);
INCLUDE_ASM(s32, "8C0B0", func_800A07A0);
INCLUDE_ASM(s32, "8C0B0", func_800A0810);
INCLUDE_ASM(s32, "8C0B0", func_800A0890);
INCLUDE_ASM(s32, "8C0B0", func_800A0900);
INCLUDE_ASM(s32, "8C0B0", func_800A0970);
INCLUDE_ASM(s32, "8C0B0", func_800A09D0);
INCLUDE_ASM(s32, "8C0B0", func_800A0A20);
INCLUDE_ASM(s32, "8C0B0", func_800A0B90);
INCLUDE_ASM(s32, "8C0B0", func_800A0D00);
INCLUDE_ASM(s32, "8C0B0", func_800A0D50);
INCLUDE_ASM(s32, "8C0B0", func_800A0DA0);
INCLUDE_ASM(s32, "8C0B0", func_800A0E00);
INCLUDE_ASM(s32, "8C0B0", func_800A0E80);
INCLUDE_ASM(s32, "8C0B0", func_800A0F00);
INCLUDE_ASM(s32, "8C0B0", func_800A0F70);
INCLUDE_ASM(s32, "8C0B0", func_800A1010);
INCLUDE_ASM(s32, "8C0B0", func_800A10C0);
INCLUDE_ASM(s32, "8C0B0", func_800A1190);
INCLUDE_ASM(s32, "8C0B0", func_800A1200);
INCLUDE_ASM(s32, "8C0B0", func_800A1250);
INCLUDE_ASM(s32, "8C0B0", func_800A1320);
INCLUDE_ASM(s32, "8C0B0", func_800A13C0);

591
src/8C610.c Normal file
View File

@ -0,0 +1,591 @@
#include "common.h"
INCLUDE_ASM(s32, "8C610", func_8008BA10);
INCLUDE_ASM(s32, "8C610", func_8008BA70);
INCLUDE_ASM(s32, "8C610", func_8008BBEC);
INCLUDE_ASM(s32, "8C610", func_8008BC90);
INCLUDE_ASM(s32, "8C610", func_8008BD50);
INCLUDE_ASM(s32, "8C610", func_8008BE40);
INCLUDE_ASM(s32, "8C610", func_8008BEB0);
INCLUDE_ASM(s32, "8C610", func_8008BF50);
INCLUDE_ASM(s32, "8C610", func_8008BFA4);
INCLUDE_ASM(s32, "8C610", func_8008C010);
INCLUDE_ASM(s32, "8C610", bcopy);
INCLUDE_ASM(s32, "8C610", bzero);
INCLUDE_ASM(s32, "8C610", func_8008C400);
INCLUDE_ASM(s32, "8C610", func_8008C438);
INCLUDE_ASM(s32, "8C610", func_8008C45C);
INCLUDE_ASM(s32, "8C610", sprintf);
INCLUDE_ASM(s32, "8C610", func_8008C4E8);
INCLUDE_ASM(s32, "8C610", func_8008C520);
INCLUDE_ASM(s32, "8C610", func_8008C534);
INCLUDE_ASM(s32, "8C610", func_8008C550);
INCLUDE_ASM(s32, "8C610", func_8008C6C0);
INCLUDE_ASM(s32, "8C610", func_8008CB88);
INCLUDE_ASM(s32, "8C610", func_8008CBFC);
INCLUDE_ASM(s32, "8C610", func_8008CCFC);
INCLUDE_ASM(s32, "8C610", func_8008D558);
INCLUDE_ASM(s32, "8C610", func_8008D6E8);
INCLUDE_ASM(s32, "8C610", func_8008D778);
INCLUDE_ASM(s32, "8C610", func_8008D7B0);
INCLUDE_ASM(s32, "8C610", func_8008D934);
INCLUDE_ASM(s32, "8C610", func_8008DE08);
INCLUDE_ASM(s32, "8C610", func_8008DED8);
INCLUDE_ASM(s32, "8C610", func_8008E0D8);
INCLUDE_ASM(s32, "8C610", func_8008E900);
INCLUDE_ASM(s32, "8C610", func_8008E96C);
INCLUDE_ASM(s32, "8C610", func_8008E9BC);
INCLUDE_ASM(s32, "8C610", func_8008EA20);
INCLUDE_ASM(s32, "8C610", func_8008EA74);
INCLUDE_ASM(s32, "8C610", func_8008EB48);
INCLUDE_ASM(s32, "8C610", func_8008EBB8);
INCLUDE_ASM(s32, "8C610", func_8008EBD4);
INCLUDE_ASM(s32, "8C610", func_8008EC18);
INCLUDE_ASM(s32, "8C610", func_8008ED3C);
INCLUDE_ASM(s32, "8C610", func_8008EDEC);
INCLUDE_ASM(s32, "8C610", func_8008EE98);
INCLUDE_ASM(s32, "8C610", func_8008EEEC);
INCLUDE_ASM(s32, "8C610", func_8008EF6C);
INCLUDE_ASM(s32, "8C610", func_8008F020);
INCLUDE_ASM(s32, "8C610", func_8008F110);
INCLUDE_ASM(s32, "8C610", func_8008F150);
INCLUDE_ASM(s32, "8C610", alSynNew);
INCLUDE_ASM(s32, "8C610", func_8008F4BC);
INCLUDE_ASM(s32, "8C610", __allocParam);
INCLUDE_ASM(s32, "8C610", func_8008F698);
INCLUDE_ASM(s32, "8C610", func_8008F6B0);
INCLUDE_ASM(s32, "8C610", _freePVoice);
INCLUDE_ASM(s32, "8C610", func_8008F744);
INCLUDE_ASM(s32, "8C610", _timeToSamples);
INCLUDE_ASM(s32, "8C610", func_8008F7D8);
INCLUDE_ASM(s32, "8C610", func_8008F830);
INCLUDE_ASM(s32, "8C610", func_8008F950);
INCLUDE_ASM(s32, "8C610", func_8008FAD0);
INCLUDE_ASM(s32, "8C610", func_8008FB50);
INCLUDE_ASM(s32, "8C610", func_8008FCE8);
INCLUDE_ASM(s32, "8C610", func_8008FD70);
INCLUDE_ASM(s32, "8C610", func_8008FED8);
INCLUDE_ASM(s32, "8C610", func_8008FF80);
INCLUDE_ASM(s32, "8C610", func_80090120);
INCLUDE_ASM(s32, "8C610", func_800901A8);
INCLUDE_ASM(s32, "8C610", func_80090244);
INCLUDE_ASM(s32, "8C610", func_80090300);
INCLUDE_ASM(s32, "8C610", func_800904F0);
INCLUDE_ASM(s32, "8C610", func_80090550);
INCLUDE_ASM(s32, "8C610", func_800905B0);
INCLUDE_ASM(s32, "8C610", func_800906F4);
INCLUDE_ASM(s32, "8C610", func_80090940);
INCLUDE_ASM(s32, "8C610", func_80090C4C);
INCLUDE_ASM(s32, "8C610", func_80090D70);
INCLUDE_ASM(s32, "8C610", func_80090F1C);
INCLUDE_ASM(s32, "8C610", func_80090F90);
INCLUDE_ASM(s32, "8C610", func_80091120);
INCLUDE_ASM(s32, "8C610", func_80091230);
INCLUDE_ASM(s32, "8C610", func_80091428);
INCLUDE_ASM(s32, "8C610", func_80091500);
INCLUDE_ASM(s32, "8C610", func_80091600);
INCLUDE_ASM(s32, "8C610", func_80091A40);
INCLUDE_ASM(s32, "8C610", func_80091AA0);
INCLUDE_ASM(s32, "8C610", func_80091C40);
INCLUDE_ASM(s32, "8C610", func_80091CB0);
INCLUDE_ASM(s32, "8C610", func_80091E40);
INCLUDE_ASM(s32, "8C610", __osSiRawStartDma);
INCLUDE_ASM(s32, "8C610", __osSpRawStartDma);
INCLUDE_ASM(s32, "8C610", func_80092050);
INCLUDE_ASM(s32, "8C610", func_800921F0);
INCLUDE_ASM(s32, "8C610", func_80092390);
INCLUDE_ASM(s32, "8C610", func_80092500);
INCLUDE_ASM(s32, "8C610", func_80092810);
INCLUDE_ASM(s32, "8C610", func_80092830);
INCLUDE_ASM(s32, "8C610", func_80092DBC);
INCLUDE_ASM(s32, "8C610", __osEnqueueAndYield);
INCLUDE_ASM(s32, "8C610", __osEnqueueThread);
INCLUDE_ASM(s32, "8C610", __osPopThread);
INCLUDE_ASM(s32, "8C610", __osDispatchThread);
INCLUDE_ASM(s32, "8C610", __osCleanupThread);
INCLUDE_ASM(s32, "8C610", osGetMemSize);
INCLUDE_ASM(s32, "8C610", osInitialize);
INCLUDE_ASM(s32, "8C610", func_80093468);
INCLUDE_ASM(s32, "8C610", __osDisableInt);
INCLUDE_ASM(s32, "8C610", __osRestoreInt);
INCLUDE_ASM(s32, "8C610", func_800935B0);
INCLUDE_ASM(s32, "8C610", func_80093660);
INCLUDE_ASM(s32, "8C610", guNormalize);
INCLUDE_ASM(s32, "8C610", func_80093770);
INCLUDE_ASM(s32, "8C610", osGetCount);
INCLUDE_ASM(s32, "8C610", func_80093790);
INCLUDE_ASM(s32, "8C610", __osProbeTLB);
INCLUDE_ASM(s32, "8C610", func_80093860);
INCLUDE_ASM(s32, "8C610", func_80093870);
INCLUDE_ASM(s32, "8C610", func_800938C0);
INCLUDE_ASM(s32, "8C610", osSetTimer);
INCLUDE_ASM(s32, "8C610", func_800939C0);
INCLUDE_ASM(s32, "8C610", func_80093E04);
INCLUDE_ASM(s32, "8C610", func_800941A0);
INCLUDE_ASM(s32, "8C610", func_8009434C);
INCLUDE_ASM(s32, "8C610", func_800944D0);
INCLUDE_ASM(s32, "8C610", func_800945AC);
INCLUDE_ASM(s32, "8C610", func_800945E0);
INCLUDE_ASM(s32, "8C610", func_80094720);
INCLUDE_ASM(s32, "8C610", func_80094750);
INCLUDE_ASM(s32, "8C610", func_8009493C);
INCLUDE_ASM(s32, "8C610", func_80094A00);
INCLUDE_ASM(s32, "8C610", func_80094AE8);
INCLUDE_ASM(s32, "8C610", func_80094C50);
INCLUDE_ASM(s32, "8C610", func_80094CB8);
INCLUDE_ASM(s32, "8C610", func_80094D20);
INCLUDE_ASM(s32, "8C610", func_80094DB0);
INCLUDE_ASM(s32, "8C610", func_80094EC4);
INCLUDE_ASM(s32, "8C610", func_80094ECC);
INCLUDE_ASM(s32, "8C610", func_80094EE8);
INCLUDE_ASM(s32, "8C610", func_80094F04);
INCLUDE_ASM(s32, "8C610", func_80094F18);
INCLUDE_ASM(s32, "8C610", func_80094F48);
INCLUDE_ASM(s32, "8C610", func_80094F98);
INCLUDE_ASM(s32, "8C610", func_80094FF0);
INCLUDE_ASM(s32, "8C610", func_80095000);
INCLUDE_ASM(s32, "8C610", __osAiDeviceBusy);
INCLUDE_ASM(s32, "8C610", __osSpDeviceBusy);
INCLUDE_ASM(s32, "8C610", __osSpGetStatus);
INCLUDE_ASM(s32, "8C610", __osSpSetStatus);
INCLUDE_ASM(s32, "8C610", __osSpSetPc);
INCLUDE_ASM(s32, "8C610", func_80095130);
INCLUDE_ASM(s32, "8C610", func_80095240);
INCLUDE_ASM(s32, "8C610", __osSiCreateAccessQueue);
INCLUDE_ASM(s32, "8C610", func_800952A4);
INCLUDE_ASM(s32, "8C610", func_80095310);
INCLUDE_ASM(s32, "8C610", func_80095340);
INCLUDE_ASM(s32, "8C610", bcmp);
INCLUDE_ASM(s32, "8C610", _Printf);
INCLUDE_ASM(s32, "8C610", func_800959E0);
INCLUDE_ASM(s32, "8C610", func_80095EA0);
INCLUDE_ASM(s32, "8C610", func_80095F44);
INCLUDE_ASM(s32, "8C610", func_800963DC);
INCLUDE_ASM(s32, "8C610", func_80096494);
INCLUDE_ASM(s32, "8C610", func_80096544);
INCLUDE_ASM(s32, "8C610", func_800965D0);
INCLUDE_ASM(s32, "8C610", func_8009662C);
INCLUDE_ASM(s32, "8C610", func_80096688);
INCLUDE_ASM(s32, "8C610", func_800966D0);
INCLUDE_ASM(s32, "8C610", func_80096BD0);
INCLUDE_ASM(s32, "8C610", func_80096CA4);
INCLUDE_ASM(s32, "8C610", func_80096F78);
INCLUDE_ASM(s32, "8C610", func_80097058);
INCLUDE_ASM(s32, "8C610", func_8009707C);
INCLUDE_ASM(s32, "8C610", func_800972FC);
INCLUDE_ASM(s32, "8C610", func_80097380);
INCLUDE_ASM(s32, "8C610", func_800976F4);
INCLUDE_ASM(s32, "8C610", func_80097708);
INCLUDE_ASM(s32, "8C610", func_800978F8);
INCLUDE_ASM(s32, "8C610", func_80097B10);
INCLUDE_ASM(s32, "8C610", func_80097C80);
INCLUDE_ASM(s32, "8C610", func_80097DF0);
INCLUDE_ASM(s32, "8C610", func_80097E8C);
INCLUDE_ASM(s32, "8C610", func_80097F20);
INCLUDE_ASM(s32, "8C610", func_80097FC8);
INCLUDE_ASM(s32, "8C610", func_80097FF0);
INCLUDE_ASM(s32, "8C610", func_80098024);
INCLUDE_ASM(s32, "8C610", func_80098068);
INCLUDE_ASM(s32, "8C610", func_80098354);
INCLUDE_ASM(s32, "8C610", func_800984B8);
INCLUDE_ASM(s32, "8C610", func_80098684);
INCLUDE_ASM(s32, "8C610", func_8009873C);
INCLUDE_ASM(s32, "8C610", func_80098A80);
INCLUDE_ASM(s32, "8C610", func_80098C80);
INCLUDE_ASM(s32, "8C610", func_80098EA0);
INCLUDE_ASM(s32, "8C610", func_80098F0C);
INCLUDE_ASM(s32, "8C610", func_80098F90);
INCLUDE_ASM(s32, "8C610", func_80099350);
INCLUDE_ASM(s32, "8C610", func_800994C0);
INCLUDE_ASM(s32, "8C610", func_80099630);
INCLUDE_ASM(s32, "8C610", func_80099A90);
INCLUDE_ASM(s32, "8C610", func_80099BE8);
INCLUDE_ASM(s32, "8C610", func_80099D50);
INCLUDE_ASM(s32, "8C610", func_80099E40);
INCLUDE_ASM(s32, "8C610", func_80099ED4);
INCLUDE_ASM(s32, "8C610", func_80099F60);
INCLUDE_ASM(s32, "8C610", func_80099FB0);
INCLUDE_ASM(s32, "8C610", func_8009A000);
INCLUDE_ASM(s32, "8C610", func_8009A050);
INCLUDE_ASM(s32, "8C610", func_8009A090);
INCLUDE_ASM(s32, "8C610", func_8009A0E0);
INCLUDE_ASM(s32, "8C610", func_8009A100);
INCLUDE_ASM(s32, "8C610", func_8009A120);
INCLUDE_ASM(s32, "8C610", func_8009A370);
INCLUDE_ASM(s32, "8C610", func_8009A7B0);
INCLUDE_ASM(s32, "8C610", func_8009A848);
INCLUDE_ASM(s32, "8C610", func_8009ADF0);
INCLUDE_ASM(s32, "8C610", func_8009AE74);
INCLUDE_ASM(s32, "8C610", func_8009AFB0);
INCLUDE_ASM(s32, "8C610", func_8009AFD0);
INCLUDE_ASM(s32, "8C610", func_8009B0A8);
INCLUDE_ASM(s32, "8C610", func_8009B150);
INCLUDE_ASM(s32, "8C610", func_8009B308);
INCLUDE_ASM(s32, "8C610", func_8009B420);
INCLUDE_ASM(s32, "8C610", func_8009B590);
INCLUDE_ASM(s32, "8C610", func_8009B618);
INCLUDE_ASM(s32, "8C610", func_8009B674);
INCLUDE_ASM(s32, "8C610", func_8009B6F0);
INCLUDE_ASM(s32, "8C610", func_8009B770);
INCLUDE_ASM(s32, "8C610", func_8009B810);
INCLUDE_ASM(s32, "8C610", func_8009B840);
INCLUDE_ASM(s32, "8C610", func_8009B848);
INCLUDE_ASM(s32, "8C610", func_8009B850);
INCLUDE_ASM(s32, "8C610", func_8009B960);
INCLUDE_ASM(s32, "8C610", func_8009BA30);
INCLUDE_ASM(s32, "8C610", func_8009BAA4);
INCLUDE_ASM(s32, "8C610", func_8009BAD8);
INCLUDE_ASM(s32, "8C610", func_8009BBD4);
INCLUDE_ASM(s32, "8C610", func_8009BCA0);
INCLUDE_ASM(s32, "8C610", func_8009BE10);
INCLUDE_ASM(s32, "8C610", func_8009BE30);
INCLUDE_ASM(s32, "8C610", func_8009BE70);
INCLUDE_ASM(s32, "8C610", func_8009BF90);
INCLUDE_ASM(s32, "8C610", func_8009C090);
INCLUDE_ASM(s32, "8C610", func_8009C0A0);
INCLUDE_ASM(s32, "8C610", func_8009C100);
INCLUDE_ASM(s32, "8C610", func_8009C160);
INCLUDE_ASM(s32, "8C610", func_8009C240);
INCLUDE_ASM(s32, "8C610", HuGuLookAtF);
INCLUDE_ASM(s32, "8C610", func_8009C6E0);
INCLUDE_ASM(s32, "8C610", func_8009C770);
INCLUDE_ASM(s32, "8C610", func_8009CD20);
INCLUDE_ASM(s32, "8C610", func_8009CDB0);
INCLUDE_ASM(s32, "8C610", func_8009D840);
INCLUDE_ASM(s32, "8C610", func_8009D920);
INCLUDE_ASM(s32, "8C610", func_8009DAD0);
INCLUDE_ASM(s32, "8C610", func_8009DB50);
INCLUDE_ASM(s32, "8C610", func_8009DD10);
INCLUDE_ASM(s32, "8C610", func_8009DD90);
INCLUDE_ASM(s32, "8C610", func_8009DFF0);
INCLUDE_ASM(s32, "8C610", func_8009E060);
INCLUDE_ASM(s32, "8C610", func_8009E360);
INCLUDE_ASM(s32, "8C610", func_8009E7E0);
INCLUDE_ASM(s32, "8C610", func_8009E8F0);
INCLUDE_ASM(s32, "8C610", func_8009EA40);
INCLUDE_ASM(s32, "8C610", func_8009EB50);
INCLUDE_ASM(s32, "8C610", func_8009ECB0);
INCLUDE_ASM(s32, "8C610", func_8009EEC0);
INCLUDE_ASM(s32, "8C610", func_8009F2D0);
INCLUDE_ASM(s32, "8C610", func_8009F530);
INCLUDE_ASM(s32, "8C610", func_8009F9B0);
INCLUDE_ASM(s32, "8C610", func_8009FD40);
INCLUDE_ASM(s32, "8C610", func_800A0270);
INCLUDE_ASM(s32, "8C610", func_800A03B0);
INCLUDE_ASM(s32, "8C610", func_800A0730);
INCLUDE_ASM(s32, "8C610", func_800A07A0);
INCLUDE_ASM(s32, "8C610", func_800A0810);
INCLUDE_ASM(s32, "8C610", func_800A0890);
INCLUDE_ASM(s32, "8C610", func_800A0900);
INCLUDE_ASM(s32, "8C610", func_800A0970);
INCLUDE_ASM(s32, "8C610", func_800A09D0);
INCLUDE_ASM(s32, "8C610", func_800A0A20);
INCLUDE_ASM(s32, "8C610", func_800A0B90);
INCLUDE_ASM(s32, "8C610", func_800A0D00);
INCLUDE_ASM(s32, "8C610", func_800A0D50);
INCLUDE_ASM(s32, "8C610", func_800A0DA0);
INCLUDE_ASM(s32, "8C610", func_800A0E00);
INCLUDE_ASM(s32, "8C610", func_800A0E80);
INCLUDE_ASM(s32, "8C610", func_800A0F00);
INCLUDE_ASM(s32, "8C610", func_800A0F70);
INCLUDE_ASM(s32, "8C610", func_800A1010);
INCLUDE_ASM(s32, "8C610", func_800A10C0);
INCLUDE_ASM(s32, "8C610", func_800A1190);
INCLUDE_ASM(s32, "8C610", func_800A1200);
INCLUDE_ASM(s32, "8C610", func_800A1250);
INCLUDE_ASM(s32, "8C610", func_800A1320);
INCLUDE_ASM(s32, "8C610", func_800A13C0);

View File

@ -0,0 +1,100 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "siint.h"
s32 __osContinitialized = 0;
OSPifRam __osContPifRam ALIGNED(16);
u8 __osContLastCmd;
u8 __osMaxControllers;
OSTimer __osEepromTimer;
OSMesgQueue __osEepromTimerQ ALIGNED(8);
OSMesg __osEepromTimerMsg;
s32 osContInit(OSMesgQueue* mq, u8* bitpattern, OSContStatus* data) {
OSMesg dummy;
s32 ret = 0;
OSTime t;
OSTimer mytimer;
OSMesgQueue timerMesgQueue;
if (__osContinitialized != 0) {
return 0;
}
__osContinitialized = 1;
t = osGetTime();
if (t < OS_USEC_TO_CYCLES(500000)) {
osCreateMesgQueue(&timerMesgQueue, &dummy, 1);
osSetTimer(&mytimer, OS_USEC_TO_CYCLES(500000) - t, 0, &timerMesgQueue, &dummy);
osRecvMesg(&timerMesgQueue, &dummy, OS_MESG_BLOCK);
}
__osMaxControllers = 4;
__osPackRequestData(CONT_CMD_REQUEST_STATUS);
ret = __osSiRawStartDma(OS_WRITE, __osContPifRam.ramarray);
osRecvMesg(mq, &dummy, OS_MESG_BLOCK);
ret = __osSiRawStartDma(OS_READ, __osContPifRam.ramarray);
osRecvMesg(mq, &dummy, OS_MESG_BLOCK);
__osContGetInitData(bitpattern, data);
__osContLastCmd = CONT_CMD_REQUEST_STATUS;
__osSiCreateAccessQueue();
osCreateMesgQueue(&__osEepromTimerQ, &__osEepromTimerMsg, 1);
return ret;
}
void __osContGetInitData(u8* pattern, OSContStatus* data) {
u8* ptr;
__OSContRequesFormat requestHeader;
s32 i;
u8 bits;
bits = 0;
ptr = (u8 *)__osContPifRam.ramarray;
for (i = 0; i < __osMaxControllers; i++, ptr += sizeof(requestHeader), data++) {
requestHeader = *(__OSContRequesFormat*)ptr;
data->errno = CHNL_ERR(requestHeader);
if (data->errno == 0) {
data->type = requestHeader.typel << 8 | requestHeader.typeh;
data->status = requestHeader.status;
bits |= 1 << i;
}
}
*pattern = bits;
}
void __osPackRequestData(u8 cmd) {
u8* ptr;
__OSContRequesFormat requestHeader;
s32 i;
for (i = 0; i < ARRLEN(__osContPifRam.ramarray); i++) {
__osContPifRam.ramarray[i] = 0;
}
__osContPifRam.pifstatus = CONT_CMD_EXE;
ptr = (u8 *)__osContPifRam.ramarray;
requestHeader.dummy = CONT_CMD_NOP;
requestHeader.txsize = CONT_CMD_RESET_TX;
requestHeader.rxsize = CONT_CMD_RESET_RX;
requestHeader.cmd = cmd;
requestHeader.typeh = CONT_CMD_NOP;
requestHeader.typel = CONT_CMD_NOP;
requestHeader.status = CONT_CMD_NOP;
requestHeader.dummy1 = CONT_CMD_NOP;
for (i = 0; i < __osMaxControllers; i++) {
*(__OSContRequesFormat*)ptr = requestHeader;
ptr += sizeof(requestHeader);
}
*ptr = CONT_CMD_END;
}

242
src/lib/2.0I/io/controller.h Executable file
View File

@ -0,0 +1,242 @@
#ifndef _CONTROLLER_H
#define _CONTROLLER_H
#include "PR/os_internal.h"
#include "PR/rcp.h"
//should go somewhere else but
#define ARRLEN(x) ((s32)(sizeof(x) / sizeof(x[0])))
#define CHNL_ERR(format) (((format).rxsize & CHNL_ERR_MASK) >> 4)
typedef struct
{
/* 0x0 */ u32 ramarray[15];
/* 0x3C */ u32 pifstatus;
} OSPifRam;
typedef struct
{
/* 0x0 */ u8 dummy;
/* 0x1 */ u8 txsize;
/* 0x2 */ u8 rxsize;
/* 0x3 */ u8 cmd;
/* 0x4 */ u16 button;
/* 0x6 */ s8 stick_x;
/* 0x7 */ s8 stick_y;
} __OSContReadFormat;
typedef struct
{
/* 0x0 */ u8 dummy;
/* 0x1 */ u8 txsize;
/* 0x2 */ u8 rxsize;
/* 0x3 */ u8 cmd;
/* 0x4 */ u8 typeh;
/* 0x5 */ u8 typel;
/* 0x6 */ u8 status;
/* 0x7 */ u8 dummy1;
} __OSContRequesFormat;
typedef struct
{
/* 0x0 */ u8 txsize;
/* 0x1 */ u8 rxsize;
/* 0x2 */ u8 cmd;
/* 0x3 */ u8 typeh;
/* 0x4 */ u8 typel;
/* 0x5 */ u8 status;
} __OSContRequesFormatShort;
typedef struct
{
/* 0x0 */ u8 dummy;
/* 0x1 */ u8 txsize;
/* 0x2 */ u8 rxsize;
/* 0x3 */ u8 cmd;
/* 0x4 */ u8 addrh;
/* 0x5 */ u8 addrl;
/* 0x6 */ u8 data[BLOCKSIZE];
/* 0x26 */ u8 datacrc;
} __OSContRamReadFormat;
typedef union {
/* 0x0 */ struct
{
/* 0x0 */ u8 bank;
/* 0x1 */ u8 page;
} inode_t;
/* 0x0 */ u16 ipage;
} __OSInodeUnit;
typedef struct
{
/* 0x0 */ u32 game_code;
/* 0x4 */ u16 company_code;
/* 0x6 */ __OSInodeUnit start_page;
/* 0x8 */ u8 status;
/* 0x9 */ s8 reserved;
/* 0xA */ u16 data_sum;
/* 0xC */ u8 ext_name[PFS_FILE_EXT_LEN];
/* 0x10 */ u8 game_name[PFS_FILE_NAME_LEN];
} __OSDir;
typedef struct
{
/* 0x0 */ __OSInodeUnit inode_page[128];
} __OSInode;
typedef struct
{
/* 0x0 */ u32 repaired;
/* 0x4 */ u32 random;
/* 0x8 */ u64 serial_mid;
/* 0x10 */ u64 serial_low;
/* 0x18 */ u16 deviceid;
/* 0x1A */ u8 banks;
/* 0x1B */ u8 version;
/* 0x1C */ u16 checksum;
/* 0x1E */ u16 inverted_checksum;
} __OSPackId;
typedef struct
{
/* 0x0 */ u8 txsize;
/* 0x1 */ u8 rxsize;
/* 0x2 */ u8 cmd;
/* 0x3 */ u8 address;
/* 0x4 */ u8 data[EEPROM_BLOCK_SIZE];
} __OSContEepromFormat;
// Joybus commands
//from: http://en64.shoutwiki.com/wiki/SI_Registers_Detailed#CONT_CMD_Usage
#define CONT_CMD_REQUEST_STATUS 0
#define CONT_CMD_READ_BUTTON 1
#define CONT_CMD_READ_PAK 2
#define CONT_CMD_WRITE_PAK 3
#define CONT_CMD_READ_EEPROM 4
#define CONT_CMD_WRITE_EEPROM 5
#define CONT_CMD_CHANNEL_RESET 0xFD
#define CONT_CMD_RESET 0xFF
// Bytes transmitted for each joybus command
#define CONT_CMD_REQUEST_STATUS_TX 1
#define CONT_CMD_READ_BUTTON_TX 1
#define CONT_CMD_READ_PAK_TX 3
#define CONT_CMD_WRITE_PAK_TX 35
#define CONT_CMD_READ_EEPROM_TX 2
#define CONT_CMD_WRITE_EEPROM_TX 10
#define CONT_CMD_RESET_TX 1
// Bytes received for each joybus command
#define CONT_CMD_REQUEST_STATUS_RX 3
#define CONT_CMD_READ_BUTTON_RX 4
#define CONT_CMD_READ_PAK_RX 33
#define CONT_CMD_WRITE_PAK_RX 1
#define CONT_CMD_READ_EEPROM_RX 8
#define CONT_CMD_WRITE_EEPROM_RX 1
#define CONT_CMD_RESET_RX 3
#define CONT_CMD_NOP 0xff
#define CONT_CMD_END 0xfe //indicates end of a command
#define CONT_CMD_EXE 1 //set pif ram status byte to this to do a command
#define DIR_STATUS_EMPTY 0
#define DIR_STATUS_UNKNOWN 1
#define DIR_STATUS_OCCUPIED 2
// Controller accessory addresses
// https://github.com/joeldipops/TransferBoy/blob/master/docs/TransferPakReference.md
// Accesory detection
#define CONT_ADDR_DETECT 0x8000
// Rumble
#define CONT_ADDR_RUMBLE 0xC000
// Controller Pak
// Transfer Pak
#define CONT_ADDR_GB_POWER 0x8000 // Same as the detection address, but semantically different
#define CONT_ADDR_GB_BANK 0xA000
#define CONT_ADDR_GB_STATUS 0xB000
// Addresses sent to controller accessories are in blocks, not bytes
#define CONT_BLOCKS(x) ((x) / BLOCKSIZE)
// Block addresses of the above
#define CONT_BLOCK_DETECT CONT_BLOCKS(CONT_ADDR_DETECT)
#define CONT_BLOCK_RUMBLE CONT_BLOCKS(CONT_ADDR_RUMBLE)
#define CONT_BLOCK_GB_POWER CONT_BLOCKS(CONT_ADDR_GB_POWER)
#define CONT_BLOCK_GB_BANK CONT_BLOCKS(CONT_ADDR_GB_BANK)
#define CONT_BLOCK_GB_STATUS CONT_BLOCKS(CONT_ADDR_GB_STATUS)
// Transfer pak
#define GB_POWER_ON 0x84
#define GB_POWER_OFF 0xFE
typedef struct
{
/* 0x0 */ __OSInode inode;
/* 0x100 */ u8 bank;
/* 0x101 */ u8 map[256];
} __OSInodeCache;
extern s32 __osEepStatus(OSMesgQueue *, OSContStatus *);
u16 __osSumcalc(u8 *ptr, int length);
s32 __osIdCheckSum(u16 *ptr, u16 *csum, u16 *icsum);
s32 __osRepairPackId(OSPfs *pfs, __OSPackId *badid, __OSPackId *newid);
s32 __osCheckPackId(OSPfs *pfs, __OSPackId *temp);
s32 __osGetId(OSPfs *pfs);
s32 __osCheckId(OSPfs *pfs);
s32 __osPfsRWInode(OSPfs *pfs, __OSInode *inode, u8 flag, u8 bank);
s32 __osPfsSelectBank(OSPfs *pfs, u8 bank);
s32 __osPfsDeclearPage(OSPfs *pfs, __OSInode *inode, int file_size_in_pages, int *first_page, u8 bank, int *decleared, int *last_page);
s32 __osPfsReleasePages(OSPfs *pfs, __OSInode *inode, u8 start_page, u8 bank, __OSInodeUnit *last_page);
s32 __osBlockSum(OSPfs *pfs, u8 page_no, u16 *sum, u8 bank);
s32 __osContRamRead(OSMesgQueue *mq, int channel, u16 address, u8 *buffer);
s32 __osContRamWrite(OSMesgQueue *mq, int channel, u16 address, u8 *buffer, int force);
void __osContGetInitData(u8 *pattern, OSContStatus *data);
void __osPackRequestData(u8 cmd);
void __osPfsRequestData(u8 cmd);
void __osPfsGetInitData(u8* pattern, OSContStatus* data);
u8 __osContAddressCrc(u16 addr);
u8 __osContDataCrc(u8 *data);
s32 __osPfsGetStatus(OSMesgQueue *queue, int channel);
extern u8 __osContLastCmd;
extern OSTimer __osEepromTimer;
extern OSMesg __osEepromTimerMsg;
extern OSMesgQueue __osEepromTimerQ;
extern OSPifRam __osEepPifRam;
extern OSPifRam __osContPifRam;
extern OSPifRam __osPfsPifRam;
extern u8 __osMaxControllers;
//some version of this almost certainly existed since there's plenty of times where it's used right before a return 0
#define ERRCK(fn) \
ret = fn; \
if (ret != 0) \
return ret;
#define SET_ACTIVEBANK_TO_ZERO \
if (pfs->activebank != 0) \
{ \
ERRCK(__osPfsSelectBank(pfs, 0)) \
}
#define PFS_CHECK_ID \
if (__osCheckId(pfs) == PFS_ERR_NEW_PACK) \
return PFS_ERR_NEW_PACK;
#define PFS_CHECK_STATUS \
if ((pfs->status & PFS_INITIALIZED) == 0) \
return PFS_ERR_INVALID;
#define PFS_GET_STATUS \
__osSiGetAccess(); \
ret = __osPfsGetStatus(queue, channel); \
__osSiRelAccess(); \
if (ret != 0) \
return ret;
#endif

15
src/lib/2.0I/io/siint.h Executable file
View File

@ -0,0 +1,15 @@
#ifndef _SIINT_H
#define _SIINT_H
#include "PR/os_internal.h"
#include "PR/rcp.h"
extern s32 __osEepromRead16K;
extern u8 __osPfsInodeCacheBank;
void __osSiGetAccess(void);
void __osSiRelAccess(void);
int __osSiDeviceBusy(void);
void __osSiCreateAccessQueue(void);
#endif

6
src/lib/2.0I/io/sptaskyield.c Executable file
View File

@ -0,0 +1,6 @@
#include "PR/os_internal.h"
#include "PR/rcp.h"
void osSpTaskYield(void) {
__osSpSetStatus(SP_SET_YIELD);
}

18
src/lib/2.0I/io/sptaskyielded.c Executable file
View File

@ -0,0 +1,18 @@
#include "PR/os_internal.h"
#include "PR/sptask.h"
#include "PR/rcp.h"
OSYieldResult osSpTaskYielded(OSTask *tp) {
u32 status;
OSYieldResult result;
status = __osSpGetStatus();
result = status >> 8;
result &= 1;
if (status & SP_STATUS_YIELD) {
tp->t.flags = ~(OS_TASK_DP_WAIT) & (tp->t.flags | result);
}
return result;
}

17
src/lib/2.0I/io/viblack.c Normal file
View File

@ -0,0 +1,17 @@
#include <PR/os_internal.h>
#include "viint.h"
// TODO: this comes from a header
#ident "$Revision: 1.17 $"
void osViBlack(u8 active) {
register u32 saveMask = __osDisableInt();
if (active) {
__osViNext->state |= VI_STATE_BLACK;
} else {
__osViNext->state &= ~VI_STATE_BLACK;
}
__osRestoreInt(saveMask);
}

View File

@ -0,0 +1,10 @@
#include <PR/os_internal.h>
#include "viint.h"
void *osViGetCurrentFramebuffer(void) {
register u32 saveMask = __osDisableInt();
void *framep = __osViCurr->framep;
__osRestoreInt(saveMask);
return framep;
}

View File

@ -0,0 +1,10 @@
#include <PR/os_internal.h>
#include "viint.h"
void *osViGetNextFramebuffer(void) {
register u32 saveMask = __osDisableInt();
void *framep = __osViNext->framep;
__osRestoreInt(saveMask);
return framep;
}

70
src/lib/2.0I/io/viint.h Normal file
View File

@ -0,0 +1,70 @@
#ifndef _VIINT_H
#define _VIINT_H
#include "PR/os_internal.h"
#define OS_TV_TYPE_PAL 0
#define OS_TV_TYPE_NTSC 1
#define OS_TV_TYPE_MPAL 2
#define VI_STATE_MODE_UPDATED 0x01
#define VI_STATE_XSCALE_UPDATED 0x02
#define VI_STATE_YSCALE_UPDATED 0x04
#define VI_STATE_CTRL_UPDATED 0x08 // related to control regs changing
#define VI_STATE_BUFFER_UPDATED 0x10 // swap buffer
#define VI_STATE_BLACK 0x20 // probably related to a black screen
#define VI_STATE_REPEATLINE 0x40 // repeat line?
#define VI_STATE_FADE 0x80 // fade
#define VI_CTRL_ANTIALIAS_MODE_3 0x00300 /* Bit [9:8] anti-alias mode */
#define VI_CTRL_ANTIALIAS_MODE_2 0x00200 /* Bit [9:8] anti-alias mode */
#define VI_CTRL_ANTIALIAS_MODE_1 0x00100 /* Bit [9:8] anti-alias mode */
#define VI_SCALE_MASK 0xfff //see rcp scale_x/scale_y
#define VI_2_10_FPART_MASK 0x3ff
#define VI_SUBPIXEL_SH 0x10
#define BURST(hsync_width, color_width, vsync_width, color_start) \
(hsync_width | (color_width << 8) | (vsync_width << 16) | (color_start << 20))
#define WIDTH(v) v
#define VSYNC(v) v
#define HSYNC(duration, leap) (duration | (leap << 16))
#define LEAP(upper, lower) ((upper << 16) | lower)
#define START(start, end) ((start << 16) | end)
#define FTOFIX(val, i, f) ((u32)(val * (f32)(1 << f)) & ((1 << (i + f)) - 1))
#define F210(val) FTOFIX(val, 2, 10)
#define SCALE(scaleup, off) (F210((1.0f / (f32)scaleup)) | (F210((f32)off) << 16))
#define VCURRENT(v) v //seemingly unused
#define ORIGIN(v) v
#define VINTR(v) v
#define HSTART START
typedef struct
{
/* 0x0 */ f32 factor;
/* 0x4 */ u16 offset;
/* 0x8 */ u32 scale;
} __OSViScale;
typedef struct
{
/* 0x0 */ u16 state;
/* 0x2 */ u16 retraceCount;
/* 0x4 */ void *framep;
/* 0x8 */ OSViMode *modep;
/* 0xC */ u32 control;
/* 0x10 */ OSMesgQueue *msgq;
/* 0x14 */ OSMesg msg;
/* 0x18 */ __OSViScale x;
/* 0x24 */ __OSViScale y;
} __OSViContext; // 0x30 bytes
void __osViSwapContext(void);
extern __OSViContext *__osViCurr;
extern __OSViContext *__osViNext;
extern u32 __additional_scanline;
__OSViContext *__osViGetCurrentContext(void);
void __osViInit(void);
#endif

View File

@ -0,0 +1,14 @@
#include <PR/os_internal.h>
#include "viint.h"
// TODO: this comes from a header
#ident "$Revision: 1.17 $"
void osViSetEvent(OSMesgQueue *mq, OSMesg m, u32 retraceCount) {
register u32 saveMask = __osDisableInt();
__osViNext->msgq = mq;
__osViNext->msg = m;
__osViNext->retraceCount = retraceCount;
__osRestoreInt(saveMask);
}

View File

@ -0,0 +1,14 @@
#include <PR/os_internal.h>
#include "viint.h"
// TODO: this comes from a header
#ident "$Revision: 1.17 $"
void osViSetMode(OSViMode *modep) {
register u32 saveMask = __osDisableInt();
__osViNext->modep = modep;
__osViNext->state = VI_STATE_MODE_UPDATED;
__osViNext->control = __osViNext->modep->comRegs.ctrl;
__osRestoreInt(saveMask);
}

View File

@ -0,0 +1,13 @@
#include <PR/os_internal.h>
#include "viint.h"
// TODO: this comes from a header
#ident "$Revision: 1.17 $"
void osViSwapBuffer(void* frameBufPtr) {
u32 saveMask = __osDisableInt();
__osViNext->framep = frameBufPtr;
__osViNext->state |= VI_STATE_BUFFER_UPDATED;
__osRestoreInt(saveMask);
}

View File

@ -127,7 +127,7 @@ void func_800F7318_CE788(unkObjectStruct* arg0) {
void func_800F7350_CE7C0(void) {
D_800C3110->unk_40 = 45.0f;
func_8008B6A0(0);
osViBlack(NULL);
func_80060198();
func_800F94E0_D0950();
func_800F830C_CF77C();

View File

@ -267,8 +267,22 @@ osAiGetLength = 0x8008B1C0;
osAiSetNextBuffer = 0x8008B1D0;
osSpTaskLoad = 0x8008B270;
osSpTaskStartGo = 0x8008B47C;
osSpTaskYield = 0x8008B4B0;
osSpTaskYielded = 0x8008B4D0;
osViGetCurrentFramebuffer = 0x8008B520;
osViGetNextFramebuffer = 0x8008B560;
osViSetEvent = 0x8008B5A0;
osViSetMode = 0x8008B600;
osViSwapBuffer = 0x8008B650;
osViBlack = 0x8008B6A0;
osContInit = 0x8008B700;
__osContGetInitData = 0x8008B89C;
__osPackRequestData = 0x8008B950;
alSynNew = 0x8008F1F0;
osSetTimer = 0x80093920;
__osSiRawStartDma = 0x80091F10;
__osSiCreateAccessQueue = 0x80095250;
__allocParam = 0x8008F66C;
_freePVoice = 0x8008F704;
@ -277,8 +291,16 @@ _timeToSamples = 0x8008F78C;
__osAiDeviceBusy = 0x800950A0;
__osSpDeviceBusy = 0x800950C0;
__osSpSetStatus = 0x800950F0;
__osSpGetStatus = 0x800950E0;
__osSpSetPc = 0x80095100;
__osSpRawStartDma = 0x80091FC0;
__osViCurr = 0x800C77B0;
__osViNext = 0x800C77B4;
__osMaxControllers = 0x800F09F8;
__osContPifRam = 0x800ED3F0;
__osContLastCmd = 0x800F3742;
__osEepromTimerQ = 0x800F64C8;
__osEepromTimerMsg = 0x800F3754;
sinf = 0x80088060;
cosf = 0x800855C0;