Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ Each such file says so in a comment on its first lines (`C adapted from rac3-dec
exact donor file, function and commit of every one are recorded in the maintainers' review notes. The text
was then given this game's names and checked against this game's code.

The PAL bit writer `src/pal/overlays/shared/L00_006FAC10.c` also used matching
C from rac3-decomp as a reference. Its counterpart is
[`func_L39_0066EC58`](https://github.com/OpenRAC/rac3-decomp/blob/d66fd79203489f73636921ae12aec3fbad935f1d/src/levels/shared/L39_0066EC58.c#L3-L48).
The RAC4 implementation was checked against all 47 PAL level program images.

The C of 3 functions started from the matching C of equivalent functions in
[rac2-decomp](https://github.com/OpenRAC/rac2-decomp) (*Ratchet & Clank: Going Commando*, GPL-3.0, commit
`1243c8ea`): `src/core/001399E0.c`, `src/core/00139A80.c`, `src/core/00139AE0.c`. They were found the same way (opcode sequences), renamed and checked against this game's code;
Expand Down
13 changes: 13 additions & 0 deletions config/pal/map.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -10932,3 +10932,16 @@ func_L41_004447E8 nonmatching/shared/func_L41_004447E8.c near func_L41_004458E8
func_L41_00446500 nonmatching/shared/func_L41_00446500.c near func_L41_00447608 level_41:.text:00447608:836 94.50
func_L41_0044C720 nonmatching/shared/func_L41_0044C720.c near func_L41_0044D828 level_41:.text:0044D828:272 84.56
func_L41_0061C668 nonmatching/shared/func_L41_0061C668.c near func_L41_00620DE0 level_41:.text:00620DE0:148 95.27
func_0046F3A8 src/pal/game/0046F3A8.c match func_0046F3A8 main:.text:0046F3A8:260 100.00
func_00479920 src/pal/game/00479920.c match func_00479920 main:.text:00479920:200 100.00
func_L00_0070D1A8 src/pal/overlays/l00_multiplayer_menu/L00_0070D1A8.c match func_L00_0070D1A8 level_00:.text:0070D1A8:276 100.00
func_L00_0070D2C0 src/pal/overlays/l00_multiplayer_menu/L00_0070D2C0.c match func_L00_0070D2C0 level_00:.text:0070D2C0:236 100.00
func_L00_0070DEB0 src/pal/overlays/l00_multiplayer_menu/L00_0070DEB0.c match func_L00_0070DEB0 level_00:.text:0070DEB0:108 100.00
func_L01_0055B760 src/pal/overlays/shared/L01_0055B760.c match func_L01_0055B760 level_01:.text:0055B760:68 100.00
func_L01_00575700 src/pal/overlays/shared/L01_00575700.c match func_L01_00575700 level_01:.text:00575700:40 100.00
func_00540A00 src/pal/game/00540A00.c match func_00540A00 main:.text:00540A00:176 100.00
func_L41_003BDF18 src/pal/overlays/l41_battledome_tower/L41_003BDF18.c match func_L41_003BDF18 level_41:.text:003BDF18:56 100.00
func_00499650 src/pal/game/00499650.c match func_00499650 main:.text:00499650:56 100.00
func_004FD000 src/pal/game/004FD000.c match func_004FD000 main:.text:004FD000:64 100.00
func_L41_004475C0 src/pal/overlays/l41_battledome_tower/L41_004475C0.c match func_L41_004475C0 level_41:.text:004475C0:72 100.00
func_L00_006FAC10 src/pal/overlays/shared/L00_006FAC10.c match func_L00_006FAC10 level_00:.text:006FAC10:300 100.00
13 changes: 13 additions & 0 deletions config/us/map.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -10932,3 +10932,16 @@ func_L41_004447E8 nonmatching/shared/func_L41_004447E8.c near func_L41_004447E8
func_L41_00446500 nonmatching/shared/func_L41_00446500.c near func_L41_00446500 level_41:.text:00446500:836 94.50
func_L41_0044C720 nonmatching/shared/func_L41_0044C720.c near func_L41_0044C720 level_41:.text:0044C720:272 84.56
func_L41_0061C668 nonmatching/shared/func_L41_0061C668.c near func_L41_0061C668 level_41:.text:0061C668:148 95.27
func_0046F3A8 src/pal/game/0046F3A8.c other - - 0.00
func_00479920 src/pal/game/00479920.c other - - 0.00
func_L00_0070D1A8 src/pal/overlays/l00_multiplayer_menu/L00_0070D1A8.c other - - 0.00
func_L00_0070D2C0 src/pal/overlays/l00_multiplayer_menu/L00_0070D2C0.c other - - 0.00
func_L00_0070DEB0 src/pal/overlays/l00_multiplayer_menu/L00_0070DEB0.c other - - 0.00
func_L01_0055B760 src/pal/overlays/shared/L01_0055B760.c other - - 0.00
func_L01_00575700 src/pal/overlays/shared/L01_00575700.c other - - 0.00
func_00540A00 src/pal/game/00540A00.c other - - 0.00
func_L41_003BDF18 src/pal/overlays/l41_battledome_tower/L41_003BDF18.c other - - 0.00
func_00499650 src/pal/game/00499650.c other - - 0.00
func_004FD000 src/pal/game/004FD000.c other - - 0.00
func_L41_004475C0 src/pal/overlays/l41_battledome_tower/L41_004475C0.c other - - 0.00
func_L00_006FAC10 src/pal/overlays/shared/L00_006FAC10.c other - - 0.00
8 changes: 2 additions & 6 deletions nonmatching/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Best attempts at functions that do not match yet. They are not built; see

| Function | Directory | Size | What differs |
|---|---|---|---|
| [`func_00421C48`](pal/game/func_00421C48.c) | pal/game | 36 | SIZE 44/36, compiler materializes a zero quadword and schedules stores differently |
| [`func_00461570`](game/func_00461570.c) | game | 284 | BYTES 0/284, exact only with inline asm (plzcw), which matched C may not use |
| [`func_00461690`](game/func_00461690.c) | game | 176 | BYTES 0/176, exact only with inline asm (plzcw and blezl/sub abs), which matched C may not use |
| [`func_00461740`](game/func_00461740.c) | game | 588 | BYTES 0/588, exact only with inline asm (plzcw), which matched C may not use |
Expand Down Expand Up @@ -52,15 +53,13 @@ Best attempts at functions that do not match yet. They are not built; see
| [`func_L00_0068AC58`](shared/func_L00_0068AC58.c) | shared | 688 | BYTES 9/684 |
| [`func_L41_0040F218`](shared/func_L41_0040F218.c) | shared | 376 | BYTES 5/376 |
| [`func_004934F8`](game/func_004934F8.c) | game | 288 | BYTES 4/288 |
| [`func_00479920`](pal/game/func_00479920.c) | pal/game | 200 | BYTES 3/200 (3 words differ); bindings/semantics unapproved |
| [`func_L00_005F0BD8`](pal/shared/func_L00_005F0BD8.c) | pal/shared | 200 | BYTES 3/200 (3 words differ); bindings/semantics unapproved |
| [`func_00147BA8`](core/func_00147BA8.c) | core | 132 | BYTES 2/132 |
| [`func_0051AE28`](game/func_0051AE28.c) | game | 200 | BYTES 3/196 |
| [`func_L00_0051AA08`](l00_multiplayer_menu/func_L00_0051AA08.c) | l00_multiplayer_menu | 320 | BYTES 5/316 |
| [`func_004BF658`](game/func_004BF658.c) | game | 192 | BYTES 3/188 |
| [`func_004BF718`](game/func_004BF718.c) | game | 192 | BYTES 3/188 |
| [`func_0053F600`](game/func_0053F600.c) | game | 176 | BYTES 3/176 |
| [`func_00540A00`](pal/game/func_00540A00.c) | pal/game | 176 | BYTES 3/176 (1 words differ); bindings/semantics unapproved |
| [`func_01EE992C`](net/func_01EE992C.c) | net | 116 | BYTES 2/116 |
| [`func_004F9680`](game/func_004F9680.c) | game | 232 | BYTES 4/228 |
| [`func_004B41F8`](game/func_004B41F8.c) | game | 336 | BYTES 6/332 |
Expand Down Expand Up @@ -119,7 +118,6 @@ Best attempts at functions that do not match yet. They are not built; see
| [`func_L00_00528178`](l00_multiplayer_menu/func_L00_00528178.c) | l00_multiplayer_menu | 464 | BYTES 23/464 |
| [`func_0047EB98`](game/func_0047EB98.c) | game | 24 | BYTES 1/20 - the OR operand order (regmove tie); delay slot fixed by -fno-delayed-branch |
| [`func_004DC200`](game/func_004DC200.c) | game | 200 | BYTES 10/200 |
| [`func_L41_003BDF18`](pal/l41_battledome_tower/func_L41_003BDF18.c) | pal/l41_battledome_tower | 56 | BYTES 3/56 (3 words differ); bindings/semantics unapproved |
| [`func_00548280`](game/func_00548280.c) | game | 280 | BYTES 15/276 |
| [`func_L01_0047F050`](shared/func_L01_0047F050.c) | shared | 128 | BYTES 7/128 |
| [`func_00146570`](core/func_00146570.c) | core | 200 | BYTES 11/200 |
Expand All @@ -143,7 +141,6 @@ Best attempts at functions that do not match yet. They are not built; see
| [`func_004C3140`](game/func_004C3140.c) | game | 104 | BYTES 7/104 |
| [`func_L00_00528670`](l00_multiplayer_menu/func_L00_00528670.c) | l00_multiplayer_menu | 416 | BYTES 28/416 |
| [`func_0011C568`](core/func_0011C568.c) | core | 116 | BYTES 8/116 |
| [`func_L41_004475C0`](pal/l41_battledome_tower/func_L41_004475C0.c) | pal/l41_battledome_tower | 72 | BYTES 5/72 (3 words differ); bindings/semantics unapproved |
| [`func_L00_00517208`](l00_multiplayer_menu/func_L00_00517208.c) | l00_multiplayer_menu | 104 | BYTES 7/100 |
| [`func_004F6750`](game/func_004F6750.c) | game | 496 | BYTES 35/496 |
| [`func_L41_004447E8`](shared/func_L41_004447E8.c) | shared | 168 | BYTES 12/168 |
Expand Down Expand Up @@ -199,7 +196,6 @@ Best attempts at functions that do not match yet. They are not built; see
| [`func_004766F8`](game/func_004766F8.c) | game | 8 | BYTES 1/8 |
| [`func_004A8CB0`](game/func_004A8CB0.c) | game | 8 | BYTES 1/8 |
| [`func_01EEF358`](net/func_01EEF358.c) | net | 160 | BYTES 20/160 |
| [`func_L00_006FAC10`](pal/shared/func_L00_006FAC10.c) | pal/shared | 300 | BYTES 38/300 (18 words differ); bindings/semantics unapproved |
| [`func_L01_00591730`](shared/func_L01_00591730.c) | shared | 112 | BYTES 14/108 |
| [`func_L00_0067FB70`](shared/func_L00_0067FB70.c) | shared | 512 | BYTES 67/508 |
| [`func_001614C0`](core/func_001614C0.c) | core | 104 | BYTES 14/104 |
Expand Down Expand Up @@ -387,7 +383,7 @@ Best attempts at functions that do not match yet. They are not built; see
| [`func_L00_005D5CE0`](shared/func_L00_005D5CE0.c) | shared | 400 | SIZE ours 340 / retail 400 |
| [`func_L00_006969F0`](pal/shared/func_L00_006969F0.c) | pal/shared | 120 | SIZE ours 124 / disc 120; bindings/semantics unapproved |
| [`func_L00_006AA5F8`](shared/func_L00_006AA5F8.c) | shared | 280 | SIZE ours 212 / retail 280 |
| [`func_L00_006BED98`](pal/shared/func_L00_006BED98.c) | pal/shared | 52 | SIZE ours 56 / disc 52; bindings/semantics unapproved |
| [`func_L00_006BED98`](pal/shared/func_L00_006BED98.c) | pal/shared | 52 | SIZE 56/52, compiler materializes a zero quadword and schedules stores differently |
| [`func_L00_006CF328`](pal/l00_multiplayer_menu/func_L00_006CF328.c) | pal/l00_multiplayer_menu | 84 | 16/21 (76.19%) relocation-masked positional words; 84/84 candidate/target bytes. The s64 local is a code-generation hypothesis. |
| [`func_L00_006D1C68`](shared/func_L00_006D1C68.c) | shared | 304 | SIZE ours 288 / retail 304 |
| [`func_L00_006EE598`](shared/func_L00_006EE598.c) | shared | 368 | SIZE 208/368 |
Expand Down
31 changes: 31 additions & 0 deletions nonmatching/pal/game/func_00421C48.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* Not matching yet: SIZE 44/36, compiler materializes a zero quadword and schedules stores differently.
* Reproduce with python3 tools/check_func.py --version pal func_00421C48 nonmatching/pal/game/func_00421C48.c --diff
*/

#include "common.h"

typedef unsigned int u128 __attribute__((mode(TI)));

typedef struct {
u128 f0;
u128 f10;
u8 pad20[0x10];
u32 f30;
u32 f34;
s16 f38;
s16 f3A;
u8 pad3C[2];
s8 f3E;
} Type1;

/* Clear the selected fields and set the signed fields to their sentinel. */
void func_00421C48(Type1 *arg0)
{
arg0->f0 = 0;
arg0->f3E = -1;
arg0->f10 = 0;
arg0->f30 = 0;
arg0->f34 = 0;
arg0->f38 = -1;
arg0->f3A = -1;
}
29 changes: 0 additions & 29 deletions nonmatching/pal/game/func_00479920.c

This file was deleted.

44 changes: 0 additions & 44 deletions nonmatching/pal/game/func_00540A00.c

This file was deleted.

30 changes: 0 additions & 30 deletions nonmatching/pal/l41_battledome_tower/func_L41_003BDF18.c

This file was deleted.

31 changes: 0 additions & 31 deletions nonmatching/pal/l41_battledome_tower/func_L41_004475C0.c

This file was deleted.

48 changes: 21 additions & 27 deletions nonmatching/pal/shared/func_L00_006BED98.c
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
/* cflags: -fno-schedule-insns -fno-schedule-insns2 */
/* Not matched: PAL SCES_532.85.
* Stored-object comparison: SIZE ours 56 / disc 52.
* Function text: 56 B; native catalogue: 52 B; 14 placement(s).
* Instruction/size differences remain; symbol bindings, ownership and semantics also need review.
* The draft s128 placeholder does not establish the native transfer width.
* Relocated instruction fields are masked in this comparison, not certified targets.
* Reproduce with the original compiler setup:
* python3 tools/check_func.py --version pal func_L00_006BED98 nonmatching/pal/shared/func_L00_006BED98.c --diff
/* Not matching yet: SIZE 56/52. The source uses aligned 128-bit transfers.
* The compiler materializes a zero quadword in a register. Retail uses $zero
* directly and orders the stores differently.
* Reproduce with python3 tools/check_func.py --version pal func_L00_006BED98 nonmatching/pal/shared/func_L00_006BED98.c --diff
*/
#include "common.h"
typedef long long s128;

/* Automatischer m2c-Grobentwurf, kein geprüfter Match.
* Unbekannte M2C_* und saved_reg_* müssen manuell aufgelöst werden.
* Signaturen, Datenbesitz und Funktionsgrenzen prüfen.
*/
#include "common.h"

typedef int Type1 __attribute__((mode(TI)));

/* Clear selected state words and aligned 16-byte fields. */
void func_L00_006BED98(void *arg0) {
(*(s32 *)((s8 *)(arg0) + (0x1B0))) = 0;
(*(s32 *)((s8 *)(arg0) + (0x1780))) = 0;
(*(s32 *)((s8 *)(arg0) + (0x1784))) = 0;
(*(s128 *)((s8 *)(arg0) + (0x140))) = 0;
(*(s128 *)((s8 *)(arg0) + (0x130))) = 0;
(*(s128 *)((s8 *)(arg0) + (0x150))) = 0;
(*(s128 *)((s8 *)(arg0) + (0x160))) = 0;
(*(s128 *)((s8 *)(arg0) + (0x170))) = 0;
(*(s128 *)((s8 *)(arg0) + (0x1A0))) = 0;
(*(s128 *)((s8 *)(arg0) + (0xC0))) = 0;
(*(s32 *)((s8 *)(arg0) + (0x17A4))) = 0;
(*(s32 *)((s8 *)(arg0) + (0x1B8))) = 0;
u8 *p = arg0;

*(u32 *)(p + 0x1B0) = 0;
*(u32 *)(p + 0x1780) = 0;
*(u32 *)(p + 0x1784) = 0;
*(Type1 *)(p + 0x140) = 0;
*(Type1 *)(p + 0x130) = 0;
*(Type1 *)(p + 0x150) = 0;
*(Type1 *)(p + 0x160) = 0;
*(Type1 *)(p + 0x170) = 0;
*(Type1 *)(p + 0x1A0) = 0;
*(Type1 *)(p + 0xC0) = 0;
*(u32 *)(p + 0x17A4) = 0;
*(u32 *)(p + 0x1B8) = 0;
}
59 changes: 0 additions & 59 deletions nonmatching/pal/shared/func_L00_006FAC10.c

This file was deleted.

Loading
Loading