Brussels / 4 & 5 February 2023


Emulator development in Java

This talk explores my recent experience of developing an emulator in Java for two of our favourite Z80-based retro machines, the Sinclair ZX Spectrum and Sega Master System. At first glance, Java may not seem the obvious choice for emulator development: it lacks features such as unions, macros and definable primitive types (at least until recently!) that are leveraged for efficiency by emulators written in C/C++; integrating with native libraries beyond those in the standard platform can add development complexity and performance considerations; meanwhile, our program runs in a virtual machine whose JIT compiler and garbage collector have the potential to introduce latency into time-critical code.

On the other hand, Java is cross-platform and includes sound, graphics, UI and concurrency APIs out of the box and its native platform integration and under-the-hood optimisations have been steadily maturing. We will explore what Java has to offer the emulator developer using “traditional” Java language and standard OpenJDK features alone, and see when and how to address some of our concerns when it comes to low-level data operations and performance.


Photo of Neil Coffey Neil Coffey