mirror of
https://github.com/irmen/prog8.git
synced 2025-04-22 09:37:16 +00:00
txt.getchr() is romable
This commit is contained in:
parent
ae65266a4a
commit
063de3801d
@ -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
|
||||
}}
|
||||
}
|
||||
|
@ -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
|
||||
}}
|
||||
}
|
||||
|
@ -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
|
||||
}}
|
||||
}
|
||||
|
@ -7,14 +7,8 @@ main {
|
||||
txt.home()
|
||||
for cx16.r11L in 0 to 20 {
|
||||
for cx16.r10L in 0 to 30 {
|
||||
txt.setchr(cx16.r10L, cx16.r11L, sc:'.')
|
||||
txt.setchr(cx16.r10L, cx16.r11L, txt.getchr(cx16.r10L, cx16.r11L)+1)
|
||||
}
|
||||
}
|
||||
cx16.r10L = txt.getchr(10,5)
|
||||
txt.setchr(10,5,sc:'*')
|
||||
cx16.r11L = txt.getchr(10,5)
|
||||
txt.print_ub(cx16.r10L)
|
||||
txt.spc()
|
||||
txt.print_ub(cx16.r11L)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user