/[gxemul]/trunk/src/devices/dev_z8530.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_z8530.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_z8530.c,v 1.13 2007/01/28 14:31:43 debug Exp $   *  $Id: dev_z8530.c,v 1.16 2007/06/15 19:57:34 debug Exp $
29   *     *  
30   *  Zilog "zs" serial controller (Z8530).   *  COMMENT: Zilog Z8530 "zs" serial controller
31   *   *
32   *  Features:   *  Features:
33   *      o)  Two channels, 0 = "channel B", 1 = "channel A".   *      o)  Two channels, 0 = "channel B", 1 = "channel A".
# Line 95  static void check_incoming(struct cpu *c Line 95  static void check_incoming(struct cpu *c
95  DEVICE_TICK(z8530)  DEVICE_TICK(z8530)
96  {  {
97          /*  Generate transmit and receive interrupts at regular intervals.  */          /*  Generate transmit and receive interrupts at regular intervals.  */
98          struct z8530_data *d = (struct z8530_data *) extra;          struct z8530_data *d = extra;
99          int asserted = 0;          int asserted = 0;
100    
101          if (d->rr[1][3] & ZSRR3_IP_B_TX && d->wr[0][1] & ZSWR1_TIE)          if (d->rr[1][3] & ZSRR3_IP_B_TX && d->wr[0][1] & ZSWR1_TIE)
# Line 203  DEVICE_ACCESS(z8530) Line 203  DEVICE_ACCESS(z8530)
203    
204  DEVINIT(z8530)  DEVINIT(z8530)
205  {  {
206          struct z8530_data *d = malloc(sizeof(struct z8530_data));          struct z8530_data *d;
207          char tmp[100];          char tmp[100];
208    
209          if (d == NULL) {          CHECK_ALLOCATION(d = malloc(sizeof(struct z8530_data)));
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
210          memset(d, 0, sizeof(struct z8530_data));          memset(d, 0, sizeof(struct z8530_data));
211    
212          d->addr_mult  = devinit->addr_mult;          d->addr_mult  = devinit->addr_mult;
# Line 233  DEVINIT(z8530) Line 230  DEVINIT(z8530)
230              NULL);              NULL);
231    
232          machine_add_tickfunction(devinit->machine, dev_z8530_tick, d,          machine_add_tickfunction(devinit->machine, dev_z8530_tick, d,
233              ZS_TICK_SHIFT, 0.0);              ZS_TICK_SHIFT);
234    
235          devinit->return_ptr = (void *)(size_t) d->console_handle[0];          devinit->return_ptr = (void *)(size_t) d->console_handle[0];
236    

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

  ViewVC Help
Powered by ViewVC 1.1.26