Merge pull request #1853 from KieronJ/sndtest

Add sub_efct.c for opening
This commit is contained in:
Kieron 2024-02-01 00:09:44 +00:00 committed by GitHub
commit 847b8638fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 214 additions and 328 deletions

View File

@ -1,55 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef opening_sub_efct_800CC798
opening_sub_efct_800CC798:
dw 0x3C061F80 ; 800CC798
dw 0x24070080 ; 800CC79C
dw 0x8C850038 ; 800CC7A0
dw 0x8C840034 ; 800CC7A4
dw 0xC8A00000 ; 800CC7A8
dw 0xC8A10004 ; 800CC7AC
dw 0xC8A20008 ; 800CC7B0
dw 0xC8A3000C ; 800CC7B4
dw 0xC8A40010 ; 800CC7B8
dw 0xC8A50014 ; 800CC7BC
dw 0x00000000 ; 800CC7C0
dw 0x00000000 ; 800CC7C4
dw 0x4A486012 ; 800CC7C8
dw 0x18800022 ; 800CC7CC
dw 0x24A50018 ; 800CC7D0
dw 0x00C01821 ; 800CC7D4
dw 0x34630004 ; 800CC7D8
dw 0x48024800 ; 800CC7DC
dw 0x00000000 ; 800CC7E0
dw 0x000210C3 ; 800CC7E4
dw 0x00000000 ; 800CC7E8
dw 0x4A48E012 ; 800CC7EC
dw 0x00E21021 ; 800CC7F0
dw 0xA0C20000 ; 800CC7F4
dw 0x48024800 ; 800CC7F8
dw 0x00000000 ; 800CC7FC
dw 0x000210C3 ; 800CC800
dw 0x00000000 ; 800CC804
dw 0x4A496012 ; 800CC808
dw 0x00E21021 ; 800CC80C
dw 0xA062FFFE ; 800CC810
dw 0x48024800 ; 800CC814
dw 0xC8A00000 ; 800CC818
dw 0xC8A10004 ; 800CC81C
dw 0xC8A20008 ; 800CC820
dw 0xC8A3000C ; 800CC824
dw 0xC8A40010 ; 800CC828
dw 0xC8A50014 ; 800CC82C
dw 0x000210C3 ; 800CC830
dw 0x00000000 ; 800CC834
dw 0x4A486012 ; 800CC838
dw 0x24A50018 ; 800CC83C
dw 0x00E21021 ; 800CC840
dw 0xA0620000 ; 800CC844
dw 0x24630006 ; 800CC848
dw 0x2484FFFD ; 800CC84C
dw 0x1C80FFE2 ; 800CC850
dw 0x24C60006 ; 800CC854
dw 0x03E00008 ; 800CC858
dw 0x00000000 ; 800CC85C

View File

@ -1,50 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef opening_sub_efct_800CC860
opening_sub_efct_800CC860:
dw 0x00804821 ; 800CC860
dw 0x00A04021 ; 800CC864
dw 0x24C6FFFF ; 800CC868
dw 0x04C00027 ; 800CC86C
dw 0x3C0A1F80 ; 800CC870
dw 0x3C0BFF00 ; 800CC874
dw 0x24A70030 ; 800CC878
dw 0x8D020000 ; 800CC87C
dw 0x00000000 ; 800CC880
dw 0x004B1024 ; 800CC884
dw 0x1040001B ; 800CC888
dw 0x00000000 ; 800CC88C
dw 0x8D220000 ; 800CC890
dw 0x00000000 ; 800CC894
dw 0x00401821 ; 800CC898
dw 0x00402021 ; 800CC89C
dw 0x00402821 ; 800CC8A0
dw 0x00021040 ; 800CC8A4
dw 0x000319C2 ; 800CC8A8
dw 0x000425C2 ; 800CC8AC
dw 0x00052BC2 ; 800CC8B0
dw 0x304200FE ; 800CC8B4
dw 0x306300FE ; 800CC8B8
dw 0x308400FE ; 800CC8BC
dw 0x30A500FE ; 800CC8C0
dw 0x004A1021 ; 800CC8C4
dw 0x90420000 ; 800CC8C8
dw 0x006A1821 ; 800CC8CC
dw 0xA0E2FFDC ; 800CC8D0
dw 0x90620000 ; 800CC8D4
dw 0x008A2021 ; 800CC8D8
dw 0xA0E2FFE8 ; 800CC8DC
dw 0x90820000 ; 800CC8E0
dw 0x00AA2821 ; 800CC8E4
dw 0xA0E2FFF4 ; 800CC8E8
dw 0x90A20000 ; 800CC8EC
dw 0x00000000 ; 800CC8F0
dw 0xA0E20000 ; 800CC8F4
dw 0x24E70034 ; 800CC8F8
dw 0x25080034 ; 800CC8FC
dw 0x24C6FFFF ; 800CC900
dw 0x04C1FFDD ; 800CC904
dw 0x25290004 ; 800CC908
dw 0x03E00008 ; 800CC90C
dw 0x01001021 ; 800CC910

