mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
add tracking for chao garden and collect rings
This commit is contained in:
1 parent
1ed0f1c15b
commit
ece261f01b
5 files changed
+58
-22
No files matched your search
@@ -77,6 +77,14 @@ jobs:
|
||||
run: |
|
||||
python3 scripts/progress.py text
|
||||
|
||||
- name: Collect Rings Progress
|
||||
run: |
|
||||
cd multi_boot/roms/collect_rings && python3 ../../../scripts/progress.py -f collect_rings.map text
|
||||
|
||||
- name: Chao Garden Progress
|
||||
run: |
|
||||
cd chao_garden && python3 ../scripts/progress.py -f mb_chao_garden.map text
|
||||
|
||||
- name: Generate reports
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: |
|
||||
@@ -88,6 +96,23 @@ jobs:
|
||||
python3 scripts/progress.py shield-json -m > gh-pages/reports/progress-sa2-shield-matching.json
|
||||
echo "REPORTS_COMMIT_MSG=$( git log --format=%s ${GITHUB_SHA} )" >> $GITHUB_ENV
|
||||
cp sa2.map gh-pages/maps/${GITHUB_SHA}.map
|
||||
- name: Generate reports (Collect Rings)
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: |
|
||||
cd multi_boot/roms/collect_rings
|
||||
python3 ../../../scripts/progress.py csv -f collect_rings.map >> ../../../gh-pages/reports/progress-collect_rings-nonmatching.csv
|
||||
python3 ../../../scripts/progress.py csv -m -f collect_rings.map >> ../../../gh-pages/reports/progress-collect_rings-matching.csv
|
||||
python3 ../../../scripts/progress.py shield-json -f collect_rings.map > ../../../gh-pages/reports/progress-collect_rings-shield.json
|
||||
python3 ../../../scripts/progress.py shield-json -m -f collect_rings.map > ../../../gh-pages/reports/progress-collect_rings-shield-matching.json
|
||||
|
||||
- name: Generate reports (Chao Garden)
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: |
|
||||
cd chao_garden
|
||||
python3 ../scripts/progress.py csv -f mb_chao_garden.map >> ../gh-pages/reports/progress-mb_chao_garden-nonmatching.csv
|
||||
python3 ../scripts/progress.py csv -m -f mb_chao_garden.map >> ../gh-pages/reports/progress-mb_chao_garden-matching.csv
|
||||
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: |
|
||||
|
||||
@@ -23,7 +23,7 @@ This is a work in progress matching decompilation of Sonic Advance 2
|
||||
It so far 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) (Work in Progress)
|
||||
* :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)
|
||||
|
||||
It can also build:
|
||||
* **sa2.sdl** `make sdl` (Linux/MacOS SDL 64bit port)
|
||||
@@ -32,13 +32,23 @@ It can also build:
|
||||
|
||||
## Current state
|
||||
|
||||
- :tada: The build is 100% from C files with [~80 functions which currently don't match](./asm/non_matching)
|
||||
- :tada: The build is 100% from C files with [~60 functions which currently don't match](./asm/non_matching)
|
||||
- All assembly code extracted, disassembled, and decompiled by hand to their C equivilent
|
||||
- All songs have been extracted, and documented as [matching MIDI files](./sound/songs/midi)
|
||||
- All sprite animation frames have been [extracted to PNGs and are used to build the matching rom](./graphics/obj_tiles)
|
||||
- All tilemaps (backgrounds) have been documented and [had their tiles extracted](./data/tilemaps)
|
||||
- Most aspects of core game play have been documented, but >600 functions are still unnamed
|
||||
- The game compiles to a widescreen port (*426x240*) for multiple platforms
|
||||
- The "sub games" (Chao Garden and Collect The Rings) have been disassembled but not yet decompiled
|
||||
|
||||
## Sub games
|
||||
|
||||
Within the Sonic Advance 2 rom there are some "Sub games" which we have begun to decompile as part of this project. These sub games are automatically compiled and bundled during the main build process, as they are necessary to create a matching binary.
|
||||
|
||||
| Multiboot rom | Decompilation |
|
||||
| --- | --- |
|
||||
| [**mb_chao_garden.gba**](./chao_garden) |  |
|
||||
| [**collect_rings.gba**](./multi_boot/roms/collect_rings/) |  |
|
||||
|
||||
|
||||
## Setting up the repo
|
||||
|
||||
@@ -59,7 +69,7 @@ Join us on [discord](https://discord.gg/vZTvVH3gA9) to get started in helping ou
|
||||
|
||||
- [JaceCear](https://github.com/JaceCear) for his dedication to understanding the internals of the graphics engine, writing [tools to extract this data](https://github.com/JaceCear/SA-Trilogy-Animation-Exporter), as well as massive effort in contributing towards the decompilation process, *and* setting up the PC ports
|
||||
- Shout out to [@froggestspirit](https://github.com/froggestspirit) for the drive to set this project up
|
||||
- Special thanks to [@normmatt](https://github.com/normmatt) for the initial repo setup and sounds decompilation
|
||||
- Special thanks to [@normmatt](https://github.com/normmatt) for the initial repo setup and sounds disassembly
|
||||
|
||||
- [Pokemon Reverse Engineering Tools](https://github.com/pret) community for their help with the project, and tooling for GBA decompilations
|
||||
- [Kermalis](https://github.com/Kermalis) for [their tool](https://github.com/Kermalis/VGMusicStudio) which was used to dump the game midis
|
||||
|
||||
@@ -231,7 +231,7 @@ SECTIONS {
|
||||
}
|
||||
|
||||
. = 0x2000000;
|
||||
.text :
|
||||
ROM :
|
||||
ALIGN(4)
|
||||
{
|
||||
build/mb_chao_garden/asm/rom_header.o(.text);
|
||||
@@ -251,11 +251,8 @@ SECTIONS {
|
||||
*libgcc.a:_dvmd_tls.o(.text);
|
||||
*libgcc.a:_modsi3.o(.text);
|
||||
*libc.a:memcpy.o(.text);
|
||||
} =0
|
||||
|
||||
.rodata :
|
||||
ALIGN(4)
|
||||
{
|
||||
/* Data */
|
||||
build/mb_chao_garden/data/data.o(.rodata);
|
||||
build/mb_chao_garden/src/m4a_tables.o(.rodata);
|
||||
build/mb_chao_garden/data/sound_data.o(.rodata);
|
||||
|
||||
@@ -10,7 +10,7 @@ SECTIONS {
|
||||
}
|
||||
|
||||
. = 0x20000C0;
|
||||
.text :
|
||||
ROM :
|
||||
ALIGN(4) {
|
||||
build/collect_rings/asm/rom_header.o(.text);
|
||||
build/collect_rings/src/sa2/crt0.o(.text);
|
||||
@@ -43,10 +43,8 @@ SECTIONS {
|
||||
*libgcc.a:_umodsi3.o(.text);
|
||||
*libc.a:memcpy.o(.text);
|
||||
*libc.a:memset.o(.text);
|
||||
}
|
||||
|
||||
.rodata :
|
||||
ALIGN(4) {
|
||||
/* Data */
|
||||
build/collect_rings/data/data0.o(.rodata);
|
||||
build/collect_rings/src/sa2/core.o(.rodata);
|
||||
build/collect_rings/src/sa2/background.o(.rodata);
|
||||
|
||||
Vendored
+15
-9
@@ -32,14 +32,14 @@ def collect_non_matching_funcs():
|
||||
return result
|
||||
|
||||
|
||||
def parse_map(non_matching_funcs):
|
||||
def parse_map(non_matching_funcs, map_file):
|
||||
src = 0
|
||||
asm = 0
|
||||
src_data = 0
|
||||
data = 0
|
||||
non_matching = 0
|
||||
|
||||
with open('sa2.map', 'r') as map:
|
||||
with open(map_file, 'r') as map:
|
||||
# Skip to the linker script section
|
||||
line = map.readline()
|
||||
while not line.startswith('Linker script and memory map'):
|
||||
@@ -57,11 +57,16 @@ def parse_map(non_matching_funcs):
|
||||
section = arr[0]
|
||||
size = int(arr[2], 16)
|
||||
filepath = arr[3]
|
||||
|
||||
# (asm|data|sound|src|...)/*/
|
||||
# ^
|
||||
# 0 1
|
||||
dir = filepath.split('/')[0]
|
||||
if filepath.startswith('build'):
|
||||
# build/*/(asm|data|sound|src|...)/*/
|
||||
# ^ ^ ^
|
||||
# 0 1 2 3
|
||||
dir = filepath.split("/")[2]
|
||||
else:
|
||||
# (asm|data|sound|src|...)/*/
|
||||
# ^
|
||||
# 0 1
|
||||
dir = filepath.split('/')[0]
|
||||
|
||||
if section == '.text':
|
||||
if dir == 'src':
|
||||
@@ -111,6 +116,7 @@ def main():
|
||||
parser.add_argument("format", nargs="?", default="text", choices=["text", "csv", "shield-json"])
|
||||
parser.add_argument("-m", "--matching", dest='matching', action='store_true',
|
||||
help="Output matching progress instead of decompilation progress")
|
||||
parser.add_argument("-f", "--file", dest='map_file', default="sa2.map")
|
||||
args = parser.parse_args()
|
||||
|
||||
matching = args.matching
|
||||
@@ -126,7 +132,7 @@ def main():
|
||||
if func[0] == 'ASM_FUNC':
|
||||
non_matching_funcs.append(func[1])
|
||||
|
||||
(src, asm, src_data, data) = parse_map(non_matching_funcs)
|
||||
(src, asm, src_data, data) = parse_map(non_matching_funcs, args.map_file)
|
||||
|
||||
total = src + asm
|
||||
data_total = src_data + data
|
||||
@@ -140,7 +146,7 @@ def main():
|
||||
|
||||
if args.format == 'csv':
|
||||
version = 2
|
||||
git_object = git.Repo().head.object
|
||||
git_object = git.Repo(search_parent_directories=True).head.object
|
||||
timestamp = str(git_object.committed_date)
|
||||
git_hash = git_object.hexsha
|
||||
|
||||
|
||||
Reference in new issue
Block a user