PS2SDK
PS2 Homebrew Libraries
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
_
a
c
d
e
f
g
i
l
m
n
p
q
r
s
t
u
v
Variables
_
c
d
f
g
i
k
m
n
p
q
r
s
t
u
v
w
Typedefs
a
d
h
i
l
m
n
p
r
s
t
w
Enumerations
_
a
c
d
g
i
l
m
n
o
p
s
t
v
Enumerator
c
d
e
g
i
n
p
s
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
p
q
r
s
t
u
v
w
z
▼
PS2SDK
PS2SDK - PS2DEV Open Source Project
PS2SDK - KERNEL LIBRARY
remote
►
Topics
►
Data Structures
▼
Files
▼
File List
►
common
►
ee
▼
iop
►
arcade
►
cdvd
►
debug
►
deckard
►
dev9
►
dvrp
►
fs
►
hdd
►
iLink
►
kernel
►
memorycard
►
network
►
security
►
sio
▼
sound
►
ahx
▼
audsrv
►
include
▼
src
►
adpcm.c
►
audsrv.c
►
audsrv_internal.h
►
cdrom.c
►
cdrom.h
►
common.c
►
common.h
debug_printf.h
hw.h
irx_imports.h
rpc_client.c
rpc_client.h
►
rpc_server.c
rpc_server.h
spu.h
►
upsamplers.c
►
upsamplers.h
►
clearspu
►
libsd
►
libsnd2
►
libspu2
►
ps2snd
►
rspu2drv
►
startup
►
system
►
tcpip
►
usb
►
tools
►
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
common.c
Go to the documentation of this file.
1
/*
2
# _____ ___ ____ ___ ____
3
# ____| | ____| | | |____|
4
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5
#-----------------------------------------------------------------------
6
# Copyright 2005, ps2dev - http://www.ps2dev.org
7
# Licenced under GNU Library General Public License version 2
8
*/
9
15
#include <
stdio.h
>
16
#include <
thbase.h
>
17
#include <
thsemap.h
>
18
#include <
loadcore.h
>
19
#include <
sysmem.h
>
20
#include <
intrman.h
>
21
#include <
sysclib.h
>
22
23
#include "
common.h
"
24
34
int
create_thread
(
void
*func,
int
priority,
void
*param)
35
{
36
int
tid;
37
iop_thread_t
thr;
38
39
thr.attr = TH_C;
40
thr.thread = func;
41
thr.option = 0;
42
thr.priority = priority;
43
thr.stacksize = 4096;
44
tid = CreateThread(&thr);
45
if
(tid < 0)
46
{
47
return
0;
48
}
49
50
StartThread(tid, param);
51
return
tid;
52
}
34
int
create_thread
(
void
*func,
int
priority,
void
*param) {
…
}
53
58
void
print_hex_buffer
(
unsigned
char
*ptr,
int
len)
59
{
60
int
p;
61
62
for
(p=0; p<len; p++)
63
{
64
if
(p > 0 && (p & 0x0f) == 0)
65
{
66
printf(
"\n"
);
67
}
68
69
printf(
"%02x "
, ptr[p]);
70
}
71
}
58
void
print_hex_buffer
(
unsigned
char
*ptr,
int
len) {
…
}
intrman.h
print_hex_buffer
void print_hex_buffer(unsigned char *ptr, int len)
Definition
common.c:58
create_thread
int create_thread(void *func, int priority, void *param)
Definition
common.c:34
common.h
loadcore.h
stdio.h
sysclib.h
sysmem.h
thbase.h
_iop_thread
Definition
thbase.h:40
thsemap.h
iop
sound
audsrv
src
common.c
Generated on Sun Mar 30 2025 21:53:10 for PS2SDK by
1.12.0