Package libsidplay.components.mos6526
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
This class implements a Timer A or B of a MOS6526 chip.
- Autor:
- Ken Händel
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen libsidplay.common.Event
Event.ConsumerThatThrows<T>, Event.Phase -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected longThis is a tri-state: when -1: cia is completely stopped when 0: cia 1-clock events are ticking.protected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprivate final EventPerform scheduled cycle skipping, and resume.protected byteCopy of regs[CRA/B]protected shortTimer start value (Latch).protected booleanPB6/PB7 Flipflop to signal underflows.protected intCRA/CRB control register / state.protected shortCurrent timer value.Von Klasse geerbte Felder libsidplay.common.Event
name, next, triggerTime -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidclock()Execute one CIA state transition.voidevent()Timer ticking event.final booleanGet PB6/PB7 Flipflop state.final intgetTimer()Get current timer value.private final voidReschedule CIA event at the earliest interesting time.final voidreset()Reset timer.abstract voidHandle the serial port.final voidsetControlRegister(byte cr) Set CRA/CRB control register.final voidsetLatchHigh(byte high) Set high byte of Timer start value (Latch).final voidsetLatchLow(byte low) Set low byte of Timer start value (Latch).final voidsetPbToggle(boolean state) Set PB6/PB7 Flipflop state.final voidPerform cycle skipping manually.abstract voidSignal timer underflow.final voidCounterpart of syncWithCpu(), starts the event ticking if it is needed.
-
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 stateCRA/CRB control register / state. -
lastControlValue
protected byte lastControlValueCopy of regs[CRA/B] -
timer
protected short timerCurrent timer value. -
latch
protected short latchTimer start value (Latch). -
pbToggle
protected boolean pbTogglePB6/PB7 Flipflop to signal underflows. -
ciaEventPauseTime
protected long ciaEventPauseTimeThis 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
Perform scheduled cycle skipping, and resume.
-
-
Konstruktordetails
-
Timer
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. -
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.
-