--- trunk/src/devices/dev_sgi_gbe.c 2007/10/08 16:21:17 34 +++ trunk/src/devices/dev_sgi_gbe.c 2007/10/08 16:22:32 42 @@ -25,9 +25,10 @@ * SUCH DAMAGE. * * - * $Id: dev_sgi_gbe.c,v 1.35 2006/12/30 13:30:59 debug Exp $ + * $Id: dev_sgi_gbe.c,v 1.37 2007/06/15 19:57:34 debug Exp $ + * + * COMMENT: SGI "gbe", graphics controller + framebuffer * - * SGI "gbe", graphics controller. Framebuffer. * Loosely inspired by Linux code. */ @@ -83,7 +84,7 @@ * These numbers (when << 16 bits) are pointers to the tiles. Tiles are * 512x128 in 8-bit mode, 256x128 in 16-bit mode, and 128x128 in 32-bit mode. */ -void dev_sgi_gbe_tick(struct cpu *cpu, void *extra) +DEVICE_TICK(sgi_gbe) { struct sgi_gbe_data *d = extra; int tile_nr = 0, on_screen = 1, xbase = 0, ybase = 0; @@ -204,9 +205,6 @@ } -/* - * dev_sgi_gbe_access(): - */ DEVICE_ACCESS(sgi_gbe) { struct sgi_gbe_data *d = extra; @@ -413,19 +411,12 @@ } -/* - * dev_sgi_gbe_init(): - */ void dev_sgi_gbe_init(struct machine *machine, struct memory *mem, uint64_t baseaddr) { struct sgi_gbe_data *d; - d = malloc(sizeof(struct sgi_gbe_data)); - if (d == NULL) { - fprintf(stderr, "out of memory\n"); - exit(1); - } + CHECK_ALLOCATION(d = malloc(sizeof(struct sgi_gbe_data))); memset(d, 0, sizeof(struct sgi_gbe_data)); /* 640x480 for Linux: */ @@ -443,6 +434,6 @@ memory_device_register(mem, "sgi_gbe", baseaddr, DEV_SGI_GBE_LENGTH, dev_sgi_gbe_access, d, DM_DEFAULT, NULL); - machine_add_tickfunction(machine, dev_sgi_gbe_tick, d, 18, 0.0); + machine_add_tickfunction(machine, dev_sgi_gbe_tick, d, 18); }