Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/media/titlescreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 46 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
build-gba:
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork || github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.fork}}
runs-on: ubuntu-22.04
name: Build GBA
name: Build GBA (USA)
steps:
- name: Checkout PR
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target'}}
Expand All @@ -58,11 +58,8 @@ jobs:

- name: Install tools
run: |
sudo apt update && sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi xorg-dev
sudo apt update && sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi
python3 -m pip install gitpython
# build-essential, git, and libpng-dev are already installed
# gcc-arm-none-eabi is only needed for the modern build
# as an alternative to dkP

- name: Install agbcc
run: |
Expand Down Expand Up @@ -114,16 +111,6 @@ jobs:
python3 ../scripts/progress.py shield-json -f mb_chao_garden.map > ../gh-pages/reports/progress-mb_chao_garden-shield.json
python3 ../scripts/progress.py shield-json -m -f mb_chao_garden.map > ../gh-pages/reports/progress-mb_chao_garden-shield-matching.json

#- name: Japan
#run: |
#make clean
#make japan -j${nproc}

- name: Europe
run: |
make clean
make europe -j${nproc}

- name: Update reports
if: ${{ github.event_name == 'push' }}
uses: EndBug/add-and-commit@v7
Expand All @@ -132,6 +119,50 @@ jobs:
cwd: "./gh-pages"
add: "reports maps"
message: ${{ env.REPORTS_COMMIT_MSG }}

build-gba-variants:
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork || github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.fork}}
runs-on: ubuntu-22.04
name: Build GBA (${{ matrix.variant }})
strategy:
matrix:
variant: ["europe", "japan"]
steps:
- name: Checkout PR
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target'}}
uses: actions/checkout@master
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Checkout
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@master

- name: Checkout gh-pages
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@master
with:
path: gh-pages
ref: gh-pages

- name: Checkout agbcc
uses: actions/checkout@master
with:
path: agbcc
repository: SAT-R/agbcc

- name: Install tools
run: |
sudo apt update && sudo apt install binutils-arm-none-eabi gcc-arm-none-eabi

- name: Install agbcc
run: |
./build.sh
./install.sh ../
working-directory: agbcc

- name: Compare
run: make ${{ matrix.variant }} -j${nproc}

ports:
strategy:
Expand Down
61 changes: 20 additions & 41 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,37 @@
# Building/Installing SA2
This doc assumes you are somewhat familiar with using a terminal/command line. If not, you may find these instructions confusing and this project might not be for you at this stage. If you still want to continue, googling anything which you don't understand might be a first step and then asking in the discord would be a fallback option.

## Setup environment
## Before building

This project is designed to be built on MacOS or Linux. If you are using Windows then you will need to build the project in a Linux environemnt. There are a few options for that:
This project is designed to be built on MacOS or Linux.

### Easiest option: Dev container
### If you only have a windows computer

