--- trunk/src/devices/dev_bt459.c 2007/10/08 16:19:28 21 +++ trunk/src/devices/dev_bt459.c 2007/10/08 16:19:37 22 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2005 Anders Gavare. All rights reserved. + * Copyright (C) 2003-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,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: dev_bt459.c,v 1.61 2005/11/13 00:14:08 debug Exp $ + * $Id: dev_bt459.c,v 1.63 2006/01/01 13:17:16 debug Exp $ * * Brooktree 459 vdac, used by TURBOchannel graphics cards. */ @@ -101,68 +101,6 @@ /* - * bt459_state(): - */ -int bt459_state(struct cpu *cpu, struct memory *mem, void *extra, int wf, - int nr, int *type, char **namep, void **data, size_t *len) -{ - struct bt459_data *d = (struct bt459_data *) extra; - - switch (nr) { - case 0: if (wf) { - memcpy(&d->cursor_on, *data, *len); - } else { - (*namep) = "cursor_on"; - (*type) = DEVICE_STATE_TYPE_INT; - *len = sizeof(d->cursor_on); - *data = &d->cursor_on; - } - break; - case 1: if (wf) { - memcpy(&d->cursor_x, *data, *len); - } else { - (*namep) = "cursor_x"; - (*type) = DEVICE_STATE_TYPE_INT; - *len = sizeof(d->cursor_x); - *data = &d->cursor_x; - } - break; - case 2: if (wf) { - memcpy(&d->cursor_y, *data, *len); - } else { - (*namep) = "cursor_y"; - (*type) = DEVICE_STATE_TYPE_INT; - *len = sizeof(d->cursor_y); - *data = &d->cursor_y; - } - break; - case 3: if (wf) { - memcpy(&d->cursor_xsize, *data, *len); - } else { - (*namep) = "cursor_xsize"; - (*type) = DEVICE_STATE_TYPE_INT; - *len = sizeof(d->cursor_xsize); - *data = &d->cursor_xsize; - } - break; - case 4: if (wf) { - memcpy(&d->cursor_ysize, *data, *len); - } else { - (*namep) = "cursor_ysize"; - (*type) = DEVICE_STATE_TYPE_INT; - *len = sizeof(d->cursor_ysize); - *data = &d->cursor_ysize; - } - break; - default: - return 0; - } - - return 1; -} - - -/* * bt459_update_X_cursor(): * * This routine takes the color values in the cursor RAM area, and put them @@ -350,9 +288,7 @@ /* * dev_bt459_irq_access(): */ -int dev_bt459_irq_access(struct cpu *cpu, struct memory *mem, - uint64_t relative_addr, unsigned char *data, size_t len, - int writeflag, void *extra) +DEVICE_ACCESS(bt459_irq) { struct bt459_data *d = (struct bt459_data *) extra; uint64_t idata = 0, odata = 0; @@ -378,9 +314,7 @@ /* * dev_bt459_access(): */ -int dev_bt459_access(struct cpu *cpu, struct memory *mem, - uint64_t relative_addr, unsigned char *data, size_t len, - int writeflag, void *extra) +DEVICE_ACCESS(bt459) { struct bt459_data *d = (struct bt459_data *) extra; uint64_t idata = 0, odata = 0; @@ -656,7 +590,5 @@ dev_bt459_irq_access, (void *)d, DM_DEFAULT, NULL); machine_add_tickfunction(machine, dev_bt459_tick, d, BT459_TICK_SHIFT); - - memory_device_register_statefunction(mem, d, bt459_state); }