Simplify and improve control code detection

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-29 21:19:04 +09:30
1 parent 2b9f1cc2ee
commit 366ee483cb
1 file changed
+11 -13
+11 -13
View File
@@ -165,23 +165,21 @@ not_14:
is_quote_mode: is_quote_mode:
;; Is it a control code? ;; Is it a control code?
;; = codes <$20 and certain codes like left, up, shift-HOME, RVS-OFF ;; control codes are $00-$1f and $80-$9f
cmp #$91 ;; (from reading C64 PRG p379-381)
beq + ;; so we can just check if bits 5 or 6 are set, and if so,
cmp #$9d ;; then it isn't a control character.
beq + pha
cmp #$93 and #$60
beq + bne +
cmp #$92
beq +
cmp #$20
bcs not_quote_mode
*
;; Yes, a control code in quote mode means we display it as a reverse character ;; Yes, a control code in quote mode means we display it as a reverse character
pla
and #$1F and #$1F
ora #$80 ora #$80
jmp output_literal_char jmp output_literal_char
*
pla
not_quote_mode: not_quote_mode:
;; Check for colours ;; Check for colours