mirror of
https://github.com/irmen/prog8.git
synced 2025-02-03 11:32:41 +00:00
optimized palette.set_color()
This commit is contained in:
parent
d14dac3872
commit
f275ed96ea
@ -9,8 +9,10 @@ palette {
|
||||
ubyte c
|
||||
|
||||
sub set_color(ubyte index, uword color) {
|
||||
cx16.vpoke(1, $fa00+index*2, lsb(color))
|
||||
cx16.vpoke(1, $fa01+index*2, msb(color))
|
||||
vera_palette_ptr = $fa00+index*2
|
||||
cx16.vpoke(1, vera_palette_ptr, lsb(color))
|
||||
vera_palette_ptr++
|
||||
cx16.vpoke(1, vera_palette_ptr, msb(color))
|
||||
}
|
||||
|
||||
sub set_rgb4(uword palette_bytes_ptr, uword num_colors) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
%import textio
|
||||
%import palette
|
||||
|
||||
main {
|
||||
|
||||
@ -44,9 +45,7 @@ irq {
|
||||
next_irq_line += barheight
|
||||
}
|
||||
|
||||
; set new screen background color
|
||||
cx16.vpoke(1, $fa00, lsb(c))
|
||||
cx16.vpoke(1, $fa01, msb(c))
|
||||
palette.set_color(0, c)
|
||||
|
||||
cx16.set_rasterline(next_irq_line)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user