Importing tt_001 clut data (#1730)

Again, data is shared with tt_000, so I merged that into a shared
header.
This commit is contained in:
H.M. Burger 2024-10-04 23:11:15 -05:00 committed by GitHub
parent 4282ac221e
commit 4d2ccaac2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 27 additions and 17 deletions

View File

@ -238,7 +238,7 @@ set(SOURCE_FILES_RIC
set(SOURCE_FILES_TT_000
src/servant/tt_000/10E8.c
src/servant/tt_000/448.c
src/servant/tt_000/clutdata.c
src/servant/tt_000/45E4.c
src/servant/tt_000/4A8.c
src/servant/tt_000/608.c

View File

@ -36,7 +36,7 @@ segments:
subsegments:
- [0x0, .data, 10E8]
- [0x40, .data, spriteparts]
- [0x448, .data, 448]
- [0x448, .data, clutdata]
- [0x4A8, .data, 4A8]
- [0x608, .data, 608]
- [0x10AC, .rodata, 10E8] # UpdateServantDefault

View File

@ -36,7 +36,7 @@ segments:
subsegments:
- [0x0, .data, 10E8]
- [0x40, .data, spriteparts]
- [0x448, .data, 448]
- [0x448, .data, clutdata]
- [0x4A8, .data, 4A8]
- [0x608, .data, 608]
- [0x10AC, .rodata, 10E8] # UpdateServantDefault

View File

@ -40,7 +40,8 @@ segments:
subsegments:
- [0x0, .data, F84]
- [0x40, .data, spriteparts]
- [0x448, data]
- [0x448, .data, clutdata]
- [0x4A8, data]
- [0xEFC, .rodata, F84]
- [0xF3C, .rodata, F84] # ProcessSfxState
- [0xF60, c, F84]

View File

@ -30,7 +30,7 @@ ProcessEvent = 0x092eba98;
CreateEventEntity = 0x092ebec8;
IsMovementAllowed = 0x092ebfb8;
ServantUnk0 = 0x092ec150;
D_80170448 = 0x092EC280;
g_ServantClut = 0x092EC280;
D_80170040 = 0x092EC2E0;
D_801704A8 = 0x092EC768;
D_801704E0 = 0x092EC7A0;

View File

@ -67,7 +67,7 @@ typedef struct ServantEvent {
extern ServantDesc g_ServantDesc;
extern SpriteParts* D_80170040[];
extern u16 D_80170448[];
extern u16 g_ServantClut[];
extern AnimationFrame D_801704A8[];
extern AnimationFrame D_80170514[];
extern AnimationFrame D_8017054C[];

View File

@ -1,7 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "common.h"
u16 D_80170448[] = {
u16 g_ServantClut[] = {
/* 80170448 */ 0x0000,
/* 8017044A */ 0x07E1,
/* 8017044C */ 0x3023,

View File

@ -439,7 +439,9 @@ void func_801719E0(Entity* self) {
g_api.func_8011A3AC(self, 0, 0, &D_80174C30);
}
extern u16 D_80170448[48];
#ifdef VERSION_PC
extern u16 g_ServantClut[48];
#endif
void ServantInit(InitializeMode mode) {
u16* dst;
@ -451,8 +453,7 @@ void ServantInit(InitializeMode mode) {
Entity* e;
#ifdef VERSION_PC
// i exceeds the size of D_80170448
const int len = LEN(D_80170448);
const int len = LEN(g_ServantClut);
#else
const int len = 256;
#endif
@ -465,7 +466,7 @@ void ServantInit(InitializeMode mode) {
}
dst = &g_Clut[CLUT_INDEX_SERVANT];
src = D_80170448;
src = g_ServantClut;
for (i = 0; i < len; i++) {
*dst++ = *src++;

View File

@ -0,0 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "common.h"
#include "../shared_clutdata.h"

View File

@ -256,6 +256,10 @@ Entity* func_us_80171568(Entity* self, s32 entityId) {
// BUG? There is a fall-through case here with no return value on PSX
}
#ifdef VERSION_PC
extern u16 g_ServantClut[48];
#endif
void ServantInit(InitializeMode mode) {
RECT rect;
u16* dst;
@ -264,17 +268,15 @@ void ServantInit(InitializeMode mode) {
SpriteParts** spriteBanks;
Entity* e;
u16 temp;
#ifdef VERSION_PC
// i exceeds the size of D_80170448
const int len = LEN(D_80170448);
const int len = LEN(g_ServantClut);
#else
const int len = 256;
#endif
if (mode != MENU_SAME_SERVANT) {
dst = &g_Clut[CLUT_INDEX_SERVANT];
src = D_us_80170448;
src = g_ServantClut;
for (i = 0; i < len; i++) {
temp = *src++;

View File

@ -0,0 +1,4 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "common.h"
#include "../shared_clutdata.h"