18 Commits
Author SHA1 Message Date
Luciano Ciccariello cc2c0cc81c Add all known DRA PS1 builds + VERSION refactor (#3817)
Something I've been wanted to do for a while. Importing all DRA builds,
with the recent TEK discovery in the equation, allowed me to get a more
concrete idea of the builds lineage.

I am putting the PR in draft for two reasons:
1. I want to collect feedback on this already big PR.
2. I am planning to make jp10, jp11, us, hk, and jp12 builds optional,
and just let the CI to always test them. Reason is I realize not
everyone has/wants these additional builds. Moreover, it would further
creep the build time.

The most interesting change is
https://github.com/Xeeynamo/sotn-decomp/blob/dec7c323d50ac22fd7511d6e1c1fdb3027ddf82a/include/version.h
, which drastically changes how versions are tested on the
pre-processor. Gone are `VERSION_US` and friends. Instead they're
replaced with `#define VER_US 19970901U`, corresponding to the greatest
creation date of each file from a given build. TEK and HD have unknown
build dates, so I gave them numbers prior to `VER_JP10`.

This allows us to document the code as follows:

```
// before
#if defined(VERSION_US) || defined(VERSION_EU) || defined(VERSION_HK) ||       \
    defined(VERSION_USPROTO) || defined(VERSION_JP10) ||                       \
    defined(VERSION_JP11) || defined(VERSION_JP12)

// after
#if VERSION >= VERSION_JP10
```

Helpers such as `IS_VER_INTL` are created to indicate all English PS1
builds, excluding the USPROTO. INTL is a short name for "International".

I took the chance to also change how we test a region with the new macro
`REGION_*`. The PSP exclusive paths are now tested with `'#if TARGET ==
TARGET_PSP`. I could've used `#if defined(TARGET_PSP)` but we may have
run to the same traps as earlier. Instead, we could create a simple
helper to do `#if IS_TARGET_PSP` but I did not want to add too many
unnecessary wrappers.

I also eliminate almost all inverted conditions. `#if !(defined(xxx) &&
defined(yyy))` and similar were far too hard to read.

`VER_NEXT` is our custom "ultimate" build with community fixes. It could
be paired with `PLATFORM_PSYZ`, which now replaces `VERSION_PC`
2026-11-07 11:49:01 +00:00
Luciano Ciccariello 7007c75180 Minor Saturn build system (#3460)
Previously diffing Saturn locally was pointing to the wrong files. This
attempts to fix that.

DIffing locally is still broken, I am unsure since which commit. But
this at least fixes the obvious problems.
2026-08-01 11:42:57 +01:00
Luciano Ciccariello a5dbb2e28c fname: decompile a good chunk of code (#3056)
It's a TT_000 beta, there's a lot of copy&paste from that overlay. It is
linked to a pre-release of `main.exe` which means most shared symbols
need to be rebased on the new `config/symbols.beta_fname.txt`.

I will attempt to merge the two overlays once this `fname` is fully
matching.

The development timeline, from older to newest, seems to be:

SD overlay > MAD stage > FNAME beta familiar > HD beta build > JP 1.0
2025-12-07 15:12:30 +00:00
ProjectOblivion 5bf7a6e612 asm-differ: Fixed diff_settings.py to properly handle all versions and overlays (#2326)
In looking at #2321, I found that the pathing wasn't being built
properly. I reworked it so that it should now be returning all of the
proper pathing for all versions and overlays, as well as adding `_psp`
`src/` directories for stage, boss, dra, and ric
2025-03-19 20:01:36 +00:00
Luciano Ciccariello d91155004a MAR duplicates (#1618)
Matches 72% of the entire overlay in one go. Around 80% of the overlay
code is made of duplicate function.

A few observations:
* `func_us_8018AC0C` seems to be an older, buggy version of
`func_801B246C` and it seem to indicate `ObjInit2` was either a `u16`
array or there were macros involved.
* `e_breakable` is the same function, but the data changes in most
overlays; I had to pull the data out. The SFX ID is also different.

Data handled through the asset manager and BSS will come as part of a
separate PR.
2024-09-16 18:19:29 +01:00
Luciano Ciccariello 5362c8b8da Add ST/WRP from PSP (#1172)
Extract ST/WRP out of #1119 . All the function symbols should have been
cross-referenced. There as some PSX functions missing from PSP and some
new functions from PSP that are not present on PSX (e.g.
`st_init_wrp.c`).

The files `st_debug.c` and `e_breakable.c` are shared between WRP PSX
and WRP PSP. Everything else from PSP is isolated into its own folder. I
had to do some tricks on the YAML config to allow shared code.

`ST_WRP_MERGE = st_debug e_breakable` in the `Makefile` is a bit
annoying as MWCC complains about every single minute detail from the C
source that has been already decompiled for the PSX US build.

`EntityWarpSmallRocks` is matching on PSP but I couldn't extract the
rodata without having a bunch of linker errors. This might be a Splat
issue. I need to investigate further.

`func_psp_09244760` is soooo interesting. The values from `0x11` to
`0x17` matches the Entity IDs that are unique to the WRP overlay. This
aligns to what we have in `typedef enum EntityIDs`.

Overall I am very excited to the recent discoveries from the PSP build!
2024-05-25 11:56:06 -07:00
Mark Street b6a0ddbeb6 Add mwccgap (#1131)
OK. Here goes. Version 0.0.1 alpha of the MWCC Global Assembly Processor
(mwccgap). It's currently very simple/limited, but it appears to work
for `src/servant/tt_000/10E8.c`.

There is lot more that can be done to improve mwccgap - i.e. supporting
.rodata migration would be a good addition, but let's see how far we can
get with it in it's current state.

Note that the Makefile could do with some improvements - we don't nede
to use mwccgap for any C file that *dont* have INCLUDE_ASM macros (it's
a waste of time) so these could be ignored, i.e. for SSSV I do something
like this to find the files that need fixing up:
```
GLOBAL_ASM_C_FILES := $(shell $(GREP) GLOBAL_ASM $(SRC_DIR) </dev/null 2>/dev/null)
```
.. although this is perhaps too simple given that SOTN has a mix of PSP
and PSX functions (and therefore there may be INCLUDE_ASM for a PSX
function but none for PSP functions...
2024-05-18 11:41:00 +01:00
Luciano Ciccariello aa6c5692fb More TT_000 PSP functions matching (#1115) 2024-04-23 20:06:05 +01:00
Mark Street 9793d3d383 Update maspsx (#482) 2023-08-19 13:40:24 +01:00
Luciano Ciccariello e92e9f4f4d w_000 matching (#465)
![f_000](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/abcc5bd5-ed0c-4fc7-88fa-aa6e796aac1b)

Matches w_000, effectively opening the doors to understand how hand
equippables work. That includes weapons, shields, consumable; all of
them internally named as Weapons). This overlay is used by:

* Tyrfing
* Namakura
* Gladius
* Scimitar
* Cutlass
* Saber
* Falchion
* Broadsword
* Bekatowa
* Damascus sword
* Hunter sword
* Bastard sword
* Talwar
* Sword of Hador
* Luminus
* Harper
* Gram
* Mormegil
* Terminus Est
* Dark Blade
* Mourneblade
* Badelaire

Due to the nature of splat, renaming the symbols is hella hard but
possible once we start importing the `.data` section in it. As far I
know this overlay does not contain any `.rodata`.

Checklist to convert it from Draft to Ready:

- [x] Decompile [func_4000_8017B1D8](https://decomp.me/scratch/HLPI0)
- [x] Confirm name of the functions
- [X] ~~Put shareable code in the appropriate folder (either as `.h` or
`.c`~~ not all overlays have identical functions (see w_029). Needs more
research
- [X] ~~Import `.data` in the C file~~ needs substancial re-work in the
spriteparts asset extractor
- [x] Move `AnimSoundEvent` to the appropriate header
- [X] ~~Rename `Entity::unk58` and `Entity::`unk6A`~~ more appropriate
as a separate PR
2023-08-14 09:21:59 -07:00
Luciano Ciccariello 067e5f9752 Make tools working with the env 'VERSION' 2023-07-02 23:13:37 +01:00
sozudandsozud d83a5cc779 Add saturn asm-differ config (#270)
This worked fine for me locally like this, example is for this PR
https://github.com/Xeeynamo/sotn-decomp/pull/269

`make build_saturn_docker && make check_saturn_docker`
`python3 ./tools/asm-differ/diff.py --overlay game --version saturn
AddHearts`

Co-authored-by: sozud <[email protected]>
2023-06-22 00:14:54 +01:00
Luciano Ciccariello 91df543b70 Fix diff 2023-02-21 22:03:18 +00:00
Luciano Ciccariello d33df2ce6a Update diff script to work with servant overlays 2023-02-08 14:44:01 +00:00
Luciano Ciccariello ef1dd5bcd4 Force use of mipsel-linux-gnu-objdump in diff 2023-01-02 16:49:03 +00:00
Luciano Ciccariello 79c5098537 Fix diff_settings when using diff without '-o' 2022-11-19 12:25:04 +00:00
Luciano Ciccariello c2f6feee46 Tweak asm-diff settings 2022-01-24 20:41:45 +00:00
Luciano Ciccariello fcf1f0773a Upload disassembly 2022-01-02 13:35:44 +00:00