Time
Clock and Sync control, plus busy and frame-based delays.
import "lib/time.nbl";
Clock selects the CPU clock divider. Sync selects the UserSync flag rate.
Reading RdFlags clears UserSync; time_sync_seen() performs that read.
time_delay_ms uses Sync=0 for one-millisecond ticks. The first tick can be
up to one millisecond early because writing Sync does not reset the divider.
Constants
Name |
Type |
Value |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Functions
Call |
Returns |
Notes |
|---|---|---|
|
|
Approximate busy delay; one unit is a 15x15 inner loop. Duration depends on |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Reading this clears the current UserSync flag. |
|
|
|
|
|
|
|
|
Wait for ms millisecond ticks using Sync=0. The first tick can be up to one millisecond early because writing Sync does not reset the divider. |
|
|
Wait for a number of ticks at the given Sync divider. |