View File

@ -1,40 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef opening_sub_efct_800CC914
opening_sub_efct_800CC914:
dw 0x27BDFFE0 ; 800CC914
dw 0xAFB10014 ; 800CC918
dw 0x00808821 ; 800CC91C
dw 0x3C02800B ; 800CC920
dw 0x8C43B920 ; 800CC924
dw 0x24020001 ; 800CC928
dw 0xAFBF001C ; 800CC92C
dw 0xAFB20018 ; 800CC930
dw 0xAFB00010 ; 800CC934
dw 0x00431023 ; 800CC938
dw 0x00021080 ; 800CC93C
dw 0x02221021 ; 800CC940
dw 0x8C520054 ; 800CC944
dw 0x00000000 ; 800CC948
dw 0x1240000E ; 800CC94C
dw 0x00000000 ; 800CC950
dw 0x1220000C ; 800CC954
dw 0x00000000 ; 800CC958
dw 0x8E300040 ; 800CC95C
dw 0x0C0331E6 ; 800CC960
dw 0x02002021 ; 800CC964
dw 0x8E04003C ; 800CC968
dw 0x86260052 ; 800CC96C
dw 0x0C033218 ; 800CC970
dw 0x02402821 ; 800CC974
dw 0x8E310048 ; 800CC978
dw 0x00000000 ; 800CC97C
dw 0x1620FFF6 ; 800CC980
dw 0x00409021 ; 800CC984
dw 0x8FBF001C ; 800CC988
dw 0x8FB20018 ; 800CC98C
dw 0x8FB10014 ; 800CC990
dw 0x8FB00010 ; 800CC994
dw 0x03E00008 ; 800CC998
dw 0x27BD0020 ; 800CC99C

View File

@ -1,51 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef opening_sub_efct_800CC9A0
opening_sub_efct_800CC9A0:
dw 0x27BDFFC0 ; 800CC9A0
dw 0xAFBF0038 ; 800CC9A4
dw 0xAFB10034 ; 800CC9A8
dw 0xAFB00030 ; 800CC9AC
dw 0x8C820020 ; 800CC9B0
dw 0x00000000 ; 800CC9B4
dw 0x8C510000 ; 800CC9B8
dw 0x3C02800A ; 800CC9BC
dw 0x2448D430 ; 800CC9C0
dw 0x8D030000 ; 800CC9C4
dw 0x8D060004 ; 800CC9C8
dw 0x8D070008 ; 800CC9CC
dw 0xAFA30010 ; 800CC9D0
dw 0xAFA60014 ; 800CC9D4
dw 0xAFA70018 ; 800CC9D8
dw 0x8D03000C ; 800CC9DC
dw 0x8D060010 ; 800CC9E0
dw 0x8D070014 ; 800CC9E4
dw 0xAFA3001C ; 800CC9E8
dw 0xAFA60020 ; 800CC9EC
dw 0xAFA70024 ; 800CC9F0
dw 0x8D030018 ; 800CC9F4
dw 0x8D06001C ; 800CC9F8
dw 0xAFA30028 ; 800CC9FC
dw 0xAFA6002C ; 800CCA00
dw 0x8C820024 ; 800CCA04
dw 0x27B00010 ; 800CCA08
dw 0x84440004 ; 800CCA0C
dw 0x0C024F5A ; 800CCA10
dw 0x02002821 ; 800CCA14
dw 0x0C006F11 ; 800CCA18
dw 0x02002021 ; 800CCA1C
dw 0x8630002E ; 800CCA20
dw 0x00000000 ; 800CCA24
dw 0x1A000006 ; 800CCA28
dw 0x26310048 ; 800CCA2C
dw 0x0C033245 ; 800CCA30
dw 0x02202021 ; 800CCA34
dw 0x2610FFFF ; 800CCA38
dw 0x1E00FFFC ; 800CCA3C
dw 0x2631005C ; 800CCA40
dw 0x8FBF0038 ; 800CCA44
dw 0x8FB10034 ; 800CCA48
dw 0x8FB00030 ; 800CCA4C
dw 0x03E00008 ; 800CCA50
dw 0x27BD0040 ; 800CCA54

