mirror of
https://github.com/irmen/prog8.git
synced 2024-10-16 18:23:59 +00:00
changed to fixed point math to always generate bars of 32 lines height
This commit is contained in:
parent
8388adcd1d
commit
9acec4d952
@ -1,6 +1,5 @@
|
|||||||
%import gfx2
|
%import gfx2
|
||||||
%import palette
|
%import palette
|
||||||
%import textio
|
|
||||||
|
|
||||||
|
|
||||||
; TODO WORK IN PROGRESS...
|
; TODO WORK IN PROGRESS...
|
||||||
@ -9,22 +8,24 @@
|
|||||||
|
|
||||||
main {
|
main {
|
||||||
sub start() {
|
sub start() {
|
||||||
palette.set_all_black()
|
;palette.set_all_black()
|
||||||
gfx2.screen_mode(4)
|
gfx2.screen_mode(4)
|
||||||
|
|
||||||
ubyte yy
|
ubyte yy
|
||||||
for yy in 0 to 239
|
for yy in 0 to 239
|
||||||
gfx2.horizontal_line(0, yy, 320, yy & 31)
|
gfx2.horizontal_line(0, yy, 320, yy)
|
||||||
|
|
||||||
repeat {
|
repeat {
|
||||||
|
yy = 0
|
||||||
|
repeat 8 {
|
||||||
colors.random_half_bar()
|
colors.random_half_bar()
|
||||||
colors.mirror_bar()
|
colors.mirror_bar()
|
||||||
colors.set_palette()
|
colors.set_palette(yy)
|
||||||
repeat 20
|
yy+=32
|
||||||
sys.waitvsync()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repeat {
|
repeat 10
|
||||||
|
sys.waitvsync()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,11 +108,11 @@ colors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub set_palette() {
|
sub set_palette(ubyte offset) {
|
||||||
ubyte ix
|
ubyte ix
|
||||||
for ix in 0 to 31 {
|
for ix in 0 to 31 {
|
||||||
uword color = mkword(reds[ix], (greens[ix] << 4) | blues[ix] )
|
uword color = mkword(reds[ix], (greens[ix] << 4) | blues[ix] )
|
||||||
palette.set_color(ix, color)
|
palette.set_color(ix+offset, color)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user