+stephena Posted August 20, 2007 Share Posted August 20, 2007 I know some of you have been waiting for this for quite some time, so here it is JStella is a Java port of the Stella codebase for Java 6, by John L. Allen. This means that you can embed JStella in a webpage, and let visitors play games online, directly from your own website! It's currently at release 0.5, and functionality is still being added as we speak, but it works very well considering its age. Have a look at the JStella homepage for more info. I'm listed as a maintainer on this project, so you can report bugs to me if you like. But it would be better to send them directly to John, or post them in this thread. Let us know how it works ... Quote Link to comment Share on other sites More sharing options...
mos6507 Posted August 20, 2007 Share Posted August 20, 2007 (edited) The embed code example they give is not properly cross-platform. Since IE cluster-f'd their java support, Sun came up with a Java "plugin" (basically an ActiveX control wrapper) to insure that java code uses the proper runtime. I'm having trouble coming up with a single block of HTMl that will work for both IE and Firefox. If someone gets this working cross-browser, let me know. Right now I got it working in IE only. Seriously, the state of embedding plugins is totally broken these days. It's a miracle you can still embed a flash with the EMBED tag and have it work on both IE and Firefox (as long as you have the plugins). Edited August 20, 2007 by mos6507 Quote Link to comment Share on other sites More sharing options...
+stephena Posted August 20, 2007 Author Share Posted August 20, 2007 The embed code example they give is not properly cross-platform. Since IE cluster-f'd their java support, Sun came up with a Java "plugin" (basically an ActiveX control wrapper) to insure that java code uses the proper runtime. I'm having trouble coming up with a single block of HTMl that will work for both IE and Firefox. If someone gets this working cross-browser, let me know. Right now I got it working in IE only. Seriously, the state of embedding plugins is totally broken these days. It's a miracle you can still embed a flash with the EMBED tag and have it work on both IE and Firefox (as long as you have the plugins). Well, I did say it was a 0.5 release And I think the developer is a Windows user, so it's probably more extensively tested in IE. But now that the project is public and posted here, I'm sure it'll get more cross-platform love ... Quote Link to comment Share on other sites More sharing options...
+batari Posted August 20, 2007 Share Posted August 20, 2007 Here's what I get: $ java -jar jstella_0_5.jarJStella configuration file does not exist Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: java/util/ArrayDeque at jstella.core.JSAudio.<init>(JSAudio.java:105) at jstella.core.JSConsole.initializeAudio(JSConsole.java:316) at jstella.core.JSConsole.<init>(JSConsole.java:123) at jstella.runner.Intercessor.<init>(Intercessor.java:87) at jstella.runner.JStellaMain.<init>(JStellaMain.java:61) at jstella.runner.JStellaMain$20.run(JStellaMain.java:468) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:2 9) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) Quote Link to comment Share on other sites More sharing options...
+stephena Posted August 20, 2007 Author Share Posted August 20, 2007 Here's what I get:$ java -jar jstella_0_5.jarJStella configuration file does not exist Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: java/util/ArrayDeque at jstella.core.JSAudio.<init>(JSAudio.java:105) at jstella.core.JSConsole.initializeAudio(JSConsole.java:316) at jstella.core.JSConsole.<init>(JSConsole.java:123) at jstella.runner.Intercessor.<init>(Intercessor.java:87) at jstella.runner.JStellaMain.<init>(JStellaMain.java:61) at jstella.runner.JStellaMain$20.run(JStellaMain.java:468) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:2 9) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) It requires Java version 6 (aka 1.6). I don't know if that's the issue. Quote Link to comment Share on other sites More sharing options...
+batari Posted August 20, 2007 Share Posted August 20, 2007 It requires Java version 6 (aka 1.6). I don't know if that's the issue. Looks like that's it. The ArrayDeque class didn't exist until 1.6. However, this means that JStella will not work on OS X, since it appears that Tiger comes with 1.4 and you can only update to 1.5 at this time (which I just did, to no avail.) I looked at Sun's web page and they don't seem to have an OS X version, just Linux, Windows and Sun. I suppose one could build 1.6 from source on their Mac, but I doubt too many people are going to do that. I don't know much about this ArrayDeque class, but I wonder if it would be difficult to rewrite JStella so it isn't required? Quote Link to comment Share on other sites More sharing options...
Gregory DG Posted August 20, 2007 Share Posted August 20, 2007 Cool... I've been looking forward to this for a LONG time! I got it working here. So, it only works with Java 6? Quote Link to comment Share on other sites More sharing options...
+stephena Posted August 20, 2007 Author Share Posted August 20, 2007 It requires Java version 6 (aka 1.6). I don't know if that's the issue. Looks like that's it. The ArrayDeque class didn't exist until 1.6. However, this means that JStella will not work on OS X, since it appears that Tiger comes with 1.4 and you can only update to 1.5 at this time (which I just did, to no avail.) I looked at Sun's web page and they don't seem to have an OS X version, just Linux, Windows and Sun. I suppose one could build 1.6 from source on their Mac, but I doubt too many people are going to do that. I don't know much about this ArrayDeque class, but I wonder if it would be difficult to rewrite JStella so it isn't required? I'll have to look into it. A deque is just a double-ended queue, and I assume ArrayDeque is a double-ended queue implemented using an array (vs. a linked list). Creating a new class that duplicates this functionality would be dead easy. Assuming, of course, that's not the only thing that Java6-specific in the code. I suspect it isn't, though. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 20, 2007 Share Posted August 20, 2007 It says on the following page: http://jstella.sourceforge.net/jstelladoc.html More control options/implementations are planned for future releases. That sounds like there might be a future version that will allow people to use a controller if they want. Quote Link to comment Share on other sites More sharing options...
+batari Posted August 20, 2007 Share Posted August 20, 2007 Works in Firefox over here, not just IE (on a PC, obviously.) BTW, I assume this is GPL'ed. However, the class files in the jar file are all bytecode instead of human-readable source. Is the source available anywhere? Quote Link to comment Share on other sites More sharing options...
Gregory DG Posted August 20, 2007 Share Posted August 20, 2007 Also works in tiny mode. Would be nice to replace TAT's screenshots with this. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 20, 2007 Share Posted August 20, 2007 Oops, I forgot to say that the following seems to work fine for me using Firefox on a Windows Vista computer: http://www.ataritimes.com/jstella/ Quote Link to comment Share on other sites More sharing options...
Hackmann Posted August 20, 2007 Share Posted August 20, 2007 BTW, I assume this is GPL'ed. However, the class files in the jar file are all bytecode instead of human-readable source. Is the source available anywhere? You can get it from SourceForge's CVS. I'm looking right now at what's required to backport it to Java 5. The ArrayDeque thing is trivial to fix, since the JSAudio class only wants some Queue implementation; you can safely replace it with a LinkedList. There's another line in JStellaConfigurationDialog that affects the modality of one of the dialogs; removing the line gets everything to compile and run under Java 5, but keeps the configuration dialog from working properly. I'll see if there's an easy fix to the latter problem. Quote Link to comment Share on other sites More sharing options...
+batari Posted August 20, 2007 Share Posted August 20, 2007 (edited) I'll have to look into it. A deque is just a double-ended queue, and I assume ArrayDeque is a double-ended queue implemented using an array (vs. a linked list). Creating a new class that duplicates this functionality would be dead easy. Assuming, of course, that's not the only thing that Java6-specific in the code. I suspect it isn't, though. Nope, that's the only thing, or at least with the 0.3 version (which has source - the 0.5 version doesn't seem to) so I was able to remove the reference to that class to see if it worked, and it did. The function is in the sound code. Since I didn't actually implement the function, it only works as long as you disable sound. EDIT: some of what I wrote has already been addressed... I'm a little slow at times. Edited August 20, 2007 by batari Quote Link to comment Share on other sites More sharing options...
+batari Posted August 20, 2007 Share Posted August 20, 2007 BTW, I assume this is GPL'ed. However, the class files in the jar file are all bytecode instead of human-readable source. Is the source available anywhere? You can get it from SourceForge's CVS. I'm looking right now at what's required to backport it to Java 5. The ArrayDeque thing is trivial to fix, since the JSAudio class only wants some Queue implementation; you can safely replace it with a LinkedList. There's another line in JStellaConfigurationDialog that affects the modality of one of the dialogs; removing the line gets everything to compile and run under Java 5, but keeps the configuration dialog from working properly. I'll see if there's an easy fix to the latter problem. Just saw this, thanks! Let us know if you find an easy solution. Quote Link to comment Share on other sites More sharing options...
Hackmann Posted August 20, 2007 Share Posted August 20, 2007 It's easier than I thought. As it turns out, DialogControlItem.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); at JStellaConfigurationDialog.java:452 is equivalent to the Java 5-compatible DialogControlItem.setModal(true) Swap the latter line of code in, and everything works fine. Quote Link to comment Share on other sites More sharing options...
+stephena Posted August 20, 2007 Author Share Posted August 20, 2007 It's easier than I thought. As it turns out, DialogControlItem.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); at JStellaConfigurationDialog.java:452 is equivalent to the Java 5-compatible DialogControlItem.setModal(true) Swap the latter line of code in, and everything works fine. If you get a chance, please forward these findings directly to the author, so it can be fixed upstream. I forget his email address now, but it's on the webpage. Also, for those asking about source code, it is available through CVS from Sourceforge. This port is released under the GPL, and source code will always be available. Quote Link to comment Share on other sites More sharing options...
Hackmann Posted August 20, 2007 Share Posted August 20, 2007 And here's the (trivial) patch against the current CVS HEAD: ### Eclipse Workspace Patch 1.0 #P JStella Index: src/jstella/core/JSAudio.java =================================================================== RCS file: /cvsroot/jstella/jstella/src/jstella/core/JSAudio.java,v retrieving revision 1.6 diff -u -r1.6 JSAudio.java --- src/jstella/core/JSAudio.java 20 Aug 2007 05:11:26 -0000 1.6 +++ src/jstella/core/JSAudio.java 20 Aug 2007 22:52:50 -0000 @@ -102,7 +102,7 @@ // Poke/Queue related variables - private java.util.Queue<AudioRegisterPoke> myPokeQueue=new java.util.ArrayDeque<AudioRegisterPoke>(); + private java.util.Queue<AudioRegisterPoke> myPokeQueue=new java.util.LinkedList<AudioRegisterPoke>(); private int myExcessCycles=0; private double myCyclePool=0; private int myPreviousCycle=0; Index: src/jstella/runner/JStellaConfigurationDialog.java =================================================================== RCS file: /cvsroot/jstella/jstella/src/jstella/runner/JStellaConfigurationDialog.java,v retrieving revision 1.2 diff -u -r1.2 JStellaConfigurationDialog.java --- src/jstella/runner/JStellaConfigurationDialog.java 20 Aug 2007 05:11:26 -0000 1.2 +++ src/jstella/runner/JStellaConfigurationDialog.java 20 Aug 2007 22:52:50 -0000 @@ -449,7 +449,7 @@ private void addControlItem() { - DialogControlItem.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); + DialogControlItem.setModal(true); myCurrentControlItem=null; setCurrentVKCode(KeyEvent.VK_SPACE); ComboBoxVirtualItem.setSelectedIndex(0); Quote Link to comment Share on other sites More sharing options...
+batari Posted August 21, 2007 Share Posted August 21, 2007 (edited) Nice... The source is indeed there but it is not in archive form. I'm not feeling too warm about downloading all of those files individually. I already tried an automated website downloader tool and it didn't work. Edited August 21, 2007 by batari Quote Link to comment Share on other sites More sharing options...
Hackmann Posted August 21, 2007 Share Posted August 21, 2007 Nice... The source is indeed there but it is not in archive form. I'm not feeling too warm about downloading all of those files individually. I already tried an automated website downloader tool and it didn't work. Don't use the Web frontend for downloading the source tree! That's there for quickly browsing individual files. If you want to grab the whole source tree, use a standalone CVS client. This page has the details you need. Quote Link to comment Share on other sites More sharing options...
Gregory DG Posted August 21, 2007 Share Posted August 21, 2007 Just added a bunch more games. Check out what works, what doesn't, what's glitched. I tried Berzerk VE, looks like the voice messes up. Boy, I love this. Quote Link to comment Share on other sites More sharing options...
+batari Posted August 21, 2007 Share Posted August 21, 2007 Nice... The source is indeed there but it is not in archive form. I'm not feeling too warm about downloading all of those files individually. I already tried an automated website downloader tool and it didn't work. Don't use the Web frontend for downloading the source tree! That's there for quickly browsing individual files. If you want to grab the whole source tree, use a standalone CVS client. This page has the details you need. Thanks! Got it, and built a jar that should work under java 5 jstella.zip However, there is a much bigger problem than Java compatibility. The 6507 core needs some serious help, as it does not seem to support ANY illegal opcodes, which makes it incompatible with most homebrews, which includes bB games. So much for putting it up on bataribasic.com to let people play bB games online. At least for now. Quote Link to comment Share on other sites More sharing options...
mos6507 Posted August 21, 2007 Share Posted August 21, 2007 This is a real milestone! I've seen arcade emulators on Java for ages. The old Galaxian style stuff, Space Invaders, the games.com emulators. The general concensus in the late 90s was that the processor requirements for Java to emulate the 2600 could not be met with the machines of that day. That's clearly not the case anymore. Stella has improved. Java has improved. CPU speeds have obviously improved a lot. I'd be curious to know how well it runs on older PCs, like ancient 1GHZ celerons laptops with cruddy embedded video. I really want to know where the cutoff is. It runs fine on my PIV 2.4ghz. That being said, Pitfall II sound is a little scratchy, but that's to be expected. Flicker has lots of tearing artefacts. Wish there was a way for Java to lock to the monitor refresh. Solaris still has the glitch on the warp out. Didn't that get fixed yet in the main Stella codebase? Quote Link to comment Share on other sites More sharing options...
+stephena Posted August 21, 2007 Author Share Posted August 21, 2007 That being said, Pitfall II sound is a little scratchy, but that's to be expected. Flicker has lots of tearing artefacts. Wish there was a way for Java to lock to the monitor refresh. Some of the Pitfall II sounds actually sound a little better than Stella itself. I'll have to research that. As for flickering, I don't believe the emulator is using phosphor mode for 30Hz flicker. It is built in, since I've used it when running JStella as a standalone JAR file (it's an option in the menu). Solaris still has the glitch on the warp out. Didn't that get fixed yet in the main Stella codebase? No, that hasn't been fixed in Stella yet either. Quote Link to comment Share on other sites More sharing options...
Gregory DG Posted August 21, 2007 Share Posted August 21, 2007 Any game requests for my Jstella page? I'm probably going to change Berzerk VE since it doesn't work anyway. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.