25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_ps2_gs.c,v 1.22 2006/12/30 13:30:58 debug Exp $ |
* $Id: dev_ps2_gs.c,v 1.23 2007/06/15 19:57:33 debug Exp $ |
29 |
* |
* |
30 |
* Playstation 2 "graphics system". |
* COMMENT: PlayStation 2 graphics system |
31 |
*/ |
*/ |
32 |
|
|
33 |
#include <stdio.h> |
#include <stdio.h> |
71 |
"PMODE", "SMODE1", "SMODE2", "SRFSH", |
"PMODE", "SMODE1", "SMODE2", "SRFSH", |
72 |
"SYNCH1", "SYNCH2", "SYNCV", "DISPFB1", |
"SYNCH1", "SYNCH2", "SYNCV", "DISPFB1", |
73 |
"DISPLAY1", "DISPFB2", "DISPLAY2", "EXTBUF", |
"DISPLAY1", "DISPFB2", "DISPLAY2", "EXTBUF", |
74 |
"EXTDATA", "EXTWRITE", "BGCOLOR" |
"EXTDATA", "EXTWRITE", "BGCOLOR" }; |
|
}; |
|
75 |
|
|
76 |
#define GS_S_CSR_REG 0x100 |
#define GS_S_CSR_REG 0x100 |
77 |
#define GS_S_IMR_REG 0x101 |
#define GS_S_IMR_REG 0x101 |
83 |
}; |
}; |
84 |
|
|
85 |
|
|
|
/* |
|
|
* dev_ps2_gs_access(): |
|
|
*/ |
|
86 |
DEVICE_ACCESS(ps2_gs) |
DEVICE_ACCESS(ps2_gs) |
87 |
{ |
{ |
88 |
|
struct gs_data *d = extra; |
89 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
90 |
size_t i; |
size_t i; |
91 |
int regnr; |
int regnr; |
|
struct gs_data *d = extra; |
|
92 |
|
|
93 |
if (writeflag == MEM_WRITE) |
if (writeflag == MEM_WRITE) |
94 |
idata = memory_readmax64(cpu, data, len); |
idata = memory_readmax64(cpu, data, len); |
144 |
struct gs_data *d; |
struct gs_data *d; |
145 |
char str[100]; |
char str[100]; |
146 |
|
|
147 |
d = malloc(sizeof(struct gs_data)); |
CHECK_ALLOCATION(d = malloc(sizeof(struct gs_data))); |
|
if (d == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
148 |
memset(d, 0, sizeof(struct gs_data)); |
memset(d, 0, sizeof(struct gs_data)); |
149 |
|
|
150 |
snprintf(str, sizeof(str) - 1, "ps2_gif addr=0x%llx", |
snprintf(str, sizeof(str) - 1, "ps2_gif addr=0x%llx", |