Commit Graph

92 Commits

Author SHA1 Message Date
Mark Street
44ba42516b
Switch ASPATCH to MASPSX (#254)
This PR replaces the ASPATCH command with my custom script named MASPSX.
It's very new, and so is likely to have bugs and/or missing
functionality. That said it's producing an 🆗 build across all
overlays, and is matching a few functions that required psyq3.5/aspsx.

I have not attempted to match any of the functions that require rodata,
nor any of the functions that refused to compile / had diffs.

Note that I have added `-gcoff` to the `CC_FLAGS`, this will give you
line numbers in asm-differ.

----------------------

Thank you in advance for contributing to sotn-decomp.
Before submitting this PR, please make sure:

- [x] The PR is small and focuses to address a single task
- [x] `make all` reports all `OK`
- [x] `make format` reports no files changed
- [x] Have Actions enabled in your fork to run the auto-formatter
2023-06-16 19:51:16 +01:00
sozud
74a660999d
Extract Saturn adpcm music (#252)
This adds a new tool that extracts the Saturn ADPCM music files to WAV.
@sonicdcer pointed me to an old winamp plugin that had support for this
format, so I reworked the relevant part into a standalone tool. This
doesn't try to re-encode, since I would want to examine the original
decompression code to make sure that it's 1:1 with this implementation
first. Not all the files seem to be in this format, so I explicitly list
the ones that are in the Makefile. I think the other PCM files are the
voice tracks, which would make sense to use a voice-oriented codec.

---------

Co-authored-by: sozud <sozud@users.noreply.github.com>
2023-06-16 19:39:45 +01:00
sozud
3a5f16dbbd
Set up Saturn CI (#248)
This was working on my fork but may require a little tweaking for this
repo since I can't test the dependency fetching. The CI build uses a
regular install of dosemu2 since you can't run it in a container on
GitHub actions. I rearranged the Makefile a bit to parallelize some
actions and reduce duplication for the two workflows.

---------

Co-authored-by: sozud <sozud@users.noreply.github.com>
2023-06-12 08:27:29 +01:00
Mark Street
83888e126a
Update splat (#247) 2023-06-12 06:04:25 +01:00
sozud
6c54d78562
Extract Alchemy Lab, decompile func_060e1ff8 (#240)
This adds the Alchemy Lab overlay and decompiles func_060e1ff8 to check
that it's working. func_060e1ff8 seems similar to
31d04a46d3/src/st/nz0/36DE4.c (L101)
but it's not clear if it's the same function yet.

I think it probably makes sense to add one overlay of each type. Right
now there's no stage overlay extracted. I picked Alchemy Lab since it's
the furthest along on PSX.
2023-06-06 23:28:19 +01:00
sozud
859230a25d
Add Saturn toolchain (#234)
This adds some new Makefile commands:

build_saturn_toolchain: Downloads GCCSH, and builds two docker
containers. One container is binutils for SuperH, and the other has
Dosemu.

build_saturn: Copies GCCSH, the source code, and asm into the build
directory and runs the GCCSH via Dosemu in the docker container.
Everything is kept in the same directory since it's hard to use Dosemu
otherwise.

check_saturn: Dumps the object files to binary using the binutils Docker
container, then checks the hashes.

diff_saturn: Compares the binaries and outputs a diff to
build/saturn/$FILENAME-diff.txt. Used like FILENAME=GAME.PRG make
diff_saturn.

I've added the source for game.c and t_bat.c. I've replaced one of the
asm functions in t_bat.c to show that it's possible to match simple
functions. I'm not able to generate linker scripts yet so functions that
rely on symbols from other overlays generally can't be matched yet.

This workflow is not all that clean so I'm open to ideas on improving
it. I tried using various versions of
https://github.com/decompals/old-gcc to try to get a native compiler but
couldn't get a matching build. I'm not 100% sure that this version of
GCCSH is correct but initial results seem promising.

As of right now, it's not possible to run this in CI since the dosemu
container changes the USER and Github won't let you write to disk if you
do that.
https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
2023-06-03 19:09:44 +01:00
Luciano Ciccariello
a05cd5bde1 Allow to forcefully export all the assembly code 2023-05-29 18:06:28 +01:00
sozud
be30bffea7
Integrate splitting for saturn (#233)
This PR does some initial integration work for splitting the Saturn
version. It adds T_BAT.PRG (Bat overlay) and GAME.PRG (similar to
DRA.BIN). These are extracted to asm/saturn/* and src/saturn/*. Right
now there's no attempt to compile. I haven't been able to figure out the
issues with sotn-disk so this requires pre-extracted files in
disks/saturn. Something like this is able to do it:

```
bchunk saturn.bin saturn.cue saturn.iso
7z x saturn.iso 
```

The Saturn version has the code split up differently so I think putting
it in a separate folder to begin with makes sense. For example the
Random function is in GAME.PRG rather than in the stage overlays.
There's also an Alucard overlay rather than it being included in
GAME.PRG. See here for some comparisons:
https://github.com/Xeeynamo/sotn-decomp/wiki/Saturn-Matching

I didn't attempt to install Rust as part of the project setup like with
Go.

---------

Co-authored-by: sozud <sozud@users.noreply.github.com>
2023-05-25 19:29:10 +01:00
bismurphy
54ce84cc54
Fix to makefile to properly create the directory before cp'ing into it (#222)
Solves the issue mentioned in discord - When you `cp` into expected, and
expected does not exist, the CONTENTS of build get copied into the
newly-created `expected` directory. This PR solves this by running
`mkdir -p expected` first (-p causes mkdir to not error if `expected`
already exists). Then, when `cp` runs, `expected` will always exist,
thus `build` properly gets copied into it.
2023-05-07 10:24:15 +01:00
Luciano Ciccariello
894fa47d64 Do not rely on the shebang to run 'make format' 2023-05-06 02:14:07 +01:00
Luciano Ciccariello
6400b28efd Automatically format symbol list by offset 2023-05-06 02:09:29 +01:00
Luciano Ciccariello
c35189b9e8 Add make extract_disk compatibility for PSP ISOs
This allows to extract PSP versions of the game, including the infamous
HDBIN version of the game.
2023-05-05 22:26:39 +01:00
Luciano Ciccariello
6dea1457c0 Makefile game version clean-up 2023-05-04 23:32:35 +01:00
Luciano Ciccariello
e8520f1243 HD DRA func_800F2860 matching 2023-05-04 23:11:15 +01:00
Luciano Ciccariello
eee04d6ea1
RIC extract spritesheet (#199)
Thanks to @MottZilla research I was able to extract the spritesheets of
Richter as PNGs in conjunction with the original palette from
`F_GAME2.BIN`. When the binaries are built, the PNGs are recompiled back
into binary.

In case of modding, it is possible to modify the sprite size to
accommodate bigger or smaller sprites. Although it is not possible to
modify the existing palette as currently we have no way to extract and
rebuild `F_GAME2.BIN`. You would have to modify the palette via hex
yourself. The file `config/splat.us.ric.yaml` shows in which offset the
palette is located. Just for reference, the colour format for the
palette is RGBA5551. It is important that edited PNGs has 16 colours
otherwise the build will fail.

The `padding` field is required to reconstruct some left-over / junk
data that is not part of the data sprite. For the sake of modding, the
`padding` field can be whatever.

I am not sure if `RIC.BIN` pointers can be relocated. If that is the
case you might get a black screen when playing with Richter. It should
be easily fixable though.


![image](https://user-images.githubusercontent.com/6128729/233791249-0155a6fb-c5fc-4142-b294-9f44b5524dde.png)
2023-04-22 21:03:55 +01:00
Luciano Ciccariello
2aa856a9ab Update compiler to use little endian 2023-04-05 19:19:14 +01:00
Luciano Ciccariello
17b96a68ab Add script to extract and rebuild room data 2023-03-31 08:41:52 +01:00
Luciano Ciccariello
ed940319d6 Extract Equipment data as JSON 2023-03-18 14:16:56 +00:00
Luciano Ciccariello
63d6e3cf20 make clean will not delete .vscode/settings.json 2023-03-18 11:51:31 +00:00
Luciano Ciccariello
55b7acc118 Install GO in the home directory instead in the repo 2023-03-16 12:28:17 +00:00
Luciano Ciccariello
2d303fa538 Fix __attribute__ decompilation error 2023-03-12 00:11:14 +00:00
Luciano Ciccariello
341bd90774 Extract and assemble stage graphics for all stages 2023-03-10 04:04:18 +00:00
Luciano Ciccariello
a0050b3c1e Extract WRP stage graphics 2023-03-10 03:59:33 +00:00
Luciano Ciccariello
ddd2a91696
WRP split some data and add new split tools (#109)
The objective is to separate the data that is usually written into `asm/*/data` into separate files. Those will initially be binary files.

There is also an utility that allows to decompress compressed data. The decompressed data is currently not read as we are missing a compression algorithm that matches the original one. I tried writing one in the past: it worked, it re-created similar files but sadly not the same ones. The decompression algorithm is there to allow to do some data mining and understand what the data is and how it is used.
2023-03-09 13:32:00 +00:00
Luciano Ciccariello
54d9d54832 Speed-up progress and duplicate report jobs 2023-02-25 15:02:43 +00:00
Luciano Ciccariello
814e9d1aa5 Fix unnecessary file getting created every time 2023-02-25 13:35:33 +00:00
Luciano Ciccariello
d7417b7375 Change how game assets are managed 2023-02-21 23:25:31 +00:00
Luciano Ciccariello
089bbcb252 Writes built binaries into build/us/ 2023-02-21 20:06:27 +00:00
Luciano Ciccariello
e03a4d15e2 Change assembly location from asm/ to asm/us/ 2023-02-21 19:12:52 +00:00
Luciano Ciccariello
7b07e9e9f4 You did not see anything 2023-02-21 13:03:45 +00:00
Luciano Ciccariello
651deb2f82 Rename config folder to use game version 2023-02-21 01:42:33 +00:00
Luciano Ciccariello
7433d63377 MAD reworked symbols and patches from the ground-up 2023-02-19 19:32:52 +00:00
Luciano Ciccariello
e321187bc9 AS should not use the $gp register 2023-02-12 00:22:31 +00:00
Luciano Ciccariello
df7847502c Add SERVANT/TT_000.BIN overlay 2023-02-08 14:03:44 +00:00
Luciano Ciccariello
4ba2110fe7 Fix asm-differ 2023-02-05 11:06:16 +00:00
Luciano Ciccariello
0596244649 Asset extraction and build experimentation 2023-02-03 15:41:56 +00:00
Luciano Ciccariello
65873dcfb3 Separate MAIN symbols from DRA 2023-01-28 02:31:37 +00:00
Luciano Ciccariello
3aa8257ffc Clearer GameApi symbols (thanks @KernelEquinox) 2023-01-23 07:22:35 +00:00
Luciano Ciccariello
d22ba7833f Use compiler flags from PSY-Q CC1 2023-01-22 18:34:27 +00:00
Luciano Ciccariello
9eac347212 Set signatures for GameApi 2023-01-22 14:37:34 +00:00
Luciano Ciccariello
720bd6e5ab Introduce GameApi 2023-01-22 13:33:50 +00:00
Luciano Ciccariello
b994edcc98 New MAD patches 2023-01-21 14:14:01 +00:00
Luciano Ciccariello
fad7c45407 Adjust CheckCollision signature 2023-01-21 05:28:40 +00:00
Luciano Ciccariello
59e77b4741 'make disk' now works without deleting 'sotn.cue' 2023-01-10 20:57:20 +00:00
Luciano Ciccariello
316545e8e8 Fix linker when using main/DRA components in overlays 2023-01-02 08:38:20 +00:00
Luciano Ciccariello
2a48801e11
Fix GitHub pipeline (#36)
Creates a workaround to force using spimdisasm 1.9.0 as 1.9.1 currently
breaks the repo
2023-01-01 20:59:50 +00:00
Luciano Ciccariello
764c919296
Creates a new game image based on built binaries (#34) 2023-01-01 20:49:12 +00:00
Alejandro Asenjo Nitti
b51efcc45f
GET_PLAYER + Symbol fixes + initState -> step rename + stuff (#32)
do {
      merge(&this);
} while (0) ;
2022-12-28 09:33:54 +00:00
Luciano Ciccariello
efe598631f Add tool to extract the game image 2022-12-26 20:37:34 +00:00
Luciano Ciccariello
09b412f592 Add script to automatically decompile functions 2022-12-24 20:01:37 +00:00