This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
apemanzilla's profile picture

CCEmuX - A modular ComputerCraft emulator

Started by apemanzilla, 10 June 2018 - 09:04 PM
apemanzilla #1
Posted 10 June 2018 - 11:04 PM

CCEmuX
Hello everyone! After several years of work by many contributors, I'm proud to announce the first official release of CCEmuX, a new CC emulator written in Java with many unique features.

Features
SpoilerPlugin support
CCEmuX has full support for plugins, allowing new fonts, peripherals, APIs, renderers, and more to be implemented in a modular fashion. In fact, many of the core CCEmuX features are implemented using built-in plugins: the renderers, ccemux API, custom ROM entries, high resolution font (Thanks BombBloke!), and peripherals. A complete API is available for developers to write their own plugins using any JVM language.

Peripheral support
CCEmuX has full support for peripherals, implemented using plugins. Disk drives and wireless modems are available built-in, and others may be implemented by third-party developers or added to CCEmuX itself at a later date. Peripherals can be added and removed using ccemux.attach(side, peripheral) and ccemux.detach(side) respectively.

Emulator Lua API
A new Lua API, ccemux, is optionally available (enabled by default), allowing peripherals to be attached/detached, computers to be opened/closed, access to high-precision clocks for benchmarking, and more. This is paired with the emu ROM program, allowing you to easily control the emulator.

Automatic updates
The CCEmuX launcher automatically downloads and applies updates as they're released, so you'll always have the latest features with none of the hassle. If you want to use specific versions, you can change the launcher config or simply download and run the emulator itself without the launcher.

CC-Tweaked support
CCEmuX supports both vanilla ComputerCraft (built from the latest source) and CC-Tweaked by SquidDev, for extra features and fixes.

Powerful configuration system
A robust configuration system is implemented in CCEmuX, allowing you to change settings for the emulator itself and plugins. An easy-to-use plugin API is available for developers to use in their own plugins.

Modular rendering system
CCEmuX supports multiple rendering backends, implemented via plugins. Three are available in CCEmuX itself - AWT, using Java AWT and Swing (default); JFX, using JavaFX for more modern features and improved performance; and TRoR, using the TRoR protocol over standard in/out for headless setups. Others can be implemented using plugins, opening up possibilities for things like web-based renderers.

Open source
CCEmuX is 100% open source. All components are available freely under the MIT license, and contributions are welcome.
Download
The CCEmuX launcher can be downloaded from our website. Updates will be applied automatically, and you will be prompted for whether you want to use ComputerCraft or CC-Tweaked on the first run (this can be changed later by editing the launcher configuration).
Getting started
When you start CCEmuX, a single computer will be opened by default. From here, you can use the emu program to perform other emulator actions:
  • emu open - Opens a new emulator window with the next computer ID, or a specific ID if you pass it as an argument.
  • emu close - Closes the current emulator window. If this is the only computer, it will stop the emulator.
  • emu data - Opens the CCEmuX data folder in your file manager. This can be used to browse computer files, add custom plugins or resources, or edit the config files externally.
  • emu config - Opens the configuration window. From here you can change every setting for CCEmuX and your plugins. (Note that only the AWT renderer currently supports this - for other renderers, use emu data and then edit the configuration files).
  • help emu - Read the included help file, describing all of these commands in-depth.
Source code, bug reports, suggestions
You can view the source code, report issues, or make suggestions through GitHub.
Edited on 10 June 2018 - 09:21 PM
LDDestroier #2
Posted 11 June 2018 - 05:25 AM


…I guess I can finally get CCEmuRedux off my desktop. +1'd.


EDIT: It seems that mouse_scroll events are doubled.
Edited on 11 June 2018 - 05:53 PM
SquidDev #3
Posted 11 June 2018 - 08:13 AM
I've been using this emulator for well over a year (possibly almost 2 years now) so it's amazing to see it finally get a forum post!

The configurable screen dimensions are insanely useful (both for emulating a turtle and just having more screen space). I do like how the high-resolution font (<3 BombBloke) makes it all feel that wee bit more fancy.

EDIT: It seems that mouse_scroll events are doubled.
Should be fixed now - apparently AWT is a little funky about firing events. The launcher should fetch the latest version, so running it twice (once to download, second time to use) should fix it all.
blunty666 #4
Posted 16 June 2018 - 12:29 PM
This is really good! Seems to work with my existing CC code without any issues.

