mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +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) {
|
||||
if active_mode==1 {
|
||||
; TODO for the 320x256 8bbp mode use vera auto increment
|
||||
repeat lsb(height) {
|
||||
plot(x, y, color)
|
||||
y++
|
||||
}
|
||||
position(x,y)
|
||||
; set vera auto-increment to 320 pixel increment (=next line)
|
||||
cx16.VERA_ADDR_H = (cx16.VERA_ADDR_H & %00000111) | (14<<4)
|
||||
%asm {{
|
||||
ldy height
|
||||
lda color
|
||||
- sta cx16.VERA_DATA0
|
||||
dey
|
||||
bne -
|
||||
}}
|
||||
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.
|
||||
; TODO optimize by manually advancing the vera's data pointer (note stipple and black color!)
|
||||
repeat height {
|
||||
plot(x, y, color)
|
||||
y++
|
||||
|
@ -7,7 +7,7 @@
|
||||
main {
|
||||
|
||||
sub start() {
|
||||
gfx2.screen_mode(1)
|
||||
gfx2.screen_mode(128)
|
||||
|
||||
uword pixels = memory("pixels", 320)
|
||||
uword yy = 10
|
||||
@ -16,8 +16,8 @@ main {
|
||||
uword cnt
|
||||
pp=pixels
|
||||
|
||||
for xx in 10 to 300 {
|
||||
gfx2.vertical_line(xx, 10, 220, 1)
|
||||
for xx in 0 to 639 {
|
||||
gfx2.vertical_line(xx, 0, 480, 1)
|
||||
}
|
||||
gfx2.screen_mode(255)
|
||||
txt.print("done!\n")
|
||||
|
Loading…
Reference in New Issue
Block a user