diff --git a/build.py b/build.py index d8a89e5..449e59a 100644 --- a/build.py +++ b/build.py @@ -267,6 +267,11 @@ def build_35(): add_lib_263(c_srcs, "build/3.5/c", "./psy-q/3.5/PSX/LIB/LIBC.LIB", "-DVERSION=35", "3.5") + c_srcs = [ + 'src/cd/c_002.c', + ] + + add_lib_263(c_srcs, "build/3.5/cd", "./psy-q/3.5/PSX/LIB/LIBCD.LIB", "-DVERSION=35", "3.5") def build_36(): snd_srcs = [ diff --git a/src/cd/c_002.c b/src/cd/c_002.c new file mode 100644 index 0000000..30525ff --- /dev/null +++ b/src/cd/c_002.c @@ -0,0 +1,45 @@ +#include "../types.h" +#include "c_002.h" + +static s32 reg0 = 0x1F801800; +static s32 reg1 = 0x1F801801; +static s32 reg2 = 0x1F801802; +static s32 reg3 = 0x1F801803; + +s32 Stframe_no; +s32 StFinalSector; +s16 Stsector_offset; + +void StClearRing(void); + +s32 StRgb24; +s32 StEmu_Idx; +s32 StFunc1; +s32 StCdIntrFlag; +s32 StFunc2; +s32 StRingIdx1; +s32 StRingIdx2; +s32 StRingIdx3; +s32 StStartFrame; +s32 StCHANNEL; + +void init_ring_status(s32, s32); + +s32 StEmu_Addr; +s32 StEndFrame; +s32 StSTART_FLAG; +s32 StRingAddr; +s32 StRingBase; +s32 StRingSize; +s32 CChannel; + +void StClearRing(void) { + StRingIdx3 = 0; + StRingIdx2 = 0; + StRingIdx1 = 0; + StFinalSector = 0; + init_ring_status(0, StRingSize); + StCdIntrFlag = 0; + Stsector_offset = 0; + Stframe_no = 0; +} diff --git a/src/cd/c_002.h b/src/cd/c_002.h new file mode 100644 index 0000000..d81834f --- /dev/null +++ b/src/cd/c_002.h @@ -0,0 +1,32 @@ +extern s32 dummy0; +extern s32 dummy1; +extern s32 dummy2; +extern s32 dummy3; +extern s32 dummy4; +extern s32 dummy5; +extern s32 dummy6; +extern s32 dummy7; +extern s32 dummy8; +extern s32 dummy9; +extern s32 dummy10; + +s32 StRingAddr; /* 11 */ +s32 StRingBase; /* 12 */ +s32 StRgb24; /* 13 */ +s32 StEmu_Addr; /* 14 */ +s32 StEmu_Idx; /* 15 */ +s32 StRingSize; /* 16 */ +s32 StRingIdx1; /* 17 */ +s32 StRingIdx2; /* 18 */ +s32 StRingIdx3; /* 19 */ +s32 StSTART_FLAG; /* 20 */ +s32 StStartFrame; /* 21 */ +s32 StEndFrame; /* 22 */ +s32 StFinalSector; /* 23 */ +s32 StFunc1; /* 24 */ +s32 StFunc2; /* 25 */ +s32 Stframe_no; /* 26 */ +s16 Stsector_offset; /* 27 */ +s32 StCdIntrFlag; /* 28 */ +s32 StCHANNEL; /* 29 */ +s32 CChannel; /* 30 */