This step assumes you have vscode and you can run [Dev Containers](https://code.visualstudio.com/docs/remote/containers) already. If you wanna figure that out, look up a tutorial or something.
Install WSL (Ubuntu). Once installed, open this project in the WSL terminal and follow the linux instructions. There are tutorials online for setting up WSL. You may need to mount this project in your WSL environment.

1. Open this project in VSCode and then select "open dev container" when prompted
2. Wait for it to build.
3. Once running, skip to *Build the GBA rom* (no further install requirements)

If using the Dev container you will be able to build for the GBA and PC. However, if you build the "Linux/MacOS" target you will not be able to execute that on MacOS when built from the dev container.

### WSL

Install and use WSL (Ubuntu). Once using WSL, open this project in the WSL terminal and follow the linux instructions. There are tutorials online for setting up WSL. You may need to mount this project in your WSL environment.

### MSYS

Another option is to install
[**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM) and build the project in MSYS but this is not recomended unless you know what you are doing. It doesn't really function properly.

## Install system requirements

**NOTE**: You can skip these steps if you are using the devcontainer.
### Install system requirements

### On Linux systems (including WSL)
#### On Linux (including WSL)
```
sudo apt update
sudo apt install build-essential binutils-arm-none-eabi gcc-arm-none-eabi libpng-dev xorg-dev libsdl2-dev gcc-mingw-w64 libarchive-tools
```

### On MacOS
#### On MacOS

```
brew install libpng sdl2 mingw-w64 arm-none-eabi-gcc
```

## Install `agbcc` into the repo (skip if not compiling for the GBA)

Clone the [agbcc](https://github.com/SAT-R/agbcc) repo into another folder

Inside the `agbcc` folder, run `./build.sh` and then install the compiler in this repo `./install.sh path/to/sa2`


## Building

Clone/Download the repo

The repo targets multiple platforms. You don't need to build the rom to build the port, so skip that step if you just want to run it on the PC.
The repo targets multiple platforms. You don't need to build the GBA rom to build the port, so skip that step if you only want to run it on PC.

Run all commands in the same folder as this project. All outputs go into the same folder.

**NOTE**: You can significantly speed up initial build times by passing the number of processes you wish to use for the build `make ... -j<insert number of CPU cores>`

### GBA rom

1. Run `make`
1. If the rom built successfully you will see this output: `sa2.gba: OK` (if you modify the source code this will no longer output `OK`)
1. `sa2.gba` will be output.

You can execute the rom in an emulator
**NOTE**: You can significantly speed up initial build times by passing the number of processes you wish to use for the build. For example `make -j4` with 4 being the number of cores

### PC port

Expand All @@ -86,6 +54,17 @@ Tip: On Linux and MacOS this can be opened with `wine sa2.sdl_win32.exe`
1. `sa2.sdl` will be created
1. Launch the game from the terminal with `./sa2.sdl`

### GBA rom

1. Clone [agbcc](https://github.com/SAT-R/agbcc) repo into another folder

1. Inside the `agbcc` folder, run `./build.sh` and then install the compiler in this repo `./install.sh path/to/sa2`
1. Run `make`
1. If the rom built successfully you will see this output: `sa2.gba: OK` (if you modify the source code this will no longer output `OK`)
1. `sa2.gba` will be output.

You can execute the rom in an emulator

## Code formatting

All C code in this repo is formatted with `clang-format-13`. If using the Dev Container this is installed automatically.
Expand Down
35 changes: 16 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
# Sonic Advance 2
[![CI status][ci-badge]][ci-status-link] [![Decompilation Progress][progress-badge]][progress-link] [![Decompilation Matching Progress][matching-progress-badge]][matching-progress-link] [![Contributors][contributors-badge]][contributors-link] [![Discord][discord-badge]][discord-link]

[ci-status-link]: https://github.com/SAT-R/sa2/actions/workflows/build.yml
[ci-badge]: https://github.com/SAT-R/sa2/actions/workflows/build.yml/badge.svg

[progress-link]: https://github.com/SAT-R/sa2
[progress-badge]: https://img.shields.io/endpoint?url=https://sat-r.github.io/sa2/reports/progress-sa2-shield.json

[matching-progress-link]: https://github.com/SAT-R/sa2
[matching-progress-badge]: https://img.shields.io/endpoint?url=https://sat-r.github.io/sa2/reports/progress-sa2-shield-matching.json

[contributors-link]: https://github.com/SAT-R/sa2/graphs/contributors
[contributors-badge]: https://img.shields.io/github/contributors/SAT-R/sa2

[discord-badge]: https://img.shields.io/discord/1052347299457671200
[discord-link]: https://discord.gg/vZTvVH3gA9
<h1 align="center">Sonic Advance 2</h1>
<p align="center">
<img height="240" src=".github/media/titlescreen.png" alt="Sonic Advance 2 title screen">
</p>
<p align="center">
<a href="https://github.com/SAT-R/sa2/actions/workflows/build.yml"><img src="https://github.com/SAT-R/sa2/actions/workflows/build.yml/badge.svg" alt="CI status"></a>
<a href="https://github.com/SAT-R/sa2"><img src="https://img.shields.io/endpoint?url=https://sat-r.github.io/sa2/reports/progress-sa2-shield.json" alt="Decompilation Progress"></a>
<a href="https://github.com/SAT-R/sa2"><img src="https://img.shields.io/endpoint?url=https://sat-r.github.io/sa2/reports/progress-sa2-shield-matching.json" alt="Decompilation Matching Progress"></a>
<a href="https://github.com/SAT-R/sa2/graphs/contributors"><img src="https://img.shields.io/github/contributors/SAT-R/sa2" alt="Contributors"></a>
<a href="https://discord.gg/vZTvVH3gA9"><img src="https://img.shields.io/discord/1052347299457671200" alt="Discord"></a>
</p>

> :warning: **This project is not completed and still under active development**

This is a work in progress matching decompilation of Sonic Advance 2

It so far builds the following ROMs:
It builds the following ROMs:
* [**sa2.gba**](https://datomatic.no-intro.org/index.php?page=show_record&s=23&n=0890) `sha1: 7bcd6a07af7c894746fa28073fe0c0e34408022d` (USA) (En,Ja,Fr,De,Es,It)
* [**sa2_europe.gba**](https://datomatic.no-intro.org/index.php?page=show_record&s=23&n=0900) `sha1: b0f64bdca097f2de8f05ac4c8caea2b80c5faeb1` (Europe) (En,Ja,Fr,De,Es,It)
* :construction: [**sa2_japan.gba**](https://datomatic.no-intro.org/index.php?page=show_record&s=23&n=0799) `sha1: dffd0188fc78154b42b401398a224ae0713edf23` (Japan) (En,Ja,Fr,De,Es,It) (WIP)
* [**sa2_japan.gba**](https://datomatic.no-intro.org/index.php?page=show_record&s=23&n=0799) `sha1: dffd0188fc78154b42b401398a224ae0713edf23` (Japan) (En,Ja,Fr,De,Es,It)

It can also build:
* **sa2.sdl** `make sdl` (Linux/MacOS SDL 64bit port)
Expand Down Expand Up @@ -58,6 +52,9 @@ Please see follow [these instructions](./INSTALL.md)

Join us on [discord](https://discord.gg/vZTvVH3gA9) to get started in helping out

## Screenshots


## Notes

- The [Kirby & The Amazing Mirror](https://github.com/jiangzhengwenjz/katam/) decompilation uses a very similar codebase, as it was written by the same dev team (Dimps)
Expand Down
Loading