Remix.run Logo
AlexGuo1998 2 days ago

I'm currently working on a custom Java VM for running J2ME games. Like KVM[1], but in modern C++ and without the memory footprint constraint.

The main goals are to support: - Instant save (i.e. saving and restoring the whole JVM and native state) - Deterministic replay (mainly cycle counting and deterministic thread scheduling, for TASing). Also no JIT to possibly bring it to Apple platforms.

The standard class library is also written in C++. I'm using templates heavily for native interface boilerplate, ensuring type correctness, etc.

Started because I noticed that all current J2ME emulators (or runtimes?) are written in Java. They are generally just providing the missing classes for the games to run, and relying on the system JVM. I wanted to write it like other console emulators (e.g. NES), to have full control of the execution.

Have been doing this since the last year. Current the VM part is almost done (run classes correctly) but for class libraries there's still a long way to go.

[1] https://en.wikipedia.org/wiki/K_virtual_machine