mirror of
https://github.com/irmen/prog8.git
synced 2026-04-19 20:16:51 +00:00
c64+c128: improved speed of txt.setchr and txt.getchr
This commit is contained in:
@@ -281,16 +281,13 @@ asmsub setchr (ubyte col @X, ubyte row @Y, ubyte character @A) clobbers(A, Y)
|
||||
tya
|
||||
asl a
|
||||
tay
|
||||
lda _screenrows,y
|
||||
sta P8ZP_SCRATCH_W1
|
||||
lda _screenrows+1,y
|
||||
sta P8ZP_SCRATCH_W1+1
|
||||
txa
|
||||
clc
|
||||
adc _screenrows,y
|
||||
sta P8ZP_SCRATCH_W1
|
||||
bcc +
|
||||
inc P8ZP_SCRATCH_W1+1
|
||||
+ pla
|
||||
ldy #0
|
||||
tay
|
||||
pla
|
||||
sta (P8ZP_SCRATCH_W1),y
|
||||
rts
|
||||
|
||||
@@ -306,15 +303,12 @@ asmsub getchr (ubyte col @A, ubyte row @Y) clobbers(Y) -> ubyte @ A {
|
||||
tya
|
||||
asl a
|
||||
tay
|
||||
lda setchr._screenrows,y
|
||||
sta P8ZP_SCRATCH_W1
|
||||
lda setchr._screenrows+1,y
|
||||
sta P8ZP_SCRATCH_W1+1
|
||||
pla
|
||||
clc
|
||||
adc setchr._screenrows,y
|
||||
sta P8ZP_SCRATCH_W1
|
||||
bcc +
|
||||
inc P8ZP_SCRATCH_W1+1
|
||||
+ ldy #0
|
||||
tay
|
||||
lda (P8ZP_SCRATCH_W1),y
|
||||
rts
|
||||
}}
|
||||
|
||||
@@ -285,16 +285,13 @@ asmsub setchr (ubyte col @X, ubyte row @Y, ubyte character @A) clobbers(A, Y)
|
||||
tya
|
||||
asl a
|
||||
tay
|
||||
lda _screenrows,y
|
||||
sta P8ZP_SCRATCH_W1
|
||||
lda _screenrows+1,y
|
||||
sta P8ZP_SCRATCH_W1+1
|
||||
txa
|
||||
clc
|
||||
adc _screenrows,y
|
||||
sta P8ZP_SCRATCH_W1
|
||||
bcc +
|
||||
inc P8ZP_SCRATCH_W1+1
|
||||
+ pla
|
||||
ldy #0
|
||||
tay
|
||||
pla
|
||||
sta (P8ZP_SCRATCH_W1),y
|
||||
rts
|
||||
|
||||
@@ -310,15 +307,12 @@ asmsub getchr (ubyte col @A, ubyte row @Y) clobbers(Y) -> ubyte @ A {
|
||||
tya
|
||||
asl a
|
||||
tay
|
||||
lda setchr._screenrows,y
|
||||
sta P8ZP_SCRATCH_W1
|
||||
lda setchr._screenrows+1,y
|
||||
sta P8ZP_SCRATCH_W1+1
|
||||
pla
|
||||
clc
|
||||
adc setchr._screenrows,y
|
||||
sta P8ZP_SCRATCH_W1
|
||||
bcc +
|
||||
inc P8ZP_SCRATCH_W1+1
|
||||
+ ldy #0
|
||||
tay
|
||||
lda (P8ZP_SCRATCH_W1),y
|
||||
rts
|
||||
}}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
; C64: 160, 220, 164
|
||||
; C128: 167, 229, 171
|
||||
; CX16: 83, 132, 85
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
|
||||
Reference in New Issue
Block a user