Skip to content

Commit

Permalink
Import some tt_003 data (#1967)
Browse files Browse the repository at this point in the history
Import some data for the Demon servant
  • Loading branch information
gamezter authored Dec 4, 2024
1 parent 22f4be1 commit 80cdbaf
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 16 deletions.
5 changes: 4 additions & 1 deletion config/splat.us.tt_003.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ segments:
subalign: 4
subsegments:
- [0x0, .data, demon]
- [0x40, data]
- [0x40, data, demon_spriteparts]
- [0x19F0, .data, demon_data]
- [0x1B74, data]
- [0x2090, .data, servant_events]
- [0x29DC, .rodata, demon]
- [0x2A68, c, demon]
- [0x83C4, sbss]
Expand Down
17 changes: 2 additions & 15 deletions src/servant/tt_003/demon.c
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "common.h"
#include "servant.h"
#include "demon.h"
#include "sfx.h"

typedef enum {
DEMON_MODE_DEFAULT_UPDATE = ENTITY_ID_SERVANT,
DEMON_MODE_UNK_D2,
DEMON_MODE_UNK_D3,
DEMON_MODE_UNK_D4,
DEMON_MODE_UNK_D5,
DEMON_MODE_UNK_D6,
DEMON_SUBENTITY_UNK_D7,
DEMON_MODE_UNK_D8,
DEMON_EVENT_SFX_PASSTHROUGH,
} EntityIds;

extern ServantEvent g_Events[];

extern s32 s_TargetMatch[0x80];
Expand Down Expand Up @@ -870,8 +858,7 @@ extern s32 s_DemonSfxMap[];
// PSX: https://decomp.me/scratch/vbedA
// PSP: https://decomp.me/scratch/mRGqb

extern s16 g_DemonAttackStats[][6];
extern s32 g_DemonAttackIdSfxLookup[][3];
extern s32 g_DemonAttackIdSfxLookup[5][3];
extern s32 D_us_8017860C;
extern s32 D_us_80178610;
extern s32 D_us_80178614;
Expand Down
15 changes: 15 additions & 0 deletions src/servant/tt_003/demon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "common.h"
#include <servant.h>

typedef enum {
DEMON_MODE_DEFAULT_UPDATE = ENTITY_ID_SERVANT,
DEMON_MODE_UNK_D2,
DEMON_MODE_UNK_D3,
DEMON_MODE_UNK_D4,
DEMON_MODE_UNK_D5,
DEMON_MODE_UNK_D6,
DEMON_SUBENTITY_UNK_D7,
DEMON_MODE_UNK_D8,
DEMON_EVENT_SFX_PASSTHROUGH,
} EntityIds;
27 changes: 27 additions & 0 deletions src/servant/tt_003/demon_data.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "demon.h"

s16 g_DemonAttackStats[10][6] = {
{0xFF, 0x00, 0x00, 0x00, 0x00, 0x00}, {0xD0, 0xFF, 0x00, 0x00, 0x00, 0x00},
{0xD0, 0xE0, 0xFF, 0x00, 0x00, 0x00}, {0xC0, 0xD0, 0xFF, 0x00, 0x00, 0x00},
{0xC0, 0xD0, 0xE0, 0xFF, 0x00, 0x00}, {0xB0, 0xC0, 0xD0, 0xFF, 0x00, 0x00},
{0xB0, 0xC0, 0xD0, 0xE0, 0xFF, 0x00}, {0xA0, 0xB0, 0xC0, 0xD0, 0xFF, 0x00},
{0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xFF}, {0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xFF}};

s32 g_DemonAbilityStats[10][4] = {
{0x3C, 0x80, 0x01, 0x40}, {0x3C, 0x80, 0x01, 0x40},
{0x3C, 0x60, 0x01, 0x40}, {0x2D, 0x60, 0x00, 0x40},
{0x2D, 0x40, 0x00, 0x60}, {0x2D, 0x40, 0x00, 0x60},
{0x1E, 0x20, 0x00, 0x80}, {0x1E, 0x20, 0x00, 0x80},
{0x0F, 0x10, 0x00, 0x80}, {0x0F, 0x10, 0x00, 0x80}};

s32 g_DemonAttackIdSfxLookup[5][3] = {
{0x02, 0x03, 0x17},
{0x04, 0x04, 0x18},
{0x05, 0x05, 0x19},
{0x06, 0x06, 0x1A},
{0x06, 0x07, 0x1B}};

s16 D_us_80171B44[3][8] = {{24, 0, 15, -3, 15, 3, -32, 0},
{24, 0, -2, -8, 15, 3, -2, -8},
{24, 0, -2, 8, 15, -3, -2, 8}};
5 changes: 5 additions & 0 deletions src/servant/tt_003/servant_events.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "servant.h"

#include "../shared_events.h"
#include "../shared_globals.h"

0 comments on commit 80cdbaf

Please sign in to comment.