Commit Graph

187 Commits

Author SHA1 Message Date
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
Luciano Ciccariello
050b90f097 Add SEL overlay 2022-12-21 17:08:58 +00:00
Alejandro Asenjo Nitti
0b0671f040
DRA functions + PSXSDK docs (#30)
Co-authored-by: @pixel-stuck, @Mr-Wiseguy, @Rainchus, @DavidSM64
2022-12-19 05:32:00 +00:00
Luciano Ciccariello
731f1a66f5 Fix make format command 2022-11-06 17:47:57 +00:00
Luciano Ciccariello
0a6621ca4d Many new matches across all overlays 2022-11-05 23:13:18 +00:00
Luciano Ciccariello
8d3023f9ea Do not require a password to install the pre-requirements 2022-11-05 14:15:41 +00:00
frog404
a4f769abf3
find_duplicate.py tool, credit to Ethan and papermario decomp team (#22)
i had to edit the make file also to tell ld to generate .map files
2022-11-01 18:54:31 +00:00
Alejandro Asenjo
2bd7f59900
NZ0 Extracted + File descriptions (#20) 2022-10-29 18:58:02 +01:00
Luciano Ciccariello
9d640880f5 Document PreventEntityFromRespawning 2022-10-29 18:19:07 +01:00
Luciano Ciccariello
c91276ad56 Discover g_zEntityCenter field 2022-10-29 01:13:38 +01:00
Alejandro Asenjo
70a5c7f00e
CEN overlay extracted (#19) 2022-10-28 23:46:47 +01:00
Luciano Ciccariello
703b93aea6 Patch assembly code 2022-10-26 07:41:13 +01:00
Luciano Ciccariello
5a6b3e1a61 Add clang-format as a requirement 2022-10-25 21:31:45 +01:00
Luciano Ciccariello
047ea60bda Fix make decompile for outdated context 2022-10-25 21:30:41 +01:00
Luciano Ciccariello
ccabed8676 Add make update-dependencies 2022-10-25 21:30:40 +01:00
Luciano Ciccariello
98643e844f Add rule to create the 'expected' folder for asm-differ 2022-10-23 17:55:36 +01:00
Luciano Ciccariello
894f7b6b6f Avoid unnecessary steps when building 2022-10-16 23:31:19 +01:00
Luciano Ciccariello
0ece24e16f Merge rule to generate machine code from C source 2022-10-16 23:17:13 +01:00
Luciano Ciccariello
cb6de6a444 Update splat right before 0.11.0 2022-10-16 10:31:54 +01:00
Luciano Ciccariello
9a9dae8ef8 Use of rodata section 2022-10-16 09:55:11 +01:00
Luciano Ciccariello
047307aa82 Enhanced make clean 2022-10-16 09:10:43 +01:00
Luciano Ciccariello
722079c61d Decompile code with make 2022-10-15 11:45:20 +01:00
Luciano Ciccariello
52e75e6a2f Create context with Makefile 2022-10-15 11:18:32 +01:00
Luciano Ciccariello
2b815515c1 Fix update-tools 2022-10-14 21:26:57 +01:00
Luciano Ciccariello
38ce562e8a Ensure asm-differ is installed 2022-10-14 21:19:34 +01:00
Luciano Ciccariello
1fa366ec7d Extract code from the folder iso 2022-10-14 18:57:09 +01:00
Luciano Ciccariello
28a65c9920 Automatically format code to the LLVM format 2022-08-26 19:16:27 +01:00
Luciano Ciccariello
b9c0753d71 Install splat on the first run 2022-03-26 21:32:15 +00:00
Luciano Ciccariello
d6fcd34d52 Decompile function that might be related to collision detection 2022-03-12 12:54:59 +00:00
Luciano Ciccariello
5da31f00f6 Add RIC.BIN 2022-03-07 22:46:43 +00:00
Luciano Ciccariello
e96d2f653c More MAD patches 2022-03-05 11:46:37 +00:00
Luciano Ciccariello
aa6f24c712 Compile partially fixed debug room 2022-03-05 02:45:54 +00:00
Luciano Ciccariello
cb7f7d9403 Do not delete intermediary files 2022-03-02 00:38:54 +00:00
Luciano Ciccariello
e15e813bf1 Simplify Makefile 2022-02-23 18:17:18 +00:00
Luciano Ciccariello
e9fb09829b More menu drawing decompilation 2022-02-16 10:56:48 +00:00
Luciano Ciccariello
25aaa95009 Disassemble DRE, ST0, WRP and RWRP 2022-02-09 12:49:33 +00:00
Luciano Ciccariello
6f08ef0932 Use mipsel C processor 2022-02-09 11:56:45 +00:00
Luciano Ciccariello
a0fc475575 Use GCC 2.6.3 to obtain better matching 2022-02-07 00:07:42 +00:00
Luciano Ciccariello
9d50546603 Add NP3.BIN 2022-02-05 17:16:17 +00:00
Luciano Ciccariello
1cb4efa81e Match more functions by tweaking AS flags 2022-01-24 21:09:15 +00:00
Luciano Ciccariello
2768e1b144 Tweak Makefile 2022-01-24 20:45:27 +00:00
Luciano Ciccariello
778a90c049 Add two map files 2022-01-20 22:21:40 +00:00
Luciano Ciccariello
fcf1f0773a Upload disassembly 2022-01-02 13:35:44 +00:00