View File

@ -1,31 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef opening_sub_efct_800CCA58
opening_sub_efct_800CCA58:
dw 0x27BDFFE0 ; 800CCA58
dw 0xAFBF0018 ; 800CCA5C
dw 0xAFB10014 ; 800CCA60
dw 0xAFB00010 ; 800CCA64
dw 0x8C820020 ; 800CCA68
dw 0x00000000 ; 800CCA6C
dw 0x8C420000 ; 800CCA70
dw 0x8C830068 ; 800CCA74
dw 0x8451002E ; 800CCA78
dw 0x24500048 ; 800CCA7C
dw 0x1A20000A ; 800CCA80
dw 0xAC430028 ; 800CCA84
dw 0x02002021 ; 800CCA88
dw 0x0C0069DD ; 800CCA8C
dw 0x00002821 ; 800CCA90
dw 0x02002021 ; 800CCA94
dw 0x0C0069DD ; 800CCA98
dw 0x24050001 ; 800CCA9C
dw 0x2631FFFF ; 800CCAA0
dw 0x1E20FFF8 ; 800CCAA4
dw 0x2610005C ; 800CCAA8
dw 0x8FBF0018 ; 800CCAAC
dw 0x8FB10014 ; 800CCAB0
dw 0x8FB00010 ; 800CCAB4
dw 0x03E00008 ; 800CCAB8
dw 0x27BD0020 ; 800CCABC

View File

@ -1,17 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef opening_sub_efct_800CCAC0
opening_sub_efct_800CCAC0:
dw 0x27BDFFE8 ; 800CCAC0
dw 0xAFB00010 ; 800CCAC4
dw 0xAFBF0014 ; 800CCAC8
dw 0x0C033268 ; 800CCACC
dw 0x00808021 ; 800CCAD0
dw 0x8E020020 ; 800CCAD4
dw 0x26100028 ; 800CCAD8
dw 0xAC500008 ; 800CCADC
dw 0x8FBF0014 ; 800CCAE0
dw 0x8FB00010 ; 800CCAE4
dw 0x03E00008 ; 800CCAE8
dw 0x27BD0018 ; 800CCAEC

View File

@ -1,13 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef opening_sub_efct_800CCAF0
opening_sub_efct_800CCAF0:
dw 0x27BDFFE8 ; 800CCAF0
dw 0xAFBF0010 ; 800CCAF4
dw 0x0C033296 ; 800CCAF8
dw 0x00000000 ; 800CCAFC
dw 0x8FBF0010 ; 800CCB00
dw 0x00000000 ; 800CCB04
dw 0x03E00008 ; 800CCB08
dw 0x27BD0018 ; 800CCB0C

View File

