The Java ME runtime classes behind every MIDletPascal program.
mp3cc compiles Pascal into bytecode that calls ten small classes: the MIDlet itself, forms, strings, real numbers, record stores, HTTP, media and SMS. Upstream called them the RTL stubs and shipped them precompiled with the IDE. This repository keeps their last official source release — MPS 3.1 of 28 August 2010 — byte for byte, and builds it into preverified CLDC 1.0 class files the way the original toolchain did.
Every class sits in the default package under a one- or two-letter name. Generated bytecode links against those names, so they are part of the compiler's ABI and stay as they are.
| Class | Goes into the JAR when |
|---|---|
FW |
always — it is the MIDlet, and mp3cc never reports it |
FS |
the program uses forms |
S |
strings, resources or images loaded from the JAR |
F |
real numbers in fixed-point mode (-m1, the default) |
Real, Real$NumberFormat |
real numbers in floating-point mode (-m2), always both |
RS |
record stores (RMS) |
H |
HTTP connections |
P |
sound and music playback (MMAPI) |
SM |
SMS (WMA) |
mp3cc names the ones a program needs as ^2<name>.class lines in its output; they are
requirements, not errors. Put FW.class and each reported class into the JAR next to the generated
M.class, unit and record classes, and leave the rest out: SM.class alone makes a device look
for the WMA API, and F and Real are two implementations of the same thing.
compiler-output.md in mp3cc
has the whole protocol.
You need JDK 8, the last javac that still writes Java 1.1 class files, and Sun's Java Wireless
Toolkit 2.5.2_01 for the CLDC preverifier and the Java ME API JARs. The toolkit is Oracle-licensed
and not part of this repository; the script fetches its installer, checks it against a pinned
SHA-256 and unpacks it into toolchains/:
./scripts/install-wtk.sh
makemake compiles with -source 1.3 -target 1.1, runs preverify1.1 -cldc1.0, checks the result and
leaves the ten classes in build/classes/. Nothing in them comes from Oracle, so they are yours to
package. docs/building.md has the package list for Arch Linux, what a good
build looks like, and what to do when it does not.
MPS.3.1 in revision 15 of the
MIDletPascal SourceForge repository, by Niksa Orlic and Javier Santo Domingo. Real.java is Roar
Lauritzsen's 63-bit floating-point library, version 1.13, as they shipped it. make check confirms
the sources still match that release: UPSTREAM.sha256 holds the hashes, and Git is told to leave
the original CRLF line endings alone.
GPL-3.0-or-later, as upstream. Real.java is GPL-2.0-or-later on its own and is distributed here
under GPL v3. NOTICE.md has the attributions. The Wireless Toolkit stays under Oracle's
license and is never committed.