Skip to content

Commit

Permalink
Merge pull request #6 from sozud/c_002
Browse files Browse the repository at this point in the history
libcd c_002
  • Loading branch information
sozud authored Jan 19, 2025
2 parents 23b253a + ef0398b commit 9503af2
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
45 changes: 45 additions & 0 deletions src/cd/c_002.c
Original file line number Diff line number Diff line change
@@ -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;
}
32 changes: 32 additions & 0 deletions src/cd/c_002.h
Original file line number Diff line number Diff line change
@@ -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 */

0 comments on commit 9503af2

Please sign in to comment.