25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_scc.c,v 1.37 2007/01/28 14:15:30 debug Exp $ |
* $Id: dev_scc.c,v 1.40 2007/06/15 19:57:34 debug Exp $ |
29 |
* |
* |
30 |
* Serial controller on some DECsystems and SGI machines. (Z8530 ?) |
* COMMENT: Serial controller used in some DECsystem and SGI machines |
31 |
* Most of the code in here is written for DECsystem emulation, though. |
* |
32 |
|
* Hm... Same as Z8530? Most of the code in here is written for DECsystem |
33 |
|
* emulation, though. |
34 |
* |
* |
35 |
* NOTE: |
* NOTE: |
36 |
* Each scc device is responsible for two lines; the first scc device |
* Each scc device is responsible for two lines; the first scc device |
151 |
|
|
152 |
DEVICE_TICK(scc) |
DEVICE_TICK(scc) |
153 |
{ |
{ |
154 |
|
struct scc_data *d = extra; |
155 |
int i; |
int i; |
|
struct scc_data *d = (struct scc_data *) extra; |
|
156 |
|
|
157 |
/* Add keystrokes to the rx queue: */ |
/* Add keystrokes to the rx queue: */ |
158 |
if (d->use_fb == 0 && d->scc_nr == 1) { |
if (d->use_fb == 0 && d->scc_nr == 1) { |
307 |
|
|
308 |
DEVICE_ACCESS(scc) |
DEVICE_ACCESS(scc) |
309 |
{ |
{ |
310 |
struct scc_data *d = (struct scc_data *) extra; |
struct scc_data *d = extra; |
311 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
312 |
int port; |
int port; |
313 |
int ultrix_mode = 0; |
int ultrix_mode = 0; |
411 |
abort(); |
abort(); |
412 |
// cpu_interrupt_ack(cpu, d->irq_nr); |
// cpu_interrupt_ack(cpu, d->irq_nr); |
413 |
|
|
414 |
debug("[ scc: (port %i) read from 0x%08lx: 0x%02x ]\n", |
// debug("[ scc: (port %i) read from 0x%08lx: 0x%02x ]\n", |
415 |
port, (long)relative_addr, (int)odata); |
// port, (long)relative_addr, (int)odata); |
416 |
} else { |
} else { |
417 |
/* debug("[ scc: (port %i) write to 0x%08lx: " |
/* debug("[ scc: (port %i) write to 0x%08lx: " |
418 |
"0x%08x ]\n", port, (long)relative_addr, |
"0x%08x ]\n", port, (long)relative_addr, |
476 |
{ |
{ |
477 |
struct scc_data *d; |
struct scc_data *d; |
478 |
|
|
479 |
d = malloc(sizeof(struct scc_data)); |
CHECK_ALLOCATION(d = malloc(sizeof(struct scc_data))); |
|
if (d == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
480 |
memset(d, 0, sizeof(struct scc_data)); |
memset(d, 0, sizeof(struct scc_data)); |
481 |
|
|
482 |
d->irq_nr = irq_nr; |
d->irq_nr = irq_nr; |
483 |
d->scc_nr = scc_nr; |
d->scc_nr = scc_nr; |
484 |
d->use_fb = use_fb; |
d->use_fb = use_fb; |
490 |
|
|
491 |
memory_device_register(mem, "scc", baseaddr, DEV_SCC_LENGTH, |
memory_device_register(mem, "scc", baseaddr, DEV_SCC_LENGTH, |
492 |
dev_scc_access, d, DM_DEFAULT, NULL); |
dev_scc_access, d, DM_DEFAULT, NULL); |
493 |
machine_add_tickfunction(machine, dev_scc_tick, d, SCC_TICK_SHIFT, 0.0); |
machine_add_tickfunction(machine, dev_scc_tick, d, SCC_TICK_SHIFT); |
494 |
|
|
495 |
return (void *) d; |
return (void *) d; |
496 |
} |
} |