mirror of
https://github.com/cc65/cc65.git
synced 2024-06-08 15:29:37 +00:00
ae7a38f3de
The functions return the character, or its attributes, that is at the current screen location of conio's cursor. The values can be used directly by the output functions to reproduce that screen character.
25 lines
577 B
ArmAsm
25 lines
577 B
ArmAsm
;
|
|
; 2020-07-14, Groepaz
|
|
;
|
|
; char cpeekc (void);
|
|
;
|
|
; get character from current position, do NOT advance cursor
|
|
|
|
.export _cpeekc
|
|
|
|
.include "pce.inc"
|
|
.include "extzp.inc"
|
|
|
|
_cpeekc:
|
|
st0 #VDC_MARR ; Memory-Address Read
|
|
ldy SCREEN_PTR
|
|
ldx SCREEN_PTR+1
|
|
sty a:VDC_DATA_LO
|
|
stx a:VDC_DATA_HI
|
|
|
|
st0 #VDC_VRR ; VRAM Read Register
|
|
lda a:VDC_DATA_LO ; character
|
|
and #<~$80 ; remove reverse bit
|
|
ldx #0
|
|
rts
|