1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00
cc65/libsrc/pce/cpeekrevers.s
Greg King ae7a38f3de Added peek functions to the conio library.
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.
2021-12-11 18:47:33 -05:00

27 lines
701 B
ArmAsm

;
; 2020-07-14, Groepaz
;
; unsigned char cpeekrevers (void);
;
; get inverse flag from current position, do NOT advance cursor
.export _cpeekrevers
.include "pce.inc"
.include "extzp.inc"
_cpeekrevers:
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 ; get reverse bit
asl a
tax ; ldx #>$0000
rol a ; return boolean value
rts