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