Commit Graph

2746 Commits

Author SHA1 Message Date
H.M. Burger
5b717b4ec4
Importing remainder of ghost data (#1747)
Imported the remainder of the data.
2024-10-05 19:05:22 -07:00
Josh Schreuder
bc71a8940a
Decompile no0 func_us_801C3308 (#1733) 2024-10-05 18:57:35 -07:00
bismurphy
077578210e
Document some stuff with Entrance lightning (#1745)
Some checks are pending
Format code / format (push) Waiting to run
Build C code / extract-assets (push) Waiting to run
Build C code / build-linux (push) Blocked by required conditions
Build C code / build-macos (push) Blocked by required conditions
Build C code / build-windows (push) Blocked by required conditions
Build C code / build-linux-lle (push) Blocked by required conditions
Build Saturn version / build-and-test-saturn (push) Waiting to run
Build Saturn version / function-finder-saturn (push) Waiting to run
Build Debug Module tool / build (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, hd) (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, pspeu) (push) Waiting to run
Build PSX and PSP version / build-and-test (us, us) (push) Waiting to run
Build PSX and PSP version / generate-progress-report (pspeu, hd) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (pspeu, pspeu) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report-psp (pspeu, pspeu) (push) Blocked by required conditions
Mostly just some light renaming.

I used my new entity animation viewer to figure out what this function
was, it's a very subtle cloud effect that would have been hard to
identify otherwise.

The driving factor for this was removing ext.generic from this entity,
which is also complete.

This applies to both NO3 and NP3.
2024-10-05 22:51:28 +01:00
bismurphy
9ce2a3fbf6
Rework sotn-assets animation pointers (#1742)
I was reviewing some of the animations pulled out by sotn-assets.
Speicfically, I found that in `src/st/no3/sprite_banks.h` (a file
created by sotn-assets locally, which does not exist directly in this
repo), we have:

```
extern s16* sprites_no3_0;
extern s16* sprites_no3_1;
extern s16* sprites_no3_2;
extern s16* sprites_no3_3;
extern s16* sprites_no3_4;
extern s16* sprites_no3_5;
extern s16* sprites_no3_6;
extern s16* sprites_no3_7;
extern s16* sprites_no3_8;
static s16* spriteBanks[] = {
    0,
    &sprites_no3_0,
    &sprites_no3_3,
    &sprites_no3_1,
    &sprites_no3_2,
    &sprites_no3_4,
    &sprites_no3_5,
    &sprites_no3_6,
    &sprites_no3_7,
    &sprites_no3_8,
```

However, those are not the right pointer types. `sprites_no3_#` should
have a type of `s16* []`, so I reworked the sotn-assets tool to use the
right pointers for each of these things. Now the sprite_banks.h file
looks like:
```
extern s16* sprites_no3_0[];
extern s16* sprites_no3_1[];
extern s16* sprites_no3_2[];
extern s16* sprites_no3_3[];
extern s16* sprites_no3_4[];
extern s16* sprites_no3_5[];
extern s16* sprites_no3_6[];
extern s16* sprites_no3_7[];
extern s16* sprites_no3_8[];
static s16** spriteBanks[] = {
    0,
    sprites_no3_0,
    sprites_no3_3,
    sprites_no3_1,
    sprites_no3_2,
    sprites_no3_4,
    sprites_no3_5,
    sprites_no3_6,
    sprites_no3_7,
    sprites_no3_8,
```

Which more accurately represents the data within.

Naturally, since this PR mostly just changes the tool, the real changes
are in the tool's output, so feel free to clone this branch and
investigate the sprite_banks.h file if you want to see anything further
about it.

DRA's equivalent of the SpriteBanks array is `D_800A3B70`, and is
currently in the repo as extracted data, without using `sotn-assets`;
this PR makes it so the types in the overlays (which do use
`sotn-assets`) will match the types in DRA.
2024-10-05 21:28:16 +01:00
Aleksandr Shabelnikov
a979d90d9a
NO0: Some deduplications (#1741) 2024-10-05 19:24:11 +01:00
bismurphy
4ec4a04c38
Migrate sotn-assets to use u16/s16 types (#1740)
Some checks are pending
Format code / format (push) Waiting to run
Build C code / extract-assets (push) Waiting to run
Build C code / build-linux (push) Blocked by required conditions
Build C code / build-macos (push) Blocked by required conditions
Build C code / build-windows (push) Blocked by required conditions
Build C code / build-linux-lle (push) Blocked by required conditions
Build Saturn version / build-and-test-saturn (push) Waiting to run
Build Saturn version / function-finder-saturn (push) Waiting to run
Build Debug Module tool / build (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, hd) (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, pspeu) (push) Waiting to run
Build PSX and PSP version / build-and-test (us, us) (push) Waiting to run
Build PSX and PSP version / generate-progress-report (pspeu, hd) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (pspeu, pspeu) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report-psp (pspeu, pspeu) (push) Blocked by required conditions
I did a find and replace for "unsigned short" to "u16" in the
sotn-assets `build.go` file and the same for "signed short" to "s16".
Then I went through and added common.h imports to fix each of the build
errors until it worked.

Using the numerical types is preferred due to being shorter (reducing
line wrapping), and to be future-proof for any systems where the "short"
type might not be 16 bits.
2024-10-05 18:22:03 +01:00
bismurphy
1c1e838d92
Decompile NO3 EntityBackgroundLightning (#1739)
Nice to get more progress in our "old" stages on those last few
difficult functions.

At the end of this function there is a little switch block which
switches around some SFX; this informed me that D_80097910 holds SFX, so
I went back through the repo for other uses of this variable and made it
use SFX enums. This variable appears to hold the SFX ID for the current
background music. Maybe it deserves a name, but I don't want to turn
this PR into too much of a mess of doing different things.
2024-10-05 15:44:42 +01:00
Aleksandr Shabelnikov
57e8245a2e
NO0: decompile func_us_801CC8F8 (#1728) 2024-10-05 14:53:41 +01:00
Josh Schreuder
755675bf5f
Dedupe no0 e_particles (#1736) 2024-10-05 14:09:48 +01:00
Josh Schreuder
f2e3902b5b
Dedupe no0 UpdateStatueTiles (#1735) 2024-10-05 13:44:13 +01:00
Josh Schreuder
6cb2e58fc1
Decompile no0 func_us_801DC754 (#1734) 2024-10-05 13:43:14 +01:00
bismurphy
88134dba3c
More entity cleanup: ET_Generic, renaming, and some Animset improvements (#1723)
This is doing a few different things; I'm sort of finding issues and
fixing them one by one. I've found more, but don't want this PR to get
too bloated.

1) Removal of more uses of ET_Generic, and eliminating a few of its
members

2) Renaming EntityUnk15 to EntityGreyPuff

3) Reworking Animset data. It's s16, not u32, so the data in d_2F324.c
has been adjusted to match that.
2024-10-05 12:37:48 +01:00
Josh Schreuder
b696848c5a
Dedupe some functions in no0 e_collect (#1732)
Some checks are pending
Format code / format (push) Waiting to run
Build C code / extract-assets (push) Waiting to run
Build C code / build-linux (push) Blocked by required conditions
Build C code / build-macos (push) Blocked by required conditions
Build C code / build-windows (push) Blocked by required conditions
Build C code / build-linux-lle (push) Blocked by required conditions
Build Saturn version / build-and-test-saturn (push) Waiting to run
Build Saturn version / function-finder-saturn (push) Waiting to run
Build Debug Module tool / build (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, hd) (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, pspeu) (push) Waiting to run
Build PSX and PSP version / build-and-test (us, us) (push) Waiting to run
Build PSX and PSP version / generate-progress-report (pspeu, hd) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (pspeu, pspeu) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report-psp (pspeu, pspeu) (push) Blocked by required conditions
2024-10-04 22:27:18 -07:00
H.M. Burger
7752094c15
Importing tt_001 animation data (#1731)
Adding animation frame data to tt_001
Renaming file to animationdata for tt_000
2024-10-04 22:20:07 -07:00
H.M. Burger
4d2ccaac2b
Importing tt_001 clut data (#1730)
Again, data is shared with tt_000, so I merged that into a shared
header.
2024-10-04 21:11:15 -07:00
H.M. Burger
4282ac221e
Importing tt_001 data spriteparts (#1729)
Spriteparts data is the same between bat and ghost, so I moved them to a
shared header.
If they are different than other familiars, we'll have to rename the
shared header.
2024-10-04 20:57:04 -07:00
H.M. Burger
bc549c75e6
Small refactor for servant update (#1727)
A small refactor renaming a global variable for when the cutscene has
control of the engine.
In servant, it short cuts the main update function so that your familiar
isn't doing stuff while a cutscene is running.
Also some flag cleanup.

I've figured out quite a bit with the functions and how they are called.
It looks like most of the functions in ServantDesc are actually update
functions called by using the entityId as an offset. I want to update to
make that more clear, but I want to isolate that into it's own PR and I
already had this refactor in flight.
2024-10-04 20:52:23 -07:00
Josh Schreuder
f647b0c26b
Rename g_Player.unk0 to g_Player.status (#1721)
As discussed in
https://github.com/Xeeynamo/sotn-decomp/pull/1709#issuecomment-2386396310
2024-10-04 20:03:16 -07:00
Jonathan Hohle
c1b36a1029
Map HD CEN's e_particles and create_entity (#1726)
Some checks are pending
Format code / format (push) Waiting to run
Build C code / extract-assets (push) Waiting to run
Build C code / build-linux (push) Blocked by required conditions
Build C code / build-macos (push) Blocked by required conditions
Build C code / build-windows (push) Blocked by required conditions
Build C code / build-linux-lle (push) Blocked by required conditions
Build Saturn version / build-and-test-saturn (push) Waiting to run
Build Saturn version / function-finder-saturn (push) Waiting to run
Build Debug Module tool / build (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, hd) (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, pspeu) (push) Waiting to run
Build PSX and PSP version / build-and-test (us, us) (push) Waiting to run
Build PSX and PSP version / generate-progress-report (pspeu, hd) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (pspeu, pspeu) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report-psp (pspeu, pspeu) (push) Blocked by required conditions
And fix some segment offsets.
2024-10-04 14:49:52 -07:00
H.M. Burger
87c23d5cca
Refactoring Servant init code (#1720)
Some checks failed
Format code / format (push) Has been cancelled
Build C code / extract-assets (push) Has been cancelled
Build Saturn version / build-and-test-saturn (push) Has been cancelled
Build Saturn version / function-finder-saturn (push) Has been cancelled
Build Debug Module tool / build (push) Has been cancelled
Build PSX and PSP version / build-and-test (pspeu, hd) (push) Has been cancelled
Build PSX and PSP version / build-and-test (pspeu, pspeu) (push) Has been cancelled
Build PSX and PSP version / build-and-test (us, us) (push) Has been cancelled
Build C code / build-linux (push) Has been cancelled
Build C code / build-macos (push) Has been cancelled
Build C code / build-windows (push) Has been cancelled
Build C code / build-linux-lle (push) Has been cancelled
Build PSX and PSP version / generate-progress-report (pspeu, hd) (push) Has been cancelled
Build PSX and PSP version / generate-progress-report (pspeu, pspeu) (push) Has been cancelled
Build PSX and PSP version / generate-progress-report (us, us) (push) Has been cancelled
Build PSX and PSP version / generate-duplicates-report (us, us) (push) Has been cancelled
Build PSX and PSP version / generate-duplicates-report-psp (pspeu, pspeu) (push) Has been cancelled
Lots of cleanup here to make the code easier to read.

1. Adding CLUT index defines to avoid magic numbers
2. Adding InitializeMode enum and hooking that up
3. Updating function names for servant init
4. Cleaning up magic numbers used in tt_000 init function

I wanted to add a enum for the EntityId, but both servants share 0xD1.
Looking at the other EntityIDs definitions, there seems to be some
crossover, but it also looks like they may be partly unique across the
different binaries. Probably need more study to figure out how to unify
them (or if it's even possible to unify).

We also may want to look at splitting enum definitions and defining
flags/fixed values into some sort of enum file structure. Having them
all in game.h is making a large file. But we would obviously not want to
fracture the codebase more. Either way, that's way beyond the scope of
what I wanted to do here.
2024-10-03 14:19:11 -07:00
sozud
a1c00767ea
More HD CEN dedupes (#1725) 2024-10-03 11:11:05 -07:00
Aleksandr Shabelnikov
c29c0c6fe8
NO0: deduplication of prim_helpers and popup functions (#1724) 2024-10-03 10:29:45 -07:00
Josh Schreuder
2fe2e117f3
Set some Entity flags to enum values (#1722) 2024-10-03 09:22:33 -07:00
sozud
887e32510b Get rid of non-functions in function_finder 2024-10-02 23:47:11 -07:00
sozud
6414ab36ab Remove mv? 2024-10-02 22:07:51 -07:00
sozud
b64cda2e3f Fix dirs? 2024-10-02 21:47:57 -07:00
sozud
a239ecc7e0 Fix argument? 2024-10-02 21:34:09 -07:00
sozud
a24c5cdca1 Fix path? 2024-10-02 21:31:16 -07:00
sozud
3ac5786db0 Try fixing analyze_calls 2024-10-02 21:23:59 -07:00
Josh Schreuder
98b784a592
Add duplicate match info to function report (#1719) 2024-10-02 20:54:24 -07:00
sozud
98f63b3e25 Try fixing dups report 2024-10-02 20:09:05 -07:00
sozud
b6152f5ac8
HD CEN DestroyEntity EntityPrizeDrop (#1718) 2024-10-02 18:04:22 -07:00
sozud
c90cbfaebe
CEN HD CollectHeartVessel/CollectLifeVessel (#1717) 2024-10-02 17:36:30 -07:00
Aleksandr Shabelnikov
6903e8f2bf
Decompile tt_001 func_us_801720E4 (#1713) 2024-10-02 17:26:40 -07:00
sozud
332acfe69a
CEN HD CollectHeart CollectGold (#1716) 2024-10-02 16:09:21 -07:00
sozud
a305fef935
Dedupe PrizeDropFall2 (#1715) 2024-10-02 22:39:01 +01:00
sozud
1117ef0af1
Dedupe PrizeDropFall (#1714)
Progress towards fixing CEN HD
2024-10-02 20:10:44 +01:00
bismurphy
eff7109db4
Move unkB8 out of Ext and into Entity (#1706)
Improved PR compared to #1704 .

We decided that unkB8 shouldn't be part of the Ext since it appears to
apply to all entities.

Also discovered some issues with the ET_GurkhaHammer struct, so resolved
those as well.

Now all accesses to the unkB8 offset go directly to `self->unkB8`.

Unrelated to all this unkB8 stuff, I found that there was an extra C
file in DRE which was not being used. Its code had been moved to
succubus.c, and it looks like the original file was accidentally left in
place. I deleted it here.
2024-10-02 19:16:52 +01:00
Josh Schreuder
939fd7daca
Decompile tt_001 func_us_80171284 (#1712)
PSX: https://decomp.me/scratch/APOek
PSP: https://decomp.me/scratch/T9RKT

Had do some some kinda ugly ifdef PSP stuff here as there is some
differences between the two.
2024-10-02 11:10:35 -07:00
H.M. Burger
ed33e90bd2
Decompiling tt_001.func_us_8017246C (#1711)
Accurate for PSX and PSP

PSP scratch: https://decomp.me/scratch/lZHti

Some of these global variables I've figured out, but I am planning on
doing a refactor of tt_001 next and will rename the vars there.
2024-10-02 11:04:56 -07:00
Jonathan Hohle
11631e1475
Add CEN Overlay to HD (#1705)
Adds the CEN overaly to the HD version of the game.

Resolves #1638.

This uses most, but not all, matching functions. Some were excluded
because due to symbols mapping that has not bee completed yet.

Not all data has been imported, and mapping symbols, and data should
make many of the remaining functions easy to import.
2024-10-01 22:31:18 -07:00
Josh Schreuder
b9d7e3fd57
Use player status flags where possible (#1709)
There's some cases which don't nicely map to the defines in place so
I've left as is

-
cf280c66f5/src/st/dre/succubus.c (L583)
- is this a mask like these?
https://github.com/search?q=repo%3AXeeynamo%2Fsotn-decomp%20PLAYER_UNK0C_READY_MASK&type=code
2024-10-01 17:23:24 -07:00
Aleksandr Shabelnikov
b9f02684ee
Overlay NO0: Deduplicate and split collision data (#1710) 2024-10-01 11:46:56 -07:00
Onenutmcgee
74ce2c49b8
Decompiling function tt_001.func_us_80171624 (#1708) 2024-10-01 09:04:45 -07:00
Onenutmcgee
646cc181cb
Various cleanup to match PSP decomp (#1707)
Ran my code for this function against the PSP assembly and fixed a bunch
of places where it didn't match.

It's pretty close now, but still missing a bit. I think it's mostly
around the number of parameters and the number of temp variables as it's
mostly all in the stack push/pop.

Also removing unnecessary casts.

Scratch
https://decomp.me/scratch/0Gm3x
2024-10-01 08:52:34 -07:00
Aleksandr Shabelnikov
cf280c66f5
Overlay NO0: Deduplicate and split st_update data (#1703)
Co-authored-by: SynaMax <djsynamax@gmail.com>
2024-09-30 16:56:38 -04:00
bismurphy
80d9bd8cc5
Refactor some stuff with subweapons (#1702)
Primary goal here was to eliminate `ext.generic.unkB0`. It turns out
that the only entity that reaches up into this unkB0 region is the
Subweapon entity.

I went through and changed these all to `ext.subweapon.subweaponId`, but
also did some analysis on all the uses to make sure this was an accurate
change to make.

Other highlights:

- Naming CheckSubwpnChainLimit and its RIC counterpart
- Moving the RIC version of that function to the next file, split makes
more sense this way.
- Made both versions of that function `static`
- renamed subweapondef's unk6 to be chainLimit
- Changed g_unkGraphicsStruct.unk0 to be called `pauseEnemies`. It's
true when the stopwatch subweapon is used, and in cutscenes. Found this
due to looking at the stopwatch subweapon setting this value. Also made
it a bool since it's only ever used as a bool.
- Added some playersteps enum uses where they were still using hex
values
- Studied RicEntityStopwatchCrashLightning in order to give it that name

I think that's about it. Overall just some modest cleanup, but continues
to make the game code more readable.
2024-09-30 21:19:51 +01:00
sozud
ac00e388e0 Revert "Fix matchings/nonmatchings duplicates in dups?"
This reverts commit b03d705503.
2024-09-30 11:52:05 -07:00
sozud
b03d705503 Fix matchings/nonmatchings duplicates in dups? 2024-09-30 11:35:08 -07:00
sozud
82a40f7a24 Fix dups tool 2024-09-30 11:13:21 -07:00