optimized gfx2.plot() for lores-256c

This commit is contained in:
Irmen de Jong 2021-04-28 02:22:21 +02:00
parent 98eff2701b
commit a1e4e9c50f
2 changed files with 14 additions and 7 deletions

View File

@ -588,12 +588,19 @@ _done
; TODO mode 2,3
4 -> {
; lores 256c
; TODO get rid of all the vpoke calls to optimize all plot() ?
void addr_mul_24_for_lores_256c(y, x) ; 24 bits result is in r0 and r1L (highest byte)
cx16.vpoke(lsb(cx16.r1), cx16.r0, color)
; activate vera auto-increment mode so next_pixel() can be used after this
cx16.VERA_ADDR_H = cx16.VERA_ADDR_H & %00000111 | %00010000
cx16.r0L = cx16.VERA_DATA0 ; advance 1
%asm {{
stz cx16.VERA_CTRL
lda cx16.r1
ora #%00010000 ; enable auto-increment so next_pixel() can be used after this
sta cx16.VERA_ADDR_H
lda cx16.r0+1
sta cx16.VERA_ADDR_M
lda cx16.r0
sta cx16.VERA_ADDR_L
lda color
sta cx16.VERA_DATA0
}}
}
5 -> {
; highres monochrome

View File

@ -5,7 +5,7 @@
main {
sub start() {
gfx2.screen_mode(1) ; lo res
gfx2.screen_mode(4) ; lo res 256c
gfx2.text_charset(3)
gfx2.text(10, 10, 1, @"Hello!")
@ -14,7 +14,7 @@ main {
ubyte yy
uword rw
;413 jiffies (lores mono) / 480 jiffies (highres mono) / 368 jiffies (lores 256c) / 442 jiffies (lores 4c)
;480 jiffies (highres mono) / 442 jiffies (lores 4c)
repeat 50000 {
rw = rndw()
yy = (lsb(rw) & 127) + 20