A new open source CC emulator, written in Java, with enhanced WebAssembly (WASM) support.
This version includes CCWASM integration, allowing ComputerCraft computers to load and execute WebAssembly modules using the wasm Lua API.
As simple as running ./gradlew build. The compiled, runnable jar will be written to build/libs/CCEmuX-version-all.jar.
- Navigate to the project directory
- Run the compiled JAR:
java -jar build/libs/CCEmuX-1.1.0-cct.jar
The official CCEmuX Launcher is the recommended way to run CCEmuX. Here's how to use it with your local build:
Your compiled JAR will be at:
G:\CCEmuX\build\CCEmuX-1.1.0-cct.jar
- Open CCEmuX Launcher
- Click "Add" or "Configure"
- Fill in the details:
- Name: CCEmuX with CCWASM
- Path:
G:\CCEmuX\build\CCEmuX-1.1.0-cct.jar - CC:Tweaked Version: 1.117.0 (core)
- Java Version: 21 (or your installed Java version)
- Select your configured instance
- Click "Launch" or "Run"
-
Create a
wasmfolder in your CCEmuX data directory- Default location:
%APPDATA%/CCEmuX/wasm/ - Or where your CCEmuX instance saves computer data
- Default location:
-
Place your WASM files in the
wasmfolder
In a ComputerCraft computer, you can now use:
-- Load a WASM module
local ctx = wasm.load_wasm("my_module")
-- Call WASM functions
local result = ctx.add_numbers(5, 3)
print("Result:", result)
-- Load WASM from string
local wasmCode = [=[
(module
(type $t0 (func (result i32)))
(func $export_func (type $t0) (i32.const 42))
(export "export_func" (func $export_func))
)
]=]
local ctx2 = wasm.load_wasm_from_string(wasmCode:toBytes())
print("From string:", ctx2.export_func())- Loading WASM files from the filesystem
- Loading WASM from Lua strings
- Calling WASM functions with various data types (i32, i64, f32, f64, strings, booleans)
- Object passing between Lua and WASM
- AOT compilation support for better performance
See the ccwasm/example_wasm/ directory for example programs written in Rust that can be used with CCEmuX.
If you encounter Java-related errors:
# Specify Java path
export JAVA_HOME="/path/to/java21"
java -jar build/libs/CCEmuX-1.1.0-cct.jar- Check that the
wasmfolder exists - Verify WASM files are in the correct location
- Look for CCWASM plugin loaded messages in the console
- Ensure you're using the correct Lua API syntax
If the launcher doesn't see your build:
- Ensure the JAR file exists at the specified path
- Try refreshing the launcher
- Check that you have Java 21 installed
- Run the JAR directly to verify it works
CCEmuX/
├── src/main/java/ # Source code
│ ├── com/iung/ccwasm/ # CCWASM integration
│ └── net/clgd/ccemux/ # CCEmuX core
├── build/libs/ # Compiled JARs
├── ccwasm/ # Original CCWASM source
├── CCWASM_TEST.md # Detailed testing guide
└── README.md # This file
- CCEmuX: MIT License
- CCWASM: CC0 1.0 Universal
- Chicory (WASM runtime): Apache 2.0 License
简体中文 README - 中文版使用说明,包含详细的配置和测试指南。