Klasse MOS6526.Timer

java.lang.Object
libsidplay.common.Event
libsidplay.components.mos6526.MOS6526.Timer
Bekannte direkte Unterklassen:
MOS6526.TimerA, MOS6526.TimerB
Umschließende Klasse:
MOS6526

protected abstract class MOS6526.Timer extends Event
This class implements a Timer A or B of a MOS6526 chip.
Autor:
Ken Händel
  • Felddetails

    • CIAT_CR_START

      protected static final int CIAT_CR_START
      Siehe auch:
    • CIAT_STEP

      protected static final int CIAT_STEP
      Siehe auch:
    • CIAT_CR_ONESHOT

      protected static final int CIAT_CR_ONESHOT
      Siehe auch:
    • CIAT_CR_FLOAD

      protected static final int CIAT_CR_FLOAD
      Siehe auch:
    • CIAT_PHI2IN

      protected static final int CIAT_PHI2IN
      Siehe auch:
    • CIAT_CR_MASK

      protected static final int CIAT_CR_MASK
      Siehe auch:
    • CIAT_COUNT2

      protected static final int CIAT_COUNT2
      Siehe auch:
    • CIAT_COUNT3

      protected static final int CIAT_COUNT3
      Siehe auch:
    • CIAT_ONESHOT0

      protected static final int CIAT_ONESHOT0
      Siehe auch:
    • CIAT_ONESHOT

      protected static final int CIAT_ONESHOT
      Siehe auch:
    • CIAT_LOAD1

      protected static final int CIAT_LOAD1
      Siehe auch:
    • CIAT_LOAD

      protected static final int CIAT_LOAD
      Siehe auch:
    • CIAT_OUT

      protected static final int CIAT_OUT
      Siehe auch:
    • state

      protected int state
      CRA/CRB control register / state.
    • lastControlValue

      protected byte lastControlValue
      Copy of regs[CRA/B]
    • timer

      protected short timer
      Current timer value.
    • latch

      protected short latch
      Timer start value (Latch).
    • pbToggle

      protected boolean pbToggle
      PB6/PB7 Flipflop to signal underflows.
    • ciaEventPauseTime

      protected long ciaEventPauseTime
      This is a tri-state: when -1: cia is completely stopped when 0: cia 1-clock events are ticking. otherwise: cycleskipevent is ticking, and the value is the first phi1 clock of skipping.
    • cycleSkippingEvent

      private final Event cycleSkippingEvent
      Perform scheduled cycle skipping, and resume.
  • Konstruktordetails

    • Timer

      public Timer(String eventName)
      Create a new timer.
      Parameter:
      eventName - The name of the new timer.
  • Methodendetails

    • setControlRegister

      public final void setControlRegister(byte cr)
      Set CRA/CRB control register.
      Parameter:
      cr - Control register value
    • getTimer

      public final int getTimer()
      Get current timer value.
      Gibt zurück:
      current timer value
    • getPbToggle

      public final boolean getPbToggle()
      Get PB6/PB7 Flipflop state.
      Gibt zurück:
      PB6/PB7 flipflop state
    • setPbToggle

      public final void setPbToggle(boolean state)
      Set PB6/PB7 Flipflop state.
      Parameter:
      state - PB6/PB7 flipflop state
    • setLatchHigh

      public final void setLatchHigh(byte high)
      Set high byte of Timer start value (Latch).
      Parameter:
      high - high byte of latch
    • setLatchLow

      public final void setLatchLow(byte low)
      Set low byte of Timer start value (Latch).
      Parameter:
      low - low byte of latch
    • reset

      public final void reset()
      Reset timer.
    • syncWithCpu

      public final void syncWithCpu()
      Perform cycle skipping manually. Clocks the CIA up to the state it should be in, and stops all events.
    • wakeUpAfterSyncWithCpu

      public final void wakeUpAfterSyncWithCpu()
      Counterpart of syncWithCpu(), starts the event ticking if it is needed. No clock() call or anything such is permissible here!
    • event

      public void event()
      Timer ticking event.
      Angegeben von:
      event in Klasse Event
    • clock

      public void clock()
      Execute one CIA state transition.
    • reschedule

      private final void reschedule()
      Reschedule CIA event at the earliest interesting time. If CIA timer is stopped or is programmed to just count down, the events are paused.
    • serialPort

      public abstract void serialPort()
      Handle the serial port.
    • underFlow

      public abstract void underFlow()
      Signal timer underflow.