SCREEN_PTR does only contain the offset apparently (unlike on other cbm systems), so we need extra handling
This commit is contained in:
25
libsrc/mega65/cpeekcolor.s
Normal file
25
libsrc/mega65/cpeekcolor.s
Normal file
@@ -0,0 +1,25 @@
|
||||
;
|
||||
; 2016-02-28, Groepaz
|
||||
; 2017-06-22, Greg King
|
||||
;
|
||||
; unsigned char cpeekcolor (void);
|
||||
;
|
||||
|
||||
.include "mega65.inc"
|
||||
|
||||
.export _cpeekcolor
|
||||
.importzp ptr1
|
||||
|
||||
_cpeekcolor:
|
||||
lda SCREEN_PTR + 1
|
||||
clc
|
||||
adc #>$d800
|
||||
sta ptr1 + 1
|
||||
lda SCREEN_PTR
|
||||
sta ptr1
|
||||
|
||||
ldy CURS_X
|
||||
lda (ptr1),y
|
||||
|
||||
ldx #>$0000
|
||||
rts
|
||||
Reference in New Issue
Block a user