Skip to content

CraftOS-PC v2.2 Pre-Release 1

Pre-release
Pre-release

Choose a tag to compare

@MCJack123 MCJack123 released this 01 Dec 05:30
· 1306 commits to master since this 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) or debug.setbreakpoint(file, line)
    • Does not require debugger to be attached
      • When no debugger is available, lua.lua is executed
  • 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
  • Added brand-new plugin API
    • Plugins should now provide a plugin_info function
    • 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 the library_t * getLibrary(std::string name) function
      • register_registerPeripheral: Recieves the address of the void registerPeripheral(std::string name, peripheral_init initializer) function
      • register_addMount: Recieves the address of the bool addMount(Computer * comp, const char * real_path, const char * comp_path, bool read_only) function
  • Feature parity with CC: Tweaked 1.85.2
  • Added new config options
    • vanilla: Set to true to disable all CraftOS-PC features
    • initialComputer: 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 error in the debugger will pause execution when an error occurs
    • Errors are logged to stdout if the logErrors config option is enabled
  • 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 rednet API
  • 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.