25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_pvr.c,v 1.21 2007/04/28 09:19:52 debug Exp $ |
* $Id: dev_pvr.c,v 1.24 2007/06/15 19:57:33 debug Exp $ |
29 |
* |
* |
30 |
* PowerVR CLX2 (Graphics controller used in the Dreamcast). Implemented by |
* COMMENT: PowerVR CLX2 (graphics controller used in the Dreamcast) |
31 |
* reading http://www.ludd.luth.se/~jlo/dc/powervr-reg.txt and |
* |
32 |
|
* Implemented by reading http://www.ludd.luth.se/~jlo/dc/powervr-reg.txt and |
33 |
* http://mc.pp.se/dc/pvr.html, source code of various demos and KalistOS, |
* http://mc.pp.se/dc/pvr.html, source code of various demos and KalistOS, |
34 |
* and doing a lot of guessing. |
* and doing a lot of guessing. |
35 |
* |
* |
420 |
|
|
421 |
DEVICE_ACCESS(pvr_ta) |
DEVICE_ACCESS(pvr_ta) |
422 |
{ |
{ |
423 |
struct pvr_data *d = (struct pvr_data *) extra; |
struct pvr_data *d = extra; |
424 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
425 |
|
|
426 |
if (writeflag == MEM_WRITE) { |
if (writeflag == MEM_WRITE) { |
445 |
|
|
446 |
DEVICE_ACCESS(pvr) |
DEVICE_ACCESS(pvr) |
447 |
{ |
{ |
448 |
struct pvr_data *d = (struct pvr_data *) extra; |
struct pvr_data *d = extra; |
449 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
450 |
|
|
451 |
if (writeflag == MEM_WRITE) |
if (writeflag == MEM_WRITE) |
1175 |
DEVINIT(pvr) |
DEVINIT(pvr) |
1176 |
{ |
{ |
1177 |
struct machine *machine = devinit->machine; |
struct machine *machine = devinit->machine; |
1178 |
struct pvr_data *d = malloc(sizeof(struct pvr_data)); |
struct pvr_data *d; |
1179 |
struct pvr_data_alt *d_alt = malloc(sizeof(struct pvr_data_alt)); |
struct pvr_data_alt *d_alt; |
1180 |
if (d == NULL) { |
|
1181 |
fprintf(stderr, "out of memory\n"); |
CHECK_ALLOCATION(d = malloc(sizeof(struct pvr_data))); |
|
exit(1); |
|
|
} |
|
1182 |
memset(d, 0, sizeof(struct pvr_data)); |
memset(d, 0, sizeof(struct pvr_data)); |
1183 |
|
|
1184 |
|
CHECK_ALLOCATION(d_alt = malloc(sizeof(struct pvr_data_alt))); |
1185 |
memset(d_alt, 0, sizeof(struct pvr_data_alt)); |
memset(d_alt, 0, sizeof(struct pvr_data_alt)); |
1186 |
|
|
1187 |
d_alt->d = d; |
d_alt->d = d; |
1222 |
pvr_reset_ta(d); |
pvr_reset_ta(d); |
1223 |
|
|
1224 |
machine_add_tickfunction(machine, dev_pvr_fb_tick, d, |
machine_add_tickfunction(machine, dev_pvr_fb_tick, d, |
1225 |
PVR_FB_TICK_SHIFT, 0.0); |
PVR_FB_TICK_SHIFT); |
1226 |
|
|
1227 |
return 1; |
return 1; |
1228 |
} |
} |