ParaJVE : Parabellum's Java Vectrex Emulator   

Official Home of ParaJVE ... A travel through the programming of a freeware Vectrex emulator in java!

Saturday, October 18, 2008  

Light at the end of the tunnel...

Some new devices emulation made their way into the current version :

The Lightpen (applicable in both gameports), as well as the VecVoice (only available for the second gameport).


The VecVoice emulation code has been ready for more than a year ; I simply did not want to include it before because I did not like its sound output.

The problem does not lie within the code, but it's rather attributable to the samples used to render the sound. So Richard Hutchinson (creator of the VecVoice hardware) kindly lent me his device in order to let me capture some cleaner samples. This is unfortunately a task I put on hold, and that I don't have the time to carry on anymore...

So, I finally decided to include the sampling as is - after all it's better than nothing at all :) - and to return back his VecVoice to Richard (many thanks and sorry for this lengthy borrowing!).


The lightpen emulation is finally completed, as it now works in an acceptable way for the four games I have tested so far:

  • Art Master (gameport #2)

  • Animaction (gameport #2)

  • Melody Master (gameport #2)

  • Engine Analyzer (gameport #1)

The Engine Analyzer ROM is not really a game per se (and not entertaining in anyway), but is nonetheless interesting as it is the only binary I know of that makes use of a lightpen plugged in the first game port.

Technical digression...
When plugged in the second gameport, the lightpen's pin 4 is connected to the 6522's CA1 input pin, so the application just polls the state of the 6522's CA1 interrupt flag to know if the pen detects the line that is just being drawn. Also, the application will sometime setup the 6522 interrupt enable register so that it propagates a real IRQ to the CPU when CA1 is set.

When connected in the first gameport, the lightpen may be used through the CPU's FIRQ (rather than IRQ), as the pin 4 of the first gameport is connected to the CPU's FIRQ line. This is how the Engine Analyzer program reads the lightpen inputs.

Within ParaJVE, when the lightpen is enabled (this is done automatically for the 4 games that require it to be plugged), the Mouse Pointer is replaced with a Cross that figures the position of the lightpen on the screen.

By default, the lightpen is considered inactive (it cannot detect light hit) as long as no mouse button is pressed. It becomes active when either (or both) the Left or Right mouse button(s) is(are) pressed.

If the Right mouse button is pressed, the lightpen operates in accurate mode (that means that its precision is greater than normal, but also that it is likely to loose track of the light more easily if you move the mouse too fast).

What next ?

With these devices done, the next release is finally approaching. The code is now frozen, all I have to do is updating the documentations and third party libraries, then building the different packages.

All in all, I wouldn't be surprised to see the 0.6.0 release pop up sometime this month ... So it might be an appropriate time to give a try to the "Check for new versions" feature of the Help menu...