Elona Porting Project Overview

Last modified by John Stroy on 2018/10/19 11:40

The Elona Porting Project aims to create an extensible and maintainable port of the roguelike Elona.

Please note that this project is not officially sanctioned by Noa.

The project aims to make an initial port of Elona to Java (pure, no native code outside of the Java platform) through the HSPlet framework that will be nearly 100% compatible with mainline Elona.  Within reasonable bounds, the port should behave just like mainline Elona.  Some aspects are difficult or impossible within the provided constraints (for example, inter-process mutexes do not exist in pure Java; therefore, prohibiting multiple active instances through inter-process mutexes would not be possible); such aspects should be minimized if possible.


HSPlet will be used to bring up the initial port of Elona on Java.


HSP compiles files into its own object code format, commonly called "packfiles."  These files contain byte code that interpreted at runtime by the HSP runtime virtual machine.  start.ax is the entry point for most HSP programs, including Elona.

HSPlet is an implementation of the HSP runtime environment in Java through a compiler and HSPlet runtime library.  HSPlet compiles HSP's bytecode files into one or more Java .class files.


Why Java?

  1. It's a fairly popular language.
  1. It can host many other languages, from Python (Jython) and Ruby (JRuby) to Clojure and Scala.
  1. It is a memory managed high-level language.
  1. The performance of the JVM is reasonably high, compared to other high-level languages.
  1. HSPlet is written in Java (it exists already)

Why HSPlet?

  1. It already exists and works for small programs.
  1. It is reasonably readable.
  1. Source is available.




  • HSP Extension
    • stubs - done!
  • HSPlet new opcode
    • enhancement stubs - done!
  • HSPlet new opcode enhancement implementation
  • Elona compilation on HSPlet
    • Done!  Private branch of HSPlet compiles Elona successfully.
  • Elona port with stubbed extensions
    • Broken - the constant pool has overflowed because of the number of generated c onstants.  VMspec indicates that there can be at most 65536 constant pool entries.  Currently, there are approximately 135000 constant pool entries after a source-level modification to Elona to reduce the number of constants.  
    • Done, as of 2011 June 11.
  • Elona port that verifies in the Sun RI JVM bytecode verifier
    • Blocked, due to generated run() method exceeding 64k barrier for Code attribute of a Method.
    • Fortunately, this is slightly easier to fix.
      • Tasklet: Provide a trampoline to merge consecutive method calls that do not have labels.  Assigned: JammyHammy
    • Kejardon has fixed this (as of changeset 940c67e3a1cc)
  • Elona port with implemented extensions
    • The required extensions exist.
    • Miscellaneous extensions are not complete (water, user32.dll NumLock control, DSound/DMusic/DInput)
    • Graphics performance is painful.
  • Working Elona port, equivalent to Elona 1.22
    • Pre-Alpha 1 released.  This is close to 1.22, but not equivalent yet.
  • Enhanced Elona port - extensibility hooks provided
  • Enhanced Elona port - extensibility hooks implemented
  • Enhanced Elona port - extensibility hooks used to provide i18n support, graphics pack support, music pack support
  • Enhanced Elona port - extensibility hooks used to reduce the amount of hardcoded data within the game
  • Enhanced Elona port - extensibility hooks used to provide expandable storage