/[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 24 by dpavlin, Mon Oct 8 16:19:56 2007 UTC revision 34 by dpavlin, Mon Oct 8 16:21:17 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2003-2006  Anders Gavare.  All rights reserved.   *  Copyright (C) 2003-2007  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_scc.c,v 1.33 2006/03/04 12:38:48 debug Exp $   *  $Id: dev_scc.c,v 1.37 2007/01/28 14:15:30 debug Exp $
29   *     *  
30   *  Serial controller on some DECsystems and SGI machines. (Z8530 ?)   *  Serial controller on some DECsystems and SGI machines. (Z8530 ?)
31   *  Most of the code in here is written for DECsystem emulation, though.   *  Most of the code in here is written for DECsystem emulation, though.
# Line 147  static unsigned char rx_nextchar(struct Line 147  static unsigned char rx_nextchar(struct
147  }  }
148    
149    
150  /*  DEVICE_TICK(scc)
  *  dev_scc_tick():  
  */  
 void dev_scc_tick(struct cpu *cpu, void *extra)  
151  {  {
152          int i;          int i;
153          struct scc_data *d = (struct scc_data *) extra;          struct scc_data *d = (struct scc_data *) extra;
# Line 162  void dev_scc_tick(struct cpu *cpu, void Line 159  void dev_scc_tick(struct cpu *cpu, void
159                              d->console_handle), 2);                              d->console_handle), 2);
160          }          }
161          if (d->use_fb == 1 && d->scc_nr == 1)          if (d->use_fb == 1 && d->scc_nr == 1)
162                  lk201_tick(&d->lk201);                  lk201_tick(cpu->machine, &d->lk201);
163    
164          for (i=0; i<N_SCC_PORTS; i++) {          for (i=0; i<N_SCC_PORTS; i++) {
165                  d->scc_register_r[i * N_SCC_REGS + SCC_RR0] |= SCC_RR0_TX_EMPTY;                  d->scc_register_r[i * N_SCC_REGS + SCC_RR0] |= SCC_RR0_TX_EMPTY;
# Line 187  void dev_scc_tick(struct cpu *cpu, void Line 184  void dev_scc_tick(struct cpu *cpu, void
184                                  if (d->scc_register_r[i * N_SCC_REGS + SCC_RR3]                                  if (d->scc_register_r[i * N_SCC_REGS + SCC_RR3]
185                                      & SCC_RR3_TX_IP_A ||                                      & SCC_RR3_TX_IP_A ||
186                                      d->scc_register_r[i * N_SCC_REGS + SCC_RR3]                                      d->scc_register_r[i * N_SCC_REGS + SCC_RR3]
187                                      & SCC_RR3_TX_IP_B)                                      & SCC_RR3_TX_IP_B) {
188                                          cpu_interrupt(cpu, d->irq_nr);  fatal("TODO: legacy rewrite!\n");
189    abort();
190    //                                      cpu_interrupt(cpu, d->irq_nr);
191                                    }
192                          }                          }
193    
194                          /*  RX interrupts?  */                          /*  RX interrupts?  */
# Line 207  void dev_scc_tick(struct cpu *cpu, void Line 207  void dev_scc_tick(struct cpu *cpu, void
207                                  if (d->scc_register_r[i * N_SCC_REGS + SCC_RR3]                                  if (d->scc_register_r[i * N_SCC_REGS + SCC_RR3]
208                                      & SCC_RR3_RX_IP_A ||                                      & SCC_RR3_RX_IP_A ||
209                                      d->scc_register_r[i * N_SCC_REGS + SCC_RR3]                                      d->scc_register_r[i * N_SCC_REGS + SCC_RR3]
210                                      & SCC_RR3_RX_IP_B)                                      & SCC_RR3_RX_IP_B) {
211                                          cpu_interrupt(cpu, d->irq_nr);  fatal("TODO: legacy rewrite!\n");
212    abort();
213    //                                      cpu_interrupt(cpu, d->irq_nr);
214                                    }
215                          }                          }
216    
217                          if (d->scc_register_w[N_SCC_REGS + SCC_WR1] &                          if (d->scc_register_w[N_SCC_REGS + SCC_WR1] &
# Line 230  void dev_scc_tick(struct cpu *cpu, void Line 233  void dev_scc_tick(struct cpu *cpu, void
233                                      d->scc_register_r[i * N_SCC_REGS + SCC_RR3]                                      d->scc_register_r[i * N_SCC_REGS + SCC_RR3]
234                                      & SCC_RR3_EXT_IP_B)                                      & SCC_RR3_EXT_IP_B)
235  {  {
236                                          cpu_interrupt(cpu, d->irq_nr);  fatal("TODO: legacy rewrite!\n");
237    abort();
238    //                                      cpu_interrupt(cpu, d->irq_nr);
239  /*  TODO: huh?  */  /*  TODO: huh?  */
240  cpu_interrupt(cpu, 8 + 0x02000000);  //cpu_interrupt(cpu, 8 + 0x02000000);
241  }  }
242                          }                          }
243                  }                  }
# Line 298  int dev_scc_dma_func(struct cpu *cpu, vo Line 303  int dev_scc_dma_func(struct cpu *cpu, vo
303  }  }
304    
305    
 /*  
  *  dev_scc_access():  
  */  
306  DEVICE_ACCESS(scc)  DEVICE_ACCESS(scc)
307  {  {
308          struct scc_data *d = (struct scc_data *) extra;          struct scc_data *d = (struct scc_data *) extra;
# Line 352  DEVICE_ACCESS(scc) Line 354  DEVICE_ACCESS(scc)
354    
355                                  d->scc_register_r[port * N_SCC_REGS +                                  d->scc_register_r[port * N_SCC_REGS +
356                                      SCC_RR3] = 0;                                      SCC_RR3] = 0;
357                                  cpu_interrupt_ack(cpu, d->irq_nr);  
358    fatal("TODO: legacy rewrite!\n");
359    abort();
360    //                              cpu_interrupt_ack(cpu, d->irq_nr);
361                          }                          }
362    
363  #ifdef SCC_DEBUG  #ifdef SCC_DEBUG
# Line 399  DEVICE_ACCESS(scc) Line 404  DEVICE_ACCESS(scc)
404    
405                          /*  TODO:  perhaps only clear the RX part of RR3?  */                          /*  TODO:  perhaps only clear the RX part of RR3?  */
406                          d->scc_register_r[N_SCC_REGS + SCC_RR3] = 0;                          d->scc_register_r[N_SCC_REGS + SCC_RR3] = 0;
407                          cpu_interrupt_ack(cpu, d->irq_nr);  
408    fatal("TODO: legacy rewrite!\n");
409    abort();
410    //                      cpu_interrupt_ack(cpu, d->irq_nr);
411    
412                          debug("[ scc: (port %i) read from 0x%08lx: 0x%02x ]\n",                          debug("[ scc: (port %i) read from 0x%08lx: 0x%02x ]\n",
413                              port, (long)relative_addr, (int)odata);                              port, (long)relative_addr, (int)odata);

Legend:
Removed from v.24  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26