F12 toggles VSync, F11 toggles throttling
The speed works properly for me now. Very cool.
But I use vysnc in my games too! And onyxās sync2 code, now, as well. And Iām not getting this problem
Cas
Eventually itās that timer resolution thing?
I call Sys.getTimerResolution() in my capping code just each timeā¦ therefore it should be ok, right?
Maybe he calls it only once at the beginning (or too irregularly/rarely)?
Could be it. All my code frequently requeries the resolution. The LWJGL timer code in CVS now does this as well.
Broken sound is akin to a man with a chainsaw trying to cut a live pig in half next to my ear while I have a hangover. Had to quit to avoid permanent brain damage.
Cas
I throttle to the speed of the original arcade, which is 60Hz most of the time. When VSync is switched on too (which it is at startup) and your display runs at another frequency or something, I can imagine the fast-slow speed you describe.
So press either F12 for the correct speed, or F11 for a smooth (if too slow) display.
Maybe I need to set the default vsync/throttling settings based on the video mode being chosenā¦
Iāll try to find another way to fix the sound. Sound is almost 100% perfect here, but apparently causing braindamage and pigs being slaughtered elsewhere :). I tried to āfixā the sound by putting a small sleep in the loop of the sound thread so that the main thread gets more time to regularly send sound commands to the sound thread. Maybe I need to make the sound thread sleep only if the buffer is sufficiently filled.
I updated the sound code and removed the multithreaded nature of it. It works much better now, for me anyway. I hope it doesnāt cause braindamage now
Also, at startup vsync is enabled when a video mode could be selected with the same refresh rate of the original arcade. Otherwise, throttling is used (you can still use F11 and F12 to toggle vsync and throttling).
Beware that the sound code now relies on the emulator running at the correct speed, otherwise buffer underruns might occur or more laggy sound.
Oh, BTW Solomonās Key should have sound now too
wow - excellent!
And may I just point everybody to Black Tiger - the only arcade game I could complete using 1 credit, and which also happens to be one of the best arcade games ever ;D
Now if it only had soundā¦ :-*
Did you gain any performance from using LWJGL ?
[quote]Did you gain any performance from using LWJGL ?
[/quote]
All rendering is still done inside the CPU. Only the final frame is rendered using LWJGL, so there not really a speed gain Iām afraid.
What I did gain is better timing and better display quality (getting a zoomed and filtered display for free).
It should be possible to completely render everything using LWJGL, but that will require a large rewrite.
And yeah, Black Tiger is very cool but I canāt get past one point where I have to get up on platform that I canāt reach :-[
Galaga - āillegal request to write non-integral number of framesā Apparently some kind of JMF errorā¦?
Cas
Iām not even sure what that message means. :-[
Maybe I should just render sound using openAL.
YES Thatās the whole point of the LWJGL after all
Cas
āillegal request to write non-integral number of framesā means JavaSoundās streaming has been sent a chunk of sound thatās not a full frame (as in the number of bytes in a sample). Ex.: youāre using 16-bit sound samples and youāve only sent 1 (not 2 or multiples of 2) byte to the JavaSound line. Thatāll cause the message.
HTH,
BK
No just crashes. It attempted to change screen mode ( I saw my screen res appear briefly in the JWS window log message, then screen flicked to black, then almost straight away it crashed.
Still desperately waiting for the day that LWJGL has a default screen-mode-selection routine that is easy and works AND which all developers use instead of each rolling their own and it not working half the timeā¦
Thanks for the explanation.
Looks like a bogus message in this case though, since my code cannot cause that.
Iām doing this:
line.write(sc.getByteStream(), 0, WRITE_BUF_SIZE * 2);
and WRITE_BUF_SIZE is an intā¦
Converting to openAL now :-/
[quote]No just crashes.
[/quote]
Oh, bummer :-[. Does Cosmic Trip also crash on your machine? (Iām using the same display selection code, so maybe the display selection is not the problem).
Do you have a webstart log?
Yāall should take a look in CVS for the lwjgl util Display class which has a very comprehensive screen mode selector class in it.
And of course thereās the new LWJGL Display code, which is now as simple as Display.create() Gets you a fullscreen window in the userās normal desktop resolution and colour depth.
Cas
Okay, Iāll take a look even though Iām not at all convinced my own display selection code is at fault here (after all, blahās display mode did change briefly)
blahās computer is frequently fux0red I think he must have drowned one of his great ancestors in a cup of tea or something.
Cas