@ -1,56 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef opening_sub_efct_800CCB10
opening_sub_efct_800CCB10:
dw 0x27BDFFE0 ; 800CCB10
dw 0xAFB10014 ; 800CCB14
dw 0x00808821 ; 800CCB18
dw 0xAFB20018 ; 800CCB1C
dw 0x00A09021 ; 800CCB20
dw 0x00002021 ; 800CCB24
dw 0x24050074 ; 800CCB28
dw 0xAFBF001C ; 800CCB2C
dw 0x0C005439 ; 800CCB30
dw 0xAFB00010 ; 800CCB34
dw 0x00408021 ; 800CCB38
dw 0x12000020 ; 800CCB3C
dw 0x02002021 ; 800CCB40
dw 0x3C05800D ; 800CCB44
dw 0x24A5CAC0 ; 800CCB48
dw 0x3C06800D ; 800CCB4C
dw 0x3C07800D ; 800CCB50
dw 0x24C6CAF0 ; 800CCB54
dw 0x0C005453 ; 800CCB58
dw 0x24E7D600 ; 800CCB5C
dw 0xAE110020 ; 800CCB60
dw 0xAE120024 ; 800CCB64
dw 0x8E240000 ; 800CCB68
dw 0x00000000 ; 800CCB6C
dw 0x8C820028 ; 800CCB70
dw 0x00000000 ; 800CCB74
dw 0xAE020068 ; 800CCB78
dw 0x8C820028 ; 800CCB7C
dw 0x2403FFEF ; 800CCB80
dw 0x00431024 ; 800CCB84
dw 0x8C830034 ; 800CCB88
dw 0x34420120 ; 800CCB8C
dw 0xAC820028 ; 800CCB90
dw 0x26020028 ; 800CCB94
dw 0xAE03006C ; 800CCB98
dw 0xAC820034 ; 800CCB9C
dw 0x2402F000 ; 800CCBA0
dw 0xA602002A ; 800CCBA4
dw 0x24020800 ; 800CCBA8
dw 0xA6000028 ; 800CCBAC
dw 0xA600002C ; 800CCBB0
dw 0xA6020048 ; 800CCBB4
dw 0xA602004E ; 800CCBB8
dw 0xA6020054 ; 800CCBBC
dw 0x02001021 ; 800CCBC0
dw 0x8FBF001C ; 800CCBC4
dw 0x8FB20018 ; 800CCBC8
dw 0x8FB10014 ; 800CCBCC
dw 0x8FB00010 ; 800CCBD0
dw 0x03E00008 ; 800CCBD4
dw 0x27BD0020 ; 800CCBD8

View File

@ -2227,18 +2227,7 @@ overlay_bss group file("{{OBJ_DIR}}\{{OVERLAY}}_{{OVERLAY_SUFFIX}}_bss.bin")
include "{{OBJ_DIR}}\overlays\s00a\Takabe\telop.obj"
include "{{OBJ_DIR}}\overlays\s00a\Takabe\cinema.obj"
include "{{OBJ_DIR}}\overlays\d01a\Takabe\focus.obj"
include "{{OBJ_DIR}}\overlays\opening\overlay2.obj"
include "{{OBJ_DIR}}\overlays\opening\opening_sub_efct_800CC798.obj"
include "{{OBJ_DIR}}\overlays\opening\opening_sub_efct_800CC860.obj"
include "{{OBJ_DIR}}\overlays\opening\opening_sub_efct_800CC914.obj"
include "{{OBJ_DIR}}\overlays\opening\opening_sub_efct_800CC9A0.obj"
include "{{OBJ_DIR}}\overlays\opening\opening_sub_efct_800CCA58.obj"
include "{{OBJ_DIR}}\overlays\opening\opening_sub_efct_800CCAC0.obj"
include "{{OBJ_DIR}}\overlays\opening\opening_sub_efct_800CCAF0.obj"
include "{{OBJ_DIR}}\overlays\opening\opening_sub_efct_800CCB10.obj"
include "{{OBJ_DIR}}\overlays\opening\Takabe\sub_efct.obj"
include "{{OBJ_DIR}}\overlays\opening\Takabe\optxtscn.obj"
include "{{PSYQ_SDK}}\psyq_4.4\LIB\libgpu\P22.OBJ", overlay

View File

