1. Palette Cycling Problem

This is the one I decided to go for.
It works really fast, but it creates black flickering horizontal
lines on the screen. Is my video card too slow? Wrong driver?
The delay loop helps, but by the time you get it slow enough
to kill the lines it's too slow again.
Is there some slight change which might fix it?

**********************************

procedure cycle()
sequence s
while get_key() = -1 do
s = get_all_palette()
-- for w = 1 to 347000 do
-- end for
s = append(s,s[2])
s = prepend(s[3..length(s)],s[1])
all_palette(s)
end while
end procedure

**********************************

Thanks again,
Andrew

new topic     » topic index » view message » categorize

2. Re: Palette Cycling Problem

>This is the one I decided to go for.
>It works really fast, but it creates black flickering horizontal
>lines on the screen. Is my video card too slow? Wrong driver?
>The delay loop helps, but by the time you get it slow enough
>to kill the lines it's too slow again.
>Is there some slight change which might fix it?


You need to wait for the wait-retrace.. a litle piece of code, that waits
until the screen is blit to your videocard. You stick that code, right
before you update the screen after ll others things you handle in every
frame.
It will appear slower, however what you are really doing using wait-retrace
is make sure, the screen 'keeps' up to you speed. (in other words you slow
down, because the screen will otherwise mis an action you have done)

I'm sure some one still has the machine code wait-retrace routine on their
clipbord.
Most alternative graphics engine have it either built-in or provide it
through some routine.

Ralf

new topic     » goto parent     » topic index » view message » categorize

3. Re: Palette Cycling Problem

> This is the one I decided to go for.
> It works really fast, but it creates black flickering horizontal
> lines on the screen. Is my video card too slow? Wrong driver?
> The delay loop helps, but by the time you get it slow enough
> to kill the lines it's too slow again.
> Is there some slight change which might fix it?

The flicker you indicate is caused by repeatly calling get_all_palette.
Try something like:

s = get_all_palette()
while get_key()=-1 do
    s[2..length(s)] = append(s[3..length(s)], s[2])
    all_palette(s)
end while

which only does get_all_palette once outside the loop.
I also suspect that all_palette might already wait for a vertical retrace.
 _______  ______  _______  ______
[    _  \[    _ ][ _   _ ][    _ ]
[/| [_] |[/| [_\][/ | | \][/| [_\]
  |  ___/  |  _]    | |     |  _]
[\| [/]  [\| [_/] [\| |/] [\| [_/]
[_____]  [______] [_____] [______]
xseal at harborside.com  ICQ:13466657
http://www.harborside.com/home/x/xseal/euphoria/

new topic     » goto parent     » topic index » view message » categorize

4. Palette Cycling Problem

Thanks for your idea Pete I thought it might have done the trick but,
still no joy.
Here it is as it stands so far.

************************
procedure cycle()
sequence s
s = get_all_palette()
while get_key() = -1 do
s[2..length(s)] = append(s[3..length(s)], s[2])
for w = 1 to 2450000 do
end for
all_palette(s)
end while
end procedure
************************

Even with a wait loop like that all it does is slow it down to about 3
updates per sec (which is way to slow) and there's still a black line
flashing across every time. I'm starting to think that even a wait-retrace
routine wouldn't work because at this speed it already has about 330ms to
wait for a retrace and it still flickers. So would a wait-retrace routine just
slow it down even more?
I put the get_all_palette outside the loop like you suggested but, it's
still the same.
Thanks for your help.
Andrew

new topic     » goto parent     » topic index » view message » categorize

5. Re: Palette Cycling Problem

Even with a wait loop like that all it does is slow it down to about 3
>updates per sec (which is way to slow) and there's still a black line
>flashing across every time. I'm starting to think that even a wait-retrace
>routine wouldn't work because at this speed it already has about 330ms to
>wait for a retrace and it still flickers. So would a wait-retrace routine
just slow it down even more?
>I put the get_all_palette outside the loop like you suggested but, it's
>still the same.

The wait-retrace won't slow it down (v-refresh happens every 60 times per
second aprox.), it
will sync the palette change with the vertical retrace, efectivly hidding
the unwanted flicker.
Your wait loop won't help with syncronization, it just makes it slower.


Regards,
        Daniel   Berstein
        daber at pair.com

new topic     » goto parent     » topic index » view message » categorize

6. Palette Cycling Problem

And so, as far as this section of questions go, there's just one more
question to ask.
Does anyone out there have a wait-retrace code hanging around on their
hard-drive that I could borrow? It would be really appreciated. I'm not
up on heavy stuff, so try and keep it simple. I am however and will be
deeply indebted to whoever can point me in the right direction.
Please help me!
This line of questioning has gone on long enough.
(I've still got a bone to pick with long filenames!)
Thanking anyone in advance,
Andrew

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu