/[gxemul]/trunk/src/devices/dev_mc146818.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_mc146818.c

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

revision 23 by dpavlin, Mon Oct 8 16:19:37 2007 UTC revision 24 by dpavlin, Mon Oct 8 16:19:56 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_mc146818.c,v 1.84 2006/01/17 05:55:53 debug Exp $   *  $Id: dev_mc146818.c,v 1.86 2006/06/22 13:22:41 debug Exp $
29   *     *  
30   *  MC146818 real-time clock, used by many different machines types.   *  MC146818 real-time clock, used by many different machines types.
31   *  (DS1687 as used in some other machines is also similar to the MC146818.)   *  (DS1687 as used in some other machines is also similar to the MC146818.)
# Line 137  static void recalc_interrupt_cycle(struc Line 137  static void recalc_interrupt_cycle(struc
137  #endif  #endif
138    
139          if (d->interrupt_hz > 0)          if (d->interrupt_hz > 0)
140                  d->interrupt_every_x_cycles =                  d->interrupt_every_x_cycles = emulated_hz / d->interrupt_hz;
                     emulated_hz / d->interrupt_hz;  
141          else          else
142                  d->interrupt_every_x_cycles = 0;                  d->interrupt_every_x_cycles = 0;
143  }  }
# Line 160  void dev_mc146818_tick(struct cpu *cpu, Line 159  void dev_mc146818_tick(struct cpu *cpu,
159                  if (d->cycles_left_until_interrupt < 0 ||                  if (d->cycles_left_until_interrupt < 0 ||
160                      d->cycles_left_until_interrupt >=                      d->cycles_left_until_interrupt >=
161                      d->interrupt_every_x_cycles) {                      d->interrupt_every_x_cycles) {
162                          /*  debug("[ rtc interrupt (every %i cycles) ]\n",                          /*  fatal("[ rtc interrupt (every %i cycles) ]\n",
163                              d->interrupt_every_x_cycles);  */                              d->interrupt_every_x_cycles);  */
164                          cpu_interrupt(cpu, d->irq_nr);                          cpu_interrupt(cpu, d->irq_nr);
165    
# Line 715  void dev_mc146818_init(struct machine *m Line 714  void dev_mc146818_init(struct machine *m
714    
715          mc146818_update_time(d);          mc146818_update_time(d);
716    
717          machine_add_tickfunction(machine, dev_mc146818_tick, d, TICK_SHIFT);          machine_add_tickfunction(machine, dev_mc146818_tick, d,
718                TICK_SHIFT, 0.0);
719  }  }
720    

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

  ViewVC Help
Powered by ViewVC 1.1.26