Updating README.md

This commit is contained in:
KiritoDv 2025-02-08 10:46:29 -06:00
parent 922b69e504
commit f5158c8d4c
5 changed files with 282 additions and 168 deletions

137
README.md
View File

@ -1,101 +1,86 @@
# Mario Kart 64
This work-in-progress decompilation of Mario Kart 64 pursues historical and educational elements within the game found via taking it apart and putting it back together. Inspiration to do so not only emanates from the game's hardware and technology but also its immensely positive effects on the cultures and families of nearly every nationality.
[comment]: <> (Todo: Make Light Mode Image)
[comment]: <> (Todo: Make Dark Mode Image)
This repository does not contain assets. Compiling requires asset extraction from a prior copy of the game.
# SpaghettiKart
It supports and builds the following versions:
Developed by:
* [MegaMech](https://www.github.com/MegaMech)
* [Coco](https://www.github.com/coco875)
| ROM Output | Revision| SHA-1 Checksum |
|-------------------|---------|------------------------------------------|
| mk64.us.z64 | USA | 579c48e211ae952530ffc8738709f078d5dd215e |
| mk64.eu-1.0.z64 | EUR 1.0 | a729039453210b84f17019dda3f248d5888f7690 |
| mk64.eu-final.z64 | EUR 1.1 | f6b5f519dd57ea59e9f013cc64816e9d273b2329 |
## Discord
[![Linux Compile](https://github.com/n64decomp/mk64/actions/workflows/linux-compile.yml/badge.svg)](https://github.com/n64decomp/mk64/actions/workflows/linux-compile.yml)
Official Discord: https://discord.com/invite/shipofharkinian
## Progress
If you're having any trouble after reading through this `README`, feel free ask for help in the SpaghettiKart Support text channels. Please keep in mind that we do not condone piracy.
Total progress consists of all code segments together.
# Quick Start
Game code progress consists of `main`, `ending` and `racing`.
SpaghettiKart does not include any copyrighted assets. You are required to provide a supported copy of the game.
![Build Status](https://n64decomp.github.io/mk64/total_progress.svg)
![Build Status](https://n64decomp.github.io/mk64/game_progress.svg)
### 1. Verify your ROM dump
The supported ROM is the USA 1.1 Rev A version. You can verify you have dumped a supported copy of the game by using the SHA-1 File Checksum Online at https://www.romhacking.net/hash/. The hash for a US 1.1 ROM is SHA-1: 09F0D105F476B00EFA5303A3EBC42E60A7753B7A.
![Build Status](https://n64decomp.github.io/mk64/asm_funcs.svg)
![Build Status](https://n64decomp.github.io/mk64/m2c_funcs.svg)
![Build Status](https://n64decomp.github.io/mk64/nonmatching_funcs.svg)
### 2. Verify your ROM is in .z64 format
Your ROM needs to be in .z64 format. If it's in .n64 format, use the following to convert it to a .z64: https://hack64.net/tools/swapper.php
- ![Build Status](https://n64decomp.github.io/mk64/seg_main_progress.svg)
- ![Build Status](https://n64decomp.github.io/mk64/seg_ending_progress.svg)
- ![Build Status](https://n64decomp.github.io/mk64/seg_racing_progress.svg)
- ![Build Status](https://n64decomp.github.io/mk64/audio_progress.svg)
- ![Build Status](https://n64decomp.github.io/mk64/libultra_progress.svg)
### 2. Download SpaghettiKart from [Releases](https://github.com/HarbourMasters/SpaghettiKart/releases)
## Quick Start
### 3. Generating the O2R from the ROM
#### Windows
* Extract every file from the zip into a folder of your choosing.
* Copy your ROM to the root of the folder you extracted the zip to.
* Run "generate_o2r.bat"
```
git submodule update --init --recursive
```
Extract assets
```
make assets -j
make -j
```
#### MacOS
* Extract every file from the zip into a folder of your choosing.
* Copy your ROM to the root of the folder you extracted the zip to.
* Run "generate_o2r.sh"
## Building
### 4. Play!
* Launch `SpaghettiKart.exe`
Congratulations, you are now sailing with SpaghettiKart! Have fun!
Build instructions located in the [API docs](https://n64decomp.github.io/mk64/compiling.html)
See also, the comprehensive API and documentation which includes an overview of the code-base while also discussing significant concepts, features, and modding.
# Configuration
## Current State
### Default keyboard configuration
| N64 | A | B | Z | Start | Analog stick | C buttons | D-Pad |
| - | - | - | - | - | - | - | - |
| Keyboard | X | C | Z | Space | WASD | Arrow keys | TFGH |
The code-base may change significanty overtime as naming and documentation continues. The code-base is shiftable.
### Other shortcuts
| Keys | Action |
| - | - |
| F1 | Toggle menubar |
| F11 | Fullscreen |
| Tab | Toggle Alternate assets |
| Ctrl+R | Reset |
Some menu textures are compressed using a format called tkmk00. A byte-matching compressor/decompressor does not yet exist.
### Graphics Backends
Currently, there are three rendering APIs supported: DirectX11 (Windows), OpenGL (all platforms), and Metal (macOS). You can change which API to use in the `Settings` menu of the menubar, which requires a restart. If you're having an issue with crashing, you can change the API in the `spaghettify.cfg.json` file by finding the line `"Backend":{`... and changing the `id` value to `3` and set the `Name` to `OpenGL`. `DirectX 11` with id `2` is the default on Windows. `Metal` with id `4` is the default on macOS.
## Project Structure
mk64
├── asm: Handwritten assembly code, rom header and boot
│ ├── non_matchings: Assembly for non-matching sections
│ └── os: Libultra handwritten assembly code
├── assets: Textures
├── courses: Course data, geography, display lists and staff ghosts
├── build: Output directory
├── data: Misc data, text, audio banks, and instrument sets
├── docs: Build guides
├── include: Header files
├── music: Sequences
├── src: C source code for the game
| ├── actors: Individual actors split out from other files
│ ├── audio: Sample tables and audio code
│ ├── data: Misc data referenced in other C files
| ├── debug: Custom debug code
| ├── ending: Podium ceremony and credits code
│ ├── os: Libultra C code
| └── racing: Race and game engine code
├── textures: Texture data, bitmaps
| ├── common: Textures common to many courses
| ├── courses: Course specific textures
| ├── crash screen: Crash screen font image
│ ├── raw: Raw textures
│ ├── standalone: Whole textures
| ├── startup_logo: Reflection map
| └── trophy: Ceremony cutscene podium and trophy textures
└── tools: build tools
# Custom Assets
Custom assets are packed in `.o2r` or `.otr` files. To use custom assets, place them in the `mods` folder.
## Documentation
If you're interested in creating and/or packing your own custom asset `.o2r`/`.otr` files, check out the following tools:
* [**retro - OTR and O2R generator**](https://github.com/HarbourMasters64/retro)
* [**fast64 - Blender plugin (Note that SF64 is not supported at this time)**](https://github.com/HarbourMasters/fast64)
Documentation available online at [https://n64decomp.github.io/mk64/](https://n64decomp.github.io/mk64/).
# Development
### Building
Documentation generated using [Doxygen](https://www.doxygen.nl/index.html). Run `make doc` to test locally. Documentation resides in `docs/html`. Open index.html to view the site.
If you want to manually compile SpaghettiKart, please consult the [building instructions](https://github.com/HarbourMasters/SpaghettiKart/blob/main/docs/BUILDING.md).
## Contributing
### Playtesting
If you want to playtest a continuous integration build, you can find them at the links below. Keep in mind that these are for playtesting only, and you will likely encounter bugs and possibly crashes.
Pull requests are welcome. For major changes, please discuss in the Discord.
* [Windows](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/spaghettify-windows.zip)
* [macOS](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/spaghettify-mac-x64.zip)
* [Linux](https://nightly.link/HarbourMasters/SpaghettiKart/workflows/main/main/SpaghettiKart-linux.zip)
Run `make format` to ensure it meets the project's coding standards.
If code needs to avoid formatting place `// clang-format off` before the code and `// clang-format on` after.
Official Discord: [discord.gg/DuYH3Fh](https://discord.gg/DuYH3Fh)
<a href="https://github.com/Kenix3/libultraship/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./docs/poweredbylus.darkmode.png">
<img alt="Powered by libultraship" src="./docs/poweredbylus.lightmode.png">
</picture>
</a>

221
docs/BUILDING.md Normal file
View File

@ -0,0 +1,221 @@
# Building Starship
## Windows
Requires:
* At least 8GB of RAM (machines with 4GB have seen complier failures)
* Visual Studio 2022 Community Edition with the C++ feature set
* One of the Windows SDKs that comes with Visual Studio, for example the current Windows 10 version 10.0.19041.0
* The `MSVC v143 - VS 2022 C++ build tools` component of Visual Studio
* Python 3 (can be installed manually or as part of Visual Studio)
* Git (can be installed manually or as part of Visual Studio)
* Cmake (can be installed via chocolatey or manually)
During installation, check the "Desktop development with C++" feature set:
![image](https://user-images.githubusercontent.com/30329717/183511274-d11aceea-7900-46ec-acb6-3f2cc110021a.png)
Doing so should also check one of the Windows SDKs by default. Then, in the installation details in the right-hand column, make sure you also check the v143 toolset. This is often done by default.
It is recommended that you install Python and Git standalone, the install process in VS Installer has given some issues in the past.
1. Clone the Starship repository
_Note: Be sure to either clone with the ``--recursive`` flag or do ``git submodule update --init`` after cloning to pull in the libultraship submodule!_
2. After setup and initial build, use the built-in OTR extraction to make your sf64.o2r file.
_Note: Instructions assume using powershell_
```powershell
# Navigate to the spaghetti repo within powershell. ie: cd "C:\yourpath\spaghetti"
cd spaghetti
# Setup cmake project
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64
# Generate sf64.o2r
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target ExtractAssets
# Compile project
# Add `--config Release` if you're packaging
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64
# Now you can run the executable in .\build\x64 or run in Visual Studio
```
### Developing Starship
With the cmake build system you have two options for working on the project:
#### Visual Studio
To develop using Visual Studio you only need to use cmake to generate the solution file:
```powershell
# Generates spaghetti.sln at `build/x64` for Visual Studio 2022
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64
```
#### Visual Studio Code or another editor
To develop using Visual Studio Code or another editor you only need to open the repository in it.
To build you'll need to follow the instructions from the building section.
_Note: If you're using Visual Studio Code, the [cpack plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
_Experimental: You can also use another build system entirely rather than MSVC like [Ninja](https://ninja-build.org/) for possibly better performance._
### Generating the distributable
After compiling the project you can generate the distributable by running:
```powershell
# Go to build folder
cd "build/x64"
# Generate
& 'C:\Program Files\CMake\bin\cpack.exe' -G ZIP
```
### Additional CMake Targets
#### Clean
```powershell
# If you need to clean the project you can run
C:\Program Files\CMake\bin\cmake.exe --build build-cmake --target clean
```
## Linux
### Install dependencies
#### Debian/Ubuntu
```sh
# using gcc
apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev libogg-dev ibvorbis-dev
# or using clang
apt-get install clang git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev libogg-dev libvorbis-dev
```
#### Arch
```sh
# using gcc
pacman -S gcc git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost libogg libvorbis
# or using clang
pacman -S clang git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost libogg libvorbis
```
#### Fedora
```sh
# using gcc
dnf install gcc gcc-c++ git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools nlohmann-json-devel tinyxml2-devel spdlog-devel boost-devel libogg-devel libvorbis-devel
# or using clang
dnf install clang git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools nlohmann-json-devel tinyxml2-devel spdlog-devel boost-devel libogg-devel libvorbis-devel
```
#### openSUSE
```sh
# using gcc
zypper in gcc gcc-c++ git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel libogg-devel libvorbis-devel
# or using clang
zypper in clang libstdc++-devel git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel libogg-devel libvorbis-devel
```
### Build
_Note: If you're using Visual Studio Code, the [CMake Tools plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
```bash
# Clone the repo and enter the directory
git clone https://github.com/HarbourMasters/SpaghettiKart.git
cd SpaghettiKart
# Clone the submodules
git submodule update --init
# Generate Ninja project
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
# Add `-DPython3_EXECUTABLE=$(which python3)` if you are using non-standard Python installations such as PyEnv
cmake -H. -Bbuild-cmake -GNinja
# Generate sf64.o2r
cmake --build build-cmake --target ExtractAssets
# Compile the project
# Add `--config Release` if you're packaging
cmake --build build-cmake
# Now you can run the executable in ./build-cmake/mm/2s2h.elf
# To develop the project open the repository in VSCode (or your preferred editor)
```
### Generate a distributable
After compiling the project you can generate a distributable by running of the following:
```bash
# Go to build folder
cd build-cmake
# Generate
cpack -G DEB
cpack -G ZIP
cpack -G External (creates appimage)
```
### Additional CMake Targets
#### Clean
```bash
# If you need to clean the project you can run
cmake --build build-cmake --target clean
```
## macOS
Requires Xcode (or xcode-tools) && `sdl2, libpng, glew, ninja, cmake, nlohmann-json, libzip, vorbis-tools` (can be installed via homebrew, macports, etc)
**Important: For maximum performance make sure you have ninja build tools installed!**
_Note: If you're using Visual Studio Code, the [cpack plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
```bash
# Clone the repo
git clone https://github.com/HarbourMasters/SpaghettiKart.git
cd SpaghettiKart
# Clone the submodule libultraship
git submodule update --init
# Generate Ninja project
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
cmake -H. -Bbuild-cmake -GNinja
# Generate sf64.o2r
cmake --build build-cmake --target ExtractAssets
# Compile the project
# Add `--config Release` if you're packaging
cmake --build build-cmake
# Now you can run the executable file:
./build-cmake/mm/spaghetti-macos
# To develop the project open the repository in VSCode (or your preferred editor)
```
### Generating a distributable
After compiling the project you can generate a distributable by running of the following:
```bash
# Go to build folder
cd build-cmake
# Generate
cpack
```
### Additional CMake Targets
#### Clean
```bash
# If you need to clean the project you can run
cmake --build build-cmake --target clean
```
# Compatible Roms
See [`supportedHashes.json`](supportedHashes.json)
## Getting CI to work on your fork
The CI works via [Github Actions](https://github.com/features/actions) where we mostly make use of machines hosted by Github; except for the very first step of the CI process called "Extract assets". This steps extracts assets from the game file and generates an "assets" folder in `mm/`.
To get this step working on your fork, you'll need to add a machine to your own repository as a self-hosted runner via "Settings > Actions > Runners" in your repository settings. Make sure to add the 'asset-builder' tag to your newly added runner to assign it to run this step. To setup your runner as a service read the docs [here](https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service?platform=linux).
### Runner on Windows
You'll have to enable the ability to run unsigned scripts through PowerShell. To do this, open Powershell as administrator and run `set-executionpolicy remotesigned`. Most dependencies get installed as part of the CI process. You will also need to separately install 7z and add it to the PATH so `7z` can be run as a command. [Chocolatey](https://chocolatey.org/) or other package managers can be used to install it easily.
### Runner on UNIX systems
If you're on macOS or Linux take a look at `macports-deps.txt` or `apt-deps.txt` to see the dependencies expected to be on your machine.

View File

@ -1,92 +0,0 @@
If you have some problem to get it setup you can refer to [https://github.com/HarbourMasters/Shipwright/blob/develop/docs/BUILDING.md](https://github.com/HarbourMasters/Shipwright/blob/develop/docs/BUILDING.md)
# Contribute
## Github
1) Fork
2) Create a new branch
3) `git clone --branch <branch_name> <fork_url>`
4) Place baserom.us.z64 in root.
5) `git submodule update --init`
6) copy from mk64 assets/course in assets
# Windows
## Setup
```bat
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64
```
## Extract Assets
```bat
& 'C:\Program Files\CMake\bin\cmake' --build "build/x64" --target ExtractAssets
```
## Compile
```bat
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64
```
## Clean
```bat
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target clean
```
# Linux
## Install dependencies
### Debian/Ubuntu
(not tried)
```sh
# using gcc
apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev
# or using clang
apt-get install clang git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev
```
### Arch
(not tried)
```sh
# using gcc
pacman -S gcc git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost
# or using clang
pacman -S clang git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost
```
### Fedora
```sh
# using gcc
dnf install gcc gcc-c++ git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools json-devel tinyxml2-devel spdlog-devel boost-devel SDL2_net-devel
# or using clang
dnf install clang git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools json-devel tinyxml2-devel spdlog-devel boost-devel SDL2_net-devel
```
### openSUSE
(not tried)
```sh
# using gcc
zypper in gcc gcc-c++ git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel
# or using clang
zypper in clang libstdc++-devel git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel
```
## Setup
```bash
cmake -H. -Bbuild-cmake -GNinja
```
## Extract Assets
```bash
cmake --build build-cmake --target ExtractAssets
```
## Compile
```bash
cmake --build build-cmake
```
## Clean
```bash
cmake --build build-cmake --target clean
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB