Commit Graph

1964 Commits

Author SHA1 Message Date
Luciano Ciccariello
049493c95a WIP FT_000 2024-03-27 23:19:37 +00:00
sozud
a460b833f7
_SsInitSoundSeq (#1105)
https://decomp.me/scratch/mQesq
2024-03-26 20:36:25 -07:00
sozud
b52edefec6
SpuVmPBVoice (#1104) 2024-03-24 13:51:00 -07:00
sozud
7536a8b029
_SsSndDecrescendo (#1103)
Thanks to @dezgeg @mkst @Xeeynamo
2024-03-24 19:53:20 +00:00
sozud
83c1901f9b
Seautopan (#1102)
Thanks to @Gillou68310
2024-03-22 23:01:16 +00:00
Luciano Ciccariello
2042bcc5b8
libapi GetRCnt, StartRCnt, StopRCnt, ResetRCnt (#1101)
Thanks to @NicoVazCan for figuring out that `D_8002D3B8` needs to be
`volatile`
2024-03-17 20:19:13 -07:00
Mark Street
a5ffd53cff
Update maspsx (#1100)
Also tweaked the Dockerfile since this is what I use to build the
project.
2024-03-15 14:04:57 -07:00
sozud
41ace307d4
Ss start (#1098)
This is an update of the previous PR. Not sure how to get rid of the
get20 function.
https://decomp.me/scratch/cDYU4
2024-03-15 01:00:40 +00:00
Tuomas Tynkkynen
e6046aa106
Correct the split of libapi/l10.c (#1099)
Correct the split of libapi/l10.c and decompile few trivial functions in
it.
2024-03-14 15:57:27 -07:00
Tuomas Tynkkynen
9b94a39773
Decompile libetc intr_*.c (#1096) 2024-03-09 15:19:01 +00:00
Luciano Ciccariello
c5159842c5
DRA func_8010DA70 (#1095)
Thanks to the anonymous person who managed to match the last part:
https://decomp.me/scratch/3mKBR
2024-03-07 22:19:44 +00:00
sozud
65948d3717
SpuVmSetSeqVol (#1094)
Not sure what the deal is with this line:
```
if ((u16)_svm_voice[voice].unke == (u16)temp) {
```
changing unke to unsigned causes a mismatch in SpuVmInit
2024-03-05 23:48:40 +00:00
sozud
655670a74d
_SsInit (#1093)
Thanks to the anonymous person who figured this out
https://decomp.me/scratch/fBryf
2024-03-04 20:38:38 +00:00
sozud
af23477a11
_SsSeqPlay (#1092) 2024-03-04 19:36:00 +00:00
sozud
37f15e43ef
SpuQuit (#1091) 2024-03-03 23:05:59 +00:00
Tuomas Tynkkynen
11dd31ba28
Decompile few libgpu & libgte functions (#1090) 2024-03-03 13:43:02 -08:00
sozud
fec7772be0
note2pitch (#1089) 2024-02-27 18:45:45 -08:00
Ross Squires
c02023aac2
Decomp w_025 func_B3000_8017AF14 (#1088) 2024-02-25 23:33:35 +00:00
Ross Squires
b140fb1e54
Decompile w_045's func_13F000_8017A718 (#1087)
If the control flow on this could be better, let me know.
2024-02-25 23:32:24 +00:00
Luciano Ciccariello
b81f2c557a
DRA HandleGameOver (#1086)
Solves an annoying fake match that made the US version to match but not
in the HD version. Special thanks to @Gillou68310 for figuring out the
right switch/case pattern!
2024-02-25 22:14:00 +00:00
Ross Squires
37326838d9
Decomp w_001 func_ptr_80170008 (#1085) 2024-02-25 18:31:34 +00:00
Mark Street
3bda9c043f
Migrate rodata to functions for dra (#1084) 2024-02-25 17:44:11 +00:00
Luciano Ciccariello
3897106248
DRA func_800F1D54 (#1083) 2024-02-24 22:55:13 +00:00
Luciano Ciccariello
ff06ca54f8
DRA func_800F1B08 (#1082)
Don't get fooled by the size of this function. I struggled more than I
thought I would. I think it generates the map bitmap but I am not yet
sure. There is a lot that I still do not understand of how the map gets
filled while walking through the castle. I do not even know how
partially explored maps work (e.g. when you get the Castle Map 1 or 2
from the Librarian but you do not actually pass by those unexplored
areas). I would like to wait to know more of the logic here before
documenting.
2024-02-24 22:04:26 +00:00
sozud
e137da0768
_SsSndSetVabAttr (#1080) 2024-02-24 20:21:35 +00:00
Luciano Ciccariello
d3cdc10ba6
Attempt to generate function report for the weapon overlay 2024-02-24 18:34:09 +00:00
Luciano Ciccariello
a1c3c6a61d
Render the explored castle map (#1081)
![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/fad98e8c-ff42-4944-b54f-7e97f46dd98c)

This. It still misses the texture and I do not know what the green lines
are about. All the stuff within the `#else` and `#endif` are
placeholders that will hopefully be fixed later on the same way.

To get the same result from the screenshot I had to use the
[func_800F1B08](https://decomp.me/scratch/nW7lV) scratch, comment
`g_CastleMap[i] = 0;` from `InitStatsAndGear` and use the following to
read the map from a memory card's save:

```c
if (!FileRead(LoadMemcardSave, "memcard1.mcd")) {
    WARNF("unable to correctly load the save file");
}
```
```c
s32 LoadSaveData(SaveData* save);
bool LoadMemcardSave(FILE* f) {
    const int slot = 0;
    SaveData save;

    fseek(f, 0x2000 + slot * 0x2000, SEEK_SET);
    fread(&save, sizeof(SaveData), 1, f);
    return LoadSaveData(&save) == 0;
}
```
2024-02-24 09:53:54 -08:00
Mark Street
dfc74d4acd
Migrate .rodata to functions for main.exe (#1078)
I feel like getting all the rodata migrated will make it easier to
update splat (also makes it easier to match functions that use rodata).
2024-02-24 11:35:01 +00:00
Luciano Ciccariello
05e0334de3
DRA DrawMapCursor (#1079)
![image](https://github.com/Xeeynamo/sotn-decomp/assets/6128729/e3b9b89c-6a6b-49a9-8804-b0f49da6dc79)

This thing here. Special thanks to @sonicdcer who helped me on the final
reg swaps!

I renamed `D_8003C104` as `g_ClutIds`. I am not a fan of the name, but
it gets used by `poly->clut = g_ClutIds[xyz]`, the function that
populates the table is called `GetClut` and the [official
docs](file:///run/media/xeeynamo/wd_black/SDK/sony_ps1/psyq_sdk/DOCS/LIBREF46.PDF)
mentions _Calculates and returns the texture CLUT ID_ . So that seems to
be the most appropriate name.
2024-02-23 16:14:38 -08:00
sozud
804cc40364
_spu_writeByIO (#1077) 2024-02-23 15:51:39 -08:00
sozud
0ad1a3f3bc
SpuVmSeqKeyOff etc (#1076) 2024-02-22 13:02:50 -08:00
sozud
3810fbd2c3
_SsSetControlChange (#1074) 2024-02-21 23:23:15 +00:00
Luciano Ciccariello
2b3610c336
DRA func_800F24F4 (#1073)
A relatively small but complicated function. I matched it by decompiling
from scratch while taking some inspiration from an old scratch made by
@sonicdcer
2024-02-20 13:43:00 -08:00
sozud
803fb89ef1
SsUtKeyOn (#1072) 2024-02-20 21:15:24 +00:00
sozud
2a60866d60
_SsGetMetaEvent (#1071)
Thanks to an anonymous person who fixed this scratch
https://decomp.me/scratch/Aw4jQ
2024-02-19 14:47:23 -08:00
sozud
cbf9f780d7
SpuVmInit (#1069)
Thanks to @Gillou68310
2024-02-19 11:23:05 -08:00
sozud
437856d545
_spu_init (#1070)
The SPU regs are apparently accessed as both volatile and nonvolatile,
couldn't find a different solution.
2024-02-19 11:15:39 -08:00
Luciano Ciccariello
d6dd9f1891
DRA Import some data in 7E4BC (#1068)
Some data belong to `7A4D0.c` but I had to import to `7E4BC.c` instead
due to the `factory_blueprint` getting extracted in the between. I think
in the future those JSON assets need to generate C files.
2024-02-18 14:24:03 -08:00
Mark Street
dd7d4b83d1
weapon rodata migration (#1067)
this is a step along the way to getting splat updated, but im not there
yet :)
2024-02-18 12:02:02 -08:00
Luciano Ciccariello
e74d8ae6df
ratan2, SquareRoot0, SquareRoot12 (#1066)
I verified with a PS1 emulator the values
2024-02-18 11:32:43 -08:00
Mark Street
41ad71e388
Pass undefined_syms files to linker (#1065)
Creating a PR for this, will look at updating splat in a separate PR
2024-02-18 14:57:03 +00:00
sozud
f4e7805417
_SpuIsInAllocateArea_ (#1064) 2024-02-18 10:51:57 +00:00
sozud
276e8840f4
Spu note2pitch (#1062) 2024-02-17 13:49:11 -08:00
Luciano Ciccariello
d4453b3340
DRA func_801309B4, func_80130E94, func_8013136C (#1063)
Completes `90264.c` with the exception of the BSS section.

After this PR I am thinking to either decompile and move
`func_8012F178`, `func_8012F83C` and `func_8012F894` into `90264.c` as
they all follow the same pattern, or move back `90264.c` before the
split back into `8D3E8.c` as all the code seem to be related to the wolf
form.
2024-02-17 11:18:26 -08:00
sozud
2ddfed2f3d
libspu get/set vol (#1061) 2024-02-16 20:18:51 -08:00
Luciano Ciccariello
de51521ac6
DRA func_80130264 and func_80130618 (#1060)
As per title.

`#if !defined(VERSION_PC) && !defined(M2CTX)` allows
`tools/decompile.py` to work on files where the GTE instructions are
used. Otherwise it wouldn't normally work.
2024-02-15 12:44:01 -08:00
sozud
97e07c61d8
SsUtKeyOff SpuVmKeyOff (#1059) 2024-02-15 00:19:10 +00:00
sozud
6eb5b40e60
_SsClose (#1057) 2024-02-13 23:53:08 -08:00
Ross Squires
2294523fcc
Decomp CD_set_test_parmnum, CdReadCallback, & CdLastPos (#1056) 2024-02-11 11:33:03 -08:00
Ross Squires
9a56580b1d
Fix reversed dst and src for cd_memcpy (#1055) 2024-02-11 10:36:23 -08:00