söndag 20 maj 2007

Version 1.0 of JaC64 is up!

I have finally removed the Beta status of JaC64 and now released JaC64 1.0 (it is currently up on www.jac64.com). Latest fix is mainly for getting rid of the newly introduced javasound bugs in Java SE 6. So if you have Java SE 6 installed, please try the emulator and report any problems. It works for my machines (3 PCs with windows).

Commodoregaming have re-introduced JaC64 on their new Gaming PC site, check their vintage section on www.commodoregaming.com

onsdag 9 maj 2007

Workaround for the Javasound problem

I found a workaround for the javasound bug. Instead of using the write in a way that makes it block I first check if there is room for the current newly generated piece of sound. If not, a regular "Thread.sleep(1)" is called, which will cause the soundbuffer to be emptied slighly, usually enough to be able to add the generated buffer.

A new version of the JSIDPlay is already up at jac64.com and a new version of the JaC64 emulator will be there in a few days.

lördag 5 maj 2007

Javasound messed up?

I did not get the blogs at www.jac64.com to work well, so I move over to more robust technology...

I have been synchronizing the speed of my C64 emulator JaC64 using the javasound SoundDataLine's write() method that before Java SE6 blocked the calling thread for as long time it took to get enough space to write the sound data to the buffer. This way of synchronizing the emulator worked very fine until now when I upgraded to SE6 which seems to get waits of up to ~300 milliseconds where SE5 would wait a few milliseconds. This is of course causing the emulator to "sleep" for several frames which cause all games, demos, etc. to be very hard to enjoy...

So instead of doing:

... generate sound in buffer ... [for a few milliseconds playback]
dataLine.write(buffer, 0, GEN_LEN);
... ....

I now need to fix a new way to get the emulation speed to be correct, and also report this bug to Sun for fixing it in the next version of Java SE6.