Simplify and improve control code detection
This commit is contained in:
1 parent
2b9f1cc2ee
commit
366ee483cb
1 file changed
+12
-14
+12
-14
@@ -165,25 +165,23 @@ 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
|
||||||
ldx #$f
|
ldx #$f
|
||||||
colour_check_loop:
|
colour_check_loop:
|
||||||
|
|||||||
Reference in new issue
Block a user