emuLib is the shared runtime library used by emuStudio and its plugins. It provides the public plugin API, runtime services, UI helpers, and reusable utility classes used across the emuStudio ecosystem.
- Plugin contracts and base classes for CPU, memory, compiler, and device plugins
- Runtime APIs for application integration, settings, context registration, and inter-plugin communication
- Utility classes for number conversion, radix formatting, Intel HEX handling, threading, and strings
- Swing-oriented UI helpers and reusable debugger table components
This repository currently builds version 12.1.0-SNAPSHOT. For released builds, prefer a published version from Maven Central in consumer
projects.
For Maven:
<dependency>
<groupId>net.emustudio</groupId>
<artifactId>emulib</artifactId>
<version>12.1.0-SNAPSHOT</version>
</dependency>For Gradle:
implementation 'net.emustudio:emulib:12.1.0-SNAPSHOT'- The library itself targets Java 11 bytecode.
- The Gradle wrapper in this repository is Gradle 9, which requires Java 17 or newer to run local builds.
- Until version 9.0.0, emuLib used group
net.sf.emustudioand artifactIdemuLib. - From version 10.0.0 onward, it uses group
net.emustudioand artifactIdemulib.
Run tests:
./gradlew testGenerate Javadoc:
./gradlew javadocIf Gradle fails with a JVM version error, point JAVA_HOME to a JDK 17+ installation before running the wrapper.
net.emustudio.emulib.pluginsPlugin interfaces, annotations, and abstract base classesnet.emustudio.emulib.runtimeApplication-facing runtime APIs and context managementnet.emustudio.emulib.runtime.settingsShared settings interfaces for plugins and runtime codenet.emustudio.emulib.runtime.helpersHelper utilities such asBits,NumberUtils,RadixUtils, andStringUtilsnet.emustudio.emulib.runtime.ioIntel HEX import and export supportnet.emustudio.emulib.runtime.uiSwing helpers, formatter interfaces, and debugger UI components
The table below groups methods by asymptotic cost.
n= input array or list lengthL= emitted binary string lengthp= registered radix pattern counts= input string lengthb= input byte countm= arbitrary-precision numeric magnitude size
For the O(m^2) rows, the practical cost is dominated by BigInteger
parsing and formatting, so exact constants depend on the JDK implementation.
| Methods | Time complexity |
|---|---|
Bits(int, int), Bits.toBytes(), Bits.reverseBytes(), Bits.reverseBits(), Bits.absolute(), Bits.shiftLeft(), Bits.shiftRight()NumberUtils.reverseBits(...), NumberUtils.readBits(...), all NumberUtils.readInt(...) overloads, all NumberUtils.writeInt(...) overloads, NumberUtils.bcd2bin(...), NumberUtils.bin2bcd(...)RadixUtils.getInstance(), RadixUtils.addNumberPattern(...), RadixUtils.formatByteHexString(...), both RadixUtils.formatWordHexString(...) overloads, RadixUtils.formatDwordHexString(...) |
O(1) |
NumberUtils.numbersToBytes(...), NumberUtils.numbersToNativeBytes(...), NumberUtils.shortsToBytes(...), NumberUtils.shortsToNativeBytes(...), NumberUtils.shortsToNativeShorts(...), NumberUtils.nativeShortsToNativeBytes(...), NumberUtils.nativeIntsToNativeBytes(...), NumberUtils.nativeShortsToBytes(...), NumberUtils.nativeShortsToShorts(...), NumberUtils.nativeBytesToBytes(...), NumberUtils.nativeBytesToIntegers(...), NumberUtils.nativeBytesToShorts(...), NumberUtils.nativeBytesToInts(...), NumberUtils.listToNativeInts(...) |
O(n) |
RadixUtils.formatBinaryString(int, int, int, boolean), RadixUtils.formatBinaryString(int, int) |
O(L) |
RadixUtils.setDefaults() |
O(p) |
RadixUtils.parseRadix(String), RadixUtils.parseRadix(String, int) |
O(p * s) |
RadixUtils.convertToRadix(byte[], 16, boolean) |
O(b) |
RadixUtils.convertToRadix(byte[], toRadix != 16, boolean), RadixUtils.convertToRadix(String, int, int) |
O(m^2) |
RadixUtils.convertToNumber(String, int), RadixUtils.convertToNumber(String, int, int) |
O(m^2 + b) |
RadixUtils.convertToRadix(String, int) |
O(p * s + m^2) |
For full plugin development documentation, see the emuStudio developer guide: https://www.emustudio.net/documentation/developer/introduction/.
At a high level:
- A plugin is represented by a single root object implementing
net.emustudio.emulib.plugins.Pluginor one of its derived interfaces such asCPU,Memory,Compiler, orDevice. - Plugins can expose contexts for inter-plugin communication by implementing interfaces derived from
net.emustudio.emulib.plugins.Context. - Plugins can communicate with the host application through
net.emustudio.emulib.runtime.ApplicationApi. - Shared configuration is exposed through the settings interfaces in
net.emustudio.emulib.runtime.settings.
When bundled manually, place the library in the lib/ directory of the emuStudio installation.
Example:
emuStudio/lib/emulib.jar