For this we'll rely heavily on [grumpy-coder](https://github.com/grumpycoders/pcsx-redux)'s work with pcsx-redux and various tools, which will provide us with:
* On windows, either follow the [instructions here](https://github.com/grumpycoders/pcsx-redux#windows), or install WSL2 and [Ubuntu 20.04](https://www.microsoft.com/en-gb/p/ubuntu-2004-lts/9n6svws3rx71?activetab=pivot:overviewtab) then launch a GNU/Linux terminal, then proceed with the following instructions.
* Alternatively on Windows, if you don't care about compiling pcsx-redux, you can skip steps 1, 3 and 4, get the latest precompiled toolchain from here : [http://static.grumpycoder.net/pixel/mips/](http://static.grumpycoder.net/pixel/mips/), unzip it somewhere and [add the `bin` folder to your PATH](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho#44272417). Then go on with steps 6 and 6.
If you pay attention, you can see that's the same command, but for different file types. TIM files are bitmap images and VAG is the sound format used in this example.
Each time you'll want to add a file type, just duplicate and change `%.vag` to `%.filetype`
Then, in your project folder, copy the makefile from the cube example :
```bash
mkdir new_project && cd new_project
cp ../cube/Makefile ../
```
All you have to do now is add the files you wish to embed to the SRCS variable, without forgetting the \ :
```bash
SRCS = main.c \
../common/crt0/crt0.s \
file_to_embed.ext \
```
2. So this part takes care of converting our data to binary. Now to access them from your program, just use this in your sources :
```c
extern ulong _binary_filename_extension_start[];
extern ulong _binary_filename_extension_end[];
extern ulong _binary_bowsht_tim_length[];
```
The filename variable must begin with `_binary_` followed by the full path of your file, with . and / replaced by _ (underscore), and end with `_start[];` or `_end[];` or `_length[];` [source](https://discord.com/channels/642647820683444236/663664210525290507/780866265077383189)
`_start` and `_end` are pointers, while `_length` is a constant.
That's it! When you'll type `make` next time, it should convert your files to .o, then include them in your ps-exe.
Everything here was learnt from some more talented persons, mainly but not excluding others that hang around on the [psxdev discord](https://discord.com/channels/642647820683444236/642848627823345684)
Nicolas Noble, Lameguy64, NDR008, Jaby smoll seamonstah, danhans42, rama, sickle, paul, squaresoft74, and lot mores !