CraftOS-PC v2.2
CraftOS-PC v2.2 is the biggest update for CraftOS-PC since its launch, introducing a brand new debugger, a revamped plugin API, and lots of bug fixes.
If you are currently running CCEmuX, I have written a small utility that will automatically migrate your CCEmuX data to CraftOS-PC. You can find it with the downloads below.
Also, if you haven't noticed I launched a dedicated website for CraftOS-PC at https://www.craftos-pc.cc. This site contains the latest download links as well as documentation for all of the new features in CraftOS-PC. If you haven't taken a look, go check it out!
These are the changes since the v2.2 pre-release:
- Added F12 hotkey to copy screenshot to clipboard (Windows & Mac only)
- Calling
term.screenshot("clipboard")will have the same effect
- Calling
- Fixed default IO handles (stdin/out/err)
- Changed
_HOSTvariable to more accurately represent ComputerCraft - Fixed
delete.lua wget.luano longer requires a file name (CC:T behavior)- Added
register_termQueueProvidercapability, which recieves the address of thevoid termQueueProvider(Computer *comp, const char *(*callback)(lua_State*, void*), void* data)function
In addition, here are all of the changes since v2.1.3:
- Added new debugger peripheral
- Opens in separate window
- Four tabs available
- Debugger: GDB-style debugging terminal
- Call Stack: Visual backtrace viewer, shows files
- Profiler: Measures function call count & time
- Console: Allows printing debug messages outside of the main terminal
- Computer can be paused with
debugger.break(),debug.debug(), or Ctrl-T in debugger - See the documentation for more information
- Added breakpoints
- Can be set with
debugger.setBreakpoint(file, line)ordebug.setbreakpoint(file, line) - Does not require debugger to be attached
- When no debugger is available,
lua.luais executed
- When no debugger is available,
- Can be set with
- Fixed #1 ("attempt to yield across metamethod/C-call boundary" when using pcall)
- Tracebacks/errors now function normally
- This was accomplished with a patch that allows yielding across pcall's in Lua 5.1.0
- Thanks to EveryOS for sharing the patch and for sending me a fixed version for 5.1.5
- Moved per-user save directory to more platform-appropriate locations
- Windows:
%appdata\CraftOS-PC - Mac:
~/Library/Application Support/CraftOS-PC - Linux:
$XDG_DATA_HOME/craftos-pc(usually~/.local/share/craftos-pc) - Data will be migrated when running CraftOS-PC v2.2 for the first time
- Windows:
- Added brand-new plugin API
- Plugins should now provide a
plugin_infofunction - This function pushes a table with the API version and requested capabilities onto the Lua stack
- Capabilities are requested by adding a callback function for a function in CraftOS-PC
- These callbacks will recieve the requested function as Lua userdata as the first value on the stack
- Available capabilities in v2.2:
register_getLibrary: Recieves the address of thelibrary_t * getLibrary(std::string name)functionregister_registerPeripheral: Recieves the address of thevoid registerPeripheral(std::string name, peripheral_init initializer)functionregister_addMount: Recieves the address of thebool addMount(Computer * comp, const char * real_path, const char * comp_path, bool read_only)function
- Plugins should now provide a
- Added new config options
vanilla: Set totrueto disable all CraftOS-PC featuresinitialComputer: The first computer that starts when opening CraftOS-PC
- Added
periphemu.names()which returns a list of all available peripherals (unsorted) - Added
term.drawPixels(x, y, lines)which draws a table of lines at a position- Each line can either be a string or a table of individual pixels
- Fixed
debug.sethook,debug.gethook debug.debug()now functions the same as hitting a breakpoint- Added hooks for errors, coroutine resumptions and yields
- Running
catch errorin the debugger will pause execution when an error occurs - Errors are logged to stdout if the
logErrorsconfig option is enabled
- Running
- Fixed a bug when creating directories
- Fixed timers with <= 0 length
- Fixed printing extended characters in the console
- Rewrote implementation of the modem peripheral
- Tables and strings are now properly copied
- Fixed
rednetAPI
- Replaced Lua plugin loader with custom loader
- Made SDL_mixer an optional dependency
- Fixed many more bugs
If you need help using CraftOS-PC, I'm available on the ComputerCraft Discord server as @JackMacWindows#9776. Feel free to ping me if you need anything.
This version has been re-released to fix a critical bug in the debugger.
The Mac build for this version has been pulled due to missing libraries. Please download v2.2.1 or later on Mac.