Skip to content

Commit 42b0092

Browse files
committed
doc: start writing documentation for z8tool.
1 parent 576f2b4 commit 42b0092

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed

doc/porting.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Porting zepto8 to other platforms
2+
3+
## OpenDingux, GCW0, RG350, …
4+
5+
### Build toolchain
6+
7+
First you need to get a recent enough toolchain (GCC 8.x or clang) and its dependencies. I have had
8+
success with [rg350-buildroot](https://github.com/tonyjih/RG350_buildroot):
9+
10+
```sh
11+
sudo apt install gcc-multilib mercurial rsync
12+
```
13+
14+
```sh
15+
git clone https://github.com/tonyjih/RG350_buildroot
16+
cd RG350_buildroot
17+
make rg350_defconfig BR2_EXTERNAL=board/opendingux
18+
```
19+
20+
Make sure a recent version of GCC is selected: `make menuconfig`_Toolchain__GCC Compiler Version__gcc 9.x_
21+
22+
```sh
23+
export BR2_JLEVEL=0
24+
make toolchain
25+
make toolchain sdl sdl_image sdl_mixer
26+
```
27+
28+
### Configure zepto8
29+
30+
Assuming `RG350_buildroot` is located in `${HOME}`:
31+
32+
```sh
33+
./bootstrap
34+
35+
HOST="mipsel-gcw0-linux-uclibc"
36+
XCHAIN="${HOME}/RG350_buildroot/output/host/usr/bin"
37+
SYSROOT="${HOME}/RG350_buildroot/output/host/usr/${HOST}/sysroot"
38+
PKG_CONFIG_LIBDIR="${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/share/pkgconfig" \
39+
PKG_CONFIG_SYSROOT_DIR="$SYSROOT" \
40+
./configure --host="${HOST}" --with-sysroot="${SYSROOT}" \
41+
CC="${XCHAIN}/${HOST}-cc" CXX="${XCHAIN}/${HOST}-c++" \
42+
CPPFLAGS="-I${SYSROOT}/usr/include"
43+
44+
make -j
45+
```
46+

doc/z8tool.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# z8tool
2+
3+
**z8tool** is a multi-purpose tool for working with PICO-8 cartridges.
4+
5+
Usage: `z8tool <command> <arguments>`
6+
7+
## `z8tool stats`
8+
9+
Outputs statistics about a cart.
10+
11+
Usage:
12+
13+
z8tool stats <cart>
14+
15+
Where `<cart>` is any cartridge in P8 (`.p8`), PNG (`.p8.png`), JavaScript (`.js`) or binary format (`.bin`).
16+
17+
Example:
18+
19+
```
20+
% z8tool stats celeste.p8
21+
file_name: celeste.p8
22+
token_count: 5921 [8192]
23+
code_size: 27484 [65535]
24+
compressed_code_size: 7903 [15616]
25+
26+
%
27+
```
28+
29+
## `z8tool listlua`
30+
31+
Extract code from a cart, in text format.
32+
33+
Usage:
34+
35+
z8tool listlua <cart>
36+
37+
Where `<cart>` is any cartridge in P8 (`.p8`), PNG (`.p8.png`), JavaScript (`.js`) or binary format (`.bin`).
38+
39+
## `z8tool printast`
40+
41+
Not fully implemented yet.
42+
43+
## `z8tool convert`
44+
45+
Convert carts beetween formats: P8 (`.p8`), PNG (`.p8.png`), JavaScript (`.js`) or binary format (`.bin`).
46+
47+
Usage:
48+
49+
z8tool convert <input> <output>
50+
51+
Examples:
52+
53+
% z8tool convert celeste.p8.png celeste.p8
54+
% z8tool convert celeste.p8 other_celeste.p8.png
55+
%
56+
57+
## `z8tool run`
58+
59+
Run a cart in the terminal.
60+
61+
Usage:
62+
63+
z8tool run [--telnet] [--headless] <cart>
64+
65+
- `--telnet` emit telnet server commands, for use with socat
66+
- `--headless` run without displaying anything
67+
68+
## `z8tool dither`
69+
70+
Not fully implemented yet.
71+
72+
## `z8tool compress`
73+
74+
Not fully implemented yet.
75+
76+
## `z8tool test`
77+
78+
Run the internal test suite. Not fully implemented yet.
79+

0 commit comments

Comments
 (0)