A rewrite of CraftOS-PC (Classic) using C++ and a modified version of PUC Lua, as well as SDL for drawing.
Visit the website at https://www.craftos-pc.cc/ for more information, including documentation.
$ brew tap MCJack123/CraftOSPC
$ brew install --cask craftos-pc
$ open /Applications/CraftOS-PC.app
$ sudo add-apt-repository ppa:jackmacwindows/ppa
$ sudo apt update
$ sudo apt install craftos-pc
$ craftos
sudo dnf copr enable lemoonstar/CraftOS-PC
sudo dnf install craftos-pc
Fedora support is maintained by LeMoonStar. For any issues with the Fedora package itself, please contact them on their GitHub repo.
Install the craftos-pc
package using your chosen AUR helper (e.g. yay -S craftos-pc
).
chmod a+x CraftOS-PC.x86-64.AppImage
(may be needed on some distros)Visit the App Store to download CraftOS-PC. Or you can join the TestFlight beta to get access to the latest versions before they're released.
CraftOS-PC v2.2 moves the save directory to be more appropriate for each platform. Your files are not gone; they're automatically moved over before launching if the old folder is still present. You can find the computer data files at these locations:
%appdata%\CraftOS-PC
(C:\Users\<user>\AppData\Roaming\CraftOS-PC
)~/Library/Application Support/CraftOS-PC
$XDG_DATA_HOME/craftos-pc
or ~/.local/share/craftos-pc
poco
port to use OpenSSL. Simply open vcpkg\ports\poco\portfile.cmake
, find ENABLE_NETSSL_WIN
, and replace it with FORCE_OPENSSL
. Then install as normal.--without-png
, will save as BMP instead--without-webp
, will disable WebP support (useWebP
option will always be off)--without-hpdf
, --with-html
or --with-txt
--without-ncurses
, will disable CLI support--without-sdl_mixer
, will disable audio disc and speaker supportfluidsynth
feature in vcpkg since July 9, 2021)--prefix=<path>
, which will store the ROM at <path>/share/craftos
--with-standalone-rom=<fs_standalone.cpp>
, with <fs_standalone.cpp>
referring to the path to the packed standalone ROM file.
You can get all of these dependencies with:
vcpkg --feature-flags=manifests install --triplet x64-windows
inside the repository directory
vcpkg install sdl2:x64-windows sdl2-mixer[dynamic-load,libflac,mpg123,libmodplug,libvorbis,opusfile,fluidsynth]:x64-windows pngpp:x64-windows libwebp:x64-windows libharu:x64-windows poco[netssl]:x64-windows dirent:x64-windows pdcurses:x64-windows
brew install sdl2 sdl2_mixer png++ webp libharu poco ncurses; git clone https://github.com/MCJack123/craftos2-rom
sudo apt install git build-essential libsdl2-dev libsdl2-mixer-dev libhpdf-dev libpng++-dev libwebp-dev libpoco-dev libncurses5-dev; git clone https://github.com/MCJack123/craftos2-rom
sudo pacman -S sdl2 sdl2_mixer png++ libwebp libharu poco ncurses
Builds of each commit are automatically uploaded for Windows in the Actions tab. These builds are provided to allow Windows users to test new features without having to build the entire solution and dependencies. Note that these files are just the raw executable. You must drop the file into a pre-existing CraftOS-PC install directory for it to work properly. Depending on changes made in the latest version, you may also have to download the latest ROM. You can download the latest file directly here.
Old nightly builds, as well as Android betas, are available on the website.
git submodule update --init --recursive
CraftOS-PC 2.sln
with VScraftos2\x64\Release
)The solution has a few different build configurations:
CraftOS-PC.exe
)CraftOS-PC_console.exe
)fs_standalone.cpp
to be present in src
cd
to the cloned repositorygit submodule update --init --recursive
make -C craftos2-lua macosx
./configure
make macapp
cd
to the cloned repositorygit submodule update --init --recursive
make -C craftos2-lua linux
./configure
make
sudo mkdir /usr/local/share/craftos
/usr/local/share/craftos/
./craftos
ComputerCraft and its assets are licensed under a copyleft license that requires anything using its code to be under the same license. Since I want CraftOS-PC 2 to remain under only the MIT license, I will not be distributing any original ComputerCraft files with the CraftOS-PC 2 source. You can still aquire the ROM separately.
Since the original ComputerCraft code is written in Java, it may seem like a better idea to create an emulator based on the original mod code. But I found that using native C++ lets the emulator run much better than if it was in Java.
1. It runs much faster One of the biggest issues I had with CraftOS-PC Classic was that it ran too slow. The Java VM adds much overhead to the program which, frankly, is unnecessary. As a native program, CraftOS-PC 2 runs 2x faster than CraftOS-Classic. The barebones nature of native code allows this speed boost to exist.
2. It uses less memory Another problem with CraftOS-PC Classic was that it used much more memory than necessary. At startup, CraftOS-PC Classic used well over 150 MB of memory, which could grow to nearly a gigabyte with extensive use. CraftOS-PC 2 only uses 40 MB at startup on Mac (10 on Windows!), and under my testing has never gone over 100 MB. This is due to C++'s manual memory management and the absence of the entire JVM.
3. It's the language Lua's written in Using the same language that Lua uses guarantees compatibility with the base API. LuaJ has many known issues that can hinder development and cause much confusion while writing programs. Writing CraftOS-PC 2 using liblua guarantees that Lua will behave as it should.
4. It doesn't rely on any single platform I wanted to keep CraftOS-PC Classic's wide compatibility in CraftOS-PC 2. Using other languages such as C# or Swift are platform-dependent and are not guaranteed to work on any platform. C++ is a basic language that's always present and maintains a portable library that works on all platforms. I've moved all platform-specific code into the platform_*.cpp files so the rest of the code can remain as independent as possible.