ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
sync.c
Go to the documentation of this file.
1
/*
2
# _____ ___ ____ ___ ____
3
# ____| | ____| | | |____|
4
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5
#-----------------------------------------------------------------------
6
# (c) 2009 Lion
7
# Licenced under Academic Free License version 2.0
8
# Review ps2sdk README & LICENSE files for further details.
9
*/
10
11
#include <
errno.h
>
12
#include <stdio.h>
13
#include <
kernel.h
>
14
#include <
libgs.h
>
15
16
#include "
internal.h
"
17
18
void
GsDrawSync
(
int
mode
)
19
{
20
switch
(
mode
)
21
{
22
case
0:
23
default
:
24
GsDmaWait
();
25
}
26
}
27
28
void
GsHSync
(
int
mode
)
29
{
30
unsigned
short
i;
31
32
switch
(
mode
)
33
{
34
case
0:
35
GS_SET_CSR_hsync_intrupt
(1);
36
while
(!
GS_GET_CSR_hsync_intrupt
);
37
break
;
38
default
:
39
if
(
mode
>1)
40
{
41
for
(i=0;i<
mode
;i++)
42
{
43
GS_SET_CSR_hsync_intrupt
(1);
44
while
(!
GS_GET_CSR_hsync_intrupt
);
45
}
46
}
47
}
48
}
49
50
void
GsVSync
(
int
mode
)
51
{
52
unsigned
short
i;
53
54
switch
(
mode
)
55
{
56
case
0:
//just wait
57
GS_SET_CSR_vsync_intrupt
(1);
58
while
(!
GS_GET_CSR_vsync_intrupt
);
59
break
;
60
default
:
// wait for num of vsync to pass
61
if
(
mode
>1)
62
{
63
64
for
(i=0;i<
mode
;i++)
65
{
66
GS_SET_CSR_vsync_intrupt
(1);
67
while
(!
GS_GET_CSR_vsync_intrupt
);
68
69
}
70
}
71
}
72
}
errno.h
kernel.h
GsDmaWait
void GsDmaWait(void)
Definition:
dma.c:148
libgs.h
GS_GET_CSR_hsync_intrupt
#define GS_GET_CSR_hsync_intrupt
Definition:
libgs.h:1326
GS_GET_CSR_vsync_intrupt
#define GS_GET_CSR_vsync_intrupt
Definition:
libgs.h:1329
GS_SET_CSR_vsync_intrupt
#define GS_SET_CSR_vsync_intrupt(val)
Definition:
libgs.h:1297
GS_SET_CSR_hsync_intrupt
#define GS_SET_CSR_hsync_intrupt(val)
Definition:
libgs.h:1294
internal.h
mode
s32 mode
Definition:
rpc_client.c:15
GsDrawSync
void GsDrawSync(int mode)
Definition:
sync.c:18
GsVSync
void GsVSync(int mode)
Definition:
sync.c:50
GsHSync
void GsHSync(int mode)
Definition:
sync.c:28
ee
libgs
src
sync.c
Generated on Thu Feb 11 2021 11:42:22 for ps2sdk by
1.9.2