It might be worth mentioning in the OP about the lua directory in the data folder where you can put shared code for all computers? I managed to find it but only by accident :)/>
SquidDev #5
Posted 16 June 2018 - 03:05 PM
It might be worth mentioning in the OP about the lua directory in the data folder where you can put shared code for all computers? I managed to find it but only by accident :)/>
I assume you're referencing assets/computercraft/lua? This effectively acts the same way as CC's built-in resource pack support, though I'm not really sure how well documented that is either. While I'd rather like the emulator to be as self-explanatory as possible, there's definitely some bits we need to knuckle down and write something about (though ape's done a jolly good job in the OP).
LoganDark2 #6
Posted 16 June 2018 - 06:36 PM
Oh hey, this has been upgraded.
apemanzilla #7
Posted 17 June 2018 - 05:47 AM
Oh hey, this has been upgraded.

Yeah, there's been a few minor fixes. The launcher should automatically apply them.
LoganDark2 #8
Posted 17 June 2018 - 05:48 AM
Oh hey, this has been upgraded.

Yeah, there's been a few minor fixes. The launcher should automatically apply them.

I mean, the version that I had prior to noticing this was dated back before `emu config` was a thing.
LDDestroier #9
Posted 22 June 2018 - 08:28 AM
Another thing, sometimes after terminating a few times, key events will occasionally stop working. Mouse clicks will work, but not any keys.
Lignum #10
Posted 22 June 2018 - 04:03 PM
Another thing, sometimes after terminating a few times, key events will occasionally stop working. Mouse clicks will work, but not any keys.
Please file any issues on GitHub. It's easier for us when everything's in one place.
SquidDev #11
Posted 22 June 2018 - 07:18 PM
Another thing, sometimes after terminating a few times, key events will occasionally stop working. Mouse clicks will work, but not any keys.
Hrmrm, I'm unable to reproduce this at all. It would be really useful if you could do something like while true do print(coroutine.yield()) and try to reproduce - just so we can see what's being queued and what isn't.
biggest yikes #12
Posted 01 July 2018 - 12:22 AM
Hrmrm, I'm unable to reproduce this at all. It would be really useful if you could do something like while true do print(coroutine.yield()) and try to reproduce - just so we can see what's being queued and what isn't.
I think this might be a similar (?) issue, so I figured I'd put it here.
SpoilerThis only seems to happen after forcefully rebooting the computer with CTRL+R. The key_up events at the top (which map to CTRL and R, respectively) always seem to make it through when the bug occurs, but after that, no key events make it through.
Edited on 05 July 2018 - 09:36 PM
SquidDev #13
Posted 07 July 2018 - 10:15 AM
Another thing, sometimes after terminating a few times, key events will occasionally stop working. Mouse clicks will work, but not any keys.
I think this might be a similar (?) issue, so I figured I'd put it here.
Sorry for the delay: this should be fixed in the latest version. Can you both update and double check this works for you? (you'll need to run the emulator, wait for it to download and then restart it). It's possible I've missed some other cases, so do tell me if it's still occurring!
SquidDev #14
Posted 29 July 2018 - 12:53 PM
In case people are interested, I've started writing some documentation on the basic functionality of the emulator, in the hope that it'll clear up some of the basic questions. It doesn't cover any of the advanced stuff yet (peripherals, resource packs), but hopefully provides a nice reference point.

If people have any thoughts, or things they'd like to see documented, do let me know - either here or on the issue tracker.
SquidDev #15
Posted 13 May 2019 - 10:02 PM
Almost a year later, but I've finally fleshed out the documentation a little! We've now got a pages dedicated to peripherals, the ccemux API, and a couple of other things which didn't show up elsewhere. Hopefully this should alleviate the confusion a little, but do let us know if there's anything which you feel could do with further explanation!
Pyuu #16
Posted 18 July 2019 - 07:22 PM
Is it intentional for it to flicker so much when typing? Or is that normal for CC?
SquidDev #17
Posted 18 July 2019 - 07:39 PM
Is it intentional for it to flicker so much when typing? Or is that normal for CC?
IIRC the refresh rate for CCEmuX is a higher than what you get within Minecraft, which might make any potential flicker a little more obvious. That said, I've never had much of a problem with it, so interesting that you're experiencing it…
SquidDev #18
Posted 28 January 2020 - 10:35 PM
Ho ho, it's been a while since I posted here, but thought it would be worth mentioning some of the recent changes in CCEmuX:
  • You can now take screenshots! Use ccemux.screenshot() (or press F2) to take a screenshot. These can be accessed by running emu data, and then navigating to the screenshots folder.
  • You can now point CCEmuX at your Minecraft world's computer/ folder, or even a single computer folder. This should make it easier to use CCEmuX anywhere, rather than forcing you to put all your projects within the data directory. There's more information on the website on how to do that.
Edited on 28 January 2020 - 09:35 PM