txt.getchr() is romable

This commit is contained in:
Irmen de Jong
2025-04-16 23:32:18 +02:00
parent ae65266a4a
commit 063de3801d
4 changed files with 19 additions and 25 deletions

View File

@@ -321,21 +321,21 @@ _screenrows .word cbm.Screen + range(0, 1000, 40)
asmsub getchr (ubyte col @A, ubyte row @Y) clobbers(Y) -> ubyte @ A {
; ---- get the character in the screen matrix at the given location
; TODO: Romable
%asm {{
pha
tya
asl a
tay
lda setchr._screenrows+1,y
sta _mod+2
sta P8ZP_SCRATCH_W1+1
pla
clc
adc setchr._screenrows,y
sta _mod+1
bcc _mod
inc _mod+2
_mod lda $ffff ; modified
sta P8ZP_SCRATCH_W1
bcc +
inc P8ZP_SCRATCH_W1+1
+ ldy #0
lda (P8ZP_SCRATCH_W1),y
rts
}}
}

View File

@@ -324,21 +324,21 @@ _screenrows .word cbm.Screen + range(0, 1000, 40)
asmsub getchr (ubyte col @A, ubyte row @Y) clobbers(Y) -> ubyte @ A {
; ---- get the character in the screen matrix at the given location
; TODO: Romable
%asm {{
pha
tya
asl a
tay
lda setchr._screenrows+1,y
sta _mod+2
sta P8ZP_SCRATCH_W1+1
pla
clc
adc setchr._screenrows,y
sta _mod+1
bcc _mod
inc _mod+2
_mod lda $ffff ; modified
sta P8ZP_SCRATCH_W1
bcc +
inc P8ZP_SCRATCH_W1+1
+ ldy #0
lda (P8ZP_SCRATCH_W1),y
rts
}}
}

View File

@@ -178,21 +178,21 @@ _screenrows .word cbm.Screen + range(0, 1000, 40)
asmsub getchr (ubyte col @A, ubyte row @Y) clobbers(Y) -> ubyte @ A {
; ---- get the character in the screen matrix at the given location
; TODO: Romable
%asm {{
pha
tya
asl a
tay
lda setchr._screenrows+1,y
sta _mod+2
sta P8ZP_SCRATCH_W1+1
pla
clc
adc setchr._screenrows,y
sta _mod+1
bcc _mod
inc _mod+2
_mod lda $ffff ; modified
sta P8ZP_SCRATCH_W1
bcc +
inc P8ZP_SCRATCH_W1+1
+ ldy #0
lda (P8ZP_SCRATCH_W1),y
rts
}}
}