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