--- trunk/src/devices/dev_lpt.c 2007/10/08 16:19:23 20 +++ trunk/src/devices/dev_lpt.c 2007/10/08 16:21:17 34 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005 Anders Gavare. All rights reserved. + * Copyright (C) 2005-2007 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_lpt.c,v 1.5 2005/11/13 00:14:09 debug Exp $ + * $Id: dev_lpt.c,v 1.10 2006/12/30 13:30:58 debug Exp $ * * LPT (parallel printer) controller. */ @@ -50,7 +50,6 @@ #define DEV_LPT_LENGTH 3 struct lpt_data { - int in_use; int irqnr; char *name; int console_handle; @@ -74,9 +73,7 @@ /* * dev_lpt_access(): */ -int dev_lpt_access(struct cpu *cpu, struct memory *mem, - uint64_t relative_addr, unsigned char *data, size_t len, - int writeflag, void *extra) +DEVICE_ACCESS(lpt) { uint64_t idata = 0, odata=0; struct lpt_data *d = extra; @@ -118,10 +115,7 @@ } -/* - * devinit_lpt(): - */ -int devinit_lpt(struct devinit *devinit) +DEVINIT(lpt) { struct lpt_data *d = malloc(sizeof(struct lpt_data)); size_t nlen; @@ -133,10 +127,9 @@ } memset(d, 0, sizeof(struct lpt_data)); d->irqnr = devinit->irq_nr; - d->in_use = devinit->in_use; d->name = devinit->name2 != NULL? devinit->name2 : ""; - d->console_handle = - console_start_slave(devinit->machine, devinit->name); + d->console_handle = console_start_slave(devinit->machine, devinit->name, + CONSOLE_OUTPUT_ONLY); nlen = strlen(devinit->name) + 10; if (devinit->name2 != NULL) @@ -153,7 +146,8 @@ memory_device_register(devinit->machine->memory, name, devinit->addr, DEV_LPT_LENGTH, dev_lpt_access, d, DM_DEFAULT, NULL); - machine_add_tickfunction(devinit->machine, dev_lpt_tick, d, TICK_SHIFT); + machine_add_tickfunction(devinit->machine, dev_lpt_tick, d, + TICK_SHIFT, 0.0); /* * NOTE: Ugly cast into a pointer, because this is a convenient way