ParaJVE : Parabellum's Java Vectrex Emulator   

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

Tuesday, July 21, 2009  

WIP : Game Saves

Also included in the next release will be save game support. With this feature, you will be able to save your current gaming session in a file, and load it back in the emulator whenever you want.

Following are the notes dealing with this enhancement (issue #21 on ParaJVE's tracker).

Emulator State Persistence
ParaJVE can now save and reload its full state (including the vectors work buffer) in small binary files (usually less than 4KB).

There are two kind of save/load features :

Quick Saves

When the user presses F5, the emulator will save its current state in a Quick-Save slot ; this slot will be loaded back when F9 is pressed. Each game has a specific Quick-Save slot (basically derived from its binary CRC), so quick-saving one game will not overwrite the Quick-Save slot of another game.
When Quick-Saving/Quick-Loading, the user is not asked for a file name, as all Quick-Save files are located in the <data/saves/quick> folder.

Standard Saves

When the "Save..." item is clicked in the "File" menu, ParaJVE asks the user a file name where to store its state. This file can be loaded back later, when selecting the "Load..." menu item. Please note that you can only load a save file containing data for the game currently emulated (for instance, you can't load a MINESTORM save if you are running the BERZERK game).

The save/load file selector dialog embeds a preview frame that lets you see the content of the selected save file (cf. picture attachment).

It also provides 3 different file filters :
  • "All Files" : list all the files in the current folder,
  • "ParaJVE save files" : list only the files containing valid ParaJVE save files
  • "ParaJVE compatible save files" : list only the files containing valid ParaJVE save files that match the game currently emulated.


Thursday, July 16, 2009  

WIP : Overlays & Rendering

With the arrival of the summer, I felt like it was time to provide you with some Work-In-Progress information, so here it is... First, let's start with a couple of snapshots, taken from the current development version :

Well, as you have probably already noticed from the pictures above, I've been quite busy lately with improvements regarding the Overlays and the vectors rendering. This comprehends these three different tasks :

  • Rewriting the OpenGL code responsible for rendering the overlays :

    In the previous versions, the transparent areas in the overlays were obviously too dark (the colors were barely visible, and the vectors drawn in such areas did not have their colors altered enough).

    The new overlays handler now displays textures in a much more colorful way (especially for the vectors showing through the transparent areas), and it also provides different rendering modes, so that every user can select (through a menu) the one that best fits his monitor brightness.

    This task is 100% completed.

  • Improving the overlays texture quality :

    So far, the textures used for the overlays were poor quality pictures found here and there on the Internet, and that I had to alter a bit to conform with the ParaJVE rendering engine. If this was enough for a first shot, it's now clearly not good enough when the emulator is run within a large window (let alone fullscreen).

    Therefore, I've decided to create all the overlay textures from scratch. This is a long-drawn-out job that I've been postponing for too long, but the result is really well worth the pain. So far, I've done 12 overlays (Armor Attack, Berzerk, Blitz, CosmicChasm, HyperChase, MineStorm, Fortress of Narzod, RipOff, Scramble, SolarQuest, SpaceWars, and StarHawk) and there is about 12 more to go before the task is over.

    The only drawback is that the new overlays size will drastically increase (about 10 to 15 times larger than the old ones), but I will pack them all in a single texture file that should not be bigger than 2,5 MB.

    Task completion level : 50%

  • Implementing phosphor glow using a shader :

    In the versions released previously, the physical properties of the vectrex display system are emulated using a "persistence" option that mimics the phosphor afterglow. The result is fair enough, but it misses another specificity of the original display: the phosphor glow around the vectors being drawn.

    As I have finally found some time to learn GLSL (the OpenGL Shading Language), I've started to work on shaders that would help to render the phosphor glow. The current implementation is still in its infancy (as this is a trial & error process, with a lot of parameters to tweak) and the code is far from optimal... But still, the result looks promising, and runs in real-time.

    There's still a lot of work to do for this task, because I need to find the best settings, then a way to dynamically and conditionally change the parameters depending on the users preferences and the OpenGL drivers capabilities (availability of p-buffers, etc...)

    One thing is certain : this "glow" feature will only be available for users that have a 3D card whose driver is compatible with OpenGL 2.0 (or more), because GLSL is not available for older versions of OpenGL.