Skip to content

Commit

Permalink
Change SCMD/NCMD enumerations to use the same ones in libcdvd in ps2sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
uyjulian committed Jun 26, 2021
1 parent f5fb514 commit b73847d
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 85 deletions.
104 changes: 52 additions & 52 deletions modules/iopcore/cdvdfsv/ncmd.c
Expand Up @@ -65,37 +65,37 @@ static inline void cdvd_readchain(void *buf);
static inline void rpcNCmd_cdreadDiskID(void *buf);
static inline void rpcNCmd_cdgetdisktype(void *buf);

enum CDVDFSV_NCMD {
CDVDFSV_NCMD_CDREAD = 1,
CDVDFSV_NCMD_CDDAREAD,
CDVDFSV_NCMD_DVDREAD,
CDVDFSV_NCMD_GETTOC,
CDVDFSV_NCMD_SEEK,
CDVDFSV_NCMD_STANDBY,
CDVDFSV_NCMD_STOP,
CDVDFSV_NCMD_PAUSE,
CDVDFSV_NCMD_STREAM,
CDVDFSV_NCMD_CDDASTREAM,
CDVDFSV_NCMD_APPLYNCMD = 0x0C,
CDVDFSV_NCMD_IOPMREAD,
CDVDFSV_NCMD_DISKRDY,
CDVDFSV_NCMD_READCHAIN,
CDVDFSV_NCMD_READDISKID = 0x11,
CDVDFSV_NCMD_DISKTYPE = 0x17,

CDVDFSV_NCMD_COUNT
enum CD_NCMD_CMDS {
CD_NCMD_READ = 1,
CD_NCMD_CDDAREAD,
CD_NCMD_DVDREAD,
CD_NCMD_GETTOC,
CD_NCMD_SEEK,
CD_NCMD_STANDBY,
CD_NCMD_STOP,
CD_NCMD_PAUSE,
CD_NCMD_STREAM,
CD_NCMD_CDDASTREAM,
CD_NCMD_NCMD = 0x0C,
CD_NCMD_READIOPMEM,
CD_NCMD_DISKREADY,
CD_NCMD_READCHAIN,
CD_NCMD_READDISKID = 0x11,
CD_NCMD_DISKTYPE = 0x17,

CD_NCMD_COUNT
};

enum CDVDFSV_ST_CMD {
CDVDFSV_ST_START = 1,
CDVDFSV_ST_READ,
CDVDFSV_ST_STOP,
CDVDFSV_ST_SEEK,
CDVDFSV_ST_INIT,
CDVDFSV_ST_STAT,
CDVDFSV_ST_PAUSE,
CDVDFSV_ST_RESUME,
CDVDFSV_ST_SEEKF
enum CDVD_ST_CMDS {
CDVD_ST_CMD_START = 1,
CDVD_ST_CMD_READ,
CDVD_ST_CMD_STOP,
CDVD_ST_CMD_SEEK,
CDVD_ST_CMD_INIT,
CDVD_ST_CMD_STAT,
CDVD_ST_CMD_PAUSE,
CDVD_ST_CMD_RESUME,
CDVD_ST_CMD_SEEKF
};

//--------------------------------------------------------------
Expand Down Expand Up @@ -251,31 +251,31 @@ static inline void cdvd_Stsubcmdcall(void *buf)
RpcCdvdStream_t *St = (RpcCdvdStream_t *)buf;

switch (St->cmd) {
case CDVDFSV_ST_START:
case CDVD_ST_CMD_START:
*(int *)buf = sceCdStStart(((RpcCdvdStream_t *)buf)->lsn, &cdvdfsv_Stmode);
break;
case CDVDFSV_ST_READ:
case CDVD_ST_CMD_READ:
cdvdSt_read(buf);
break;
case CDVDFSV_ST_STOP:
case CDVD_ST_CMD_STOP:
*(int *)buf = sceCdStStop();
break;
case CDVDFSV_ST_SEEK:
case CDVD_ST_CMD_SEEK:
*(int *)buf = sceCdStSeek(((RpcCdvdStream_t *)buf)->lsn);
break;
case CDVDFSV_ST_INIT:
case CDVD_ST_CMD_INIT:
*(int *)buf = sceCdStInit(((RpcCdvdStInit_t *)buf)->bufmax, ((RpcCdvdStInit_t *)buf)->bankmax, ((RpcCdvdStInit_t *)buf)->buf);
break;
case CDVDFSV_ST_STAT:
case CDVD_ST_CMD_STAT:
*(int *)buf = sceCdStStat();
break;
case CDVDFSV_ST_PAUSE:
case CDVD_ST_CMD_PAUSE:
*(int *)buf = sceCdStPause();
break;
case CDVDFSV_ST_RESUME:
case CDVD_ST_CMD_RESUME:
*(int *)buf = sceCdStResume();
break;
case CDVDFSV_ST_SEEKF:
case CDVD_ST_CMD_SEEKF:
*(int *)buf = sceCdStSeekF(((RpcCdvdStream_t *)buf)->lsn);
break;
default:
Expand Down Expand Up @@ -387,42 +387,42 @@ static void *cbrpc_cdvdNcmds(int fno, void *buf, int size)
sceCdSC(CDSC_IO_SEMA, &fno);

switch (fno) {
case CDVDFSV_NCMD_CDREAD:
case CDVDFSV_NCMD_CDDAREAD:
case CDVDFSV_NCMD_DVDREAD:
case CD_NCMD_READ:
case CD_NCMD_CDDAREAD:
case CD_NCMD_DVDREAD:
cdvd_readee(buf);
break;
case CDVDFSV_NCMD_GETTOC:
case CD_NCMD_GETTOC:
*(int *)buf = 1;
break;
case CDVDFSV_NCMD_SEEK:
case CD_NCMD_SEEK:
*(int *)buf = sceCdSeek(*(u32 *)buf);
break;
case CDVDFSV_NCMD_STANDBY:
case CD_NCMD_STANDBY:
*(int *)buf = sceCdStandby();
break;
case CDVDFSV_NCMD_STOP:
case CD_NCMD_STOP:
*(int *)buf = sceCdStop();
break;
case CDVDFSV_NCMD_PAUSE:
case CD_NCMD_PAUSE:
*(int *)buf = sceCdPause();
break;
case CDVDFSV_NCMD_STREAM:
case CD_NCMD_STREAM:
cdvd_Stsubcmdcall(buf);
break;
case CDVDFSV_NCMD_IOPMREAD:
case CD_NCMD_READIOPMEM:
cdvd_readiopm(buf);
break;
case CDVDFSV_NCMD_DISKRDY:
case CD_NCMD_DISKREADY:
*(int *)buf = sceCdDiskReady(0);
break;
case CDVDFSV_NCMD_READCHAIN:
case CD_NCMD_READCHAIN:
cdvd_readchain(buf);
break;
case CDVDFSV_NCMD_READDISKID:
case CD_NCMD_READDISKID:
rpcNCmd_cdreadDiskID(buf);
break;
case CDVDFSV_NCMD_DISKTYPE:
case CD_NCMD_DISKTYPE:
rpcNCmd_cdgetdisktype(buf);
break;
default:
Expand Down
66 changes: 33 additions & 33 deletions modules/iopcore/cdvdfsv/scmd.c
Expand Up @@ -38,24 +38,24 @@ static inline void rpcSCmd_cdsettimeout(void *buf);
static inline void rpcSCmd_cdreadModelID(void *buf);
static inline void rpcSCmd_cdreaddvddualinfo(void *buf);

enum CDVDFSV_SCMD {
CDVDFSV_SCMD_READCLOCK = 0x01,
CDVDFSV_SCMD_WRITECLOCK,
CDVDFSV_SCMD_DISKTYPE,
CDVDFSV_SCMD_GETERROR,
CDVDFSV_SCMD_TRAYREQ,
CDVDFSV_SCMD_APPLYSCMD = 0x0B,
CDVDFSV_SCMD_STATUS,
CDVDFSV_SCMD_BREAK = 0x16,
CDVDFSV_SCMD_CANCELPOFF = 0x1F,
CDVDFSV_SCMD_BLUELEDCTRL,
CDVDFSV_SCMD_POWEROFF,
CDVDFSV_SCMD_MMODE,
CDVDFSV_SCMD_THREADPRIO,
CDVDFSV_SCMD_READGUID,
CDVDFSV_SCMD_SETTIMEOUT,
CDVDFSV_SCMD_READMODELID,
CDVDFSV_SCMD_READDUALINFO
enum CD_SCMD_CMDS {
CD_SCMD_READCLOCK = 0x01,
CD_SCMD_WRITECLOCK,
CD_SCMD_GETDISKTYPE,
CD_SCMD_GETERROR,
CD_SCMD_TRAYREQ,
CD_SCMD_SCMD = 0x0B,
CD_SCMD_STATUS,
CD_SCMD_BREAK = 0x16,
CD_SCMD_CANCELPOWEROFF = 0x1F,
CD_SCMD_BLUELEDCTRL,
CD_SCMD_POWEROFF,
CD_SCMD_MMODE,
CD_SCMD_SETTHREADPRI,
CD_SCMD_READGUID,
CD_SCMD_SETTIMEOUT,
CD_SCMD_READMODELID,
CD_SCMD_READDUALINFO
};

//-------------------------------------------------------------------------
Expand Down Expand Up @@ -126,49 +126,49 @@ static void *cbrpc_cdvdScmds(int fno, void *buf, int size)
{ // CD SCMD RPC callback

switch (fno) {
case CDVDFSV_SCMD_READCLOCK:
case CD_SCMD_READCLOCK:
rpcSCmd_cdreadclock(buf);
break;
case CDVDFSV_SCMD_DISKTYPE:
case CD_SCMD_GETDISKTYPE:
*(int *)buf = sceCdGetDiskType();
break;
case CDVDFSV_SCMD_GETERROR:
case CD_SCMD_GETERROR:
*(int *)buf = sceCdGetError();
break;
case CDVDFSV_SCMD_TRAYREQ:
case CD_SCMD_TRAYREQ:
rpcSCmd_cdtrayreq(buf);
break;
case CDVDFSV_SCMD_APPLYSCMD:
case CD_SCMD_SCMD:
rpcSCmd_cdapplySCmd(buf);
break;
case CDVDFSV_SCMD_STATUS:
case CD_SCMD_STATUS:
*(int *)buf = sceCdStatus();
break;
case CDVDFSV_SCMD_BREAK:
case CD_SCMD_BREAK:
*(int *)buf = sceCdBreak();
break;
case CDVDFSV_SCMD_CANCELPOFF:
case CD_SCMD_CANCELPOWEROFF:
*(int *)buf = 1;
break;
case CDVDFSV_SCMD_POWEROFF:
case CD_SCMD_POWEROFF:
*(int *)buf = sceCdPowerOff((u32 *)buf);
break;
case CDVDFSV_SCMD_MMODE:
case CD_SCMD_MMODE:
*(int *)buf = sceCdMmode(*(int *)buf);
break;
case CDVDFSV_SCMD_THREADPRIO:
case CD_SCMD_SETTHREADPRI:
*(int *)buf = sceCdChangeThreadPriority(*(int *)buf);
break;
case CDVDFSV_SCMD_READGUID:
case CD_SCMD_READGUID:
rpcSCmd_cdreadGUID(buf);
break;
case CDVDFSV_SCMD_SETTIMEOUT:
case CD_SCMD_SETTIMEOUT:
rpcSCmd_cdsettimeout(buf);
break;
case CDVDFSV_SCMD_READMODELID:
case CD_SCMD_READMODELID:
rpcSCmd_cdreadModelID(buf);
break;
case CDVDFSV_SCMD_READDUALINFO:
case CD_SCMD_READDUALINFO:
rpcSCmd_cdreaddvddualinfo(buf);
break;
default:
Expand Down

0 comments on commit b73847d

Please sign in to comment.