Skip to content

Commit

Permalink
Merge branch 'master' into dra-import-data
Browse files Browse the repository at this point in the history
  • Loading branch information
sozud authored Dec 12, 2023
2 parents 8661635 + 130bc38 commit 652350d
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/dra/692E8.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ void func_801093C4(void) {
}
}

// Duplicate of RIC func_80156F40
void func_80109594(void) {
Entity* e;
Primitive* prim;
Expand Down
83 changes: 81 additions & 2 deletions src/ric/1AC60.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,87 @@ s16 func_80156DE4(void) {
}
return 0;
}

INCLUDE_ASM("asm/us/ric/nonmatchings/1AC60", func_80156F40);
// Duplicate of DRA func_80109594
void func_80156F40(s16 arg0) {
Entity* e;
s32 radius;
s32 intensity;
s32 primIndex;
Primitive* prim;
s32 i;
s32 val;
s32 memset_len;
s32* memset_ptr;
SpriteParts** spriteptr;
Entity* playerPtr = &PLAYER;

DestroyEntity(&PLAYER);
PLAYER.posX.val = FIX(32);
PLAYER.posY.val = FIX(32);
PLAYER.animSet = ANIMSET_OVL(0x10);
PLAYER.palette = 0x8120;
PLAYER.rotX = PLAYER.rotY = 0x100;
PLAYER.facingLeft = 0;
PLAYER.rotPivotY = 0x18;
PLAYER.zPriority = g_unkGraphicsStruct.g_zEntityCenter.S16.unk0;
memset_len = sizeof(PlayerState) / sizeof(s32);
memset_ptr = &g_Player;
for (i = 0; i < memset_len; i++) {
*memset_ptr++ = 0;
}
g_Player.unk04 = 1;
g_Player.pl_vram_flag = 1;
func_8015CD98(0);
PLAYER.unk4C = D_80155480;
g_Player.unk5C = arg0;
if (g_StageId == STAGE_ST0) {
D_80154570 = 1;
} else {
D_80154570 = 0;
}
D_80097D37 = 0;
func_801587C0();
for (i = 0; i < 0x20; i++) {
radius = (rand() & 0x3FF) + 0x100;
intensity = (rand() & 0xFF) + 0x100;
val = rcos(radius) * 0x10;
D_80175958[i] = +((val * intensity) >> 8);
val = rsin(radius) * 0x10;
D_801759D8[i] = -((val * intensity) >> 7);
}
spriteptr = g_api.o.spriteBanks;
spriteptr += 0x10;
*spriteptr++ = D_801530AC;
*spriteptr++ = D_80153AA0;
*spriteptr++ = D_80153D24;
*spriteptr++ = D_801541A8;
for (e = &g_Entities[1], i = 0; i < 3; i++, e++) {
DestroyEntity(e);
e->animSet = ANIMSET_OVL(0x10);
e->unk5A = i + 1;
e->palette = 0x8120;
e->flags = FLAG_UNK_20000 | FLAG_UNK_08000000;
}
primIndex = g_api.AllocPrimitives(PRIM_TILE, 6);

g_Entities[1].primIndex = primIndex;
g_Entities[1].flags |= FLAG_HAS_PRIMS;
for (prim = &g_PrimBuf[primIndex]; prim != NULL; prim = prim->next) {
prim->blendMode = 0x102 | BLEND_VISIBLE;
}
if (D_80097C98 == 6) {
CreateEntFactoryFromEntity(playerPtr, 0x1004D, 0);
func_8015CC70(1);
}
if (D_80097C98 == 4) {
CreateEntFactoryFromEntity(playerPtr, 0x3004D, 0);
func_8015CC70(3);
}
if (D_80097C98 == 5) {
CreateEntFactoryFromEntity(playerPtr, 0x5004D, 0);
func_8015CC70(5);
}
}

INCLUDE_ASM("asm/us/ric/nonmatchings/1AC60", func_801572A8);

Expand Down
7 changes: 7 additions & 0 deletions src/ric/ric.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ typedef enum {
Player_AxearmorHit,
} PlayerSteps;

extern SpriteParts* D_801530AC[];
extern SpriteParts* D_80153AA0[];
extern SpriteParts* D_80153D24[];
extern SpriteParts* D_801541A8[];
extern void func_80159C04(void);
extern void DestroyEntity(Entity* entity);
extern void func_8015BB80(void);
Expand Down Expand Up @@ -100,6 +104,7 @@ extern AnimationFrame* D_80154E38;
extern AnimationFrame* D_80155394;
extern AnimationFrame* D_8015539C;
extern AnimationFrame* D_801553BC;
extern AnimationFrame D_80155480[];
extern AnimationFrame* D_80155488;
extern AnimationFrame* D_801554B0;
extern AnimationFrame* D_801554C0;
Expand Down Expand Up @@ -157,3 +162,5 @@ extern u16 D_80175950;
extern u16 D_80175952;
extern u16 D_80175954;
extern s16 D_80175956;
extern s32 D_80175958[];
extern s32 D_801759D8[];

0 comments on commit 652350d

Please sign in to comment.