--- trunk/src/devices/dev_sh4.c 2007/10/08 16:22:11 40 +++ trunk/src/devices/dev_sh4.c 2007/10/08 16:22:32 42 @@ -25,9 +25,9 @@ * SUCH DAMAGE. * * - * $Id: dev_sh4.c,v 1.48 2007/05/01 04:03:09 debug Exp $ + * $Id: dev_sh4.c,v 1.50 2007/06/15 19:57:34 debug Exp $ * - * SH4 processor specific memory mapped registers (0xf0000000 - 0xffffffff). + * COMMENT: SH4-specific memory mapped registers (0xf0000000 - 0xffffffff) * * TODO: Among other things: * @@ -173,7 +173,7 @@ */ static void sh4_timer_tick(struct timer *t, void *extra) { - struct sh4_data *d = (struct sh4_data *) extra; + struct sh4_data *d = extra; int i; /* Fake RAM refresh: */ @@ -259,7 +259,7 @@ DEVICE_TICK(sh4) { - struct sh4_data *d = (struct sh4_data *) extra; + struct sh4_data *d = extra; unsigned int i; /* @@ -679,7 +679,7 @@ DEVICE_ACCESS(sh4_pcic) { - struct sh4_data *d = (struct sh4_data *) extra; + struct sh4_data *d = extra; uint64_t idata = 0, odata = 0; if (writeflag == MEM_WRITE) @@ -837,7 +837,7 @@ DEVICE_ACCESS(sh4) { - struct sh4_data *d = (struct sh4_data *) extra; + struct sh4_data *d = extra; uint64_t idata = 0, odata = 0; int timer_nr = 0, dma_channel = 0; @@ -1593,12 +1593,9 @@ char tmp[200], n[200]; int i; struct machine *machine = devinit->machine; - struct sh4_data *d = malloc(sizeof(struct sh4_data)); + struct sh4_data *d; - if (d == NULL) { - fprintf(stderr, "out of memory\n"); - exit(1); - } + CHECK_ALLOCATION(d = malloc(sizeof(struct sh4_data))); memset(d, 0, sizeof(struct sh4_data)); @@ -1720,7 +1717,7 @@ d->sh4_timer = timer_add(SH4_PSEUDO_TIMER_HZ, sh4_timer_tick, d); machine_add_tickfunction(devinit->machine, dev_sh4_tick, d, - SH4_TICK_SHIFT, 0.0); + SH4_TICK_SHIFT); /* Initial Timer values, according to the SH7750 manual: */ d->tcor[0] = 0xffffffff; d->tcnt[0] = 0xffffffff;