PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
accdvdi-entry.c
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
11#include "accdvd_internal.h"
12
13#define MODNAME "CD/DVD_Compatible"
14IRX_ID(MODNAME, 1, 1);
15// Text section hash:
16// 0530902ecc03cd3839dfd4b9d9367440
17// Known titles:
18// NM00005
19// NM00006
20// NM00008
21// Path strings:
22// /home/ueda/tmp/psalm-0.1.3/cdvd-iop-0.1.9/src/
23// /home/ueda/tmp/psalm-0.1.3/core-hdr-0.1.3/src/util/
24// TODO: diff with module text hash 3b63ef6314122a3f5bf1ae695def643b
25
26extern struct irx_export_table _exp_accdvd;
27
28#define acCdvdEntry _start
29
30static struct cdvd_modules Cdvd_modules[4] = {
31 {&acd_module_restart, &acd_module_start, &acd_module_status, &acd_module_stop},
32 {&cdfs_module_restart, &cdfs_module_start, &cdfs_module_status, &cdfs_module_stop},
33 {&cddrv_module_restart, &cddrv_module_start, &cddrv_module_status, &cddrv_module_stop},
34 {&cdc_module_restart, &cdc_module_start, &cdc_module_status, &cdc_module_stop}};
35
36int acCdvdModuleRestart(int argc, char **argv)
37{
38 int v2;
39 int index;
40
41 v2 = argc;
42 for ( index = 0; (unsigned int)index < 4; ++index )
43 {
44 int v5;
45 int ret;
46
47 v5 = Cdvd_modules[index].cm_restart(argc, argv);
48 ret = v5;
49 if ( v5 < 0 )
50 {
51 printf("accdvd:init_restart:%d: error %d\n", index, v5);
52 return ret;
53 }
54 argc = v2;
55 }
56 return 0;
57}
58
59int acCdvdModuleStart(int argc, char **argv)
60{
61 int v2;
62 int index;
63
64 v2 = argc;
65 for ( index = 0; (unsigned int)index < 4; ++index )
66 {
67 int v5;
68 int ret;
69
70 v5 = Cdvd_modules[index].cm_start(argc, argv);
71 ret = v5;
72 if ( v5 < 0 )
73 {
74 printf("accdvd:init_start:%d: error %d\n", index, v5);
75 return ret;
76 }
77 argc = v2;
78 }
79 return 0;
80}
81
82int acCdvdModuleStatus()
83{
84 int status;
85 int index;
86
87 status = 0;
88 index = 0;
89 while ( (unsigned int)index < 4 )
90 {
91 int ret;
92
93 ret = Cdvd_modules[index].cm_status();
94 if ( ret < 0 )
95 {
96 printf("accdvd:init_status:%d: error %d\n", index, ret);
97 return ret;
98 }
99 if ( status < ret )
100 status = ret;
101 index++;
102 }
103 return status;
104}
105
106int acCdvdModuleStop()
107{
108 int index;
109
110 index = 3;
111 while ( index >= 0 )
112 {
113 int v2;
114 int ret;
115
116 v2 = Cdvd_modules[index].cm_stop();
117 ret = v2;
118 if ( v2 < 0 )
119 {
120 printf("accdvd:init_stop:%d: error %d\n", index, v2);
121 return ret;
122 }
123 index--;
124 }
125 return 0;
126}
127
128int acCdvdEntry(int argc, char **argv)
129{
130 int ret;
131
132 ret = acCdvdModuleStart(argc, argv);
133 DelayThread(1000);
134 if ( ret < 0 )
135 return ret;
136 if ( RegisterLibraryEntries(&_exp_accdvd) != 0 )
137 return -16;
138 return 0;
139}