mirror of
https://github.com/irmen/prog8.git
synced 2024-10-16 18:23:59 +00:00
gfx2 optimizations for vertical lines
This commit is contained in:
parent
51f32677b7
commit
f80e462d25
@ -212,15 +212,21 @@ _done
|
|||||||
|
|
||||||
sub vertical_line(uword x, uword y, uword height, ubyte color) {
|
sub vertical_line(uword x, uword y, uword height, ubyte color) {
|
||||||
if active_mode==1 {
|
if active_mode==1 {
|
||||||
; TODO for the 320x256 8bbp mode use vera auto increment
|
position(x,y)
|
||||||
repeat lsb(height) {
|
; set vera auto-increment to 320 pixel increment (=next line)
|
||||||
plot(x, y, color)
|
cx16.VERA_ADDR_H = (cx16.VERA_ADDR_H & %00000111) | (14<<4)
|
||||||
y++
|
%asm {{
|
||||||
}
|
ldy height
|
||||||
|
lda color
|
||||||
|
- sta cx16.VERA_DATA0
|
||||||
|
dey
|
||||||
|
bne -
|
||||||
|
}}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
; note for the 1 bpp modes we can't use vera's auto increment mode because we have to 'or' the pixel data in place.
|
; note for the 1 bpp modes we can't use vera's auto increment mode because we have to 'or' the pixel data in place.
|
||||||
|
; TODO optimize by manually advancing the vera's data pointer (note stipple and black color!)
|
||||||
repeat height {
|
repeat height {
|
||||||
plot(x, y, color)
|
plot(x, y, color)
|
||||||
y++
|
y++
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
main {
|
main {
|
||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
gfx2.screen_mode(1)
|
gfx2.screen_mode(128)
|
||||||
|
|
||||||
uword pixels = memory("pixels", 320)
|
uword pixels = memory("pixels", 320)
|
||||||
uword yy = 10
|
uword yy = 10
|
||||||
@ -16,8 +16,8 @@ main {
|
|||||||
uword cnt
|
uword cnt
|
||||||
pp=pixels
|
pp=pixels
|
||||||
|
|
||||||
for xx in 10 to 300 {
|
for xx in 0 to 639 {
|
||||||
gfx2.vertical_line(xx, 10, 220, 1)
|
gfx2.vertical_line(xx, 0, 480, 1)
|
||||||
}
|
}
|
||||||
gfx2.screen_mode(255)
|
gfx2.screen_mode(255)
|
||||||
txt.print("done!\n")
|
txt.print("done!\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user