--- trunk/src/devices/dev_pvr.c 2007/10/08 16:22:20 41 +++ trunk/src/devices/dev_pvr.c 2007/10/08 16:22:32 42 @@ -25,10 +25,11 @@ * SUCH DAMAGE. * * - * $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 $ * - * PowerVR CLX2 (Graphics controller used in the Dreamcast). Implemented by - * reading http://www.ludd.luth.se/~jlo/dc/powervr-reg.txt and + * COMMENT: PowerVR CLX2 (graphics controller used in the Dreamcast) + * + * Implemented by reading http://www.ludd.luth.se/~jlo/dc/powervr-reg.txt and * http://mc.pp.se/dc/pvr.html, source code of various demos and KalistOS, * and doing a lot of guessing. * @@ -419,7 +420,7 @@ DEVICE_ACCESS(pvr_ta) { - struct pvr_data *d = (struct pvr_data *) extra; + struct pvr_data *d = extra; uint64_t idata = 0, odata = 0; if (writeflag == MEM_WRITE) { @@ -444,7 +445,7 @@ DEVICE_ACCESS(pvr) { - struct pvr_data *d = (struct pvr_data *) extra; + struct pvr_data *d = extra; uint64_t idata = 0, odata = 0; if (writeflag == MEM_WRITE) @@ -1174,13 +1175,13 @@ DEVINIT(pvr) { struct machine *machine = devinit->machine; - struct pvr_data *d = malloc(sizeof(struct pvr_data)); - struct pvr_data_alt *d_alt = malloc(sizeof(struct pvr_data_alt)); - if (d == NULL) { - fprintf(stderr, "out of memory\n"); - exit(1); - } + struct pvr_data *d; + struct pvr_data_alt *d_alt; + + CHECK_ALLOCATION(d = malloc(sizeof(struct pvr_data))); memset(d, 0, sizeof(struct pvr_data)); + + CHECK_ALLOCATION(d_alt = malloc(sizeof(struct pvr_data_alt))); memset(d_alt, 0, sizeof(struct pvr_data_alt)); d_alt->d = d; @@ -1221,7 +1222,7 @@ pvr_reset_ta(d); machine_add_tickfunction(machine, dev_pvr_fb_tick, d, - PVR_FB_TICK_SHIFT, 0.0); + PVR_FB_TICK_SHIFT); return 1; }