ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
scmd.c
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 ## (C) 2002 Nicholas Van Veen (nickvv@xtra.co.nz)
7 # 2003 loser (loser@internalreality.com)
8 # (c) 2004 Marcus R. Brown <mrbrown@0xd6.org> Licenced under Academic Free License version 2.0
9 # Review ps2sdk README & LICENSE files for further details.
10 */
11 
22 #include <stdio.h>
23 #include <kernel.h>
24 #include <sifrpc.h>
25 #include <libcdvd.h>
26 #include <libcdvd-rpc.h>
27 #include <string.h>
28 #include <time.h>
29 #include <osd_config.h>
30 
31 #include "internal.h"
32 
34 #define CD_SERVER_SCMD 0x80000593
35 
72 };
73 
74 typedef union {
77  u8 bcertify[4];
79  struct cdvdScmdParam scmd;
80  struct cdvdDecSetParam decSet;
81  struct cdvdReadWriteNvmParam nvm;
82  u8 id[8];
83  char mname[16];
84  u8 data[0x420];
86 
87 #ifdef F__scmd_internals
88 int bindSCmd = -1;
89 
90 SifRpcClientData_t clientSCmd __attribute__ ((aligned(64)));
91 
92 int sCmdSemaId = -1;
93 
94 u8 sCmdRecvBuff[0x440] __attribute__ ((aligned(64)));
95 sCmdSendParams_t sCmdSendBuff __attribute__ ((aligned(64)));
96 
97 int sCmdNum = 0;
98 
100 #endif
101 
102 extern int bindSCmd;
104 extern int sCmdSemaId;
105 extern u8 sCmdRecvBuff[];
107 extern int sCmdNum;
108 
109 extern int CdConfigRdWrNumBlocks;
110 
112 
113 int _CdCheckSCmd(int cmd);
114 
115 /* S-Command Functions */
116 
117 #ifdef F_sceCdReadClock
118 int sceCdReadClock(sceCdCLOCK * clock)
119 {
121  return 0;
122 
123  if (CdDebug > 0)
124  printf("Libcdvd call Clock read 1\n");
125 
126  if (SifCallRpc(&clientSCmd, CD_SCMD_READCLOCK, 0, NULL, 0, sCmdRecvBuff, 16, NULL, NULL) < 0) {
128  return 0;
129  }
130 
131  memcpy(clock, UNCACHED_SEG(sCmdRecvBuff + 4), 8);
132 
133  if (CdDebug > 0)
134  printf("Libcdvd call Clock read 2\n");
135 
137  return *(int *) UNCACHED_SEG(sCmdRecvBuff);
138 }
139 #endif
140 
141 #ifdef F_time
142 /*
143  * newlib function, unfortunately depends on the 'cdvd' library.
144  * In libc there is a dummy 'time' function declared as WEAK.
145  * In cdvd there is a working 'time' function declared as STRONG
146  * Include libcdvd if you need to use the time function.
147  */
148 time_t time(time_t *t)
149 {
150  sceCdCLOCK ps2tim;
151  struct tm tim;
152  time_t tim2;
153 
154  sceCdReadClock(&ps2tim);
155  configConvertToGmtTime(&ps2tim);
156  //configConvertToLocalTime(&ps2tim);
157  convertfrombcd(&ps2tim);
158 #ifdef DEBUG
159  printf("ps2time: %d-%d-%d %d:%d:%d\n",
160  ps2tim.day,
161  ps2tim.month,
162  ps2tim.year,
163  ps2tim.hour,
164  ps2tim.minute,
165  ps2tim.second);
166 #endif
167  tim.tm_sec = ps2tim.second;
168  tim.tm_min = ps2tim.minute;
169  tim.tm_hour = ps2tim.hour;
170  tim.tm_mday = ps2tim.day;
171  tim.tm_mon = ps2tim.month - 1;
172  tim.tm_year = ps2tim.year + 100;
173 
174  tim2 = mktime(&tim);
175 
176  if(t != NULL)
177  *t = tim2;
178 
179  return tim2;
180 }
181 #endif
182 
183 #ifdef F_sceCdWriteClock
184 int sceCdWriteClock(const sceCdCLOCK * clock)
185 {
186  int result;
187 
189  return 0;
190 
191  memcpy(&sCmdSendBuff.clock, clock, 8);
192 
195  return 0;
196  }
197 
198  memcpy((sceCdCLOCK *)clock, UNCACHED_SEG(sCmdRecvBuff + 4), 8);
199  result = *(int *) UNCACHED_SEG(sCmdRecvBuff);
200 
202  return result;
203 }
204 #endif
205 
206 #ifdef F_sceCdGetDiskType
207 int sceCdGetDiskType(void)
208 {
209  int result;
210 
212  return 0;
213 
216  return 0;
217  }
218 
219  result = *(int *) UNCACHED_SEG(sCmdRecvBuff);
220 
222  return result;
223 }
224 #endif
225 
226 #ifdef F_sceCdGetError
227 int sceCdGetError(void)
228 {
229  int result;
230 
231  if (_CdCheckSCmd(CD_SCMD_GETERROR) == 0)
232  return -1;
233 
234  if (SifCallRpc(&clientSCmd, CD_SCMD_GETERROR, 0, NULL, 0, sCmdRecvBuff, 4, NULL, NULL) < 0) {
236  return -1;
237  }
238 
239  result = *(int *) UNCACHED_SEG(sCmdRecvBuff);
240 
242  return result;
243 }
244 #endif
245 
246 #ifdef F_sceCdTrayReq
247 int sceCdTrayReq(int param, u32 * traychk)
248 {
249  int result;
250 
251  if (_CdCheckSCmd(CD_SCMD_TRAYREQ) == 0)
252  return 0;
253 
254  sCmdSendBuff.s32arg = param;
255 
258  return 0;
259  }
260 
261  if (traychk)
262  *traychk = *(u32 *) UNCACHED_SEG(sCmdRecvBuff + 4);
263  result = *(int *) UNCACHED_SEG(sCmdRecvBuff);
264 
266  return result;
267 }
268 #endif
269 
270 #ifdef F_sceCdApplySCmd
271 int sceCdApplySCmd(u8 cmdNum, const void *inBuff, u16 inBuffSize, void *outBuff, u16 outBuffSize)
272 {
273  if (_CdCheckSCmd(CD_SCMD_SCMD) == 0)
274  return 0;
275 
276  sCmdSendBuff.scmd.cmdNum = cmdNum;
277  sCmdSendBuff.scmd.inBuffSize = inBuffSize;
278  memset(sCmdSendBuff.scmd.inBuff, 0, 16);
279  if (inBuff)
280  memcpy(sCmdSendBuff.scmd.inBuff, inBuff, inBuffSize);
281 
282  if (SifCallRpc(&clientSCmd, CD_SCMD_SCMD, 0, &sCmdSendBuff, 20, sCmdRecvBuff, 16, NULL, NULL) < 0) {
284  return 0;
285  }
286 
287  if (outBuff)
288  memcpy(outBuff, UNCACHED_SEG(sCmdRecvBuff), outBuffSize);
290  return 1;
291 }
292 #endif
293 
294 #ifdef F_sceCdStatus
295 int sceCdStatus(void)
296 {
297  int result;
298 
299  if (_CdCheckSCmd(CD_SCMD_STATUS) == 0)
300  return -1;
301 
302  if (SifCallRpc(&clientSCmd, CD_SCMD_STATUS, 0, NULL, 0, sCmdRecvBuff, 4, NULL, NULL) < 0) {
304  return -1;
305  }
306 
307  if (CdDebug >= 2)
308  printf("status called\n");
309  result = *(int *) UNCACHED_SEG(sCmdRecvBuff);
310 
312  return result;
313 }
314 #endif
315 
316 #ifdef F_sceCdBreak
317 int sceCdBreak(void)
318 {
319  int result;
320 
321  if (_CdCheckSCmd(CD_SCMD_BREAK) == 0)
322  return 0;
323 
324  if (SifCallRpc(&clientSCmd, CD_SCMD_BREAK, 0, NULL, 0, sCmdRecvBuff, 4, NULL, NULL) < 0) {
326  return 0;
327  }
328  result = *(int *) UNCACHED_SEG(sCmdRecvBuff);
329 
331  return result;
332 }
333 #endif
334 
335 #ifdef F_sceCdCancelPOffRdy
337 {
338  int status;
339 
341  return 0;
342 
345  return 0;
346  }
347 
348  *result = *(u32 *) UNCACHED_SEG(sCmdRecvBuff + 4);
349  status = *(int *) UNCACHED_SEG(sCmdRecvBuff);
350 
352  return status;
353 }
354 #endif
355 
356 #ifdef F_sceCdBlueLedCtrl
357 int sceCdBlueLedCtrl(u8 control, u32 *result)
358 {
359  int status;
360 
362  return 0;
363 
364  sCmdSendBuff.u32arg = control;
367  return 0;
368  }
369 
370  *result = *(u32 *) UNCACHED_SEG(sCmdRecvBuff + 4);
371  status = *(int *) UNCACHED_SEG(sCmdRecvBuff);
372 
374  return status;
375 }
376 #endif
377 
378 #ifdef F_sceCdPowerOff
379 int sceCdPowerOff(u32 * result)
380 {
381  int status;
382 
383  if (_CdCheckSCmd(CD_SCMD_POWEROFF) == 0)
384  return 0;
385 
386  if (SifCallRpc(&clientSCmd, CD_SCMD_POWEROFF, 0, NULL, 0, sCmdRecvBuff, 8, NULL, NULL) < 0) {
388  return 0;
389  }
390 
391  *result = *(u32 *) UNCACHED_SEG(sCmdRecvBuff + 4);
392  status = *(int *) UNCACHED_SEG(sCmdRecvBuff);
393 
395  return status;
396 }
397 #endif
398 
399 #ifdef F_sceCdMmode
400 int sceCdMmode(int media)
401 {
402  int result;
403 
404  if (_CdCheckSCmd(CD_SCMD_MMODE) == 0)
405  return 0;
406 
407  sCmdSendBuff.s32arg = media;
410  return 0;
411  }
412 
413  result = *(int *) UNCACHED_SEG(sCmdRecvBuff);
414 
416  return result;
417 }
418 #endif
419 
420 #ifdef F_sceCdChangeThreadPriority
421 int sceCdChangeThreadPriority(int priority)
422 {
423  int result;
424 
426  return 0;
427 
428  sCmdSendBuff.s32arg = priority;
431  return 0;
432  }
433 
434  result = *(int *) UNCACHED_SEG(sCmdRecvBuff);
435 
437  return result;
438 }
439 #endif
440 
441 #ifdef F__CdCheckSCmd
442 int _CdCheckSCmd(int cur_cmd)
443 {
444  _CdSemaInit();
445  if (PollSema(sCmdSemaId) != sCmdSemaId) {
446  if (CdDebug > 0)
447  printf("Scmd fail sema cur_cmd:%d keep_cmd:%d\n", cur_cmd, sCmdNum);
448  return 0;
449  }
450  sCmdNum = cur_cmd;
452  if (_CdSyncS(1)) {
454  return 0;
455  }
456 
457  SifInitRpc(0);
458  if (bindSCmd >= 0)
459  return 1;
460  while (1) {
461  if (SifBindRpc(&clientSCmd, CD_SERVER_SCMD, 0) < 0) {
462  if (CdDebug > 0)
463  printf("Libcdvd bind err S cmd\n");
464  }
465  if (clientSCmd.server != 0)
466  break;
467 
468  nopdelay();
469  }
470 
471  bindSCmd = 0;
472  return 1;
473 }
474 #endif
475 
476 #ifdef F_sceCdForbidRead
477 int sceCdForbidRead(u32 *status)
478 {
479  int result;
480 
481  if(_CdCheckSCmd(CD_SCMD_FORBID_READ)==0) return 0;
483  *status = ((u32 *)UNCACHED_SEG(sCmdRecvBuff))[1];
484  result = ((int *)UNCACHED_SEG(sCmdRecvBuff))[0];
485  }else{
486  result = 0;
487  }
489  return result;
490 }
491 #endif
492 
493 #ifdef F_sceCdSpinCtrlEE
494 int sceCdSpinCtrlEE(u32 speed)
495 {
496  int result;
497 
498  if(_CdCheckSCmd(CD_SCMD_SPIN_CTRL)==0) return 0;
499  sCmdSendBuff.u32arg = speed;
501  result = ((int *)UNCACHED_SEG(sCmdRecvBuff))[0];
502  }else{
503  result = 0;
504  }
506  return result;
507 }
508 #endif
509 
510 #ifdef F_sceCdBootCertify
511 int sceCdBootCertify(const u8 *romname)
512 {
513  int result;
514 
515  if(_CdCheckSCmd(CD_SCMD_BOOT_CERTIFY)==0) return 0;
516 
517  memcpy(sCmdSendBuff.bcertify, romname, 4);
520  }else{
521  result=0;
522  }
523 
525  return result;
526 }
527 #endif
528 
529 #ifdef F_sceCdReadSUBQ
530 int sceCdReadSUBQ(void *buffer, u32 *status)
531 {
532  int result;
533 
534  if(_CdCheckSCmd(CD_SCMD_READ_SUBQ)==0) return 0;
535 
537  memcpy(buffer, UNCACHED_SEG(&sCmdRecvBuff[8]), 0x12);
538  *status=*(u32 *)UNCACHED_SEG(&sCmdRecvBuff[4]);
540  }
541  else{
542  result=0;
543  }
544 
546  return result;
547 }
548 #endif
549 
550 #ifdef F_sceCdForbidDVDP
552 {
553  int status;
554 
555  if(_CdCheckSCmd(CD_SCMD_FORBID_DVDP) == 0) return 0;
556 
558  *result = ((u32 *)UNCACHED_SEG(sCmdRecvBuff))[1];
559  status = *(int*)UNCACHED_SEG(sCmdRecvBuff);
560  }else{
561  status = 0;
562  }
563 
565  return status;
566 }
567 #endif
568 
569 #ifdef F_sceCdAutoAdjustCtrl
571 {
572  int status;
573 
574  if(_CdCheckSCmd(CD_SCMD_AUTO_ADJUST_CTRL) == 0) return 0;
575 
578  *result = ((u32 *)UNCACHED_SEG(sCmdRecvBuff))[1];
579  status = *(int*)UNCACHED_SEG(sCmdRecvBuff);
580  }else{
581  status = 0;
582  }
583 
585  return status;
586 }
587 #endif
588 
589 #ifdef F_sceCdDecSet
590 int sceCdDecSet(unsigned char arg1, unsigned char arg2, unsigned char shift)
591 {
592  int result;
593 
594  if(_CdCheckSCmd(CD_SCMD_DEC_SET)==0) return 0;
595 
596  sCmdSendBuff.decSet.arg1 = arg1;
597  sCmdSendBuff.decSet.arg2 = arg2;
598  sCmdSendBuff.decSet.shift = shift;
599 
601  result = *(int*)UNCACHED_SEG(sCmdRecvBuff);
602  }else{
603  result = 0;
604  }
605 
607  return result;
608 }
609 #endif
610 
611 #ifdef F_sceCdSetHDMode
613 {
614  int result;
615 
616  if(_CdCheckSCmd(CD_SCMD_SET_HD_MODE)==0) return 0;
620  }else{
621  result=0;
622  }
624  return result;
625 }
626 #endif
627 
628 #ifdef F_sceCdOpenConfig
629 int sceCdOpenConfig(int block, int mode, int NumBlocks, u32 *status){
630  int result;
631 
632  if(NumBlocks<0x45){
633  if(_CdCheckSCmd(CD_SCMD_OPEN_CONFIG) == 0) return 0;
634 
635  sCmdSendBuff.u32arg = ((NumBlocks&0xFF)<<16) | (mode&0xFF) | ((block&0xFF)<<8);
636  CdConfigRdWrNumBlocks = NumBlocks;
638  *status = ((u32 *)UNCACHED_SEG(sCmdRecvBuff))[1];
639  result = ((int *)UNCACHED_SEG(sCmdRecvBuff))[0];
640  }
641  else result = 0;
642 
644  }
645  else result=0;
646 
647  return result;
648 }
649 #endif
650 
651 #ifdef F_sceCdCloseConfig
653  int status;
654 
655  if(_CdCheckSCmd(CD_SCMD_CLOSE_CONFIG) == 0) return 0;
656 
658  *result = ((u32 *)UNCACHED_SEG(sCmdRecvBuff))[1];
659  status = *(int*)UNCACHED_SEG(sCmdRecvBuff);
660  }else{
661  status = 0;
662  }
663 
665  return status;
666 }
667 #endif
668 
669 #ifdef F_sceCdReadConfig
670 int sceCdReadConfig(void *buffer, u32 *result){
671  int status;
672 
673  if(_CdCheckSCmd(CD_SCMD_READ_CONFIG) == 0) return 0;
674 
676  *result = ((int *)UNCACHED_SEG(sCmdRecvBuff))[1];
678  status = *(int*)UNCACHED_SEG(sCmdRecvBuff);
679  }else{
680  status = 0;
681  }
682 
684  return status;
685 }
686 #endif
687 
688 #ifdef F_sceCdWriteConfig
689 int sceCdWriteConfig(const void *buffer, u32 *result){
690  int status;
691 
692  if(_CdCheckSCmd(CD_SCMD_WRITE_CONFIG) == 0) return 0;
693 
696  *result = ((int *)UNCACHED_SEG(sCmdRecvBuff))[1];
697  status = *(int*)UNCACHED_SEG(sCmdRecvBuff);
698  }else{
699  status = 0;
700  }
701 
703 
704  return status;
705 }
706 #endif
707 
708 #ifdef F_sceCdReadNVM
709 int sceCdReadNVM(u32 address, u16 *data, u8 *result){
710  int status;
711 
712  if(_CdCheckSCmd(CD_SCMD_READ_NVM) == 0) return 0;
713 
714  sCmdSendBuff.nvm.address = address;
715  sCmdSendBuff.nvm.value = 0;
716  sCmdSendBuff.nvm.pad = 0;
717 
719  *data = *(unsigned short int *)UNCACHED_SEG(&sCmdRecvBuff[8]);
720  *result = *(u8 *)UNCACHED_SEG(&sCmdRecvBuff[10]);
721  status = *(int *)UNCACHED_SEG(sCmdRecvBuff);
722  }else{
723  status=0;
724  }
725 
727  return status;
728 }
729 #endif
730 
731 #ifdef F_sceCdWriteNVM
732 int sceCdWriteNVM(u32 address, u16 data, u8 *result){
733  int status;
734 
735  if(_CdCheckSCmd(CD_SCMD_WRITE_NVM) == 0) return 0;
736 
737  sCmdSendBuff.nvm.address=address;
739  sCmdSendBuff.nvm.pad = 0;
740 
742  *result = *(u8 *)UNCACHED_SEG(&sCmdRecvBuff[10]);
743  status = *(int *)UNCACHED_SEG(sCmdRecvBuff);
744  }else{
745  status = 0;
746  }
747 
749  return status;
750 }
751 #endif
752 
753 #ifdef F_sceCdRI
754 int sceCdRI(unsigned char *buffer, u32 *result){
755  int status;
756 
757  if(_CdCheckSCmd(CD_SCMD_READ_ILINK_ID) == 0) return 0;
758 
760  memcpy(buffer, UNCACHED_SEG(&sCmdRecvBuff[8]), 8);
761  *result = *(u32 *)UNCACHED_SEG(&sCmdRecvBuff[4]);
762  status = *(int *)UNCACHED_SEG(sCmdRecvBuff);
763  }else{
764  status = 0;
765  }
766 
768  return status;
769 }
770 #endif
771 
772 #ifdef F_sceCdWI
773 int sceCdWI(const unsigned char *buffer, u32 *status){
774  int result;
775 
776  if(_CdCheckSCmd(CD_SCMD_WRITE_ILINK_ID) == 0) return 0;
777 
778  memcpy(sCmdSendBuff.id, buffer, 8);
780  *status = *(u32 *)UNCACHED_SEG(&sCmdRecvBuff[4]);
781  result = *(int *)UNCACHED_SEG(sCmdRecvBuff);
782  }else{
783  result = 0;
784  }
785 
787  return result;
788 }
789 #endif
790 
791 #ifdef F_sceCdReadConsoleID
792 int sceCdReadConsoleID(unsigned char *buffer, u32 *result){
793  int status;
794 
795  if(_CdCheckSCmd(CD_SCMD_READ_CONSOLE_ID) == 0) return 0;
796 
798  memcpy(buffer, UNCACHED_SEG(&sCmdRecvBuff[8]), 8);
799  *result = *(u32 *)UNCACHED_SEG(&sCmdRecvBuff[4]);
800  status = *(int *)UNCACHED_SEG(sCmdRecvBuff);
801  }else{
802  status = 0;
803  }
804 
806  return status;
807 }
808 #endif
809 
810 #ifdef F_sceCdWriteConsoleID
811 int sceCdWriteConsoleID(const unsigned char *buffer, u32 *result){
812  int status;
813 
814  if(_CdCheckSCmd(CD_SCMD_WRITE_CONSOLE_ID) == 0) return 0;
815 
816  memcpy(sCmdSendBuff.id, buffer, 8);
818  *result = *(u32 *)UNCACHED_SEG(&sCmdRecvBuff[4]);
819  status = *(int *)UNCACHED_SEG(sCmdRecvBuff);
820  }else{
821  status = 0;
822  }
823 
825  return status;
826 }
827 #endif
828 
829 #ifdef F_sceCdMV
830 int sceCdMV(unsigned char *buffer, u32 *result){
831  int status;
832 
833  if(_CdCheckSCmd(CD_SCMD_READ_MECHACON_VERSION) == 0) return 0;
834 
836 
837 #ifdef _XCDVD
838  memcpy(buffer, UNCACHED_SEG(&sCmdRecvBuff[8]), 4);
839 #else
840  memcpy(buffer, UNCACHED_SEG(&sCmdRecvBuff[8]), 3);
841 #endif
842  *result = *(u32 *)UNCACHED_SEG(&sCmdRecvBuff[4]);
843  status = *(int *)UNCACHED_SEG(sCmdRecvBuff);
844  }else{
845  status = 0;
846  }
847 
849  return status;
850 }
851 #endif
852 
853 #ifdef F_sceCdCtrlADout
854 int sceCdCtrlADout(int arg1, u32 *result){
855  int status;
856 
857  if(_CdCheckSCmd(CD_SCMD_CTRL_AD_OUT) == 0) return 0;
858 
859  sCmdSendBuff.s32arg = arg1;
861  *result = *(u32 *)UNCACHED_SEG(&sCmdRecvBuff[4]);
862  status = *(int *)UNCACHED_SEG(sCmdRecvBuff);
863  }else{
864  status = 0;
865  }
866 
868  return status;
869 }
870 #endif
871 
872 #ifdef F_sceCdRM
873 int sceCdRM(char *buffer, u32 *result){
874  int status;
875 
876  if(_CdCheckSCmd(CD_SCMD_READ_MODEL_NAME) == 0) return 0;
877 
879  memcpy(buffer, UNCACHED_SEG(&sCmdRecvBuff[8]), 16);
880  *result = *(u32 *)UNCACHED_SEG(&sCmdRecvBuff[4]);
881  status = *(int *)UNCACHED_SEG(sCmdRecvBuff);
882  }else{
883  status=0;
884  }
885 
887  return status;
888 }
889 #endif
890 
891 #ifdef F_sceCdWM
892 int sceCdWM(const char *buffer, u32 *result){
893  int status;
894 
895  if(_CdCheckSCmd(CD_SCMD_WRITE_MODEL_NAME) == 0) return 0;
896 
897  memcpy(sCmdSendBuff.mname, buffer, 16);
899  *result = *(u32 *)UNCACHED_SEG(&sCmdRecvBuff[4]);
900  status = *(int *)UNCACHED_SEG(sCmdRecvBuff);
901  }else{
902  status = 0;
903  }
904 
906  return status;
907 }
908 #endif
909 
910 #ifdef F__CdSyncS
911 int _CdSyncS(int mode)
912 {
913  if (mode == 0) {
914  if (CdDebug > 0)
915  printf("S cmd wait\n");
916  while (SifCheckStatRpc(&clientSCmd))
917  ;
918  return 0;
919  }
920 
921  return SifCheckStatRpc(&clientSCmd);
922 }
923 #endif
s32 SignalSema(s32 sema_id)
static void nopdelay(void)
Definition: kernel.h:141
s32 ReferThreadStatus(s32 thread_id, ee_thread_status_t *info)
s32 PollSema(s32 sema_id)
#define UNCACHED_SEG(x)
Definition: kernel.h:35
int sceCdBreak(void)
int sceCdGetError(void)
int sceCdCancelPOffRdy(u32 *result)
int sceCdPowerOff(u32 *result)
int sceCdReadSUBQ(void *buffer, u32 *status)
int sceCdSetHDMode(u32 mode)
int sceCdReadNVM(u32 address, u16 *data, u8 *result)
int sceCdCloseConfig(u32 *result)
int sceCdStatus(void)
int sceCdChangeThreadPriority(int priority)
int sceCdForbidRead(u32 *result)
int sceCdRM(char *buffer, u32 *status)
int sceCdReadConsoleID(u8 *buffer, u32 *result)
int sceCdReadClock(sceCdCLOCK *clock)
int sceCdWriteConfig(const void *buffer, u32 *result)
int sceCdWM(const char *buffer, u32 *status)
int sceCdWriteConsoleID(const u8 *buffer, u32 *status)
int sceCdGetDiskType(void)
int sceCdMmode(int media)
int sceCdWI(const u8 *buffer, u32 *result)
int sceCdAutoAdjustCtrl(int mode, u32 *result)
int sceCdBootCertify(const u8 *romname)
int sceCdReadConfig(void *buffer, u32 *result)
int sceCdMV(u8 *buffer, u32 *status)
int sceCdWriteNVM(u32 address, u16 data, u8 *result)
int sceCdRI(u8 *buffer, u32 *result)
int sceCdCtrlADout(int arg1, u32 *status)
int sceCdWriteClock(const sceCdCLOCK *clock)
int sceCdForbidDVDP(u32 *result)
int sceCdTrayReq(int param, u32 *traychk)
int sceCdDecSet(unsigned char arg1, unsigned char arg2, unsigned char shift)
int sceCdApplySCmd(u8 cmdNum, const void *inBuff, u16 inBuffSize, void *outBuff, u16 outBuffSize)
int sceCdSpinCtrlEE(u32 speed)
int sceCdOpenConfig(int block, int mode, int NumBlocks, u32 *status)
u32 data
Definition: libmouse.c:36
u32 time
Definition: libmouse.c:37
void configConvertToGmtTime(sceCdCLOCK *time)
void _CdSemaInit(void)
int CdDebug
ee_thread_status_t CdThreadParam
int CdThreadId
int _CdSyncS(int mode)
s32 mode
Definition: rpc_client.c:15
u8 buffer[128]
Definition: rpc_client.c:19
s32 result
Definition: rpc_client.c:23
int CdConfigRdWrNumBlocks
int sCmdSemaId
int _CdCheckSCmd(int cmd)
void convertfrombcd(sceCdCLOCK *time)
int sCmdNum
u8 sCmdRecvBuff[]
sCmdSendParams_t sCmdSendBuff
SifRpcClientData_t clientSCmd
#define CD_SERVER_SCMD
Definition: scmd.c:34
CD_SCMD_CMDS
Definition: scmd.c:36
@ CD_SCMD_WRITE_ILINK_ID
Definition: scmd.c:43
@ CD_SCMD_SPIN_CTRL
Definition: scmd.c:65
@ CD_SCMD_BREAK
Definition: scmd.c:58
@ CD_SCMD_STATUS
Definition: scmd.c:48
@ CD_SCMD_WRITECLOCK
Definition: scmd.c:38
@ CD_SCMD_READ_MECHACON_VERSION
Definition: scmd.c:56
@ CD_SCMD_READ_CONSOLE_ID
Definition: scmd.c:54
@ CD_SCMD_CLOSE_CONFIG
Definition: scmd.c:51
@ CD_SCMD_DEC_SET
Definition: scmd.c:46
@ CD_SCMD_WRITE_CONSOLE_ID
Definition: scmd.c:55
@ CD_SCMD_SET_HD_MODE
Definition: scmd.c:49
@ CD_SCMD_OPEN_CONFIG
Definition: scmd.c:50
@ CD_SCMD_READ_MODEL_NAME
Definition: scmd.c:62
@ CD_SCMD_SCMD
Definition: scmd.c:47
@ CD_SCMD_READCLOCK
Definition: scmd.c:37
@ CD_SCMD_FORBID_READ
Definition: scmd.c:64
@ CD_SCMD_WRITE_MODEL_NAME
Definition: scmd.c:63
@ CD_SCMD_READ_NVM
Definition: scmd.c:44
@ CD_SCMD_WRITE_CONFIG
Definition: scmd.c:53
@ CD_SCMD_CTRL_AD_OUT
Definition: scmd.c:57
@ CD_SCMD_SETTHREADPRI
Definition: scmd.c:71
@ CD_SCMD_READ_ILINK_ID
Definition: scmd.c:42
@ CD_SCMD_GETDISKTYPE
Definition: scmd.c:39
@ CD_SCMD_AUTO_ADJUST_CTRL
Definition: scmd.c:61
@ CD_SCMD_BLUELEDCTRL
Definition: scmd.c:68
@ CD_SCMD_MMODE
Definition: scmd.c:70
@ CD_SCMD_WRITE_NVM
Definition: scmd.c:45
@ CD_SCMD_READ_SUBQ
Definition: scmd.c:59
@ CD_SCMD_BOOT_CERTIFY
Definition: scmd.c:66
@ CD_SCMD_CANCELPOWEROFF
Definition: scmd.c:67
@ CD_SCMD_TRAYREQ
Definition: scmd.c:41
@ CD_SCMD_READ_CONFIG
Definition: scmd.c:52
@ CD_SCMD_FORBID_DVDP
Definition: scmd.c:60
@ CD_SCMD_POWEROFF
Definition: scmd.c:69
@ CD_SCMD_GETERROR
Definition: scmd.c:40
int bindSCmd
void SifInitRpc(int mode)
int SifCheckStatRpc(SifRpcClientData_t *cd)
int SifBindRpc(SifRpcClientData_t *client, int rpc_number, int mode)
int SifCallRpc(SifRpcClientData_t *client, int rpc_number, int mode, void *send, int ssize, void *receive, int rsize, SifRpcEndFunc_t end_function, void *end_param)
struct t_SifRpcServerData * server
Definition: sifrpc.h:142
u8 inBuff[16]
Definition: libcdvd-rpc.h:26
#define NULL
Definition: tamtypes.h:91
signed int s32
Definition: tamtypes.h:58
unsigned int u32
Definition: tamtypes.h:30
unsigned short u16
Definition: tamtypes.h:24
unsigned char u8
Definition: tamtypes.h:23
struct cdvdDecSetParam decSet
Definition: scmd.c:80
u8 id[8]
Definition: scmd.c:82
sceCdCLOCK clock
Definition: scmd.c:78
struct cdvdReadWriteNvmParam nvm
Definition: scmd.c:81
struct cdvdScmdParam scmd
Definition: scmd.c:79
s32 s32arg
Definition: scmd.c:75
u8 data[0x420]
Definition: scmd.c:84
u8 bcertify[4]
Definition: scmd.c:77
char mname[16]
Definition: scmd.c:83
u32 u32arg
Definition: scmd.c:76