jac64-devel Mailing List for JaC64
Brought to you by:
joxe
You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
---|
From: Chris P. <cpr...@gm...> - 2011-10-06 14:42:35
|
Hello, The attached patch (against svn revision 140) fixes a few issues in JaC64. I've been working on these changes in a fork I made of the JaC64 sources on Bitbucket: https://bitbucket.org/catseye/jac64.fork/ Please feel free to include the patch (or parts of it that you like) in JaC64 itself. Here are the issues that the patch addresses, from most significant to least significant: * When reloading the web page, the Java applet does not get properly re-initialized, and just hangs, usually requiring you to restart your browser. The problem was that the map of InterruptManagers from the previous instance of the applet was still available in the new applet, and these objects were working on obsolete state. Deleting and re-allocating the map of InterruptManagers at applet destroy time fixed this. * When the applet starts, the joystick sometimes acts as if it is pushed down and right, and it "sticks" that way. The variable "bval" was initally 0 (all switches on); initializing it to 255 instead (all switches off) fixed this. As part of fixing this, I refactored the code to make more sense (to me), moving the logic to wait for the Kernal startup to a different place, renaming updateKeyboard() to updateJoystick() (because that's really what it is doing now), and not resetting the CPU when it wasn't necessary (i.e., when it was already reset earlier in the code,) * The routine to read a file was not properly handling files smaller than 256 bytes -- it would try to read even more data from the file, because -1 < 256. This was a simple fix. * If the audio driver could not be initialized, the applet would crash with a NullPointerException, because "dataLine" was not initialized, but still being dereferenced. This has been fixed, but it doesn't help much, because the applet relies on the audio driver for timing; if the audio driver could not be initialized, getMicros() always returns 0, making the applet go really, really fast (too fast to be usable for anything.) A better solution here would be to initialize a fake audio driver which just supplies timing information, if a real audio driver could not be initialized. * The Makefile doesn't delete all classfiles when doing "make clean". Also, the Makefile doesn't specify that the classfiles are dependencies of the jars, so it does not always rebuild a jar if a classfile changed. These issues have been fixed. * Some source files contain non-ASCII characters, which the Java compiler would complain about. I changed the encoding of these files to UTF-8 to avoid these Java warnings. * Some other warnings were being issued by the Java compiler (isFocusable(), UnsupportedEncodingException, . Some of these have been cleaned up. And some small improvements: * Added EXTRA_JARFILES to allow the smalljar target to include any files you specify in the jar. This is useful for bundling .PRGs and .D64s in the jar, to avoid Java security restrictions which prevent them from being fetched separately from the server. * Fixed some typos, used some symbolic constants where available, added some printStackTrace()s, improved some debugging printlns, etc. Thanks for writing JaC64! -Chris |