OffsetSinceLastCall:
PROC [knobIndex: KnobIndex, returnZero:
BOOLEAN ←
FALSE]
RETURNS [offset:
INTEGER, waitCycles:
INT ← 0];
Returns the number of ticks of the physical dial since the last call to this procedure. Note that negative means left-rotation, and positive means right rotation.
returnZero = FALSE => the routine WILL NOT return until the dial has been fiddled with.
returnZero = TRUE => the routine will ALWAYS return immediately.
waitCycles is the number of vertical retraces waited through before knob moved.
InitializeOffset:
PROC [knobIndex: KnobIndex] ~
INLINE {
Ignore any rotation on knob #knobIndex up to now.
[] ← OffsetSinceLastCall[knobIndex];
};