Better HN
topnewbestaskshowjobs
Log inSign up

AlexGuo1998

2 karma · joined Jan 21, 2023 (3y ago) · 2 submissions

Submissions

comment 6mo ago · link · parent

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

comment 3y ago · link · parent

> ... instead of copy/pasting from Firefox's developer tools.

You may toggle the "raw" switch in the upper-right corner, or Firefox will trim the header like "jh6…W5n".