|
| 1 | +/* |
| 2 | +# _____ ___ ____ ___ ____ |
| 3 | +# ____| | ____| | | |____| |
| 4 | +# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
| 5 | +#----------------------------------------------------------------------- |
| 6 | +# Licenced under Academic Free License version 2.0 |
| 7 | +# Review ps2sdk README & LICENSE files for further details. |
| 8 | +*/ |
| 9 | + |
| 10 | +/** |
| 11 | + * @file |
| 12 | + * DECI2 |
| 13 | + */ |
| 14 | + |
| 15 | +#include "kernel.h" |
| 16 | + |
| 17 | +// actual size? |
| 18 | +static char userarea[56]; |
| 19 | + |
| 20 | +int sceDeci2Open(unsigned short protocol, void *opt, |
| 21 | + void (*handler)(int event, int param, void *opt)) |
| 22 | +{ |
| 23 | + |
| 24 | + u32 args[4]; |
| 25 | + |
| 26 | + args[0] = protocol & 0xffff; |
| 27 | + args[1] = (u32)opt; |
| 28 | + args[2] = (u32)handler; |
| 29 | + args[3] = (u32)UNCACHED_SEG(userarea); |
| 30 | + |
| 31 | + return Deci2Call(1, args); |
| 32 | +} |
| 33 | + |
| 34 | +int sceDeci2Close(int s) |
| 35 | +{ |
| 36 | + u32 args[4]; |
| 37 | + |
| 38 | + args[0] = s; |
| 39 | + |
| 40 | + return Deci2Call(2, args); |
| 41 | +} |
| 42 | + |
| 43 | +int sceDeci2ReqSend(int s, char dest) |
| 44 | +{ |
| 45 | + u32 args[4]; |
| 46 | + |
| 47 | + args[0] = s; |
| 48 | + args[1] = dest; |
| 49 | + |
| 50 | + return Deci2Call(3, args); |
| 51 | +} |
| 52 | + |
| 53 | +void sceDeci2Poll(int s) |
| 54 | +{ |
| 55 | + u32 args[4]; |
| 56 | + |
| 57 | + args[0] = s; |
| 58 | + |
| 59 | + Deci2Call(4, args); |
| 60 | +} |
| 61 | + |
| 62 | +int sceDeci2ExRecv(int s, void *buf, unsigned short len) |
| 63 | +{ |
| 64 | + u32 args[4]; |
| 65 | + |
| 66 | + args[0] = s; |
| 67 | + args[1] = (u32)buf; |
| 68 | + args[2] = len & 0xffff; |
| 69 | + |
| 70 | + return Deci2Call(-5, args); |
| 71 | +} |
| 72 | + |
| 73 | +int sceDeci2ExSend(int s, void *buf, unsigned short len) |
| 74 | +{ |
| 75 | + u32 args[4]; |
| 76 | + |
| 77 | + args[0] = s; |
| 78 | + args[1] = (u32)buf; |
| 79 | + args[2] = len & 0xffff; |
| 80 | + |
| 81 | + return Deci2Call(-6, args); |
| 82 | +} |
| 83 | + |
| 84 | +int sceDeci2ExReqSend(int s, char dest) |
| 85 | +{ |
| 86 | + u32 args[4]; |
| 87 | + |
| 88 | + args[0] = s; |
| 89 | + args[1] = dest; |
| 90 | + |
| 91 | + return Deci2Call(-7, args); |
| 92 | +} |
| 93 | + |
| 94 | +int sceDeci2ExLock(int s) |
| 95 | +{ |
| 96 | + u32 args[4]; |
| 97 | + |
| 98 | + args[0] = s; |
| 99 | + |
| 100 | + return Deci2Call(-8, args); |
| 101 | +} |
| 102 | + |
| 103 | +int sceDeci2ExUnLock(int s) |
| 104 | +{ |
| 105 | + u32 args[4]; |
| 106 | + |
| 107 | + args[0] = s; |
| 108 | + |
| 109 | + return Deci2Call(-9, args); |
| 110 | +} |
| 111 | + |
| 112 | +int kputs(char *s) |
| 113 | +{ |
| 114 | + u32 args[4]; |
| 115 | + |
| 116 | + args[0] = (u32)s; |
| 117 | + |
| 118 | + return Deci2Call(16, args); |
| 119 | +} |
0 commit comments