aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2022-10-23 12:25:12 +0200
committerBad Diode <bd@badd10de.dev>2022-10-23 12:25:12 +0200
commit641518e364f391b194ba2302e8cd5fab1a35aa07 (patch)
tree5fcc6d1eff8fdca061aac9535c844fa43373b118
parent5114c90e30406c6fb570c4246a806e63528338a9 (diff)
downloaduxn64-641518e364f391b194ba2302e8cd5fab1a35aa07.tar.gz
uxn64-641518e364f391b194ba2302e8cd5fab1a35aa07.zip
Add README with build instructions
-rw-r--r--README.md115
1 files changed, 115 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..514fbec
--- /dev/null
+++ b/README.md
@@ -0,0 +1,115 @@
1# UXN64
2
3This is a port of the [UXN virtual machine][uxn] for the Nintendo 64 (N64). UXN
4is a project created by the artist collective and research studio [100
5rabbits][100r]. It can be used to write small graphical applications, tools and
6games. Programs written for UXN are distributed via bytecode compiled roms, akin
7to classic console emulators.
8
9[uxn]: https://wiki.xxiivv.com/site/uxn.html
10[100r]: https://100r.co/
11
12## Building from source
13
14To build this project, you will need a [MIPS III compatible][n64brew-gcc]
15compiler toolchain and [the official N64 sdk (libultra)][n64ultra]. For this
16guide I'll assume you are using Linux and your toolchain and sdk will be located
17at `/opt/n64sdk/` and `/opt/n64sdk/libultra/` respectively.
18
19### The toolchain
20
21Paraphrasing the installation guide from the [N64brew wiki][n64brew-gcc]. This
22installation will take some time. Also before you start make sure you export
23your path as follows. You probably don't need to install newlib for this
24project, but just in case we'll follow the full procedure.
25
26```
27PATH=/opt/n64sdk/bin:$PATH
28```
29
30#### Prepare the SDK directory
31
32```
33mkdir /opt/n64sdk
34sudo chown <yourusername> /opt/n64sdk
35```
36
37#### Binutils
38
39```
40git clone git://sourceware.org/git/binutils-gdb.git /tmp/binutils
41cd /tmp/binutils
42mkdir build
43cd build
44../configure --target=mips32-elf --prefix=/opt/n64sdk --with-cpu=vr4300 --disable-nls --with-sysroot=/opt/n64sdk/mips32-elf/sysroot
45make -j8 # select the number of cores you want to use. here I'm using 8.
46make install
47```
48
49#### GCC and Newlib
50
51```
52# GCC (part 1)
53git clone git://gcc.gnu.org/git/gcc.git /tmp/gcc
54cd /tmp/gcc
55mkdir build
56cd build
57../configure --target=mips32-elf --prefix=/opt/n64sdk --with-languages=c,c++ --disable-shared --disable-threads --disable-nls --without-headers --disable-multilib --with-newlib --with-sysroot=/opt/n64sdk/mips32-elf/sysroot --with-arch=vr4300 --with-abi=32
58make -j8 all-gcc
59make install-gcc
60make -j8 all-target-libgcc
61make install-target-libgcc
62
63# Newlib
64git clone git://sourceware.org/git/newlib-cygwin.git /tmp/newlib
65cd /tmp/newlib
66mkdir build
67cd build
68../configure --prefix=/usr --target=mips32-elf --disable-threads --disable-libssp CFLAGS_FOR_TARGET='-march=vr4300 -mfix4300 -G 0'
69make -j8
70make DESTDIR=/opt/n64sdk/mips32-elf/sysroot install
71cd /opt/n64sdk/mips32-elf/sysroot/usr
72mv mips32-elf/* .
73rmdir mips32-elf
74
75# GCC (part 2)
76cd /tmp/gcc/build
77make -j8 all-target-libgcc
78make install-target-libgcc
79```
80
81### Libultra
82
83An iso image for the official N64 SDK can be found [in archive.org][n64ultra].
84Download the iso and mount it to your filesystem:
85
86```
87mkdir /tmp/cdrom
88sudo mount -o loop "N64 Dev kit full.iso" /tmp/cdrom
89cd /tmp/cdrom
90cp -r ultra /opt/n64sdk/libultra
91```
92
93### This project
94
95If everything is installed correctly, you should be able to clone this project
96as follows:
97
98```
99git clone https://git.badd10de.dev/uxn64/
100cd uxn64
101git submodule init
102git submodule update
103make UXN_ROM=/path/to/uxn/rom.rom
104```
105
106Since we are embedding the rom in the n64 file, to create different rom names
107for each respective uxn rom we can change the `TARGET` from the default `uxn64`:
108
109```
110make UXN_ROM=screen.rom TARGET=uxn64-screen # creates uxn64-screen.n64
111make UXN_ROM=audio.rom TARGET=uxn64-audio # creates uxn64-audio.n64
112```
113
114[n64brew-gcc]: https://n64brew.dev/wiki/Building_GCC
115[n64ultra]: https://archive.org/details/nintendo-64-developers-toolkit-v-5.0