Link

Wait For Specified Amount Unless There’s Been A Keypress

The amount to wait is specified in the accumulator. Note the wait time is not linear with the value of the accumulator but quadratic.

If there’s been a keypress, we immediately return.

6246    2C 00 C0    BIT $C000
6249    30 0B       BMI $6256

Otherwise…

Set the carry bit and preserve the accumulator on the stack.

624B    38          SEC
624C    48          PHA

Keep reducing the accumulator by 1 until it’s zero.

624D    E9 01       SBC #$01
624F    D0 FC       BNE $624D

Restore the preserved accumulator.

6251    68          PLA

Reduce the accumulator and loop back to preserve that as the new accumulator we count down, until the new starting point hits zero.

6252    E9 01       SBC #$01
6254    D0 F6       BNE $624C
6256    60          RTS

What Calls This

  • $609D — Animate “Lord British” signature

And some other places in BOOT not yet explored.