Skip to content

Mii rendering sample and renderer server using the FFL decompilation by AboodXD

Notifications You must be signed in to change notification settings

ariankordi/FFL-Testing

 
 

Repository files navigation

Check the renderer-server-prototype branch if you want to run a service that renders Miis.

FFL-Testing

Sample using the FFL decomp and RIO framework, all originally written by AboodXD, to render Miis on PC and Wii U via WUT.

Screen.Recording.2024-10-16.at.8.34.31.PM.mp4

Running

  1. Clone the repo, recursively.

    git clone --recursive https://github.com/ariankordi/FFL-Testing
    
  2. Install requirements.

    This project needs GLFW3, zlib, and OpenGL dev libraries. The commands below will install them.

    • Ubuntu/Debian: sudo apt install libglfw3-dev zlib1g-dev libgl1-mesa-dev
    • Fedora/RHEL: sudo dnf install glfw-devel zlib-devel mesa-libGL-devel
    • Arch/Manjaro: sudo pacman -S glew glfw zlib (⚠️ UNTESTED)
    • MSYS2 MINGW64 (Windows): pacman -S mingw-w64-x86_64-glfw mingw-w64-x86_64-zlib
      • Make sure to also install the basics: pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-pkg-config
      • Use mingw32-make instead of make
      • As of 2024-06-02, this doesn't copy DLLs from MinGW64's environment to yours so you can launch the program in the command line, you can't click on the exe to run it.
      • Also note that it should build with MSVC, but I don't have a cxxproj for you to use / this should be ported to CMake at some point...

    If you are building with WUT, you need to install ppc-zlib.

  3. Build using the makefile.

    If you don't already have them, you will also need: git, g++, make, pkg-config.

    make -j4
    
    • To build with WUT, use: make wut -j4.

    • This also supports OpenGL ES 3.0, for mobile devices or using ANGLE. To build targeting that, define this as an environment variable: DEFS="-DRIO_GLES"

    • To build for Emscripten, use make -f Makefile.emscripten -j4

      • Make sure FFLResHigh.dat is in the current working directory. After this builds, the html file may not work if you click on it so you may need to run a mini web server and access it there.
  4. Obtain the resource file, FFLResHigh.dat.

  5. Run ffl_testing_2_debug64, and pray that it works.

    • If it crashes with a segfault or shows you a blank screen, make sure you have FFLResHigh.dat and it can open it.

Showing your own Miis

As of 2024-06-14, I added a change that would let you change which Miis this program renders, by reading files in the place_ffsd_files_here folder.

As the name implies, you should be able to take any Mii in a 96 byte FFSD/FFLStoreData file, and place it in that folder.

  • Only the length of the file is checked, not the extension or name. It needs to be 96 bytes.

  • Then, it will just read each file sequentially, looping through all of them.

  • You can also just put one file there and that one Mii will spin continuously.

If you don't have any FFSD files...

  • You can search for any *.ffsd or *.cfsd (CFLStoreData = FFLStoreData) file in this repo:

  • Grab the Mii from your Nintendo Network ID using the mii-unsecure.ariankordi.net API, if it is still up by the time you are reading this.

    • curl --verbose --header "Accept: application/octet-stream" https://mii-unsecure.ariankordi.net/mii_data/JasmineChlora --output JasmineChlora.ffsd
      • Replace JasmineChlora with your own NNID, of course.
  • I believe this script decrypts Mii QR Code data directly to FFSD/CFSD format: https://gist.github.com/jaames/96ce8daa11b61b758b6b0227b55f9f78

    • I use it with ZBar like so: zbarimg --quiet --raw --oneshot -Sbinary image.jpg | python3 mii-qr.py /dev/stdin ./mii.ffsd
      • Replace: image.jpg, mii.ffsd
    • I also made a scanner in JS, though it gives you Base64 that you have to decode: https://jsfiddle.net/arian_/h31tdg7r/1/

Compiling GLFW3

GLFW3 is needed to run any RIO application on PC, which this is.

If you can't install it (not on Linux or MSYS2), or need the latest version, let's build it.

(You probably don't need to follow these)

GLFW3:

  • git clone https://github.com/glfw/glfw && cd glfw
  • cmake -S . -B build
    • If you are cross compiling, append: -D CMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake -D CMAKE_INSTALL_PREFIX=/usr/local/x86_64-w64-mingw32/
  • cmake --build build -j8
  • (sudo) cmake --install build

Now it should be available to pkg-config

Try: pkg-config --libs zlib glfw3

(Unless it complains about needing glu)

If you are still reading

NOTE from 2024-06-02: To cross compile this from Linux to Windows, I used the following command: TOOLCHAIN_PREFIX=x86_64-w64-mingw32- make LDFLAGS="-L/dev/shm/glfw/build/src/ -lz -L/dev/shm/glew/lib/ -lglew32 -lglfw3 -lopengl32 -lgdi32 -lws2_32

Where I have glew and glfw built at /dev/shm.

While pkg-config worked, letting me need only the TOOLCHAIN_PREFIX set, for whatever reason it wasn't building and threw lots of linking errors saying it couldn't link tons of symbols from glew32 even though it literally finds it and opens the library, so... IDK.

About

Mii rendering sample and renderer server using the FFL decompilation by AboodXD

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages

  • C++ 74.3%
  • GLSL 18.5%
  • Makefile 7.2%