/[gxemul]/trunk/src/devices/dev_scc.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/dev_scc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 41 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
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
# Line 149  static unsigned char rx_nextchar(struct Line 151  static unsigned char rx_nextchar(struct
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) {
# Line 305  int dev_scc_dma_func(struct cpu *cpu, vo Line 307  int dev_scc_dma_func(struct cpu *cpu, vo
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;
# Line 409  fatal("TODO: legacy rewrite!\n"); Line 411  fatal("TODO: legacy rewrite!\n");
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,
# Line 474  void *dev_scc_init(struct machine *machi Line 476  void *dev_scc_init(struct machine *machi
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;
# Line 491  void *dev_scc_init(struct machine *machi Line 490  void *dev_scc_init(struct machine *machi
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  }  }

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26