--- trunk/src/devices/dev_malta_lcd.c 2007/10/08 16:18:27 10 +++ trunk/src/devices/dev_malta_lcd.c 2007/10/08 16:19:37 22 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005 Anders Gavare. All rights reserved. + * Copyright (C) 2005-2006 Anders Gavare. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -25,9 +25,9 @@ * SUCH DAMAGE. * * - * $Id: dev_malta_lcd.c,v 1.1 2005/06/20 08:19:58 debug Exp $ + * $Id: dev_malta_lcd.c,v 1.6 2006/02/09 20:02:59 debug Exp $ * - * Malta (evbmips) LCD thingy. TODO: This is just a dummy device. + * Malta (evbmips) LCD thingy. Mostly a dummy device. */ #include @@ -68,11 +68,11 @@ d->display_modified = 2; return; } - fatal("[ malta_lcd: "); + debug("[ malta_lcd: "); for (i=0; idisplay[i] >= ' ') - fatal("%c", d->display[i]); - fatal(" ]\n"); + debug("%c", d->display[i]); + debug(" ]\n"); d->display_modified = 0; } @@ -80,15 +80,14 @@ /* * dev_malta_lcd_access(): */ -int dev_malta_lcd_access(struct cpu *cpu, struct memory *mem, - uint64_t relative_addr, unsigned char *data, size_t len, - int writeflag, void *extra) +DEVICE_ACCESS(malta_lcd) { struct malta_lcd_data *d = (struct malta_lcd_data *) extra; uint64_t idata = 0, odata = 0; int i; - idata = memory_readmax64(cpu, data, len); + if (writeflag == MEM_WRITE) + idata = memory_readmax64(cpu, data, len); switch (relative_addr) { case 0x18: @@ -123,10 +122,7 @@ } -/* - * devinit_malta_lcd(): - */ -int devinit_malta_lcd(struct devinit *devinit) +DEVINIT(malta_lcd) { struct malta_lcd_data *d = malloc(sizeof(struct malta_lcd_data)); @@ -138,7 +134,7 @@ memory_device_register(devinit->machine->memory, devinit->name, devinit->addr, DEV_MALTA_LCD_LENGTH, - dev_malta_lcd_access, (void *)d, MEM_DEFAULT, NULL); + dev_malta_lcd_access, (void *)d, DM_DEFAULT, NULL); machine_add_tickfunction(devinit->machine, dev_malta_lcd_tick, d, MALTA_LCD_TICK_SHIFT);