mirror of
https://github.com/irmen/prog8.git
synced 2025-02-09 07:31:34 +00:00
optimized gfx2.plot() for lores-256c
This commit is contained in:
parent
98eff2701b
commit
a1e4e9c50f
@ -588,12 +588,19 @@ _done
|
|||||||
; TODO mode 2,3
|
; TODO mode 2,3
|
||||||
4 -> {
|
4 -> {
|
||||||
; lores 256c
|
; 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)
|
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)
|
%asm {{
|
||||||
; activate vera auto-increment mode so next_pixel() can be used after this
|
stz cx16.VERA_CTRL
|
||||||
cx16.VERA_ADDR_H = cx16.VERA_ADDR_H & %00000111 | %00010000
|
lda cx16.r1
|
||||||
cx16.r0L = cx16.VERA_DATA0 ; advance 1
|
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 -> {
|
5 -> {
|
||||||
; highres monochrome
|
; highres monochrome
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
main {
|
main {
|
||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
gfx2.screen_mode(1) ; lo res
|
gfx2.screen_mode(4) ; lo res 256c
|
||||||
gfx2.text_charset(3)
|
gfx2.text_charset(3)
|
||||||
gfx2.text(10, 10, 1, @"Hello!")
|
gfx2.text(10, 10, 1, @"Hello!")
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ main {
|
|||||||
ubyte yy
|
ubyte yy
|
||||||
uword rw
|
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 {
|
repeat 50000 {
|
||||||
rw = rndw()
|
rw = rndw()
|
||||||
yy = (lsb(rw) & 127) + 20
|
yy = (lsb(rw) & 127) + 20
|
||||||
|
Loading…
x
Reference in New Issue
Block a user