;; #LAYOUT# STD * #TAKE ;; #LAYOUT# * KERNAL_0 #TAKE ;; #LAYOUT# * * #IGNORE ; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech) !ifndef CONFIG_ARNITECH_BLADE { ; ; CHROUT routine - convert PETSCII to screen code ; chrout_to_screen_code: ; Codes $C0-$FE become $40-$7E, and $FF (pi) becomes $5E, as $DE does ; (C64 PRG p380-381) cmp #$FF beq @pi cmp #$C0 bcc @1 and #$7F rts ; not high char @pi: lda #$5E rts @1: ; Range $20-$3F is unchanged cmp #$40 bcc @done ; not high char ; Unshifted letters and symbols from $40-$5F ; all end up being -$40 ; (C64 PRG p376) ; But anything >= $80 needs to be -$40 ; (C64 PRG p380-381) ; And bit 7 should be cleared, only to be ; set by reverse video sec sbc #$40 ; Fix shifted chars by adding $20 again cmp #$20 bcc @done ; not high char cmp #$40 bcs @done ; not high char clc adc #$20 ; FALLTROUGH @done: rts } ; CONFIG_ARNITECH_BLADE