Commit Graph

18 Commits

Author SHA1 Message Date
bismurphy
be98e5a383
Add data_tracer.py (#301)
This is the script demonstrated in Discord, with both graphical and
command line interfaces.
I won't say it's particularly good Python, but it gets the job done for
now :)

This traverses all functions in /asm (after doing `make force_extract`),
and logs all functions called by every function. This takes several
seconds, so the result of this traversing is saved to a text file called
sotn_calltree.txt and used for future runs. I've added this to the
gitignore. As mentioned in the comments at the top of the Python file,
this file can be deleted if the user would like to re-generate the call
tree (mainly if symbols have been renamed, which would change the
generated assembly files).

This is very much meant to be a first draft; it may have bugs and it
definitely has ugly, low-quality code (I had to do a whole bunch of
special cases for assembly that calls functions indirectly, for
example), but at least for now this could be a useful starting point.
Hopefully myself or others will make improvements into the future!
2023-07-01 15:06:30 +01:00
sozud
9fcc9371b3
Decompile various Saturn functions (#269)
Saturn equivalent of
d0822751b3/src/dra/5D6C4.c (LL6C1-L6C1)

https://decomp.me/scratch/SUNET

I also added a few files to the .gitignore

---------

Co-authored-by: sozud <sozud@users.noreply.github.com>
2023-06-21 01:28:21 +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
2aa856a9ab Update compiler to use little endian 2023-04-05 19:19:14 +01:00
Luciano Ciccariello
e954826b14 Remove shared VSCode settings 2023-03-16 12:31:37 +00:00
Luciano Ciccariello
d7417b7375 Change how game assets are managed 2023-02-21 23:25:31 +00:00
Luciano Ciccariello
e03a4d15e2 Change assembly location from asm/ to asm/us/ 2023-02-21 19:12:52 +00:00
Luciano Ciccariello
df7847502c Add SERVANT/TT_000.BIN overlay 2023-02-08 14:03:44 +00:00
Luciano Ciccariello
8d3023f9ea Do not require a password to install the pre-requirements 2022-11-05 14:15:41 +00:00
Luciano Ciccariello
ccabed8676 Add make update-dependencies 2022-10-25 21:30:40 +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
Alejandro Asenjo
4282d14fe0
vs code settings (#1) 2022-10-15 10:16:18 +01:00
Luciano Ciccariello
1fa366ec7d Extract code from the folder iso 2022-10-14 18:57:09 +01:00
Luciano Ciccariello
f3e836c9d1 Update gitignore to exclude vscode files 2022-10-14 18:30:59 +01:00
Luciano Ciccariello
5da31f00f6 Add RIC.BIN 2022-03-07 22:46:43 +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