I manage the JStella project at SourceForge (at http://jstella.sourceforge.net). JStella is an Atari 2600 emulator written in Java. It is based on the open source Stella software, which is written in C++. I translated Stella into Java mainly to prove wrong the people who said that it would not work well in Java. And I think I have been largely successful in this…it currently runs just as well as the C++ on my computer. But I really don’t think it’s optimized…I’m not a Java2D expert, or a Java performance person, and I think there is a lot of stuff relating to graphics in the code that causes it to not be as fast as it should. (For example, I just found out about the createCompatibleImage method…that improved performance on my machine dramatically, but apparently not so much on other machines.)
I use clipping, so the main problems are when things on different parts of the screen get changed. There is some slowdown…it slows down the virtual CPU (of the Atari) as well, which seems to me like somehow the code in the “calculation” thread is blocking while waiting for the thread that does the painting to finish…is this normal? Of course, I may be completely wrong. But if any Java2D pros out there want to look at it, contribute, etc., I (et al.) would be grateful. (You can go to the JStella project page on Sourceforge and check out the CVS repository, where all the most recent source code is…the downloadable source code is a few weeks old.)
JLA