Wiki source code of Elona Porting Project Overview

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

Show last authors
1 {{toc/}}
2
3 The Elona Porting Project aims to create an extensible and maintainable port of the roguelike [[Elona]].
4
5 Please note that this project is **not** officially sanctioned by [[Noa]].
6
7 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>>HSPlet]] 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.
8
9 = Resources =
10
11 HSPlet will be used to bring up the initial port of Elona on Java.
12
13 = Background =
14
15 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.
16
17 [[HSPlet]] is an implementation of the HSP runtime environment in Java through a compiler and HSPlet runtime library. HSPlet compiles [[HSP's bytecode>>ReferenceDocuments.hsp3code\.txt]] files into one or more Java .class files.
18
19 = Rationale =
20
21 == Why Java? ==
22
23 1. It's a fairly popular language.
24
25 1. It can host many other languages, from Python (Jython) and Ruby (JRuby) to Clojure and Scala.
26
27 1. It is a memory managed high-level language.
28
29 1. The performance of the JVM is reasonably high, compared to other high-level languages.
30
31 1. HSPlet is written in Java (it exists already)
32
33 == Why HSPlet? ==
34
35 1. It already exists and works for small programs.
36
37 1. It is reasonably readable.
38
39 1. Source is available.
40
41 = Requirements =
42
43 ToDo
44
45
46 = Objectives/Milestones =
47
48 * [[HSP Extension>>Main.HSP Extensions Required in Elona]]
49 ** stubs - done!
50 * HSPlet [[new opcode>>Main.HSP Opcodes Required in Elona]]
51 ** enhancement stubs - done!
52 * HSPlet new opcode enhancement implementation
53 ** Mostly done - missing some extended [[DllCtrl opcode>>Main.HSP Opcodes Required in Elona#DllCtrl]] implementations, [[COM>>Main.Microsoft Windows#COM]] interaction.
54 * Elona compilation on HSPlet
55 ** Done! Private branch of HSPlet compiles Elona successfully.
56 * Elona port with stubbed extensions
57 ** --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.--
58 ** Done, as of 2011 June 11.
59 * Elona port that verifies in the Sun RI JVM bytecode verifier
60 ** --Blocked, due to generated run() method exceeding 64k barrier for Code attribute of a Method.--
61 ** Fortunately, this is slightly easier to fix.
62 *** --Tasklet: Provide a trampoline to merge consecutive method calls that do not have labels. Assigned: JammyHammy--
63 ** Kejardon has fixed this (as of changeset [[940c67e3a1cc>>https://bitbucket.org/jdstroy/hsplet/changeset/940c67e3a1cc]])
64 * Elona port with implemented [[extensions]]
65 ** The required extensions exist.
66 ** Miscellaneous extensions are not complete (water, user32.dll NumLock control, DSound/DMusic/DInput)
67 ** Graphics performance is painful.
68 * Working Elona port, equivalent to Elona 1.22
69 ** Pre-Alpha 1 released. This is close to 1.22, but not equivalent yet.
70 * Enhanced Elona port - extensibility hooks provided
71 * Enhanced Elona port - extensibility hooks implemented
72 * Enhanced Elona port - extensibility hooks used to provide [[i18n]] support, [[graphics pack]] support, [[music pack]] support
73 * Enhanced Elona port - extensibility hooks used to reduce the amount of hardcoded data within the game
74 * Enhanced Elona port - extensibility hooks used to provide expandable storage