Merge pull request #2978 from StewBC/plus4-cgetc-bitmap-fix

Fix plus4 cgetc() returning a phantom key in bitmap mode
This commit is contained in:
Bob Andrews authored and GitHub committed 2026-08-20 14:36:14 +02:00
commit 41eda3e647
1 file changed
+9 -5
+9 -5
View File
@@ -18,16 +18,20 @@ _cgetc: lda KEY_COUNT ; Get number of characters
ora FKEY_COUNT ; Or with number of function key chars
bne L2 ; Jump if there are already chars waiting
lda #%00100000
bit $FF06
bne L2 ; always disable cursor if in bitmap mode
; Switch on the cursor if needed
; Save the character under the cursor, wait for a key, then put it back. In
; bitmap mode there is no cursor to show, so the save and restore are
; effectively a no-op.
ldy CURS_X
lda (CRAM_PTR),y ; Get current char
pha ; And save it
lda #%00100000
bit $FF06
bne L1 ; No cursor in bitmap mode
; Switch on the cursor if needed
lda CHARCOLOR
sta (CRAM_PTR),y