Disabling auto-refresh of game list by default, as it is causing bugs sometimes
[open-ps2-loader.git] / modules / debug / ps2link / hostlink.h
blob4ff72ace40f33aec483e4a0c08aa5a8aeb6651e0
1 /*********************************************************************
2 * Copyright (C) 2003 Tord Lindstrom (pukko@home.se)
3 * This file is subject to the terms and conditions of the PS2Link License.
4 * See the file LICENSE in the main directory of this distribution for more
5 * details.
6 */
8 #define PKO_PORT 0x4711
9 #define PKO_CMD_PORT 0x4712
10 #define PKO_PRINTF_PORT 0x4712
12 #define PKO_OPEN_CMD 0xbabe0111
13 #define PKO_OPEN_RLY 0xbabe0112
14 #define PKO_CLOSE_CMD 0xbabe0121
15 #define PKO_CLOSE_RLY 0xbabe0122
16 #define PKO_READ_CMD 0xbabe0131
17 #define PKO_READ_RLY 0xbabe0132
18 #define PKO_WRITE_CMD 0xbabe0141
19 #define PKO_WRITE_RLY 0xbabe0142
20 #define PKO_LSEEK_CMD 0xbabe0151
21 #define PKO_LSEEK_RLY 0xbabe0152
22 #define PKO_OPENDIR_CMD 0xbabe0161
23 #define PKO_OPENDIR_RLY 0xbabe0162
24 #define PKO_CLOSEDIR_CMD 0xbabe0171
25 #define PKO_CLOSEDIR_RLY 0xbabe0172
26 #define PKO_READDIR_CMD 0xbabe0181
27 #define PKO_READDIR_RLY 0xbabe0182
28 #define PKO_REMOVE_CMD 0xbabe0191
29 #define PKO_REMOVE_RLY 0xbabe0192
30 #define PKO_MKDIR_CMD 0xbabe01a1
31 #define PKO_MKDIR_RLY 0xbabe01a2
32 #define PKO_RMDIR_CMD 0xbabe01b1
33 #define PKO_RMDIR_RLY 0xbabe01b2
35 #define PKO_RESET_CMD 0xbabe0201
36 #define PKO_EXECIOP_CMD 0xbabe0202
37 #define PKO_EXECEE_CMD 0xbabe0203
38 #define PKO_POWEROFF_CMD 0xbabe0204
39 #define PKO_SCRDUMP_CMD 0xbabe0205
40 #define PKO_NETDUMP_CMD 0xbabe0206
42 #define PKO_DUMP_MEM 0xbabe0207
43 #define PKO_START_VU 0xbabe0208
44 #define PKO_STOP_VU 0xbabe0209
45 #define PKO_DUMP_REG 0xbabe020a
46 #define PKO_GSEXEC_CMD 0xbabe020b
47 #define PKO_WRITE_MEM 0xbabe020c
48 #define PKO_IOPEXCEP_CMD 0xbabe020d
49 #define PKO_SCRSHOT_CMD 0xbabe020e
51 #define PKO_RPC_RESET 1
52 #define PKO_RPC_EXECEE 2
53 #define PKO_RPC_DUMMY 3
54 #define PKO_RPC_SCRDUMP 4
55 #define PKO_RPC_NETDUMP 5
56 #define PKO_RPC_STARTVU 6
57 #define PKO_RPC_STOPVU 7
58 #define PKO_RPC_DUMPMEM 8
59 #define PKO_RPC_DUMPREG 9
60 #define PKO_RPC_GSEXEC 10
61 #define PKO_RPC_WRITEMEM 11
62 #define PKO_RPC_IOPEXCEP 12
63 #define PKO_RPC_SCRSHOT 13
65 #define PKO_MAX_PATH 256
67 #define REGDMA 0
68 #define REGINTC 1
69 #define REGTIMER 2
70 #define REGGS 3
71 #define REGSIF 4
72 #define REGFIFO 5
73 #define REGGIF 6
74 #define REGVIF0 7
75 #define REGVIF1 8
76 #define REGIPU 9
77 #define REGALL 10
78 #define REGVU0 11
79 #define REGVU1 12
81 typedef struct
83 unsigned int cmd;
84 unsigned short len;
85 } __attribute__((packed)) pko_pkt_hdr;
87 typedef struct
89 unsigned int cmd;
90 unsigned short len;
91 unsigned int retval;
92 } __attribute__((packed)) pko_pkt_file_rly;
94 typedef struct
96 unsigned int cmd;
97 unsigned short len;
98 int flags;
99 char path[PKO_MAX_PATH];
100 } __attribute__((packed)) pko_pkt_open_req;
102 typedef struct
104 unsigned int cmd;
105 unsigned short len;
106 int fd;
107 } __attribute__((packed)) pko_pkt_close_req;
109 typedef struct
111 unsigned int cmd;
112 unsigned short len;
113 int fd;
114 int nbytes;
115 } __attribute__((packed)) pko_pkt_read_req;
117 typedef struct
119 unsigned int cmd;
120 unsigned short len;
121 int retval;
122 int nbytes;
123 } __attribute__((packed)) pko_pkt_read_rly;
125 typedef struct
127 unsigned int cmd;
128 unsigned short len;
129 int fd;
130 int nbytes;
131 } __attribute__((packed)) pko_pkt_write_req;
133 typedef struct
135 unsigned int cmd;
136 unsigned short len;
137 int fd;
138 int offset;
139 int whence;
140 } __attribute__((packed)) pko_pkt_lseek_req;
142 typedef struct
144 unsigned int cmd;
145 unsigned short len;
146 char name[PKO_MAX_PATH];
147 } __attribute__((packed)) pko_pkt_remove_req;
149 typedef struct
151 unsigned int cmd;
152 unsigned short len;
153 int mode;
154 char name[PKO_MAX_PATH];
155 } __attribute__((packed)) pko_pkt_mkdir_req;
157 typedef struct
159 unsigned int cmd;
160 unsigned short len;
161 char name[PKO_MAX_PATH];
162 } __attribute__((packed)) pko_pkt_rmdir_req;
164 typedef struct
166 unsigned int cmd;
167 unsigned short len;
168 int fd;
169 } __attribute__((packed)) pko_pkt_dread_req;
171 typedef struct
173 unsigned int cmd;
174 unsigned short len;
175 int retval;
176 /* from io_common.h (fio_dirent_t) in ps2lib */
177 unsigned int mode;
178 unsigned int attr;
179 unsigned int size;
180 unsigned char ctime[8];
181 unsigned char atime[8];
182 unsigned char mtime[8];
183 unsigned int hisize;
184 char name[256];
185 } __attribute__((packed)) pko_pkt_dread_rly;
187 ////
189 typedef struct
191 unsigned int cmd;
192 unsigned short len;
193 } __attribute__((packed)) pko_pkt_reset_req;
195 typedef struct
197 unsigned int cmd;
198 unsigned short len;
199 int argc;
200 char argv[PKO_MAX_PATH];
201 } __attribute__((packed)) pko_pkt_execee_req;
203 typedef struct
205 unsigned int cmd;
206 unsigned short len;
207 int argc;
208 char argv[PKO_MAX_PATH];
209 } __attribute__((packed)) pko_pkt_execiop_req;
211 typedef struct
213 unsigned int cmd;
214 unsigned short len;
215 unsigned short size;
216 unsigned char file[PKO_MAX_PATH];
217 } __attribute__((packed)) pko_pkt_gsexec_req;
219 typedef struct
221 unsigned int cmd;
222 unsigned short len;
223 } __attribute__((packed)) pko_pkt_poweroff_req;
225 typedef struct
227 unsigned int cmd;
228 unsigned short len;
229 int vpu;
230 } __attribute__((packed)) pko_pkt_start_vu;
232 typedef struct
234 unsigned int cmd;
235 unsigned short len;
236 int vpu;
237 } __attribute__((packed)) pko_pkt_stop_vu;
239 typedef struct
241 unsigned int cmd;
242 unsigned short len;
243 unsigned int offset;
244 unsigned int size;
245 char argv[PKO_MAX_PATH];
246 } __attribute__((packed)) pko_pkt_mem_io;
248 typedef struct {
249 unsigned int cmd;
250 unsigned short len;
251 int regs;
252 char argv[PKO_MAX_PATH];
253 } __attribute__((packed)) pko_pkt_dump_regs;
255 typedef struct {
256 unsigned int cmd;
257 unsigned short len;
258 unsigned int regs[79];
259 } __attribute__((packed)) pko_pkt_send_regs;
261 typedef struct {
262 unsigned int cmd;
263 unsigned short len;
264 unsigned int base;
265 unsigned int width;
266 unsigned int height;
267 unsigned short psm;
268 } __attribute__((packed)) pko_pkt_screenshot;
270 #define PKO_MAX_WRITE_SEGMENT (1460 - sizeof(pko_pkt_write_req))
271 #define PKO_MAX_READ_SEGMENT (1460 - sizeof(pko_pkt_read_rly))