SCREEN_PTR does only contain the offset apparently (unlike on other cbm systems), so we need extra handling

This commit is contained in:
mrdudz
2025-06-25 05:13:09 +02:00
parent 955c6627c0
commit 4db5ac6c14
13 changed files with 356 additions and 36 deletions

View File

@@ -0,0 +1,28 @@
;
; 2016-02-28, Groepaz
; 2017-06-15, Greg King
;
; unsigned char cpeekrevers (void);
;
.include "mega65.inc"
.export _cpeekrevers
.importzp ptr1
_cpeekrevers:
lda SCREEN_PTR + 1
clc
adc #>$0800
sta ptr1 + 1
lda SCREEN_PTR
sta ptr1
ldy CURS_X
lda (ptr1),y ; get screen code
and #$80 ; get reverse bit
asl a
tax ; ldx #>$0000
rol a ; return boolean value
rts