mirror of
https://github.com/irmen/prog8.git
synced 2025-10-25 05:18:38 +00:00
txt.setcc() is romable
This commit is contained in:
@@ -388,27 +388,29 @@ asmsub getclr (ubyte col @A, ubyte row @Y) clobbers(Y) -> ubyte @ A {
|
||||
|
||||
sub setcc (ubyte col, ubyte row, ubyte character, ubyte charcolor) {
|
||||
; ---- set char+color at the given position on the screen
|
||||
; TODO: Romable
|
||||
%asm {{
|
||||
_charptr = P8ZP_SCRATCH_W1
|
||||
_colorptr = P8ZP_SCRATCH_W2
|
||||
lda row
|
||||
asl a
|
||||
tay
|
||||
lda setchr._screenrows+1,y
|
||||
sta _charmod+2
|
||||
sta _charptr+1
|
||||
adc #$d4
|
||||
sta _colormod+2
|
||||
sta _colorptr+1
|
||||
lda setchr._screenrows,y
|
||||
clc
|
||||
adc col
|
||||
sta _charmod+1
|
||||
sta _colormod+1
|
||||
sta _charptr
|
||||
sta _colorptr
|
||||
bcc +
|
||||
inc _charmod+2
|
||||
inc _colormod+2
|
||||
inc _charptr+1
|
||||
inc _colorptr+1
|
||||
+ lda character
|
||||
_charmod sta $ffff ; modified
|
||||
ldy #0
|
||||
sta (_charptr),y
|
||||
lda charcolor
|
||||
_colormod sta $ffff ; modified
|
||||
sta (_colorptr),y
|
||||
rts
|
||||
}}
|
||||
}
|
||||
|
||||
@@ -391,27 +391,29 @@ asmsub getclr (ubyte col @A, ubyte row @Y) clobbers(Y) -> ubyte @ A {
|
||||
|
||||
sub setcc (ubyte col, ubyte row, ubyte character, ubyte charcolor) {
|
||||
; ---- set char+color at the given position on the screen
|
||||
; TODO: Romable
|
||||
%asm {{
|
||||
_charptr = P8ZP_SCRATCH_W1
|
||||
_colorptr = P8ZP_SCRATCH_W2
|
||||
lda row
|
||||
asl a
|
||||
tay
|
||||
lda setchr._screenrows+1,y
|
||||
sta _charmod+2
|
||||
sta _charptr+1
|
||||
adc #$d4
|
||||
sta _colormod+2
|
||||
sta _colorptr+1
|
||||
lda setchr._screenrows,y
|
||||
clc
|
||||
adc col
|
||||
sta _charmod+1
|
||||
sta _colormod+1
|
||||
sta _charptr
|
||||
sta _colorptr
|
||||
bcc +
|
||||
inc _charmod+2
|
||||
inc _colormod+2
|
||||
inc _charptr+1
|
||||
inc _colorptr+1
|
||||
+ lda character
|
||||
_charmod sta $ffff ; modified
|
||||
ldy #0
|
||||
sta (_charptr),y
|
||||
lda charcolor
|
||||
_colormod sta $ffff ; modified
|
||||
sta (_colorptr),y
|
||||
rts
|
||||
}}
|
||||
}
|
||||
|
||||
@@ -202,23 +202,23 @@ sub setclr (ubyte col, ubyte row, ubyte color) {
|
||||
}
|
||||
|
||||
|
||||
sub setcc (ubyte col, ubyte row, ubyte character, ubyte charcolor) {
|
||||
sub setcc (ubyte col, ubyte row, ubyte character, ubyte charcolor_ignored) {
|
||||
; ---- set char at the given position on the screen. charcolor is ignored on PET
|
||||
; TODO: Romable
|
||||
%asm {{
|
||||
lda row
|
||||
asl a
|
||||
tay
|
||||
lda setchr._screenrows+1,y
|
||||
sta _charmod+2
|
||||
sta P8ZP_SCRATCH_W1+1
|
||||
lda setchr._screenrows,y
|
||||
clc
|
||||
adc col
|
||||
sta _charmod+1
|
||||
sta P8ZP_SCRATCH_W1
|
||||
bcc +
|
||||
inc _charmod+2
|
||||
inc P8ZP_SCRATCH_W1+1
|
||||
+ lda character
|
||||
_charmod sta $ffff ; modified
|
||||
ldy #0
|
||||
sta (P8ZP_SCRATCH_W1),y
|
||||
rts
|
||||
}}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,7 @@ 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.setclr(cx16.r10L, cx16.r11L, txt.getclr(cx16.r10L, cx16.r11L)+1)
|
||||
txt.setcc(cx16.r10L, cx16.r11L, sc:'*', 7)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user