--- trunk/src/devices/dev_scc.c 2007/10/08 16:18:00 4 +++ trunk/src/devices/dev_scc.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_scc.c,v 1.27 2005/02/25 06:14:30 debug Exp $ + * $Id: dev_scc.c,v 1.32 2006/01/01 13:17:17 debug Exp $ * * Serial controller on some DECsystems and SGI machines. (Z8530 ?) * Most of the code in here is written for DECsystem emulation, though. @@ -40,6 +40,15 @@ * emulate the same lk201 behaviour as when using the dc device) * DMA * More correct interrupt support. + * + ****************************************************************************** + * _____ ___ ____ ___ _ + * |_ _/ _ \| _ \ / _ \| | + * | || | | | | | | | | | | + * | || |_| | |_| | |_| |_| + * |_| \___/|____/ \___/(_) + * + * Since this is actually a Z8530, it should be merged with dev_z8530.c! */ #include @@ -292,16 +301,15 @@ /* * dev_scc_access(): */ -int dev_scc_access(struct cpu *cpu, struct memory *mem, - uint64_t relative_addr, unsigned char *data, size_t len, - int writeflag, void *extra) +DEVICE_ACCESS(scc) { struct scc_data *d = (struct scc_data *) extra; uint64_t idata = 0, odata = 0; int port; int ultrix_mode = 0; - idata = memory_readmax64(cpu, data, len); + if (writeflag == MEM_WRITE) + idata = memory_readmax64(cpu, data, len); /* relative_addr /= d->addrmul; */ /* See SGI comment below instead. */ @@ -468,13 +476,13 @@ d->scc_nr = scc_nr; d->use_fb = use_fb; d->addrmul = addrmul; - d->console_handle = console_start_slave(machine, "SCC"); + d->console_handle = console_start_slave(machine, "SCC", 1); lk201_init(&d->lk201, use_fb, dev_scc_add_to_rx_queue, d->console_handle, d); memory_device_register(mem, "scc", baseaddr, DEV_SCC_LENGTH, - dev_scc_access, d, MEM_DEFAULT, NULL); + dev_scc_access, d, DM_DEFAULT, NULL); machine_add_tickfunction(machine, dev_scc_tick, d, SCC_TICK_SHIFT); return (void *) d;