You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: X16 Reference - 05 - KERNAL.md
+45Lines changed: 45 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1695,6 +1695,7 @@ Registers affected: Varies
1695
1695
|`$0B`|[`led_update`](#extapi-function-name-led_update)| Illuminates or clears the SMC activity LED based on disk activity or error status | - | - | - |
1696
1696
|`$0C`|[`mouse_set_position`](#extapi-function-name-mouse_set_position)| Moves the mouse cursor to a specific X/Y location | .X (.X)-(.X+3) | - | - |
1697
1697
|`$0D`|[`scnsiz`](#extapi-function-name-scnsiz)| Directly sets the kernal editor text dimensions | .X .Y | - | - |
1698
+
|`$0E`|[`kbd_leds`](#extapi-function-name-kbd_leds)| Set or get the state of the PS/2 keyboard LEDs | .X .P | .X | - |
1698
1699
1699
1700
1700
1701
---
@@ -2314,6 +2315,50 @@ do_80x25:
2314
2315
2315
2316
---
2316
2317
2318
+
#### extapi Function Name: kbd_leds
2319
+
2320
+
Purpose: Set or retrieve the PS/2 keyboard LED state
2321
+
Minimum ROM version: R48
2322
+
Call address: $FEAB, .A=14
2323
+
Communication registers: .X .P
2324
+
Preparatory routines: None
2325
+
Error returns: (none)
2326
+
Registers affected: .A .X .Y .P
2327
+
2328
+
**Description:** This routine is used to send a command to the keyboard to set the state of the Num Lock, Caps Lock, and Scroll Lock LEDs. You can also query the KERNAL for its idea of what the state of the LEDs is.
2329
+
2330
+
Note: This call does **not** change the state of the kernal's caps lock toggle.
2331
+
2332
+
**How to Use:**
2333
+
2334
+
1) To query the state of the LEDs, set carry, otherwise to set the LED state, clear carry and set .X to the desired value of the LED register. Bit 0 is Scroll Lock, bit 1 is Num Lock, and bit 2 is Caps Lock.
2335
+
2) Call `kbd_leds`
2336
+
3) If carry was set on the call to `kbd_leds`, the routine will return with .X set to the current state, otherwise the routine will send the updated LED state to the keyboard. In this case, there will be no confirmation on whether it was successful.
2337
+
2338
+
**EXAMPLE:**
2339
+
2340
+
This example toggles the state of the LEDs to the opposite state that they were initially.
0 commit comments