1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-24 11:31:31 +00:00
cc65/libsrc/apple2/cpeekc.s

29 lines
727 B
ArmAsm
Raw Normal View History

;
; 2020-07-12, Oliver Schmidt
;
; char cpeekc (void);
;
.export _cpeekc
.include "apple2.inc"
_cpeekc:
ldy CH
.ifdef __APPLE2ENH__
bit RD80VID ; In 80 column mode?
bpl peek ; No, just go ahead
tya
lsr ; Div by 2
tay
bcs peek ; Odd cols are in main memory
bit HISCR ; Assume SET80COL
.endif
peek: lda (BASL),Y ; Get character
.ifdef __APPLE2ENH__
bit LOWSCR ; Doesn't hurt in 40 column mode
.endif
eor #$80 ; Invert high bit
ldx #$00
rts