CraftOS-PC v2.2 Pre-Release 1
Pre-release
Pre-release
CraftOS-PC v2.2 is nearly complete and is ready for a beta test. This version features many new debugging features as well as a new plugin API.
- 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
- Feature parity with CC: Tweaked 1.85.2
- 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
This version is not available on the Ubuntu PPA or Arch AUR. Please compile from source if you're on Linux. The official release of v2.2 will be available on both package managers.
Please report any bugs you find to the issue tracker.
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.