/vgedit

SDL text editor for homebrew'd video game consoles, with controller and touch screen support

Primary LanguageC++GNU General Public License v3.0GPL-3.0

vgedit+

GPLv3 License gh actions PRs Welcome

A basic SDL2 text editor designed for easy use on a video game console using a controller or touch screen. The primary goal of this project is to allow you to not have to turn to another device to edit text files.

File browser Editor View

Passing files to vgedit

vgedit can be passed a file name to open by specifying it as the first argument on the command line. On PC this looks like vgedit.exe test.txt, and on Switch/Wii U, if supported, the calling homebrew can pass the argument before launching vgedit.

Another way to pass a target file is to write an args.json file in the same directory as vgedit. For example, to open test.txt:

{
    "filename": "sd:/path/to/test.txt",
    "callback": "sd:/switch/the_caller.nro"
}

An optional callback can be specified, which will be launched when vgedit exits. This is useful for homebrew that want to open a file, edit it, and then return back.

After reading the path info from the args.json file, vgedit will delete it, so it can be used as a one-time file opener. In this mode, vgedit will not show the file browser and close after saving or discarding changes.

Compilation instructions

This program is written using Chesto and has a dependency on SDL2. It targets Switch, Wii U, and PC.

You can get pre-compiled binaries for each console platform under GH Actions for a given commit. Click here to download the latest nightly builds without signing in.

The latest PC binaries are also available to download under these GH Actions, or here without signing in.

Building with Docker

The fortheusers/sealeo image has all required dependencies to build on any of the target platforms:

git clone --recursive https://github.com/vgmoose/vgedit.git
cd vgedit
export PLATFORM=wiiu    # or switch, pc
docker run -v $(pwd):/code -it ghcr.io/fortheusers/sealeo /bin/bash -c "cd /code && make $PLATFORM"

The result should be a vgedit.rpx (or .wuhb, .nro, .bin) file in the current directory.

Building Manually

Depending on your target platform and the current state of its toolchain, you should be able to build it by installing the deps and running: make <platform>

For a list of platforms and their dependencies as of this time of writing, see Sealeo's configuration script.

License

This software is licensed under the GPLv3.

Free software is software that gives you the user the freedom to share, study and modify it. We call this free software because the user is free. - Free Software Foundation

Folder and file icons by Alfredo Hernandez under the Flaticon Basic License

Contributors

Contributing

It's not required, but running a clang-format before making a PR helps to clean up styling issues:

find . \( -name "*.cpp" -or -name "*.hpp" \) -not -path "./libs/*" -exec clang-format -i {} \;

Any and all PRs are welcome and appreciated!