@ -0,0 +1,213 @@
#include "libgv/libgv.h"
#include "Game/game.h"
typedef struct _SubEfctWork
{
GV_ACT actor;
OBJECT *parent;
SVECTOR *rotation;
MATRIX light[2];
u_long flag;
MATRIX *lightp;
char pad[0x4];
} SubEfctWork;
extern MATRIX DG_ZeroMatrix_8009D430;
extern int GV_Clock_800AB920;
#define EXEC_LEVEL 0
#define gte_pop_color(r0) __asm__ volatile("mfc2 %0, $9;" : "=r"(r0))
void SubEfct_800CC798(DG_MDL *model)
{
int base;
u_char *out;
SVECTOR *vertices;
int n_vertices;
int color;
base = 128;
out = (u_char *)0x1F800000;
vertices = model->vertexIndexOffset_38;
n_vertices = model->numVertex_34;
gte_ldv3c(vertices);
gte_nop();
gte_rtv0_b();
vertices += 3;
for (; n_vertices > 0; n_vertices -= 3)
{
gte_pop_color(color);
color >>= 3;
gte_nop();
gte_rtv1_b();
out[0] = base + color;
gte_pop_color(color);
color >>= 3;
gte_nop();
gte_rtv2_b();
out[2] = base + color;
gte_pop_color(color);
gte_ldv3c(vertices);
color >>= 3;
gte_nop();
gte_rtv0_b();
out[4] = base + color;
vertices += 3;
out += 6;
}
}
POLY_GT4 * SubEfct_800CC860(unsigned int *indices, POLY_GT4 *packs, int n_packs)
{
unsigned int scratch;
unsigned int n0, n1, n2, n3;
scratch = 0x1F800000;
while (--n_packs >= 0)
{
if (packs->tag & 0xFF000000)
{
n0 = *indices;
n1 = *indices;
n2 = *indices;
n3 = *indices;
n0 <<= 1;
n1 >>= 7;
n2 >>= 23;
n3 >>= 15;
n0 &= 0xFE;
n1 &= 0xFE;
n2 &= 0xFE;
n3 &= 0xFE;
n0 += scratch;
n1 += scratch;
n2 += scratch;
n3 += scratch;
packs->u0 = *(u_char *)n0;
packs->u1 = *(u_char *)n1;
packs->u2 = *(u_char *)n2;
packs->u3 = *(u_char *)n3;
}
packs++;
indices++;
}
return packs;
}
void SubEfct_800CC914(DG_OBJ *obj)
{
POLY_GT4 *packs;
DG_MDL *model;
packs = obj->packs[1 - GV_Clock_800AB920];
if (packs == NULL)
{
return;
}
while (obj != NULL)
{
model = obj->model;
SubEfct_800CC798(model);
packs = SubEfct_800CC860((unsigned int *)model->faceIndexOffset_3C, packs, obj->n_packs);
obj = obj->extend;
}
}
void SubEfct_800CC9A0(SubEfctWork *work)
{
MATRIX world;
DG_OBJS *objs;
DG_OBJ *obj;
int i;
objs = work->parent->objs;
world = DG_ZeroMatrix_8009D430;
RotMatrixZ(work->rotation->vz, &world);
DG_SetPos_8001BC44(&world);
obj = objs->objs;
for (i = objs->n_models; i > 0; i--)
{
SubEfct_800CC914(obj);
obj++;
}
}
void SubEfct_800CCA58(SubEfctWork *work)
{
DG_OBJS *objs;
DG_OBJ *obj;
int i;
objs = work->parent->objs;
objs->flag = work->flag;
obj = objs->objs;
for (i = objs->n_models; i > 0; i--)
{
DG_WriteObjPacketUV_8001A774(obj, 0);
DG_WriteObjPacketUV_8001A774(obj, 1);
obj++;
}
}
void SubEfctAct_800CCAC0(SubEfctWork *work)
{
SubEfct_800CC9A0(work);
work->parent->light = work->light;
}
void SubEfctDie_800CCAF0(SubEfctWork *work)
{
SubEfct_800CCA58(work);
}
GV_ACT * NewSubEfct_800CCB10(OBJECT *parent, SVECTOR *rotation)
{
SubEfctWork *work;
DG_OBJS *objs;
work = (SubEfctWork *)GV_NewActor_800150E4(EXEC_LEVEL, sizeof(SubEfctWork));
if (work != NULL)
{
GV_SetNamedActor_8001514C(&work->actor, (TActorFunction)SubEfctAct_800CCAC0, (TActorFunction)SubEfctDie_800CCAF0, "sub_efct.c");
work->parent = parent;
work->rotation = rotation;
objs = parent->objs;
work->flag = objs->flag;
objs->flag = (objs->flag & ~DG_FLAG_BOUND) | DG_FLAG_AMBIENT | DG_FLAG_GBOUND;
work->lightp = objs->light;
objs->light = work->light;
work->light[0].m[0][0] = 0;
work->light[0].m[0][1] = -4096;
work->light[0].m[0][2] = 0;
work->light[1].m[0][0] = 2048;
work->light[1].m[1][0] = 2048;
work->light[1].m[2][0] = 2048;
}
return &work->actor;
}

View File

@ -1,3 +0,0 @@
#include "libgcl/libgcl.h"
const char opening_dword_800CD600[] = "sub_efct.c";