diff --git a/CMakeLists.txt b/CMakeLists.txt index 9815be261..75044a395 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -217,13 +217,13 @@ set(SOURCE_FILES_DRA ) set(SOURCE_FILES_RIC + src/ric/pl_header.c src/ric/1AC60.c src/ric/1FCD0.c src/ric/20920.c src/ric/24788.c src/ric/2A060.c src/ric/319C4.c - src/ric/d_00000.c src/ric/d_188F4.c src/ric/d_194B0.c src/ric/d_19EE0.c diff --git a/config/splat.us.ric.yaml b/config/splat.us.ric.yaml index bd3655ce4..696c75be7 100644 --- a/config/splat.us.ric.yaml +++ b/config/splat.us.ric.yaml @@ -33,7 +33,7 @@ segments: align: 4 subalign: 4 subsegments: - - [0x0, .data, d_00000] + - [0x0, .data, pl_header] - [0x20, spritesheet, richter, disks/us/BIN/F_GAME2.BIN, 32] - [0x170AC, .data, spriteparts] - [0x18568, .data, d_18568] diff --git a/include/game.h b/include/game.h index ee73640fe..d7bfc8404 100644 --- a/include/game.h +++ b/include/game.h @@ -684,6 +684,10 @@ typedef struct { /* 0x6 */ u16 repeat; } Pad; // size = 0x8 +#define FRAME(x, y) ((x) | ((y) << 8)) +#define A_LOOP_AT(frame) {0, frame} +#define A_END {-1, 0} +#define A_JUMP_AT(anim) {-2, anim} typedef struct { u16 duration; u16 unk2; @@ -1507,7 +1511,7 @@ typedef struct { typedef struct { void (*D_8013C000)(void); - void (*D_8013C004)(void); + void (*D_8013C004)(u16 params); void (*D_8013C008)(void); void (*D_8013C00C)(void); } PlayerOvl; diff --git a/src/dra/5087C.c b/src/dra/5087C.c index b09a31b30..73b250542 100644 --- a/src/dra/5087C.c +++ b/src/dra/5087C.c @@ -1152,7 +1152,7 @@ void RunMainEngine(void) { LayerDef* layer; s32 i; s32 ent_unk68; - void (*RichterInitializer)(int isPrologue); + void (*playerInit)(int isPrologue); void (*RichterUpdater)(void); s32 tempX; s32 tempY; @@ -1175,11 +1175,11 @@ void RunMainEngine(void) { DrawHud(); func_800F2404(0); if (g_StageId == STAGE_ST0 || g_PlayableCharacter != PLAYER_ALUCARD) { - RichterInitializer = g_PlOvl.D_8013C004; + playerInit = g_PlOvl.D_8013C004; if (g_StageId == STAGE_ST0) { - RichterInitializer(1); + playerInit(1); } else { - RichterInitializer(0); + playerInit(0); } } else { func_80109594(); diff --git a/src/dra/6D59C.c b/src/dra/6D59C.c index fd4dee5a9..b65f8e139 100644 --- a/src/dra/6D59C.c +++ b/src/dra/6D59C.c @@ -528,7 +528,7 @@ u8 D_800ACF54[] = { 0x04, 0x05, 0x0A, 0x0B, 0x0E, 0x0F, 0x1D, 0x1E, 0x04, 0x03, 0x00, 0x00, }; -// Corresponding RIC function is func_8015CD98 (much simpler) +// Corresponding RIC function is RicLandToTheGround (much simpler) void func_8010E570(s32 arg0) { s32 anim; s32 atLedge; @@ -1395,7 +1395,7 @@ bool func_8010FDF8(s32 branchFlags) { return 1; } - if (PLAYER.velocityY > 0x6E000) { + if (PLAYER.velocityY > FIX(6.875)) { func_8010E470(1, 0); func_80134714(SFX_STOMP_HARD_B); CreateEntFactoryFromEntity( @@ -1413,7 +1413,7 @@ bool func_8010FDF8(s32 branchFlags) { return 1; } - if (PLAYER.velocityY > 0x6E000) { + if (PLAYER.velocityY > FIX(6.875)) { if ((PLAYER.step_s == 112) || (PLAYER.step == 4)) { func_8010E470(3, PLAYER.velocityX / 2); } else { diff --git a/src/pc/pl_ric.c b/src/pc/pl_ric.c index 59511bfab..9b3b62584 100644 --- a/src/pc/pl_ric.c +++ b/src/pc/pl_ric.c @@ -1,24 +1,20 @@ #include -extern void (*D_8013C000)(void); -extern void (*D_8013C004)(s32); -extern void (*D_8013C008)(void); -extern void (*D_8013C00C)(void); +extern PlayerOvl RIC_player; -static void Stub_8013C004(int isPrologue) { func_80109594(); } - -void UpdateEntityRichter(void); -void func_80156F40(s16 arg0); -void func_801603C4(void); -void func_8015E7B4(Unkstruct_8010BF64* arg0); +static void (*real_player_init)(u16 params); +static void InjectPlayerInit(u16 params) { + // fixes a bug where g_CurrentEntity is not correctly initialized at init + g_CurrentEntity = &PLAYER; + real_player_init(params); +} void InitPlayerRic(void) { - g_PlayableCharacter = PLAYER_RICHTER; - - g_PlOvl.D_8013C000 = UpdateEntityRichter; - g_PlOvl.D_8013C004 = func_80156F40; - g_PlOvl.D_8013C008 = func_801603C4; - g_PlOvl.D_8013C00C = func_8015E7B4; + g_PlOvl.D_8013C000 = RIC_player.D_8013C000; + g_PlOvl.D_8013C004 = InjectPlayerInit; + g_PlOvl.D_8013C008 = RIC_player.D_8013C008; + g_PlOvl.D_8013C00C = RIC_player.D_8013C00C; + real_player_init = RIC_player.D_8013C004; } // ric stubs diff --git a/src/ric/1AC60.c b/src/ric/1AC60.c index dc74cc845..16f81d0c2 100644 --- a/src/ric/1AC60.c +++ b/src/ric/1AC60.c @@ -34,7 +34,7 @@ static TeleportCheck GetTeleportToOtherCastle(void) { return TELEPORT_CHECK_NONE; } -s16 func_80156DE4(void) { +static s16 func_80156DE4(void) { // Variables that change during execution Collider collider; s32 yvar; @@ -68,10 +68,10 @@ s16 func_80156DE4(void) { return 0; } -void func_801587C0(); +static void RicDebugOff(); // Duplicate of DRA func_80109594 -void func_80156F40(s16 arg0) { +void RicInit(s16 arg0) { Entity* e; s32 radius; s32 intensity; @@ -100,16 +100,16 @@ void func_80156F40(s16 arg0) { } g_Player.unk04 = 1; g_Player.pl_vram_flag = 1; - func_8015CD98(0); + RicSetStand(0); PLAYER.unk4C = D_80155480; g_Player.unk5C = arg0; if (g_StageId == STAGE_ST0) { - D_80154570 = 1; + g_IsPrologueStage = true; } else { - D_80154570 = 0; + g_IsPrologueStage = false; } g_PlayerDraw->enableColorBlend = 0; - func_801587C0(); + RicDebugOff(); for (i = 0; i < 0x20; i++) { radius = (rand() & 0x3FF) + 0x100; intensity = (rand() & 0xFF) + 0x100; @@ -152,7 +152,7 @@ void func_80156F40(s16 arg0) { } } -void func_801572A8(bool arg0) { +static void func_801572A8(bool arg0) { Collider collider; s16 argX; s16 argY; @@ -221,7 +221,7 @@ void func_801572A8(bool arg0) { argX = PLAYER.posX.i.hi + D_801545F4[i].x; argY = PLAYER.posY.i.hi + D_801545F4[i].y; g_api.CheckCollision(argX, argY, &g_Player.colliders[i], 0); - if ((g_Player.D_80072F00[7] != 0) && + if ((g_Player.D_80072F00[PL_T_7] != 0) && (g_Player.colliders[i].effects & 0x40)) { g_api.CheckCollision(argX, argY + 0xC, &collider, 0); if (!(collider.effects & EFFECT_SOLID)) { @@ -257,7 +257,7 @@ void func_801572A8(bool arg0) { } } -void CheckBladeDashInput(void) { +static void CheckBladeDashInput(void) { s32 up; s32 down; s32 temp_down = PAD_DOWN; @@ -302,18 +302,18 @@ void CheckBladeDashInput(void) { if ((PLAYER.step == Player_Stand || PLAYER.step == Player_Walk) || PLAYER.step == Player_Crouch || (PLAYER.step == Player_Fall || PLAYER.step == Player_Jump)) { - if (g_Player.unk72 != 0) { + if (g_Player.unk72) { g_bladeDashButtons.buttonsCorrect = 0; } else if ( (g_Player.unk46 == 0) && (g_Player.padTapped & PAD_SQUARE)) { - DoBladeDash(); + RicSetBladeDash(); } } break; } } -void CheckHighJumpInput(void) { +static void CheckHighJumpInput(void) { switch (D_801758E4.buttonsCorrect) { case 0: if (g_Player.padTapped & PAD_DOWN) { @@ -343,8 +343,8 @@ void CheckHighJumpInput(void) { ((PLAYER.step == Player_Crouch) || (PLAYER.step == Player_Stand) || ((PLAYER.step == Player_Jump) && (PLAYER.velocityY > FIX(1))) || (PLAYER.step == Player_Fall))) { - if (g_Player.unk72 == 0) { - DoHighJump(); + if (!g_Player.unk72) { + RicSetHighJump(); } D_801758E4.buttonsCorrect = 0; } @@ -352,10 +352,10 @@ void CheckHighJumpInput(void) { } } -bool func_8015885C(void); -void func_8015A9B0(s32 damageEffects, s32 arg1, s32 arg2, s32 arg3); +static bool RicDebug(void); +void RicHandleDead(s32 damageEffects, s32 arg1, s32 arg2, s32 arg3); -void UpdateEntityRichter(void) { +void RicMain(void) { DamageParam damage; s32 temp_s0; s32 var_s4; @@ -364,7 +364,7 @@ void UpdateEntityRichter(void) { s16 playerStep; s16 playerStepS; s32 i; - bool condition; + bool isDamageTakenDeadly; f32* playerY; PlayerDraw* playerDraw = g_PlayerDraw; @@ -373,28 +373,28 @@ void UpdateEntityRichter(void) { g_Player.unk4C = 0; g_Player.unk72 = func_80156DE4(); FntPrint("pl_head_f:%02x\n", g_Player.unk72); - for (i = 0; i < 16; i++) { + for (i = 0; i < LEN(g_Player.D_80072F00); i++) { if (g_Player.D_80072F00[i] == 0) { continue; } switch (i) { - case 0: - case 1: - case 3: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 14: + case PL_T_POISON: + case PL_T_CURSE: + case PL_T_3: + case PL_T_5: + case PL_T_6: + case PL_T_7: + case PL_T_8: + case PL_T_9: + case PL_T_10: + case PL_T_RUN: + case PL_T_12: + case PL_T_INVINCIBILITY_CONSUMABLE: break; - case 2: + case PL_T_2: PLAYER.palette = g_Player.unk40; break; - case 4: { + case PL_T_4: { s32 temp_s0 = (g_GameTimer & 0xF) << 8; playerDraw->r0 = playerDraw->b0 = playerDraw->g0 = (rsin((s16)temp_s0) + 0x1000) / 64 + 0x60; @@ -407,41 +407,41 @@ void UpdateEntityRichter(void) { playerDraw->enableColorBlend = 1; break; } - case 13: - g_Player.D_80072F00[13] = 4; + case PL_T_INVINCIBLE: + g_Player.D_80072F00[PL_T_INVINCIBLE] = 4; break; - case 15: + case PL_T_15: func_8015CB58(0, 0); break; } - if (--(g_Player.D_80072F00[i]) != 0) { + if (--g_Player.D_80072F00[i]) { continue; } switch (i) { - case 0: + case PL_T_POISON: break; - case 2: + case PL_T_2: PLAYER.palette = 0x8120; break; - case 4: + case PL_T_4: playerDraw->enableColorBlend = 0; break; - case 13: - func_8015CAD4(1, 0x10); + case PL_T_INVINCIBLE: + func_8015CAD4(1, 16); break; - case 6: + case PL_T_6: if ((PLAYER.step == Player_Fall) && (PLAYER.unk4C != D_80155534)) { - func_8015C920(D_80155534); + RicSetAnimation(D_80155534); g_Player.unk44 &= ~0x10; } break; - case 15: + case PL_T_15: func_8015CC28(); break; } } g_Player.padHeld = g_Player.padPressed; - if (g_Player.D_80072EFC != 0) { + if (g_Player.D_80072EFC) { g_Player.D_80072EFC--; g_Player.padPressed = g_Player.padSim; } else { @@ -449,7 +449,7 @@ void UpdateEntityRichter(void) { } g_Player.padTapped = (g_Player.padHeld ^ g_Player.padPressed) & g_Player.padPressed; - if (PLAYER.step == Player_Kill) { + if (PLAYER.step == PL_S_DEAD) { goto block_47; } // Reuse the i variable here even though we aren't iterating @@ -461,7 +461,7 @@ void UpdateEntityRichter(void) { if (PLAYER.step == Player_SpellDarkMetamorphosis) { goto block_48; } - if ((g_DebugPlayer != 0) && (func_8015885C())) { + if (g_DebugPlayer && RicDebug()) { return; } if (g_Player.unk60 >= 2) { @@ -470,10 +470,11 @@ void UpdateEntityRichter(void) { if (g_Player.unk60 == 1) { playerStep = PLAYER.step; playerStepS = PLAYER.step_s; - RicSetPlayerStep(Player_BossGrab); + RicSetStep(PL_S_BOSS_GRAB); goto block_48; } - if (((g_Player.D_80072F00[13] | g_Player.D_80072F00[14]) != 0) || + if (((g_Player.D_80072F00[PL_T_INVINCIBLE] | + g_Player.D_80072F00[PL_T_INVINCIBILITY_CONSUMABLE]) != 0) || (PLAYER.unk44 == 0)) { goto block_47; } @@ -482,18 +483,18 @@ void UpdateEntityRichter(void) { damage.effects = PLAYER.unk44 & ~0x1F; damage.damageKind = PLAYER.unk44 & 0x1F; damage.damageTaken = PLAYER.hitPoints; - condition = g_api.func_800FD5BC(&damage); + isDamageTakenDeadly = g_api.func_800FD5BC(&damage); damageKind = damage.damageKind; damageEffects = damage.effects; - if (condition) { + if (isDamageTakenDeadly) { if (g_Player.unk5C == 0) { - RicSetPlayerStep(Player_Kill); + RicSetStep(PL_S_DEAD); } else { g_Status.hp = 1; - RicSetPlayerStep(Player_Hit); + RicSetStep(PL_S_HIT); } } else { - RicSetPlayerStep(Player_Hit); + RicSetStep(PL_S_HIT); } goto block_48; block_47: @@ -503,62 +504,62 @@ block_48: g_Player.unk50 = PLAYER.step; g_Player.unk52 = PLAYER.step_s; switch (PLAYER.step) { - case 0: - func_80158BFC(); + case PL_S_STAND: + RicHandleStand(); break; - case 1: - func_80158F38(); + case PL_S_WALK: + RicHandleWalk(); break; - case 2: - func_80159670(); + case PL_S_CROUCH: + RicHandleCrouch(); break; - case 3: - func_801595D8(); + case PL_S_FALL: + RicHandleFall(); break; - case 4: - func_801590A0(); + case PL_S_JUMP: + RicHandleJump(); break; - case 8: - func_8015C2A8(); + case PL_S_HIGHJUMP: + RicHandleHighJump(); break; - case 10: - RichterHandleDamage(damageEffects, damageKind, playerStep, playerStepS); + case PL_S_HIT: + RicHandleHit(damageEffects, damageKind, playerStep, playerStepS); break; - case 12: - func_8015A7D0(); + case PL_S_BOSS_GRAB: + RicHandleBossGrab(); break; - case 16: - func_8015A9B0(damageEffects, damageKind, playerStep, playerStepS); + case PL_S_DEAD: + RicHandleDead(damageEffects, damageKind, playerStep, playerStepS); break; - case 18: - func_8015AFE0(); + case PL_S_STAND_IN_AIR: + RicHandleStandInAir(); break; - case 19: - func_8015B098(); + case PL_S_FLAME_WHIP: + RicHandleEnableFlameWhip(); break; - case 20: - func_8015B18C(); + case PL_S_HYDROSTORM: + RicHandleHydrostorm(); break; - case 21: - func_8015B244(); + case PL_S_THROW_DAGGERS: + RicHandleThrowDaggers(); break; - case 27: - func_8015B1E8(); + case PL_S_SUBWPN_CRASH: + RicHandleGenericSubwpnCrash(); break; - case 22: + case PL_S_22: func_8015B348(); break; - case 23: + case PL_S_23: func_8015B898(); break; - case 25: - func_80158FA4(); + case PL_S_RUN: + RicHandleRun(); break; case Player_SlideKick: PlayerStepSlideKick(); break; - case Player_RichterBladeDash: - HandleBladeDash(); + case PL_S_BLADEDASH: + RicHandleBladeDash(); break; case 32: func_8015BCD0(); @@ -566,36 +567,36 @@ block_48: } g_Player.unk08 = g_Player.unk0C; switch (PLAYER.step) { - case 0: - case 1: - var_s4 = 0x08000000; + case PL_S_STAND: + case PL_S_WALK: + var_s4 = NO_AFTERIMAGE; break; - case 2: - var_s4 = 0x08000000; + case PL_S_CROUCH: + var_s4 = NO_AFTERIMAGE; if (PLAYER.step_s != 2) { - var_s4 = 0x08000020; + var_s4 = NO_AFTERIMAGE | 0x20; } break; - case 3: - case 4: - var_s4 = 0x08002000; + case PL_S_FALL: + case PL_S_JUMP: + var_s4 = NO_AFTERIMAGE | 0x2000; break; - case 8: + case PL_S_HIGHJUMP: func_8015CAD4(1, 4); break; - case 10: - var_s4 = 0x08010000; + case PL_S_HIT: + var_s4 = NO_AFTERIMAGE | 0x10000; case 18: func_8015CAD4(1, 16); break; - case 12: - var_s4 = 0x08110040; + case PL_S_BOSS_GRAB: + var_s4 = NO_AFTERIMAGE | 0x100000 | 0x10000 | 0x40; func_8015CAD4(1, 16); break; - case 16: - var_s4 = 0x08050000; + case PL_S_DEAD: + var_s4 = NO_AFTERIMAGE | 0x40000 | 0x10000; if (PLAYER.step_s == 0x80) { - var_s4 = 0x080D0000; + var_s4 = NO_AFTERIMAGE | 0x80000 | 0x40000 | 0x10000; } func_8015CAD4(1, 16); break; @@ -609,17 +610,17 @@ block_48: case 22: case 27: case 32: - var_s4 = 0x08000000; + var_s4 = NO_AFTERIMAGE; func_8015CAD4(1, 16); break; } - if (g_Player.D_80072F00[9] != 0) { + if (g_Player.D_80072F00[PL_T_9] != 0) { var_s4 |= 0x400; } - if (g_Player.D_80072F00[10] != 0) { + if (g_Player.D_80072F00[PL_T_10] != 0) { var_s4 |= 0x800; } - if (g_Player.D_80072F00[12] != 0) { + if (g_Player.D_80072F00[PL_T_12] != 0) { var_s4 |= 0x1000; } if (*D_80097448 != 0) { @@ -632,19 +633,20 @@ block_48: if (g_Player.unk5C != 0) { if (g_Status.hp < 2) { func_8015D9B4(); - func_8015CAD4(1, 0x10); + func_8015CAD4(1, 16); } } else { - func_8015CAD4(1, 0x10); - g_Player.D_80072F00[4] = 0x10; + func_8015CAD4(1, 16); + g_Player.D_80072F00[PL_T_4] = 0x10; PLAYER.palette = 0x8120; } } } - if (var_s4 & 0x08000000) { + if (var_s4 & NO_AFTERIMAGE) { func_8015CB58(1, 4); } - if ((g_Player.D_80072F00[13] | g_Player.D_80072F00[14]) != 0) { + if ((g_Player.D_80072F00[PL_T_INVINCIBLE] | + g_Player.D_80072F00[PL_T_INVINCIBILITY_CONSUMABLE]) != 0) { g_Player.unk0C |= 0x100; } g_api.UpdateAnim(D_80155964, D_8015538C); @@ -655,7 +657,7 @@ block_48: if (PLAYER.unk4C == D_801556C4) { PLAYER.palette = D_80154574[PLAYER.animFrameIdx]; } - if ((PLAYER.unk4C == D_80155658) && (PLAYER.animFrameIdx == 4)) { + if ((PLAYER.unk4C == ric_anim_stand_in_air) && (PLAYER.animFrameIdx == 4)) { PLAYER.palette = D_80154594[PLAYER.animFrameDuration & 3]; } if ((PLAYER.step == 0x10) && (PLAYER.animFrameDuration < 0)) { @@ -669,7 +671,7 @@ block_48: PLAYER.velocityY = PLAYER.velocityY * 3 / 4; PLAYER.velocityX = PLAYER.velocityX * 3 / 4; } - playerY = &g_Entities[PLAYER_CHARACTER].posY.i; + playerY = &PLAYER.posY.i; temp_s0 = g_Player.pl_vram_flag; if ((abs(PLAYER.velocityY) > FIX(2)) || (abs(PLAYER.velocityX) > FIX(2))) { PLAYER.velocityY = PLAYER.velocityY >> 2; @@ -694,36 +696,36 @@ block_48: func_8015C6D4(); } -void func_801587C0() { D_80175956 = 0; } +static void RicDebugOff() { g_IsRicDebugEnter = false; } -void func_801587D0(void) { - D_80175956 = 1; - D_80175950 = PLAYER.animCurFrame; - D_80175952 = PLAYER.drawFlags; - D_80175954 = PLAYER.palette; +static void RicDebugEnter(void) { + g_IsRicDebugEnter = true; + g_RicDebugCurFrame = PLAYER.animCurFrame; + g_RicDebugDrawFlags = PLAYER.drawFlags; + g_RicDebugPalette = PLAYER.palette; } -void func_80158814(void) { - D_80175956 = 0; +static void RicDebugExit(void) { + g_IsRicDebugEnter = false; PLAYER.unk44 = 0; - PLAYER.animCurFrame = D_80175950; - PLAYER.drawFlags = *(u8*)&D_80175952; - PLAYER.palette = D_80175954; + PLAYER.animCurFrame = g_RicDebugCurFrame; + PLAYER.drawFlags = g_RicDebugDrawFlags; + PLAYER.palette = g_RicDebugPalette; } -bool func_8015885C(void) { - if (D_80175956 == 0) { +static bool RicDebug(void) { + if (!g_IsRicDebugEnter) { if (g_Player.padTapped & PAD_L2) { if (g_Player.D_80072EFC == 0) { - func_801587D0(); + RicDebugEnter(); return true; } } return false; } - if ((g_Player.D_80072EFC != 0) || (g_Player.padTapped & PAD_L2)) { - func_80158814(); + if (g_Player.D_80072EFC || g_Player.padTapped & PAD_L2) { + RicDebugExit(); return false; } diff --git a/src/ric/1CB04.c b/src/ric/1CB04.c index da08f2b81..0e1a218b0 100644 --- a/src/ric/1CB04.c +++ b/src/ric/1CB04.c @@ -28,7 +28,7 @@ void func_80158B04(s32 arg0) { } } -void func_80158BFC(void) { +void RicHandleStand(void) { s32 var_s0; if (PLAYER.step < 64) { @@ -54,34 +54,34 @@ void func_80158BFC(void) { RicDecelerateX(0x2000); switch (PLAYER.step_s) { case 0: - if (func_8015C9CC() == 0) { + if (RicCheckMovement() == 0) { if (g_Player.padPressed & PAD_UP) { - func_8015C920(&D_80155394); + RicSetAnimation(D_80155394); PLAYER.step_s = 1; break; } } else { - func_8015CDE0(0); + RicSetWalk(0); } break; case 1: - if (func_8015C9CC() != 0) { - func_8015CDE0(0); + if (RicCheckMovement() != 0) { + RicSetWalk(0); break; } else if (g_Player.padPressed & PAD_UP) { break; } else { - func_8015CD98(0); + RicSetStand(0); break; } case 64: func_8015CB58(1, 1); if (PLAYER.animFrameIdx < 3) { - func_8015C9CC(); + RicCheckMovement(); if (g_Player.padPressed & PAD_DOWN) { - PLAYER.step = Player_RichterCrouch; + PLAYER.step = PL_S_CROUCH; PLAYER.unk4C = D_801555A8; break; } @@ -91,13 +91,13 @@ void func_80158BFC(void) { if (g_Player.padPressed & PAD_SQUARE) { g_Player.unk46 = 2; PLAYER.step_s++; - func_8015C920(D_80155730); + RicSetAnimation(D_80155730); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0, 17), 0); break; } g_Player.unk46 = 0; - func_8015CD98(0); + RicSetStand(0); } break; @@ -107,27 +107,27 @@ void func_80158BFC(void) { break; } g_Player.unk46 = 0; - func_8015CD98(0); + RicSetStand(0); break; case 66: func_8015CB58(1, 1); if (PLAYER.animFrameIdx < 3) { - func_8015C9CC(); + RicCheckMovement(); } if (PLAYER.animFrameDuration < 0) { g_Player.unk46 = 0; - func_8015CD98(0); + RicSetStand(0); } } } } -void func_80158F38(void) { +void RicHandleWalk(void) { if (func_8015DBB0(0x305C) == 0) { RicDecelerateX(0x2000); - if (func_8015C9CC() == 0) { - func_8015CD98(0); + if (RicCheckMovement() == 0) { + RicSetStand(0); return; } @@ -137,21 +137,21 @@ void func_80158F38(void) { } } -void func_80158FA4(void) { +void RicHandleRun(void) { if (g_Player.unk7A != 0) { - func_8015CDE0(0); + RicSetWalk(0); return; } - g_Player.D_80072F00[8] = 8; - g_Player.D_80072F00[1] = 8; + g_Player.D_80072F00[PL_T_8] = 8; + g_Player.D_80072F00[PL_T_CURSE] = 8; if (!func_8015DBB0(0x305C)) { RicDecelerateX(0x2000); - if (func_8015C9CC() == 0) { - func_8015CD98(0); - if (g_Player.D_80072F00[11] == 0) { + if (RicCheckMovement() == 0) { + RicSetStand(0); + if (g_Player.D_80072F00[PL_T_RUN] == 0) { if (!(g_Player.pl_vram_flag & 0xC)) { - func_8015C920(&D_8015539C); + RicSetAnimation(D_8015539C); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0, 0), 0); } @@ -164,8 +164,8 @@ void func_80158FA4(void) { } } -void func_801590A0(void) { - if ((D_80154570 == 0) && (PLAYER.velocityY < FIX(-1)) && +void RicHandleJump(void) { + if (!g_IsPrologueStage && (PLAYER.velocityY < FIX(-1)) && !(g_Player.unk44 & 0x40) && !(g_Player.padPressed & PAD_CROSS)) { PLAYER.velocityY = FIX(-1); } @@ -182,7 +182,7 @@ void func_801590A0(void) { return; case 0: RicDecelerateX(0x1000); - if (func_8015C9CC()) { + if (RicCheckMovement()) { if (g_Player.unk44 & 0x10) { RicSetSpeedX(FIX(2.25)); } else { @@ -194,10 +194,10 @@ void func_801590A0(void) { if ((PLAYER.animFrameIdx < 2) && ((LOW(g_Player.unk44) & 0xC) == 4) && (g_Player.padTapped & PAD_CROSS)) { - func_8015C920(D_8015555C); + RicSetAnimation(D_8015555C); RicSetSpeedX(FIX(-1.5)); PLAYER.velocityY = FIX(-2.625); - if (g_Player.unk72 != 0) { + if (g_Player.unk72) { PLAYER.velocityY = 0; } PLAYER.step_s = 2; @@ -209,7 +209,7 @@ void func_801590A0(void) { case 0x40: func_8015CB58(1, 1); if (PLAYER.animFrameIdx < 3) { - if (func_8015C9CC() != 0) { + if (RicCheckMovement() != 0) { if (g_Player.unk44 & 0x10) { RicSetSpeedX(FIX(2.25)); } else { @@ -237,13 +237,13 @@ void func_801590A0(void) { if (g_Player.padPressed & PAD_SQUARE) { g_Player.unk46 = 2; PLAYER.step_s += 1; - func_8015C920(D_80155740); + RicSetAnimation(D_80155740); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0, 17), 0); } else { g_Player.unk46 = 0; PLAYER.step_s = 0; - func_8015C920(D_80155528); + RicSetAnimation(D_80155528); } } return; @@ -252,13 +252,13 @@ void func_801590A0(void) { if (!(g_Player.padPressed & PAD_SQUARE)) { g_Player.unk46 = 0; PLAYER.step_s = 0; - func_8015C920(D_80155528); + RicSetAnimation(D_80155528); } return; case 0x42: func_8015CB58(1, 1); if (PLAYER.animFrameIdx < 3) { - if (func_8015C9CC() != 0) { + if (RicCheckMovement() != 0) { if (g_Player.unk44 & 0x10) { RicSetSpeedX(FIX(2.25)); } else { @@ -285,12 +285,12 @@ void func_801590A0(void) { if (PLAYER.animFrameDuration < 0) { g_Player.unk46 = 0; PLAYER.step_s = 0; - func_8015C920(D_80155528); + RicSetAnimation(D_80155528); } } } -void func_801595D8(void) { +void RicHandleFall(void) { if (func_8015DBB0(0x9009)) { return; } @@ -298,14 +298,14 @@ void func_801595D8(void) { if (PLAYER.step_s != 0) { return; } - if (g_Player.D_80072F00[5] != 0 && g_Player.padTapped & PAD_CROSS) { - func_8015D020(); - } else if (func_8015C9CC() != 0) { + if (g_Player.D_80072F00[PL_T_5] != 0 && g_Player.padTapped & PAD_CROSS) { + RicSetJump(); + } else if (RicCheckMovement() != 0) { RicSetSpeedX(0xC000); } } -void func_80159670(void) { +void RicHandleCrouch(void) { s32 i; s16 xShift; @@ -313,7 +313,7 @@ void func_80159670(void) { (g_Player.padPressed & PAD_DOWN)) { for (i = 0; i < 4; i++) { if (g_Player.colliders[i].effects & EFFECT_SOLID_FROM_ABOVE) { - g_Player.D_80072F00[7] = 8; + g_Player.D_80072F00[PL_T_7] = 8; return; } } @@ -322,10 +322,10 @@ void func_80159670(void) { return; } if ((g_Player.padTapped & PAD_CROSS) && (g_Player.unk46 == 0) && - (g_Player.unk72 == 0)) { - func_8015D020(1); + (!g_Player.unk72)) { + RicSetJump(1); return; - } else if ((g_Player.unk72 == 0) && (g_Player.unk46 == 0) && + } else if ((!g_Player.unk72) && (g_Player.unk46 == 0) && (g_Player.padTapped & PAD_TRIANGLE) && func_8015D678()) { return; } @@ -349,47 +349,47 @@ void func_80159670(void) { PLAYER.posX.i.hi -= xShift; } if (!(g_Player.padPressed & PAD_DOWN) && - ((g_Player.unk72 == 0) || !(g_Player.pl_vram_flag & 0x40))) { - func_8015C920(D_801554E0); + ((!g_Player.unk72) || !(g_Player.pl_vram_flag & 0x40))) { + RicSetAnimation(D_801554E0); PLAYER.step_s = 2; return; } break; case 0x1: if (!(g_Player.padPressed & PAD_DOWN) && - ((g_Player.unk72 == 0) || !(g_Player.pl_vram_flag & 0x40))) { - if (func_8015C9CC() == 0) { + ((!g_Player.unk72) || !(g_Player.pl_vram_flag & 0x40))) { + if (RicCheckMovement() == 0) { PLAYER.unk4C = D_801554E0; PLAYER.step_s = 2; PLAYER.animFrameDuration = 1; PLAYER.animFrameIdx = 2 - PLAYER.animFrameIdx; return; } - func_8015CDE0(0); + RicSetWalk(0); return; } case 0x4: if (PLAYER.animFrameDuration != -1) { return; } - func_8015C920(D_801554C0); + RicSetAnimation(anim_crouch); PLAYER.step_s = 0; return; case 0x2: - if ((g_Player.unk72 == 0) || !(g_Player.pl_vram_flag & 0x40)) { - if (func_8015C9CC() != 0) { - func_8015CDE0(0); + if ((!g_Player.unk72) || !(g_Player.pl_vram_flag & 0x40)) { + if (RicCheckMovement() != 0) { + RicSetWalk(0); return; } if (PLAYER.animFrameDuration == -1) { - func_8015CD98(0); + RicSetStand(0); return; } } break; case 0x3: if (PLAYER.animFrameDuration < 0) { - func_8015C920(D_801554C0); + RicSetAnimation(anim_crouch); PLAYER.step_s = 0; return; } @@ -397,8 +397,8 @@ void func_80159670(void) { case 0x40: func_8015CB58(1, 1); if (PLAYER.animFrameIdx < 3) { - func_8015C9CC(); - if (!(g_Player.padPressed & PAD_DOWN) && (g_Player.unk72 == 0)) { + RicCheckMovement(); + if (!(g_Player.padPressed & PAD_DOWN) && (!g_Player.unk72)) { PLAYER.step = 0; PLAYER.unk4C = D_80155588; return; @@ -408,14 +408,14 @@ void func_80159670(void) { if (g_Player.padPressed & PAD_SQUARE) { g_Player.unk46 = 2; PLAYER.step_s++; - func_8015C920(D_80155738); + RicSetAnimation(D_80155738); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0, 17), 0); return; } g_Player.unk46 = 0; PLAYER.step_s = 0; - func_8015C920(D_801554C0); + RicSetAnimation(anim_crouch); } break; case 0x41: @@ -423,7 +423,7 @@ void func_80159670(void) { if (!(g_Player.padPressed & PAD_SQUARE)) { g_Player.unk46 = 0; PLAYER.step_s = 0; - func_8015C920(D_801554C0); + RicSetAnimation(anim_crouch); } break; } @@ -476,9 +476,9 @@ void func_80159C04(void) { } } -void func_8015A9B0(s32 damageEffects, s32 arg1, s32 arg2, s32 arg3); +void RicHandleDead(s32 damageEffects, s32 arg1, s32 arg2, s32 arg3); -void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { +void RicHandleHit(s32 arg0, u32 arg1, s16 arg2) { DamageParam damage; s32 xShift; s32 i; @@ -506,7 +506,7 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 48), 0); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0x4600, 33), 0); - g_Player.D_80072F00[2] = 6; + g_Player.D_80072F00[PL_T_2] = 6; g_api.PlaySfx(0x703); break; } else { @@ -540,7 +540,7 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { PLAYER.velocityY = FIX(-3); func_8015CAAC(FIX(-1.25)); PLAYER.step_s = 1; - PLAYER.unk4C = D_80155694; + PLAYER.unk4C = ric_anim_stun; g_api.PlaySfx(0x702); break; } @@ -552,8 +552,8 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { PLAYER.posY.val -= 1; func_8015CAAC(FIX(-8)); PLAYER.step_s = 2; - PLAYER.unk4C = D_80155694; - g_Player.D_80072F00[2] = 0x200; + PLAYER.unk4C = ric_anim_stun; + g_Player.D_80072F00[PL_T_2] = 0x200; PLAYER.facingLeft = PLAYER.entityRoomIndex; break; default: @@ -576,7 +576,7 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { PLAYER.velocityY = FIX(-4); func_8015CAAC(FIX(-1.25)); PLAYER.step_s = 1; - PLAYER.unk4C = D_80155694; + PLAYER.unk4C = ric_anim_stun; g_api.PlaySfx(0x702); break; case 2: @@ -593,14 +593,14 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { PLAYER.velocityY = FIX(-3); func_8015CAAC(FIX(-1.25)); PLAYER.step_s = 1; - PLAYER.unk4C = D_80155694; + PLAYER.unk4C = ric_anim_stun; g_api.PlaySfx(0x702); break; } break; } g_Player.unk40 = 0x8166; - g_Player.D_80072F00[2] = 6; + g_Player.D_80072F00[PL_T_2] = 6; if (arg0 & 0x8000) { RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0x100, 8), 0); @@ -609,7 +609,7 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0x4300, 33), 0); g_Player.unk40 = 0x8160; - g_Player.D_80072F00[2] = 0x10; + g_Player.D_80072F00[PL_T_2] = 0x10; break; } else if (arg0 & 0x40) { RicCreateEntFactoryFromEntity( @@ -617,13 +617,13 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0x4400, 33), 0); g_Player.unk40 = 0x8166; - g_Player.D_80072F00[2] = 0x10; + g_Player.D_80072F00[PL_T_2] = 0x10; break; } else if (arg0 & 0x2000) { // Creates EntityHitByIce RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0, 47), 0); - g_Player.D_80072F00[2] = 0xC; + g_Player.D_80072F00[PL_T_2] = 0xC; g_Player.unk40 = 0x8169; break; } else { @@ -632,7 +632,7 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { g_CurrentEntity, FACTORY(0, 70), 0); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0x5600, 33), 0); - g_Player.D_80072F00[2] = 0x10; + g_Player.D_80072F00[PL_T_2] = 0x10; g_Player.unk40 = 0x8164; } if (arg0 & 0x1000) { @@ -640,7 +640,7 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { g_CurrentEntity, FACTORY(0, 71), 0); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0x5700, 33), 0); - g_Player.D_80072F00[2] = 8; + g_Player.D_80072F00[PL_T_2] = 8; g_Player.unk40 = 0x8168; } if (!(arg0 & 0xF840)) { @@ -679,8 +679,8 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { damage.damageKind = 1; damage.damageTaken = g_Player.damageTaken; if (g_api.func_800FD5BC(&damage) != 0) { - RicSetPlayerStep(Player_Kill); - func_8015A9B0(0, 2, 10, 2); + RicSetStep(PL_S_DEAD); + RicHandleDead(0, 2, 10, 2); return; } break; @@ -720,8 +720,8 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { damage.damageKind = 1; damage.damageTaken = g_Player.damageTaken; if (g_api.func_800FD5BC(&damage) != 0) { - RicSetPlayerStep(Player_Kill); - func_8015A9B0(0, 2, 10, 2); + RicSetStep(PL_S_DEAD); + RicHandleDead(0, 2, 10, 2); return; } break; @@ -739,8 +739,8 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { damage.damageKind = 1; damage.damageTaken = g_Player.damageTaken; if (g_api.func_800FD5BC(&damage) != 0) { - RicSetPlayerStep(Player_Kill); - func_8015A9B0(0, 2, 10, 2); + RicSetStep(PL_S_DEAD); + RicHandleDead(0, 2, 10, 2); return; } break; @@ -783,7 +783,7 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { } if (PLAYER.animFrameDuration < 0) { if ((g_Player.unk5C == 0) || (g_Status.hp > 0)) { - func_8015CD98(PLAYER.velocityX); + RicSetStand(PLAYER.velocityX); break; } func_8015D9B4(); @@ -800,23 +800,23 @@ void RichterHandleDamage(s32 arg0, u32 arg1, s16 arg2) { func_8015D9B4(); return; } - func_8015CCC8(0, PLAYER.velocityX); + RicSetCrouch(0, PLAYER.velocityX); } break; } - if (step_s_zero && (g_Player.unk72 != 0)) { + if (step_s_zero && (g_Player.unk72)) { PLAYER.velocityY = 0; } } -void func_8015A7D0(void) { +void RicHandleBossGrab(void) { DamageParam damage; switch (g_CurrentEntity->step_s) { case 0: func_80159BC8(); if (g_Player.unk62 == 0) { - PLAYER.unk4C = D_80155694; - g_Player.D_80072F00[2] = 8; + PLAYER.unk4C = ric_anim_stun; + g_Player.D_80072F00[PL_T_2] = 8; g_Player.unk40 = 0x8166; g_api.PlaySfx(0x702); } @@ -831,24 +831,24 @@ void func_8015A7D0(void) { damage.damageKind = 1; damage.damageTaken = g_Player.damageTaken; if (g_api.func_800FD5BC(&damage)) { - RicSetPlayerStep(Player_Kill); - func_8015A9B0(0, 2, 12, 1); + RicSetStep(PL_S_DEAD); + RicHandleDead(0, 2, 12, 1); return; } if (g_Player.unk62 == 0) { - g_Player.D_80072F00[2] = 4; + g_Player.D_80072F00[PL_T_2] = 4; g_Player.unk40 = 0x8166; g_api.PlaySfx(0x703); } g_Player.unk60 = 2; - } else if (g_Player.unk60 == 4) { /* switch 1 */ - PLAYER.step = Player_Hit; + } else if (g_Player.unk60 == 4) { + PLAYER.step = PL_S_HIT; PLAYER.step_s = 2; g_Player.unk60 = 0; g_Player.damageTaken = g_Player.unk64; g_api.PlaySfx(0x704); - } else if (g_Player.unk60 == 0) { /* switch 1 */ - PLAYER.step = Player_Hit; + } else if (g_Player.unk60 == 0) { + PLAYER.step = PL_S_HIT; PLAYER.step_s = 1; } } @@ -856,7 +856,7 @@ void func_8015A7D0(void) { // Compare to DRA func_80115394 // Only damageEffects is used, but the callers give 4 args. -void func_8015A9B0(s32 damageEffects, s32 arg1, s32 arg2, s32 arg3) { +void RicHandleDead(s32 damageEffects, s32 arg1, s32 arg2, s32 arg3) { s32 j; s32 i; u8* s2; @@ -869,7 +869,7 @@ void func_8015A9B0(s32 damageEffects, s32 arg1, s32 arg2, s32 arg3) { func_80159BC8(); func_80159C04(); func_8015CAAC(FIX(-0.75)); - func_8015C920(D_80155544); + RicSetAnimation(D_80155544); PLAYER.velocityY = FIX(-1.625); g_api.PlaySfx(SFX_UNK_6FF); if (damageEffects & ELEMENT_FIRE) { @@ -1009,7 +1009,7 @@ void func_8015A9B0(s32 damageEffects, s32 arg1, s32 arg2, s32 arg3) { } } -void func_8015AFE0(void) { +void RicHandleStandInAir(void) { if (PLAYER.step_s == 0) { PLAYER.velocityY += 0x3800; if (PLAYER.velocityY > 0) { @@ -1018,39 +1018,39 @@ void func_8015AFE0(void) { } } else if (g_Player.unk4E != 0) { g_Player.unk46 = 0; - RicSetPlayerStep(4); - func_8015C920(&D_80155528); + RicSetStep(PL_S_JUMP); + RicSetAnimation(D_80155528); g_Player.unk44 = 0; } - if (g_Player.unk72 != 0) { + if (g_Player.unk72) { PLAYER.velocityY = 0; } } -void func_8015B098(void) { +void RicHandleEnableFlameWhip(void) { if ((PLAYER.animCurFrame == 0xB5) && (PLAYER.animFrameDuration == 1)) { RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 35), 0); g_api.PlaySfx(SFX_WEAPON_APPEAR); } if (PLAYER.animFrameDuration < 0) { - func_8015CD98(0); + RicSetStand(0); g_Player.unk46 = 0; RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x4500, 33), 0); - g_Player.D_80072F00[0] = 0x800; + g_Player.D_80072F00[PL_T_POISON] = 0x800; } if (!(g_Player.pl_vram_flag & 1)) { func_8015CF08(); g_Player.unk46 = 0; RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x4500, 33), 0); - g_Player.D_80072F00[0] = 0x800; + g_Player.D_80072F00[PL_T_POISON] = 0x800; } } -void func_8015B18C(void) { +void RicHandleHydrostorm(void) { if (PLAYER.animFrameDuration < 0) { - func_8015CD98(0); + RicSetStand(0); g_Player.unk46 = 0; } @@ -1060,9 +1060,9 @@ void func_8015B18C(void) { } } -void func_8015B1E8(void) { +void RicHandleGenericSubwpnCrash(void) { if (g_Player.unk4E) { - func_8015CD98(0); + RicSetStand(0); g_Player.unk46 = 0; } @@ -1072,21 +1072,21 @@ void func_8015B1E8(void) { } } -void func_8015B244(void) { +void RicHandleThrowDaggers(void) { if (PLAYER.step_s == 0) { D_80174F74 = 0x200; PLAYER.step_s++; } else { - func_8015C9CC(); + RicCheckMovement(); D_80174F74--; if (D_80174F74 == 0) { g_Player.unk46 = 0; - func_8015CD98(0); + RicSetStand(0); g_Player.unk4E = 1; } } if (g_Player.padTapped & PAD_CROSS) { - func_8015D020(); + RicSetJump(); g_Player.unk46 = 0; g_Player.unk4E = 1; D_80174F74 = 0; @@ -1108,8 +1108,8 @@ void func_8015B348(void) { RicDecelerateX(0x2000); if (PLAYER.velocityX == 0) { - func_8015C920(&D_80155748); - g_Player.D_80072F00[13] = 4; + RicSetAnimation(D_80155748); + g_Player.D_80072F00[PL_T_INVINCIBLE] = 4; RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 29), 0); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0x900, 33), 0); @@ -1141,7 +1141,7 @@ void func_8015B348(void) { // Cross subweapon crash. D_801545A8--; if ((D_801545A8) == 0) { - func_8015C920(&D_801558B4); + RicSetAnimation(D_801558B4); PLAYER.palette = 0x814E; g_CurrentEntity->velocityY = FIX(-1); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 22), 0); @@ -1165,7 +1165,7 @@ void func_8015B348(void) { RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0x400, 39), 0); PLAYER.palette = 0x813D; - g_Player.D_80072F00[13] = 0; + g_Player.D_80072F00[PL_T_INVINCIBLE] = 0; PLAYER.step_s++; } @@ -1204,7 +1204,7 @@ void func_8015B348(void) { } D_801545A8--; if (D_801545A8 == 0) { - func_8015C920(&D_801558D4); + RicSetAnimation(D_801558D4); g_api.PlaySfx(SFX_WEAPON_APPEAR); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 27), 0); PLAYER.step_s++; @@ -1218,7 +1218,7 @@ void func_8015B348(void) { case 6: if (PLAYER.animFrameDuration < 0) { - func_8015C920(&D_801558DC); + RicSetAnimation(D_801558DC); PLAYER.step_s++; } break; @@ -1228,8 +1228,8 @@ void func_8015B348(void) { g_CurrentEntity->flags &= ~FLAG_UNK_10000; g_unkGraphicsStruct.unk20 = 0; func_8015CF08(); - func_8015C920(&D_801558DC); - g_Player.D_80072F00[13] = 4; + RicSetAnimation(D_801558DC); + g_Player.D_80072F00[PL_T_INVINCIBLE] = 4; RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0x900, 33), 0); } @@ -1271,7 +1271,7 @@ void func_8015B898(void) { if (func_8015DBB0(0x44)) { return; } - if ((g_Player.unk72 == 0) && (g_Player.padTapped & PAD_CROSS)) { + if ((!g_Player.unk72) && (g_Player.padTapped & PAD_CROSS)) { PLAYER.posY.i.hi -= 4; func_8015DA60(); return; @@ -1295,7 +1295,7 @@ void func_8015B898(void) { RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 0), 0); } if (PLAYER.animFrameDuration < 0) { - func_8015CCC8(0, PLAYER.velocityX); + RicSetCrouch(0, PLAYER.velocityX); } } } diff --git a/src/ric/1FCD0.c b/src/ric/1FCD0.c index 9c7c0d548..f5f5e9a9c 100644 --- a/src/ric/1FCD0.c +++ b/src/ric/1FCD0.c @@ -15,7 +15,7 @@ void func_8015BCD0(void) { PLAYER.animFrameDuration = 2; } if (PLAYER.animFrameDuration < 0) { - func_8015CD98(0); + RicSetStand(0); } break; @@ -27,7 +27,7 @@ void func_8015BCD0(void) { PLAYER.animFrameDuration = 2; } if (PLAYER.animFrameDuration < 0) { - func_8015CD98(0); + RicSetStand(0); } break; @@ -39,7 +39,7 @@ void func_8015BCD0(void) { PLAYER.animFrameDuration = 2; } if (PLAYER.animFrameDuration < 0) { - func_8015CD98(0); + RicSetStand(0); } break; @@ -47,10 +47,10 @@ void func_8015BCD0(void) { case 3: case 5: if (PLAYER.animFrameDuration < 0) { - func_8015CD98(0); + RicSetStand(0); } if (g_Player.unk1C != 0) { - func_8015CD98(0); + RicSetStand(0); } } } @@ -60,10 +60,10 @@ void PlayerStepSlideKick(void) { // (as detected in g_Player.unk44), we will bounce back. if (g_Player.padPressed & PAD_SQUARE && g_Player.unk44 & 0x80) { PLAYER.step = Player_Jump; - func_8015C920(&D_8015555C); + RicSetAnimation(D_8015555C); RicSetSpeedX(FIX(-1.5)); PLAYER.velocityY = 0; - if (g_Player.unk72 == 0) { + if (!g_Player.unk72) { PLAYER.velocityY = FIX(-4.5); } PLAYER.step_s = 2; @@ -78,7 +78,7 @@ void PlayerStepSlideKick(void) { g_CurrentEntity->velocityX /= 2; RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 0), 0); PLAYER.facingLeft = (PLAYER.facingLeft + 1) & 1; - func_8015CCC8(3, PLAYER.velocityX); + RicSetCrouch(3, PLAYER.velocityX); g_api.PlaySfx(SFX_STOMP_SOFT_A); return; } @@ -95,7 +95,7 @@ void PlayerStepSlideKick(void) { (g_Player.pl_vram_flag & 8)) { PLAYER.velocityX /= 2; PLAYER.facingLeft = (PLAYER.facingLeft + 1) & 1; - func_8015C920(&D_80155788); + RicSetAnimation(D_80155788); g_Player.unk44 = 0xA; PLAYER.step_s = 2; PLAYER.step = 4; @@ -109,7 +109,7 @@ void PlayerStepSlideKick(void) { if ((PLAYER.velocityX <= 0x2FFFF) || (g_Player.pl_vram_flag & 4)) { PLAYER.velocityX /= 2; PLAYER.facingLeft = (PLAYER.facingLeft + 1) & 1; - func_8015C920(&D_80155788); + RicSetAnimation(D_80155788); g_Player.unk44 = 0xA; PLAYER.step_s = 2; PLAYER.step = 4; @@ -117,12 +117,12 @@ void PlayerStepSlideKick(void) { } } -void HandleBladeDash(void) { +void RicHandleBladeDash(void) { RicDecelerateX(0x1C00); if (PLAYER.animFrameDuration < 0) { g_Player.unk46 = 0; - func_8015CD98(0); + RicSetStand(0); } else if (PLAYER.animFrameIdx >= 0x12 && !(g_Player.pl_vram_flag & 1)) { g_Player.unk46 = 0; func_8015CF08(); diff --git a/src/ric/202A8.c b/src/ric/202A8.c index 9619c7aaf..28166e1bd 100644 --- a/src/ric/202A8.c +++ b/src/ric/202A8.c @@ -1,7 +1,7 @@ #include "ric.h" -void func_8015C2A8(void) { +void RicHandleHighJump(void) { bool loadAnim = 0; s32 temp; @@ -56,8 +56,8 @@ void func_8015C2A8(void) { } if (loadAnim) { - func_8015C920(&D_80155534); - RicSetPlayerStep(4); + RicSetAnimation(D_80155534); + RicSetStep(PL_S_JUMP); } } @@ -171,7 +171,7 @@ void func_8015C6D4(void) { } } -void RicSetPlayerStep(PlayerSteps step) { +void RicSetStep(int step) { PLAYER.step = step; PLAYER.step_s = 0; } diff --git a/src/ric/20920.c b/src/ric/20920.c index 0566e0b39..449dbd10c 100644 --- a/src/ric/20920.c +++ b/src/ric/20920.c @@ -1,7 +1,7 @@ #include "ric.h" -void func_8015C920(AnimationFrame* unk0) { - g_CurrentEntity->unk4C = unk0; +void RicSetAnimation(AnimationFrame* anim) { + g_CurrentEntity->unk4C = anim; g_CurrentEntity->animFrameDuration = 0; g_CurrentEntity->animFrameIdx = 0; } @@ -33,7 +33,7 @@ static void DecelerateY(s32 speed) { } } -s32 func_8015C9CC(void) { +s32 RicCheckMovement(void) { if (g_Player.unk44 & 2) { return 0; } @@ -74,11 +74,11 @@ void func_8015CAAC(s32 speed) { void func_8015CAD4(s32 arg0, s16 arg1) { if (arg0 == 0) { RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x1500, 44), 0); - if (arg1 >= g_Player.D_80072F00[13]) { - g_Player.D_80072F00[13] = arg1; + if (arg1 >= g_Player.D_80072F00[PL_T_INVINCIBLE]) { + g_Player.D_80072F00[PL_T_INVINCIBLE] = arg1; } - } else if (g_Player.D_80072F00[14] <= arg1) { - g_Player.D_80072F00[14] = arg1; + } else if (g_Player.D_80072F00[PL_T_INVINCIBILITY_CONSUMABLE] <= arg1) { + g_Player.D_80072F00[PL_T_INVINCIBILITY_CONSUMABLE] = arg1; } } @@ -101,7 +101,7 @@ void func_8015CB58(s32 arg0, s32 arg1) { g_Entities[UNK_ENTITY_1].ext.generic.unk7C.S8.unk0 = 1; g_Entities[UNK_ENTITY_1].ext.generic.unk7E.modeU8.unk0 = 0xA; if (arg1 != 0) { - g_Player.D_80072F00[15] = 4; + g_Player.D_80072F00[PL_T_15] = 4; } } @@ -114,7 +114,7 @@ void func_8015CC28(void) { entity->ext.generic.unk7C.U8.unk0 = 0; } -void func_8015CC50() { RicSetPlayerStep(0xF0); } +void RicSetDebug() { RicSetStep(PL_S_DEBUG); } void func_8015CC70(s16 arg0) { PLAYER.step_s = arg0; @@ -128,63 +128,58 @@ void func_8015CC70(s16 arg0) { } } -void func_8015CCC8(s32 arg0, s32 velocityX) { - RicSetPlayerStep(2); - func_8015C920(D_801554C0); +void RicSetCrouch(s32 kind, s32 velocityX) { + RicSetStep(PL_S_CROUCH); + RicSetAnimation(anim_crouch); PLAYER.velocityX = velocityX; PLAYER.velocityY = 0; - if (arg0 == 1) { - PLAYER.unk4C = &D_801554B0; + if (kind == 1) { + PLAYER.unk4C = anim_land_strong_impact; PLAYER.step_s = 4; } - if (arg0 == 2) { - PLAYER.unk4C = &D_801554D0; + if (kind == 2) { + PLAYER.unk4C = anim_crouch_from_stand; PLAYER.step_s = 1; } - if (arg0 == 3) { - PLAYER.unk4C = &D_801554C8; + if (kind == 3) { + PLAYER.unk4C = anim_land_from_run; PLAYER.step_s = 4; } } // Corresponding DRA function is func_8010E570 (much more complex) -void func_8015CD98(s32 velocityX) { +void RicSetStand(s32 velocityX) { PLAYER.velocityX = velocityX; PLAYER.velocityY = 0; g_Player.unk44 = 0; - RicSetPlayerStep(0); -#ifdef VERSION_PC - // I think this is uninitialized and works by accident - g_CurrentEntity = &PLAYER; -#endif - func_8015C920(&D_801553BC); + RicSetStep(PL_S_STAND); + RicSetAnimation(anim_stand); } -void func_8015CDE0(s32 arg0) { - if ((g_Player.D_80072F00[8] != 0) && (g_Player.unk7A == 0)) { - func_8015CE7C(); +void RicSetWalk(s32 arg0) { + if ((g_Player.D_80072F00[PL_T_8] != 0) && (g_Player.unk7A == 0)) { + RicSetRun(); return; - } else { - g_Player.D_80072F00[1] = 8; } - g_Player.D_80072F00[8] = 0xC; - g_Player.D_80072F00[1] = 0xC; + g_Player.D_80072F00[PL_T_CURSE] = 8; + g_Player.D_80072F00[PL_T_8] = 12; + g_Player.D_80072F00[PL_T_CURSE] = 12; g_Player.unk44 = 0; - RicSetPlayerStep(1); - func_8015C920(&D_80155488); - RicSetSpeedX(0x14000); + RicSetStep(PL_S_WALK); + RicSetAnimation(ric_anim_walk); + RicSetSpeedX(FIX(1.25)); PLAYER.velocityY = 0; } -void func_8015CE7C(void) { +void RicSetRun(void) { if (g_Player.unk7A != 0) { - func_8015CDE0(0); + RicSetWalk(0); } else { g_Player.unk44 = 0; - RicSetPlayerStep(0x19); - func_8015C920(&D_80155670); - RicSetSpeedX(0x24000); - g_Player.D_80072F00[11] = 0x28; + RicSetStep(PL_S_RUN); + RicSetAnimation(ric_anim_run); + RicSetSpeedX(FIX(2.25)); + g_Player.D_80072F00[PL_T_RUN] = 40; PLAYER.velocityY = 0; RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x500, 1), 0); } @@ -199,7 +194,7 @@ void func_8015CF08(void) { } if (g_Player.unk50 != 1) { if (g_Player.unk50 != 0x19) { - func_8015C920(&D_80155534); + RicSetAnimation(D_80155534); goto block_6; } goto block_7; @@ -209,29 +204,29 @@ block_6: block_7: g_Player.unk44 = 0x10; } - RicSetPlayerStep(3); + RicSetStep(PL_S_FALL); PLAYER.velocityY = 0x20000; - g_Player.D_80072F00[5] = 8; - g_Player.D_80072F00[6] = 8; - g_Player.D_80072F00[1] = 0; - g_Player.D_80072F00[8] = 0; + g_Player.D_80072F00[PL_T_5] = 8; + g_Player.D_80072F00[PL_T_6] = 8; + g_Player.D_80072F00[PL_T_CURSE] = 0; + g_Player.D_80072F00[PL_T_8] = 0; if (g_Player.unk50 == 0x17) { - g_Player.D_80072F00[6] = 0; - g_Player.D_80072F00[5] = 0; + g_Player.D_80072F00[PL_T_6] = 0; + g_Player.D_80072F00[PL_T_5] = 0; PLAYER.animFrameIdx = 2; PLAYER.animFrameDuration = 0x10; PLAYER.velocityX /= 2; } } -void func_8015D020(void) { - if (g_Player.unk72 != 0) { +void RicSetJump(void) { + if (g_Player.unk72) { func_8015CF08(); return; } - if (func_8015C9CC() != 0 || PLAYER.step == Player_Slide) { - func_8015C920(&D_8015550C); - if (PLAYER.step == Player_RichterSprint) { + if (RicCheckMovement() != 0 || PLAYER.step == Player_Slide) { + RicSetAnimation(D_8015550C); + if (PLAYER.step == PL_S_RUN) { RicSetSpeedX(FIX(2.25)); g_Player.unk44 = 0x10; } else { @@ -239,54 +234,54 @@ void func_8015D020(void) { g_Player.unk44 = 0; } } else { - func_8015C920(&D_801554F0); + RicSetAnimation(D_801554F0); PLAYER.velocityX = 0; g_Player.unk44 = 4; } - RicSetPlayerStep(Player_Jump); - if (D_80154570 != 0) { + RicSetStep(PL_S_JUMP); + if (g_IsPrologueStage) { PLAYER.velocityY = -FIX(4.6875); } else { PLAYER.velocityY = -FIX(5.4375); } } -void DoHighJump(void) { - RicSetPlayerStep(Player_HighJump); +void RicSetHighJump(void) { + RicSetStep(PL_S_HIGHJUMP); PLAYER.velocityX = 0; RicSetSpeedX(FIX(1.25)); PLAYER.velocityY = FIX(-7.5); g_Player.pl_high_jump_timer = 0; - func_8015C920(&D_8015579C); + RicSetAnimation(ric_anim_high_jump); func_8015CC28(); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 45), 0); - g_api.PlaySfx(0x6FB); - g_Player.D_80072F00[12] = 4; - if (g_Player.unk72 != 0) { + g_api.PlaySfx(SFX_GRUNT_C); + g_Player.D_80072F00[PL_T_12] = 4; + if (g_Player.unk72) { PLAYER.velocityY = 0; } } -s32 func_8015D1D0(s16 subWpnId, s16 subWpnUnk6) { +s32 func_8015D1D0(s16 subWpnId, s16 maxParticles) { Entity* entity; - s32 b0MatchCount; - s32 nullObjCount; + s32 nFound; + s32 nEmpty; s32 i; entity = &g_Entities[32]; - for (i = 0, b0MatchCount = 0, nullObjCount = 0; i < 0x10; i++, entity++) { + for (i = 0, nFound = 0, nEmpty = 0; i < 16; i++, entity++) { if (entity->entityId == E_NONE) { - nullObjCount++; + nEmpty++; } if (entity->ext.generic.unkB0 != 0 && entity->ext.generic.unkB0 == subWpnId) { - b0MatchCount++; + nFound++; } - if (b0MatchCount >= subWpnUnk6) { + if (nFound >= maxParticles) { return -1; } } - if (nullObjCount == 0) { + if (nEmpty == 0) { return -1; } return 0; diff --git a/src/ric/21250.c b/src/ric/21250.c index b77b1e831..434d282b1 100644 --- a/src/ric/21250.c +++ b/src/ric/21250.c @@ -22,108 +22,108 @@ s32 func_8015D250(s32 unused_arg) { if ((s16)func_8015FB84(&subweapon, 0, 1) <= 0) { return 3; } - if (g_Player.unk72 != 0) { + if (g_Player.unk72) { return 5; } RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0, subweapon.blueprintNum), 0); - g_Player.D_80072F00[10] = 4; + g_Player.D_80072F00[PL_T_10] = 4; switch (PLAYER.step) { case 25: PLAYER.step = 0; RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 0), 0); - func_8015C920(D_801555E8); + RicSetAnimation(D_801555E8); break; case 0: case 1: case 2: PLAYER.step = 0; - func_8015C920(D_801555E8); + RicSetAnimation(D_801555E8); break; case 3: case 4: PLAYER.step = 4; - func_8015C920(D_80155638); + RicSetAnimation(D_80155638); break; } g_Player.unk46 = 3; PLAYER.step_s = 0x42; - g_Player.D_80072F00[10] = 4; + g_Player.D_80072F00[PL_T_10] = 4; return 0; } -bool func_8015D3CC(void) { +bool RicPrepareAttack(void) { s32 i; s16 poisoned; s32 temp_rand = rand(); - s16 randOf6 = temp_rand % 6; + s16 sfxGrunt = temp_rand % 6; if (func_8015D250(temp_rand / 6) == 0) { - if (randOf6 == 0) { - g_api.PlaySfx(0x6F9); + if (sfxGrunt == 0) { + g_api.PlaySfx(SFX_GRUNT_A); } - if (randOf6 == 1) { - g_api.PlaySfx(0x6FA); + if (sfxGrunt == 1) { + g_api.PlaySfx(SFX_GRUNT_B); } - if (randOf6 == 2) { - g_api.PlaySfx(0x6FB); + if (sfxGrunt == 2) { + g_api.PlaySfx(SFX_GRUNT_C); } - return 1; + return true; } - poisoned = g_Player.D_80072F00[0] != 0; + poisoned = g_Player.D_80072F00[PL_T_POISON] != 0; for (i = 16; i < 31; i++) { DestroyEntity(&g_Entities[i]); } if (RicCreateEntFactoryFromEntity( - g_CurrentEntity, FACTORY(poisoned * 0x100, 10), 0) != NULL) { + g_CurrentEntity, FACTORY(poisoned * 0x100, 10), 0)) { if (poisoned) { g_api.PlaySfx(0x6B5); } else { g_api.PlaySfx(0x706); } - if (randOf6 == 0) { - g_api.PlaySfx(0x6F9); + if (sfxGrunt == 0) { + g_api.PlaySfx(SFX_GRUNT_A); } - if (randOf6 == 1) { - g_api.PlaySfx(0x6FA); + if (sfxGrunt == 1) { + g_api.PlaySfx(SFX_GRUNT_B); } - if (randOf6 == 2) { - g_api.PlaySfx(0x6FB); + if (sfxGrunt == 2) { + g_api.PlaySfx(SFX_GRUNT_C); } switch (PLAYER.step) { default: - return 0; + return false; case Player_Stand: case Player_Walk: PLAYER.step = 0; - func_8015C920(D_80155588); + RicSetAnimation(D_80155588); g_CurrentEntity->velocityX = 0; break; - case Player_RichterSprint: + case PL_S_RUN: PLAYER.step = 0; - func_8015C920(D_80155588); + RicSetAnimation(D_80155588); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 0), 0); break; case Player_Crouch: - func_8015C920(D_801555A8); + RicSetAnimation(D_801555A8); g_CurrentEntity->velocityX = 0; break; case Player_Fall: case Player_Jump: PLAYER.step = 4; - func_8015C920(D_801555C8); + RicSetAnimation(D_801555C8); break; } g_Player.unk46 = 1; PLAYER.step_s = 0x40; - g_Player.D_80072F00[9] = 4; - return 1; + g_Player.D_80072F00[PL_T_9] = 4; + return true; } - return 0; + return false; } bool func_8015D678(void) { @@ -135,7 +135,7 @@ bool func_8015D678(void) { if (subWpnID < 0) { return 0; } - if ((subWpnID == 3) && (g_Player.D_80072F00[3] != 0)) { + if ((subWpnID == 3) && (g_Player.D_80072F00[PL_T_3] != 0)) { return 0; } if ((subWpnID == 6) && (g_unkGraphicsStruct.D_800973FC != 0)) { @@ -160,105 +160,105 @@ bool func_8015D678(void) { PLAYER.velocityX = 0; switch (subWpnID) { case SUBWPN_NONE: - RicSetPlayerStep(Player_FlameWhip); - func_8015C920(D_80155840); + RicSetStep(PL_S_FLAME_WHIP); + RicSetAnimation(ric_anim_flame_whip); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x100, 36), 0); - g_api.PlaySfx(0x6FC); + g_api.PlaySfx(SFX_GRUNT_SUBWPN_A); break; case SUBWPN_DAGGER: - RicSetPlayerStep(Player_ThousandBlades); - func_8015C920(D_80155608); - g_api.PlaySfx(0x6FC); + RicSetStep(PL_S_THROW_DAGGERS); + RicSetAnimation(ric_anim_throw_daggers); + g_api.PlaySfx(SFX_GRUNT_SUBWPN_A); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x200, 33), 0); break; case SUBWPN_AXE: - RicSetPlayerStep(Player_Teleport); - func_8015C920(D_80155658); + RicSetStep(PL_S_STAND_IN_AIR); + RicSetAnimation(ric_anim_stand_in_air); PLAYER.velocityY = FIX(-4.6875); - if (g_Player.unk72 != 0) { + if (g_Player.unk72) { PLAYER.velocityY = 0; } func_8015CC28(); - g_api.PlaySfx(0x6FC); + g_api.PlaySfx(SFX_GRUNT_SUBWPN_A); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x200, 33), 0); break; case SUBWPN_HOLYWATER: - RicSetPlayerStep(Player_Hydrostorm); - func_8015C920(D_801557AC); + RicSetStep(PL_S_HYDROSTORM); + RicSetAnimation(ric_anim_point_finger_up); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x4000, 33), 0); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x4700, 33), 0); - g_api.PlaySfx(0x700); + g_api.PlaySfx(SFX_HYDROSTORM); break; case SUBWPN_REBNDSTONE: case SUBWPN_VIBHUTI: case SUBWPN_AGUNEA: - RicSetPlayerStep(Player_Unk27); - func_8015C920(D_801557AC); + RicSetStep(PL_S_SUBWPN_CRASH); + RicSetAnimation(ric_anim_point_finger_up); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x4000, 33), 0); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x4700, 33), 0); - g_api.PlaySfx(0x6FC); + g_api.PlaySfx(SFX_GRUNT_SUBWPN_A); break; case SUBWPN_BIBLE: case SUBWPN_STOPWATCH: - RicSetPlayerStep(Player_Unk27); - func_8015C920(D_801558E4); + RicSetStep(PL_S_SUBWPN_CRASH); + RicSetAnimation(D_801558E4); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x4000, 33), 0); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x4700, 33), 0); - g_api.PlaySfx(0x6FC); + g_api.PlaySfx(SFX_GRUNT_SUBWPN_A); break; case SUBWPN_CROSS: - RicSetPlayerStep(Player_Teleport); - func_8015C920(D_80155658); + RicSetStep(PL_S_STAND_IN_AIR); + RicSetAnimation(ric_anim_stand_in_air); PLAYER.velocityY = FIX(-4.6875); - if (g_Player.unk72 != 0) { + if (g_Player.unk72) { PLAYER.velocityY = 0; } func_8015CC28(); - g_api.PlaySfx(0x701); + g_api.PlaySfx(SFX_CROSS_CRASH); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0x200, 33), 0); break; } - g_Player.D_80072F00[12] = 4; + g_Player.D_80072F00[PL_T_12] = 4; return 1; } -void func_8015D9B4() { RicSetPlayerStep(22); } +void func_8015D9B4() { RicSetStep(PL_S_22); } void func_8015D9D4(void) { - func_8015C9CC(); - RicSetPlayerStep(0x17); - func_8015C920(&D_80155750); + RicCheckMovement(); + RicSetStep(PL_S_23); + RicSetAnimation(D_80155750); g_CurrentEntity->velocityY = 0; - RicSetSpeedX(0x58000); + RicSetSpeedX(FIX(5.5)); func_8015CC28(); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 25), 0); g_api.PlaySfx(0x707); - g_Player.D_80072F00[12] = 4; + g_Player.D_80072F00[PL_T_12] = 4; } void func_8015DA60(void) { g_Player.unk44 = 0; - RicSetPlayerStep(0x1A); - func_8015C920(&D_8015577C); + RicSetStep(PL_S_26); + RicSetAnimation(D_8015577C); g_CurrentEntity->velocityY = FIX(-2); - RicSetSpeedX(0x58000); + RicSetSpeedX(FIX(5.5)); func_8015CC28(); RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 25), 0); - g_api.PlaySfx(0x6FA); - g_Player.D_80072F00[12] = 4; + g_api.PlaySfx(SFX_GRUNT_B); + g_Player.D_80072F00[PL_T_12] = 4; RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 31), 0); } -void DoBladeDash(void) { - RicSetPlayerStep(0x18); - func_8015C920(&D_801557D8); +void RicSetBladeDash(void) { + RicSetStep(PL_S_BLADEDASH); + RicSetAnimation(ric_anim_blade_dash); g_CurrentEntity->velocityY = 0; RicSetSpeedX(FIX(5.5)); g_Player.unk46 = 5; - g_Player.D_80072F00[12] = 4; + g_Player.D_80072F00[PL_T_12] = 4; RicCreateEntFactoryFromEntity(g_CurrentEntity, FACTORY(0, 26), 0); func_8015CC28(); - g_api.PlaySfx(0x6FB); + g_api.PlaySfx(SFX_GRUNT_C); g_api.PlaySfx(0x707); } @@ -268,7 +268,7 @@ bool func_8015DBB0(s32 arg_flags) { if (arg_flags & 8) { if (g_Player.unk46 == 0) { - func_8015C9CC(); + RicCheckMovement(); } } velYChange = (arg_flags & 0x8000) ? FIX(28.0 / 128) : 0; @@ -307,30 +307,30 @@ bool func_8015DBB0(s32 arg_flags) { case 0: default: if (g_Player.unk44 & 8) { - func_8015CCC8(3, PLAYER.velocityX); + RicSetCrouch(3, PLAYER.velocityX); g_api.PlaySfx(SFX_STOMP_SOFT_A); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0, 0), 0); return true; } - if (PLAYER.velocityY > 0x6E000) { - func_8015CCC8(1, 0); + if (PLAYER.velocityY > FIX(6.875)) { + RicSetCrouch(1, 0); g_api.PlaySfx(SFX_STOMP_SOFT_A); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0, 0), 0); } else if (g_Player.padPressed & (PAD_LEFT | PAD_RIGHT)) { if ((g_Player.unk44 & 0x10) && (g_Player.unk7A == 0)) { - func_8015CE7C(); + RicSetRun(); } else { - func_8015CDE0(0); + RicSetWalk(0); } } else { - func_8015CD98(0); + RicSetStand(0); } return true; - case 1: /* switch 1 */ - if (PLAYER.velocityY > 0x6E000) { - PLAYER.step = Player_RichterCrouch; + case 1: + if (PLAYER.velocityY > FIX(6.875)) { + PLAYER.step = PL_S_CROUCH; PLAYER.unk4C = D_801555A8; g_api.PlaySfx(SFX_STOMP_HARD_B); RicCreateEntFactoryFromEntity( @@ -349,9 +349,9 @@ bool func_8015DBB0(s32 arg_flags) { PLAYER.velocityY = 0; g_Player.unk44 = 0; return true; - case 2: /* switch 1 */ - if (PLAYER.velocityY > 0x6E000) { - PLAYER.step = Player_RichterCrouch; + case 2: + if (PLAYER.velocityY > FIX(6.875)) { + PLAYER.step = PL_S_CROUCH; PLAYER.unk4C = D_80155738; g_api.PlaySfx(SFX_STOMP_SOFT_A); RicCreateEntFactoryFromEntity( @@ -370,8 +370,8 @@ bool func_8015DBB0(s32 arg_flags) { PLAYER.velocityY = 0; g_Player.unk44 = 0; return true; - case 3: /* switch 1 */ - if ((PLAYER.velocityY > 0x6E000) || (g_Player.unk44 & 8)) { + case 3: + if ((PLAYER.velocityY > FIX(6.875)) || (g_Player.unk44 & 8)) { g_api.PlaySfx(SFX_STOMP_SOFT_A); RicCreateEntFactoryFromEntity( g_CurrentEntity, FACTORY(0, 0), 0); @@ -386,7 +386,7 @@ bool func_8015DBB0(s32 arg_flags) { return true; } } else if ((arg_flags & 0x20000) && (g_Player.pl_vram_flag & 1)) { - func_8015CCC8(1, PLAYER.velocityX); + RicSetCrouch(1, PLAYER.velocityX); g_api.PlaySfx(SFX_STOMP_SOFT_A); if ((g_Player.unk5C != 0) && (g_Status.hp < 2)) { func_8015D9B4(); @@ -437,8 +437,8 @@ bool func_8015DBB0(s32 arg_flags) { effects = g_Player.colliders[3].effects & EFFECT_UNK_8000; } if (!effects) { - if (((PLAYER.posX.i.hi <= (u8)-5) || (PLAYER.facingLeft)) && - ((PLAYER.posX.i.hi >= 5) || (!PLAYER.facingLeft)) && + if (((PLAYER.posX.i.hi <= (u8)-5) || PLAYER.facingLeft) && + ((PLAYER.posX.i.hi >= 5) || !PLAYER.facingLeft) && (g_Player.padPressed & PAD_DOWN) && (g_Player.padTapped & PAD_CROSS)) { func_8015D9D4(); @@ -447,15 +447,15 @@ bool func_8015DBB0(s32 arg_flags) { } } if (arg_flags & 0x10 && (g_Player.padTapped & PAD_CROSS)) { - func_8015D020(); + RicSetJump(); return true; } if ((arg_flags & 0x1000) && (g_Player.padTapped & PAD_SQUARE) && - (func_8015D3CC() != 0)) { + RicPrepareAttack()) { return true; } if ((arg_flags & 0x2000) && (g_Player.padPressed & PAD_DOWN)) { - func_8015CCC8(2, 0); + RicSetCrouch(2, 0); return true; } return false; @@ -486,7 +486,7 @@ void func_8015E484(void) { s32 collision = 0; s16 startingPosY = PLAYER.posY.i.hi; - if (g_Player.pl_vram_flag & 1 || D_80175956 != 0 || g_Player.unk78 == 1) { + if (g_Player.pl_vram_flag & 1 || g_IsRicDebugEnter || g_Player.unk78 == 1) { return; } if (PLAYER.posY.i.hi < 0x30) { @@ -1096,11 +1096,11 @@ void func_8015FA5C(s32 arg0) { D_80174FB8 = D_80154674[arg0][3]; } -void func_8015FAB8(Entity* entity) { +void RicSetSubweaponParams(Entity* entity) { u16 attack; SubweaponDef* subwpn = &D_80154688[entity->ext.generic.unkB0]; - if ((g_Player.D_80072F00[13]) != NULL) { + if ((g_Player.D_80072F00[PL_T_INVINCIBLE]) != NULL) { attack = subwpn->attack * 2; } else { attack = subwpn->attack; diff --git a/src/ric/24788.c b/src/ric/24788.c index 27c6f57fe..d2cc996a5 100644 --- a/src/ric/24788.c +++ b/src/ric/24788.c @@ -168,7 +168,7 @@ void func_80160C38(Entity* entity) { entity->hitboxHeight = 9; entity->hitboxWidth = 9; entity->ext.generic.unkB0 = 0x12; - func_8015FAB8(entity); + RicSetSubweaponParams(entity); entity->ext.generic.unk7C.s = entity->hitboxState; entity->step++; } @@ -197,7 +197,7 @@ void func_80160D2C(Entity* self) { self->hitboxHeight = 9; self->hitboxWidth = 9; self->ext.generic.unkB0 = 0x17; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->step++; } @@ -219,7 +219,7 @@ void func_80160D2C(Entity* self) { // created from a blueprint, #24 void BladeDashHelper(Entity* self) { - if (PLAYER.step != Player_RichterBladeDash) { + if (PLAYER.step != PL_S_BLADEDASH) { DestroyEntity(self); } else { self->posX.i.hi = PLAYER.posX.i.hi; @@ -232,7 +232,7 @@ void BladeDashHelper(Entity* self) { self->hitboxOffY = 0; self->hitboxOffX = 0; self->ext.generic.unkB0 = 0x11; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->step++; } if (PLAYER.animFrameIdx >= 19) { @@ -256,7 +256,7 @@ void func_80160F0C(Entity* self) { self->hitboxWidth = 12; self->hitboxHeight = 12; self->ext.generic.unkB0 = 0x16; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->step++; } } diff --git a/src/ric/26C84.c b/src/ric/26C84.c index ad2694ef0..9dfca1a00 100644 --- a/src/ric/26C84.c +++ b/src/ric/26C84.c @@ -10,7 +10,7 @@ void func_80162C84(Entity* entity) { entity->zPriority = PLAYER.zPriority - 8; entity->palette = 0x8149; entity->animSet = ANIMSET_OVL(19); - func_8015C920(D_80154ED4); + RicSetAnimation(D_80154ED4); entity->velocityX = FIX(-1.75); entity->posY.i.hi = 0xBB; entity->posX.i.hi = 0x148; @@ -33,7 +33,7 @@ void func_80162C84(Entity* entity) { entity->ext.generic.unk7E.modeU16++; } if (entity->posX.i.hi < 0xE0) { - func_8015C920(D_80154EF8); + RicSetAnimation(D_80154EF8); entity->velocityX = 0; entity->step++; RicCreateEntFactoryFromEntity(entity, FACTORY(0x400, 0), 0); @@ -179,18 +179,18 @@ void RicEntityPlayerBlinkWhite(Entity* self) { if (dataPtr[7] >= 0x7000) { switch ((u32)dataPtr[7]) { case 0x7000: - if (g_Player.D_80072F00[0] == 0) { + if (g_Player.D_80072F00[PL_T_POISON] == 0) { self->step++; } break; case 0x7001: - if (g_Player.D_80072F00[13] == 0) { + if (g_Player.D_80072F00[PL_T_INVINCIBLE] == 0) { self->step++; } break; case 0x7007: case 0x7002: - if (PLAYER.step != Player_Hit) { + if (PLAYER.step != PL_S_HIT) { self->step++; } break; @@ -664,7 +664,7 @@ void EntityShrinkingPowerUpRing(Entity* self) { } // Entity ID #40. Created by blueprint 47. That factory comes from -// RichterHandleDamage. +// RicHandleHit. void RicEntityHitByIce(Entity* self) { s32 i; Primitive* prim; diff --git a/src/ric/2A060.c b/src/ric/2A060.c index 66b0a19d2..e950cedd7 100644 --- a/src/ric/2A060.c +++ b/src/ric/2A060.c @@ -228,7 +228,7 @@ void RicEntityTeleport(Entity* self) { } // Entity #10, uses blueprint #10. Appears related to poisoning, due to call in -// func_8015D3CC +// RicPrepareAttack void func_80166784(Entity* self) { byte stackpad[40]; s32 sp38; @@ -326,7 +326,7 @@ void func_80166784(Entity* self) { self->ext.et_80166784.unk86 = 0; if (lowerParams == 0) { if (self->step == 1) { - if (PLAYER.step == Player_RichterCrouch) { + if (PLAYER.step == PL_S_CROUCH) { if (PLAYER.facingLeft == 0) { var_s3 = D_80155A40[var_s4]; } else { @@ -348,7 +348,7 @@ void func_80166784(Entity* self) { var_s5 = D_801559E4[var_s4].y; } } else { - if (PLAYER.step == Player_RichterCrouch) { + if (PLAYER.step == PL_S_CROUCH) { var_s3 = D_801559C8[PLAYER.animFrameIdx].x; var_s5 = D_801559C8[PLAYER.animFrameIdx].y; } else { @@ -381,7 +381,7 @@ void func_80166784(Entity* self) { self->hitboxOffX = 0; self->hitboxOffY = 0; self->ext.et_80166784.unkB0 = 0xE; - func_8015FAB8(self); + RicSetSubweaponParams(self); } if (lowerParams == 0) { self->zPriority = PLAYER.zPriority - 2; @@ -723,7 +723,7 @@ void func_8016779C(Entity* entity) { entity->zPriority = PLAYER.zPriority + 2; } - if (PLAYER.step == Player_RichterCrouch) { + if (PLAYER.step == PL_S_CROUCH) { if (PLAYER.facingLeft != 0) { entity->animCurFrame = D_80155CCC[D_80175080]; } else { @@ -899,7 +899,7 @@ void EntityHydroStorm(Entity* self) { return; } self->ext.factory.unkB0 = 0x10; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->flags = FLAG_UNK_08000000 | FLAG_UNK_04000000 | FLAG_HAS_PRIMS | FLAG_UNK_20000; line = (PrimLineG2*)&g_PrimBuf[self->primIndex]; @@ -983,7 +983,7 @@ void EntityHydroStorm(Entity* self) { DestroyEntity(self); break; } - g_Player.D_80072F00[3] = 16; + g_Player.D_80072F00[PL_T_3] = 16; } // Copy of DRA function diff --git a/src/ric/2C4C4.c b/src/ric/2C4C4.c index db1680196..b957bf9ae 100644 --- a/src/ric/2C4C4.c +++ b/src/ric/2C4C4.c @@ -37,7 +37,7 @@ void RicEntityHolyWater(Entity* self) { self->velocityY = -((trigresult * 32 + trigtemp) << 9) >> 8; self->ext.factory.unkB0 = 3; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxWidth = 4; self->hitboxHeight = 4; self->ext.holywater.unk80 = 0x200; @@ -152,7 +152,7 @@ void RicEntityHolyWater(Entity* self) { self->hitboxState = 0; self->posY.i.hi -= 5; } - g_Player.D_80072F00[3] = 2; + g_Player.D_80072F00[PL_T_3] = 2; } // Entity ID #8. Blueprint 7. @@ -214,7 +214,7 @@ void RicEntityHolyWaterFlame(Entity* self) { case 1: if (--self->ext.timer.t == 0) { self->ext.factory.unkB0 = 0xB; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxWidth = 4; self->ext.factory.unk84 = (s16)self->hitboxState; self->posY.i.hi = self->posY.i.hi - 0xA; @@ -303,7 +303,7 @@ void RicEntityHolyWaterFlame(Entity* self) { self->hitboxHeight = temp_v0_2 >> 1; self->hitboxOffY = (-temp_v0_2 >> 1); } - g_Player.D_80072F00[3] = 2; + g_Player.D_80072F00[PL_T_3] = 2; } // Entity 13. Made by blueprint 13. That's from subweapon 12. @@ -330,7 +330,7 @@ void RicEntitySubwpnCrashCross(Entity* self) { self->ext.crashcross.unk80 = 1; self->zPriority = 0xC2; self->ext.factory.unkB0 = 0xC; - func_8015FAB8(self); + RicSetSubweaponParams(self); LoadImage(&D_80155E3C, D_80155DDC); g_api.PlaySfx(0x6DF); g_api.PlaySfx(SFX_TELEPORT_BANG_B); @@ -421,7 +421,7 @@ void RicEntitySubwpnCrashCross(Entity* self) { } prim->drawMode = 0x31; prim->priority = self->zPriority; - g_Player.D_80072F00[3] = 2; + g_Player.D_80072F00[PL_T_3] = 2; return; } @@ -521,7 +521,7 @@ void EntityCrossBoomerang(Entity* self) { self->drawFlags = 4; self->rotZ = 0xC00; self->ext.factory.unkB0 = 4; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxHeight = self->hitboxWidth = 8; self->posY.i.hi -= 8; g_api.PlaySfx(0x69F); @@ -640,7 +640,7 @@ void EntityCrossBoomerang(Entity* self) { temp_a0->y = self->posY.i.hi + g_Tilemap.scrollY.i.hi; self->ext.crossBoomerang.unk80++; self->ext.crossBoomerang.unk80 &= 0x3F; - g_Player.D_80072F00[3] = 2; + g_Player.D_80072F00[PL_T_3] = 2; } void func_80169C10(Entity* entity) { @@ -900,7 +900,7 @@ void EntitySubwpnCrashAgunea(Entity* self) { sp10++; } self->ext.factory.unkB0 = 2; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxWidth = 12; self->hitboxHeight = 12; g_api.PlaySfx(SFX_WEAPON_SWISH_C); @@ -1115,7 +1115,7 @@ void EntitySubwpnCrashAxe(Entity* self) { } while (prim != NULL); } self->ext.factory.unkB0 = 2; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxWidth = 12; self->hitboxHeight = 12; self->ext.axeCrash.unk9C = 16; @@ -1297,7 +1297,7 @@ void RicEntitySubwpnThrownDagger(Entity* self) { // This line is not in the DRA version of dagger. self->ext.factory.unkB0 = 1; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxWidth = 4; self->hitboxHeight = 2; self->hitboxOffX = 4; @@ -1547,7 +1547,7 @@ void RicEntitySubwpnReboundStone(Entity* self) { self->ext.reboundStone.lifeTimer = 0x40; self->ext.factory.unkB0 = 7; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxWidth = 4; self->hitboxHeight = 4; g_api.CheckCollision(self->posX.i.hi, self->posY.i.hi, &collider, 0); @@ -1798,7 +1798,7 @@ void RicEntitySubwpnThrownVibhuti(Entity* self) { } self->flags = FLAG_UNK_08000000 | FLAG_HAS_PRIMS; self->ext.factory.unkB0 = 8; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxWidth = self->hitboxHeight = 4; self->posY.i.hi -= 15; selfX = self->posX.i.hi; @@ -1969,7 +1969,7 @@ void RicEntitySubwpnAgunea(Entity* self) { FLAG_UNK_08000000 | FLAG_UNK_04000000 | FLAG_HAS_PRIMS; self->facingLeft = PLAYER.facingLeft; self->ext.factory.unkB0 = 9; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxHeight = 4; self->hitboxWidth = 4; self->hitboxOffX = 4; @@ -2296,7 +2296,7 @@ void func_8016D328(Entity* entity) { entity->facingLeft = entity->ext.generic.unk8C.entityPtr->ext .generic.unk8C.modeU16.unk0; entity->ext.generic.unkB0 = 0x18; - func_8015FAB8(entity); + RicSetSubweaponParams(entity); entity->unk5A = 0x79; entity->animSet = ANIMSET_DRA(14); entity->palette = 0x819E; @@ -2423,7 +2423,7 @@ void func_8016D920(Entity* entity) { case 0: entity->flags = FLAG_UNK_04000000; entity->ext.generic.unkB0 = 0x19; - func_8015FAB8(entity); + RicSetSubweaponParams(entity); entity->hitboxWidth = 4; entity->hitboxHeight = 4; entity->step++; diff --git a/src/ric/319C4.c b/src/ric/319C4.c index 7811ebe56..30a68d502 100644 --- a/src/ric/319C4.c +++ b/src/ric/319C4.c @@ -211,7 +211,7 @@ void func_8016DF74(Entity* self) { self->ext.et_8016DF74.unk84 += 0x20; if (self->ext.et_8016DF74.unk84 > 0x120) { self->ext.factory.unkB0 = 0x1D; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->posX.val = FIX(128.0); self->posY.val = FIX(128.0); self->hitboxWidth = 0x80; @@ -356,7 +356,7 @@ void EntityBiblePageBeam(Entity* self) { case 1: if (++self->ext.et_8016E46C.unk80 >= 0x3C) { self->ext.et_8016E46C.unkB0 = 0x11; - func_8015FAB8(self); + RicSetSubweaponParams(self); g_api.PlaySfx(SFX_WEAPON_APPEAR); g_api.PlaySfx(SFX_TELEPORT_BANG_A); self->step++; @@ -1067,7 +1067,7 @@ void func_80170548(Entity* entity) { case 0: entity->flags = FLAG_UNK_04000000; entity->ext.generic.unkB0 = 0x1E; - func_8015FAB8(entity); + RicSetSubweaponParams(entity); entity->hitboxWidth = 8; entity->hitboxHeight = 8; entity->step++; @@ -1349,7 +1349,7 @@ void EntityAguneaCircle(Entity* self) { prim = prim->next; } self->ext.et_80170F64.unkB0 = 0x1A; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->step++; break; case 1: @@ -1591,7 +1591,7 @@ void EntityStopwatch(Entity* self) { self->ext.et_801719A4.unk94 = 0; } self->ext.et_801719A4.unkB0 = 6; - func_8015FAB8(self); + RicSetSubweaponParams(self); g_api.PlaySfx(0x6AD); if (self->ext.et_801719A4.unk94 < 2) { g_unkGraphicsStruct.D_800973FC = 1; @@ -2035,7 +2035,7 @@ void RicEntitySubwpnBible(Entity* self) { prim->drawMode = 0x108; self->ext.et_BibleSubwpn.unk84 = self->facingLeft ? 0x20 : -0x20; self->ext.et_BibleSubwpn.unkB0 = 5; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxWidth = 6; self->hitboxHeight = 6; self->step++; @@ -2159,7 +2159,7 @@ void RicEntityGiantSpinningCross(Entity* self) { prim = prim->next; } self->ext.giantcross.unkB0 = 0xD; - func_8015FAB8(self); + RicSetSubweaponParams(self); self->hitboxHeight = 0x50; self->hitboxWidth = 0xC; self->posY.i.hi = 0x160; diff --git a/src/ric/bss.c b/src/ric/bss.c index 3da543364..4ab5db57b 100644 --- a/src/ric/bss.c +++ b/src/ric/bss.c @@ -40,9 +40,9 @@ u32 D_801758D0[4]; ButtonComboState g_bladeDashButtons; ButtonComboState D_801758E4; u16 D_801758E6[52]; -u16 D_80175950; -u16 D_80175952; -u16 D_80175954; -u16 D_80175956; +u16 g_RicDebugCurFrame; +u16 g_RicDebugDrawFlags; +u16 g_RicDebugPalette; +u16 g_IsRicDebugEnter; u32 D_80175958[32]; u32 D_801759D8[32]; diff --git a/src/ric/d_18568.c b/src/ric/d_18568.c index 4c61413e5..c5ea1d8f0 100644 --- a/src/ric/d_18568.c +++ b/src/ric/d_18568.c @@ -1,50 +1,30 @@ #include "ric.h" s16 D_80154568[4] = {0, -8, -16, 0}; - -s32 D_80154570 = 0; - +s32 g_IsPrologueStage = 0; s16 D_80154574[] = {0x812F, 0x812F, 0x8120, 0x812F, 0x812F, 0x8120, 0x812F, 0x812F, 0x8120, 0x812F, 0x812E, 0x812F, 0x812E, 0x812F, 0x8120, 0x0000}; - s16 D_80154594[] = {0x8120, 0x812B, 0x812C, 0x812D}; - s32 D_8015459C = 0; - RECT D_801545A0 = {512, 256, 32, 80}; - s16 D_801545A8 = 0; - s16 D_801545AA = 0; - s16 D_801545AC = 0; - u8 D_801545B0[] = {10, 8, 8, 6, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 255, 255, 0, 0}; - u8 D_801545C4[] = {4, 4, 4, 4, 6, 6, 6, 6, 8, 8, 16, 16, 16, 16, 16, 16}; - u8 D_801545D4[] = {8, 12, 16, 20, 24, 28, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}; - Point16 D_801545E4[] = {0, -16, 0, -16, 4, -16, -4, -16}; - Point16 D_801545F4[] = {0, 28, 0, 24, 4, 24, -4, 24}; - Point16 D_80154604[] = {7, 23, 7, 16, 7, 8, 7, 0, 7, -8, 7, -8, 7, -15, -7, 23, -7, 16, -7, 8, -7, 0, -7, -8, -7, -8, -7, -15}; - u16 D_8015463C[] = {-16, -16, -16, -16}; - u16 D_80154644[] = {28, 24, 24, 24}; - u16 D_8015464C[] = {23, 16, 8, 0, -8, -8, -15, 0}; - u16 D_8015465C[] = {0, 0, 0, 0}; - u16 D_80154664[] = {23, 16, 8, 4, 4, 1, 1, 0}; - u8 D_80154674[][4] = {{16, 127, 63, 0}, {16, 127, 0, 0}, {16, 63, 63, 127}, diff --git a/src/ric/d_188F4.c b/src/ric/d_188F4.c index d4f2e297a..8d5ca405c 100644 --- a/src/ric/d_188F4.c +++ b/src/ric/d_188F4.c @@ -7,8 +7,10 @@ u8 D_801548F4[6][8] = { 0x78, 0x38, 0x80, 0x38, 0x70, 0x38, 0x78, 0x38, 0x77, 0x40, 0x78, 0x40}; AnimationFrame D_80154924[] = { - 0x0002, 0x0001, 0x0002, 0x0002, 0x0002, 0x0003, 0x0002, - 0x0004, 0x0002, 0x0005, 0x0002, 0x0006, 0x0002, 0x0007, - 0x0002, 0x0008, 0x0002, 0x0009, 0x0002, 0x000A, 0x0002, - 0x000B, 0x0002, 0x000C, 0x0002, 0x000D, 0xFFFF, 0x0000, -}; + {2, FRAME(1, 0)}, {2, FRAME(2, 0)}, + {2, FRAME(3, 0)}, {2, FRAME(4, 0)}, + {2, FRAME(5, 0)}, {2, FRAME(6, 0)}, + {2, FRAME(7, 0)}, {2, FRAME(8, 0)}, + {2, FRAME(9, 0)}, {2, FRAME(10, 0)}, + {2, FRAME(11, 0)}, {2, FRAME(12, 0)}, + {2, FRAME(13, 0)}, A_END}; diff --git a/src/ric/d_18C40.c b/src/ric/d_18C40.c index aca0aa806..e997ea028 100644 --- a/src/ric/d_18C40.c +++ b/src/ric/d_18C40.c @@ -2,81 +2,68 @@ u8 D_80154C40[] = {0x30, 0x3F, 0x20, 0x2F, 0x10, 0x1E, 0x10, 0x3F, 0x1F, 0x1F, 0x30, 0x30, 0x10, 0x2F, 0x00, 0x00}; - u16 D_80154C50[] = {0x0000, 0xFFFC, 0xFFF8, 0xFFF4, 0xFFF0, 0xFFEC}; - s32 D_80154C5C[] = {0xFFFFD000, 0xFFFFC000, 0xFFFFA000, 0xFFFF8000, 0xFFFF6000, 0xFFFF4000}; - u16 D_80154C74[] = {0x0030, 0x0040, 0x0050, 0x0060, 0x0070, 0x0080}; - AnimationFrame D_80154C80[] = { 0x0001, 0x0001, 0x0001, 0x0002, 0x0001, 0x0003, 0x0001, 0x0004, 0x0001, 0x0005, 0x0001, 0x0006, 0x0001, 0x0007, 0x0001, 0x0008, 0x0001, 0x0009, 0x0001, 0x000A, 0x0001, 0x000B, 0x0001, 0x000C, 0x0001, 0x000D, 0x0001, 0x000E, 0x0001, 0x000F, 0x0001, 0x0010, 0x0001, 0x0011, 0x0001, 0x0012, 0x0001, 0x0013, 0x0001, 0x0014, 0x0001, 0x0015, 0x0001, 0x0016, 0x0001, - 0x0017, 0x0001, 0x0018, 0xFFFF, 0x0000, -}; - + 0x0017, 0x0001, 0x0018, A_END}; u8 D_80154CE4[] = {0x02, 0x09, 0x03, 0x0A, 0x01, 0x08, 0x04, 0x0B, 0x00, 0x07, 0x05, 0x0C, 0x06, 0x0D, 0x00, 0x00}; - u8 D_80154CF4[] = {0x02, 0x09, 0x03, 0x0A, 0x04, 0x0B, 0x05, 0x0C, 0x06, 0x0D, 0x00, 0x00}; - unkStr_8011E4BC D_80154D00 = { 0x08, 0xC0, 0x60, 0x00, 0x01, 0x01, 0x0004, 0x0033, 0x0003, 0x08800000}; - unkStr_8011E4BC D_80154D10 = { 0x10, 0x7F, 0x7F, 0x7F, 0x01, 0x01, 0x0002, 0x0033, 0x0001, 0x0C800000}; - unkStr_8011E4BC D_80154D20 = { 0x08, 0x7F, 0x7F, 0x7F, 0x02, 0x02, 0x0002, 0x0033, 0x0000, 0x08800000}; - unkStr_8011E4BC D_80154D30 = { 0x06, 0x7F, 0xFF, 0xFF, 0x01, 0x01, 0x0004, 0x0073, 0x0003, 0x08800000}; - unkStr_8011E4BC D_80154D40 = { 0x0C, 0xC0, 0x60, 0x00, 0x01, 0x01, 0x0004, 0x0033, 0x0003, 0x08800000}; - unkStr_8011E4BC D_80154D50 = { 0x0C, 0x7F, 0x00, 0x00, 0x03, 0x03, 0x0002, 0x0002, 0x0004, 0x0C800000}; - unkStr_8011E4BC D_80154D60 = { 0x08, 0x1F, 0x1F, 0x7F, 0x01, 0x01, 0x0004, 0x0033, 0x0006, 0x0C800000}; - unkStr_8011E4BC D_80154D70 = { 0x14, 0x7F, 0x7F, 0xC0, 0x01, 0x01, 0xFFFE, 0x0033, 0x0007, 0x0C800000}; - unkStr_8011E4BC D_80154D80 = { 0x06, 0xC0, 0xC0, 0xC0, 0x02, 0x02, 0x0002, 0x007B, 0x0008, 0x08800000}; - unkStr_8011E4BC D_80154D90 = { 0x10, 0x7F, 0x7F, 0x7F, 0x01, 0x01, 0x0002, 0x0033, 0x0009, 0x08800000}; - unkStr_8011E4BC* D_80154DA0[] = { &D_80154D00, &D_80154D10, &D_80154D20, &D_80154D30, &D_80154D40, &D_80154D50, &D_80154D60, &D_80154D70, &D_80154D80, &D_80154D90}; - AnimationFrame D_80154DC8[] = { - 0x0002, 0x0001, 0x0002, 0x0002, 0x0002, 0x0003, 0x0002, 0x0004, - 0x0002, 0x0005, 0x0002, 0x0004, 0x0002, 0x0003, 0x0002, 0x0004, - 0x0002, 0x0003, 0x0002, 0x0004, 0x0002, 0x0005, 0x0001, 0x0006, - 0x0001, 0x0007, 0x0001, 0x0008, 0xFFFF, 0x0000, -}; - + {2, FRAME(1, 0)}, {2, FRAME(2, 0)}, {2, FRAME(3, 0)}, + {2, FRAME(4, 0)}, {2, FRAME(5, 0)}, {2, FRAME(4, 0)}, + {2, FRAME(3, 0)}, {2, FRAME(4, 0)}, {2, FRAME(3, 0)}, + {2, FRAME(4, 0)}, {2, FRAME(5, 0)}, {1, FRAME(6, 0)}, + {1, FRAME(7, 0)}, {1, FRAME(8, 0)}, A_END}; AnimationFrame D_80154E04[] = { - 0x0001, 0x0009, 0x0002, 0x000A, 0x0002, 0x000B, 0x0002, 0x000C, 0x0002, - 0x000D, 0x0002, 0x000E, 0x0002, 0x000F, 0x0002, 0x0010, 0x0002, 0x0011, - 0x0002, 0x0012, 0x0003, 0x0013, 0x0004, 0x0014, 0xFFFF, 0x0000, -}; - + {1, FRAME(9, 0)}, + {2, FRAME(10, 0)}, + {2, FRAME(11, 0)}, + {2, FRAME(12, 0)}, + {2, FRAME(13, 0)}, + {2, FRAME(14, 0)}, + {2, FRAME(15, 0)}, + {2, FRAME(16, 0)}, + {2, FRAME(17, 0)}, + {2, FRAME(18, 0)}, + {3, FRAME(19, 0)}, + {4, FRAME(20, 0)}, + A_END}; AnimationFrame D_80154E38[] = { - 0x0002, 0x0001, 0x0002, 0x0002, 0x0002, 0x0003, 0x0002, 0x0004, 0x0002, - 0x0005, 0x0002, 0x0006, 0x0002, 0x0007, 0x0002, 0x0008, 0xFFFF, 0x0000, -}; - + {2, FRAME(1, 0)}, {2, FRAME(2, 0)}, {2, FRAME(3, 0)}, + {2, FRAME(4, 0)}, {2, FRAME(5, 0)}, {2, FRAME(6, 0)}, + {2, FRAME(7, 0)}, {2, FRAME(8, 0)}, A_END}; unkStr80154E5C D_80154E5C[] = { { 0xFFC0, @@ -124,49 +111,26 @@ unkStr80154E5C D_80154E5C[] = { }, }; -s16 D_80154EAC[] = { - 0x016E, - 0x0161, - 0x0160, - 0x0162, -}; - -s32 D_80154EB4[] = { - 0x0001AAAA, - 0xFFFE5556, - 0x00005555, - 0xFFFF2AAB, -}; - -s32 D_80154EC4[] = { - 0xFFFE0000, - 0xFFFE5556, - 0xFFFD0000, - 0xFFFDAAAB, -}; - -s32 D_80154ED4[] = { - 0x00010004, 0x00020004, 0x00030004, 0x00040004, 0x00050004, - 0x00060004, 0x00070004, 0x00080004, 0x00000000, -}; - +s16 D_80154EAC[] = {0x016E, 0x0161, 0x0160, 0x0162}; +s32 D_80154EB4[] = {0x0001AAAA, 0xFFFE5556, 0x00005555, 0xFFFF2AAB}; +s32 D_80154EC4[] = {0xFFFE0000, 0xFFFE5556, 0xFFFD0000, 0xFFFDAAAB}; +AnimationFrame D_80154ED4[] = { + {4, FRAME(1, 0)}, {4, FRAME(2, 0)}, {4, FRAME(3, 0)}, + {4, FRAME(4, 0)}, {4, FRAME(5, 0)}, {4, FRAME(6, 0)}, + {4, FRAME(7, 0)}, {4, FRAME(8, 0)}, A_LOOP_AT(0)}; AnimationFrame D_80154EF8[] = { - 0x0008, 0x0009, 0x0008, 0x000D, 0x0040, 0x000A, 0x0002, 0x000B, 0x0002, - 0x000C, 0x0006, 0x000D, 0x0007, 0x000E, 0x0006, 0x000F, 0x0005, 0x000E, - 0x0004, 0x000D, 0x0003, 0x000F, 0x0003, 0x000E, 0x0003, 0x000D, 0x0003, - 0x000E, 0x0003, 0x000F, 0x0003, 0x000E, 0x0003, 0x000D, 0x0004, 0x000E, - 0x0005, 0x000F, 0x0006, 0x000E, 0x0007, 0x000D, 0x0030, 0x000E, 0x000C, - 0x0009, 0x000D, 0x0010, 0x0008, 0x0011, 0x000C, 0x0012, 0x00B0, 0x0013, - 0x000A, 0x0014, 0x000A, 0x0015, 0x000A, 0x0016, 0x0030, 0x0017, 0x00D0, - 0x0018, 0xFFFF, 0x0000, -}; - -s32 D_80154F7C[] = { - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, -}; - + {0x08, FRAME(0x09, 0)}, {0x08, FRAME(0x0D, 0)}, {0x40, FRAME(0x0A, 0)}, + {0x02, FRAME(0x0B, 0)}, {0x02, FRAME(0x0C, 0)}, {0x06, FRAME(0x0D, 0)}, + {0x07, FRAME(0x0E, 0)}, {0x06, FRAME(0x0F, 0)}, {0x05, FRAME(0x0E, 0)}, + {0x04, FRAME(0x0D, 0)}, {0x03, FRAME(0x0F, 0)}, {0x03, FRAME(0x0E, 0)}, + {0x03, FRAME(0x0D, 0)}, {0x03, FRAME(0x0E, 0)}, {0x03, FRAME(0x0F, 0)}, + {0x03, FRAME(0x0E, 0)}, {0x03, FRAME(0x0D, 0)}, {0x04, FRAME(0x0E, 0)}, + {0x05, FRAME(0x0F, 0)}, {0x06, FRAME(0x0E, 0)}, {0x07, FRAME(0x0D, 0)}, + {0x30, FRAME(0x0E, 0)}, {0x0C, FRAME(0x09, 0)}, {0x0D, FRAME(0x10, 0)}, + {0x08, FRAME(0x11, 0)}, {0x0C, FRAME(0x12, 0)}, {0xB0, FRAME(0x13, 0)}, + {0x0A, FRAME(0x14, 0)}, {0x0A, FRAME(0x15, 0)}, {0x0A, FRAME(0x16, 0)}, + {0x30, FRAME(0x17, 0)}, {0xD0, FRAME(0x18, 0)}, A_END}; +s32 D_80154F7C[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; s16 D_80154FBC[][10] = { 0x0000, 0x0000, 0x0000, 0x015F, 0x0100, 0x0100, 0x0100, 0x0060, 0x0031, 0x0200, 0x0000, 0x0002, 0x0006, 0x015F, 0x0100, 0x0100, 0x0100, 0x0040, @@ -194,149 +158,34 @@ s16 D_80154FBC[][10] = { 0x0000, 0x0031, 0x0200, 0x0000, 0x0000, 0x0000, 0x015F, 0x00C0, 0x00C0, 0x0100, 0x0010, 0x0031, 0x0200, 0x0008, 0x0000, 0x0008, 0x0165, 0x0100, 0x0100, 0x0100, 0x7007, 0x0051, 0x0200, 0x0000, 0x0000, 0x0000, 0x0168, - 0x7100, 0x7100, 0x0200, 0x7007, 0x0031, 0x0200, -}; - + 0x7100, 0x7100, 0x0200, 0x7007, 0x0031, 0x0200}; s16 D_8015519C[][6] = { - 0x0000, 0x0000, - - 0x0100, 0x0100, - - 0x0100, 0x0100, - - 0x0500, 0x0A00, - - 0x0100, 0x0100, - - 0x0100, 0x0000, - - 0x0000, 0x0000, - - 0x0100, 0x7000, - - 0x7000, 0x0200, - - 0x0000, 0x0000, - - 0x7100, 0x7100, - - 0x0100, 0x1000, - - 0x0000, 0x0000, - - 0x7100, 0x0100, - - 0x7000, 0x0800, - - 0x0000, 0x0000, - - 0x0100, 0x7100, - - 0x0100, 0x0400, - - 0x0500, 0x0A00, - - 0x0100, 0x0100, - - 0x0100, 0x0100, - - 0x0500, 0x0A00, - - 0x0100, 0x0200, - - 0x7100, 0x0100, -}; - -Point16 D_801551FC = { - 0xFFFE, - 0xFFE8, -}; - -Point16 D_80155200 = { - 0x0000, - 0xFFF8, -}; - -Point16 D_80155204 = { - 0x0002, - 0x0008, -}; - -Point16 D_80155208 = { - 0x0000, - 0x0018, -}; - -Point16 D_8015520C = { - 0x0006, - 0xFFF4, -}; - -Point16 D_80155210 = { - 0x0008, - 0x0000, -}; - -Point16 D_80155214 = { - 0x0007, - 0x000C, -}; - -Point16 D_80155218 = { - 0xFFF8, - 0xFFF4, -}; - -Point16 D_8015521C = { - 0xFFF7, - 0x0000, -}; - -Point16 D_80155220 = { - 0xFFF9, - 0x000C, -}; - -Point16 D_80155224 = { - 0xFFF2, - 0xFFFA, -}; - -Point16 D_80155228 = { - 0xFFF1, - 0x0007, -}; - -Point16 D_8015522C = { - 0x000D, - 0xFFF9, -}; - -Point16 D_80155230 = { - 0x0010, - 0x0008, -}; - -Point16 D_80155234 = { - 0xFFF9, - 0xFFEA, -}; - -Point16 D_80155238 = { - 0x0006, - 0xFFEB, -}; - -Point16 D_8015523C = { - 0xFFF8, - 0x0015, -}; - -Point16 D_80155240 = { - 0x0007, - 0x0016, -}; - + {0x0000, 0x0000, 0x0100, 0x0100, 0x0100, 0x0100}, + {0x0500, 0x0A00, 0x0100, 0x0100, 0x0100, 0x0000}, + {0x0000, 0x0000, 0x0100, 0x7000, 0x7000, 0x0200}, + {0x0000, 0x0000, 0x7100, 0x7100, 0x0100, 0x1000}, + {0x0000, 0x0000, 0x7100, 0x0100, 0x7000, 0x0800}, + {0x0000, 0x0000, 0x0100, 0x7100, 0x0100, 0x0400}, + {0x0500, 0x0A00, 0x0100, 0x0100, 0x0100, 0x0100}, + {0x0500, 0x0A00, 0x0100, 0x0200, 0x7100, 0x0100}}; +Point16 D_801551FC = {0xFFFE, 0xFFE8}; +Point16 D_80155200 = {0x0000, 0xFFF8}; +Point16 D_80155204 = {0x0002, 0x0008}; +Point16 D_80155208 = {0x0000, 0x0018}; +Point16 D_8015520C = {0x0006, 0xFFF4}; +Point16 D_80155210 = {0x0008, 0x0000}; +Point16 D_80155214 = {0x0007, 0x000C}; +Point16 D_80155218 = {0xFFF8, 0xFFF4}; +Point16 D_8015521C = {0xFFF7, 0x0000}; +Point16 D_80155220 = {0xFFF9, 0x000C}; +Point16 D_80155224 = {0xFFF2, 0xFFFA}; +Point16 D_80155228 = {0xFFF1, 0x0007}; +Point16 D_8015522C = {0x000D, 0xFFF9}; +Point16 D_80155230 = {0x0010, 0x0008}; +Point16 D_80155234 = {0xFFF9, 0xFFEA}; +Point16 D_80155238 = {0x0006, 0xFFEB}; +Point16 D_8015523C = {0xFFF8, 0x0015}; +Point16 D_80155240 = {0x0007, 0x0016}; Point16* D_80155244[] = { &D_801551FC, &D_8015520C, &D_80155200, &D_8015520C, &D_80155210, &D_80155200, &D_80155210, &D_80155204, &D_80155200, &D_80155210, @@ -354,50 +203,66 @@ Point16* D_80155244[] = { &D_8015520C, &D_80155228, &D_80155220, &D_8015523C, &D_80155230, &D_80155240, &D_80155214, }; - -s16 D_80155364[] = { - 0x0194, - 0x0199, -}; - +s16 D_80155364[] = {0x0194, 0x0199}; s32 D_80155368[] = {255, 255, 255, 127, 127, 63, 127, 63, 127}; - -AnimationFrame* D_8015538C[] = { - D_801553BC, - D_801553BC, -}; - -AnimationFrame D_80155394[2] = { - 0x0040, - 0x0226, -}; - +AnimationFrame* D_8015538C[] = {anim_stand, anim_stand}; +AnimationFrame D_80155394[] = {{64, FRAME(38, 2)}, A_LOOP_AT(0)}; AnimationFrame D_8015539C[] = { - 0x0002, 0x0237, 0x0001, 0x0290, 0x0002, 0x0291, 0x0003, 0x0290, - 0x0004, 0x0291, 0x000C, 0x0290, 0x0004, 0x0210, 0xFFFE, 0x0001, -}; - -AnimationFrame D_801553BC[] = { - 0x0007, 0x0201, 0x0007, 0x0202, 0x0007, 0x0203, 0x0007, 0x0202, 0x0007, - 0x0201, 0x0007, 0x0202, 0x0007, 0x0203, 0x0007, 0x0202, 0x0007, 0x0201, - 0x0007, 0x0202, 0x0007, 0x0203, 0x0007, 0x0202, 0x0007, 0x0201, 0x0007, - 0x0202, 0x0007, 0x0203, 0x0007, 0x0202, 0x0007, 0x0201, 0x0007, 0x0202, - 0x0007, 0x0203, 0x0007, 0x0202, 0x0008, 0x0201, 0x0008, 0x0202, 0x0008, - 0x0203, 0x0008, 0x0202, 0x0009, 0x0201, 0x0009, 0x0202, 0x0009, 0x0203, - 0x0009, 0x0202, 0x000A, 0x0201, 0x000A, 0x0202, 0x000A, 0x0203, 0x000A, - 0x0202, 0x000B, 0x0201, 0x000B, 0x0202, 0x000B, 0x0203, 0x000B, 0x0202, - 0x000C, 0x0201, 0x000C, 0x0202, 0x000D, 0x0203, 0x000D, 0x0202, 0x000F, - 0x0201, 0x000F, 0x0202, 0x000F, 0x0203, 0x0080, 0x0202, 0x0004, 0x0204, - 0x0004, 0x0205, 0x0004, 0x0206, 0x0040, 0x0207, 0xFFFF, 0x0000, -}; - -AnimationFrame D_80155480[2] = { - 0x0040, - 0x0207, -}; - -AnimationFrame D_80155488[] = { - 0x0003, 0x0208, 0x0006, 0x0209, 0x0005, 0x020A, 0x0006, - 0x020B, 0x0007, 0x020C, 0x0006, 0x020D, 0x0005, 0x020E, - 0x0006, 0x020F, 0x0004, 0x0208, 0x0000, 0x0000, -}; + {2, FRAME(55, 2)}, {1, FRAME(144, 2)}, {2, FRAME(145, 2)}, + {3, FRAME(144, 2)}, {4, FRAME(145, 2)}, {12, FRAME(144, 2)}, + {4, FRAME(16, 2)}, A_JUMP_AT(1)}; +AnimationFrame anim_stand[] = { + {7, FRAME(1, 2)}, + {7, FRAME(2, 2)}, + {7, FRAME(3, 2)}, + {7, FRAME(2, 2)}, + {7, FRAME(1, 2)}, + {7, FRAME(2, 2)}, + {7, FRAME(3, 2)}, + {7, FRAME(2, 2)}, + {7, FRAME(1, 2)}, + {7, FRAME(2, 2)}, + {7, FRAME(3, 2)}, + {7, FRAME(2, 2)}, + {7, FRAME(1, 2)}, + {7, FRAME(2, 2)}, + {7, FRAME(3, 2)}, + {7, FRAME(2, 2)}, + {7, FRAME(1, 2)}, + {7, FRAME(2, 2)}, + {7, FRAME(3, 2)}, + {7, FRAME(2, 2)}, + {8, FRAME(1, 2)}, + {8, FRAME(2, 2)}, + {8, FRAME(3, 2)}, + {8, FRAME(2, 2)}, + {9, FRAME(1, 2)}, + {9, FRAME(2, 2)}, + {9, FRAME(3, 2)}, + {9, FRAME(2, 2)}, + {10, FRAME(1, 2)}, + {10, FRAME(2, 2)}, + {10, FRAME(3, 2)}, + {10, FRAME(2, 2)}, + {11, FRAME(1, 2)}, + {11, FRAME(2, 2)}, + {11, FRAME(3, 2)}, + {11, FRAME(2, 2)}, + {12, FRAME(1, 2)}, + {12, FRAME(2, 2)}, + {13, FRAME(3, 2)}, + {13, FRAME(2, 2)}, + {15, FRAME(1, 2)}, + {15, FRAME(2, 2)}, + {15, FRAME(3, 2)}, + {128, FRAME(2, 2)}, + {4, FRAME(4, 2)}, + {4, FRAME(5, 2)}, + {4, FRAME(6, 2)}, + {64, FRAME(7, 2)}, + A_END}; +AnimationFrame D_80155480[] = {{64, FRAME(7, 2)}, A_LOOP_AT(0)}; +AnimationFrame ric_anim_walk[] = { + {3, FRAME(8, 2)}, {6, FRAME(9, 2)}, {5, FRAME(10, 2)}, {6, FRAME(11, 2)}, + {7, FRAME(12, 2)}, {6, FRAME(13, 2)}, {5, FRAME(14, 2)}, {6, FRAME(15, 2)}, + {4, FRAME(8, 2)}, A_LOOP_AT(0)}; diff --git a/src/ric/d_194B0.c b/src/ric/d_194B0.c index 950ef8806..5e10530f4 100644 --- a/src/ric/d_194B0.c +++ b/src/ric/d_194B0.c @@ -1,156 +1,114 @@ #include "ric.h" -AnimationFrame D_801554B0[] = { - 0x0001, 0x0410, 0x0001, 0x0611, 0x0010, 0x0612, 0xFFFF, 0x0000, -}; - -AnimationFrame D_801554C0[] = {0x0040, 0x0612, 0xFFFF, 0x0000}; - -AnimationFrame D_801554C8[] = {0x0010, 0x0698, 0xFFFF, 0x0000}; - -AnimationFrame D_801554D0[] = { - 0x0001, 0x0410, 0x0001, 0x0611, 0x0001, 0x0612, 0xFFFF, 0x0000}; - +AnimationFrame anim_land_strong_impact[] = { + 0x0001, 0x0410, 0x0001, 0x0611, 0x0010, 0x0612, A_END}; +AnimationFrame anim_crouch[] = {{64, FRAME(18, 6)}, A_END}; +AnimationFrame anim_land_from_run[] = {{16, FRAME(152, 6)}, A_END}; +AnimationFrame anim_crouch_from_stand[] = { + 0x0001, 0x0410, 0x0001, 0x0611, 0x0001, 0x0612, A_END}; AnimationFrame D_801554E0[] = { - 0x0001, 0x0612, 0x0001, 0x0611, 0x0001, 0x0410, 0xFFFF, 0x0000}; - + 0x0001, 0x0612, 0x0001, 0x0611, 0x0001, 0x0410, A_END}; AnimationFrame D_801554F0[] = { 0x0008, 0x0813, 0x0003, 0x0415, 0x0005, 0x0416, 0x0003, - 0x0415, 0x0006, 0x0417, 0x0050, 0x0418, 0xFFFF, 0x0000}; - + 0x0415, 0x0006, 0x0417, 0x0050, 0x0418, A_END}; AnimationFrame D_8015550C[] = { 0x0008, 0x0814, 0x0003, 0x0415, 0x0005, 0x0416, 0x0003, - 0x0415, 0x0006, 0x0417, 0x0050, 0x0418, 0xFFFF, 0x0000}; - -AnimationFrame D_80155528[] = {0x0006, 0x0417, 0x0050, 0x0418, 0xFFFF, 0x0000}; - + 0x0415, 0x0006, 0x0417, 0x0050, 0x0418, A_END}; +AnimationFrame D_80155528[] = {0x0006, 0x0417, 0x0050, 0x0418, A_END}; AnimationFrame D_80155534[] = { - 0x0002, 0x0813, 0x0006, 0x0417, 0x0050, 0x0418, 0xFFFF, 0x0000}; - + 0x0002, 0x0813, 0x0006, 0x0417, 0x0050, 0x0418, A_END}; AnimationFrame D_80155544[] = {0x0004, 0x0820, 0x0003, 0x0C21, 0x0002, 0x0C22, - 0x0010, 0x0C22, 0x0001, 0x0C22, 0xFFFF, 0x0000}; - + 0x0010, 0x0C22, 0x0001, 0x0C22, A_END}; AnimationFrame D_8015555C[] = { - 0x0004, 0x0820, 0x0003, 0x0C21, 0x0003, 0x0C22, 0x0003, 0x0C23, - 0x0002, 0x0C24, 0x0001, 0x0A1C, 0x0001, 0x0A1B, 0x0020, 0x0425, - 0x0012, 0x0819, 0x0030, 0x0418, 0xFFFF, 0x0000}; - + 0x0004, 0x0820, 0x0003, 0x0C21, 0x0003, 0x0C22, 0x0003, + 0x0C23, 0x0002, 0x0C24, 0x0001, 0x0A1C, 0x0001, 0x0A1B, + 0x0020, 0x0425, 0x0012, 0x0819, 0x0030, 0x0418, A_END}; AnimationFrame D_80155588[] = { 0x0002, 0x0226, 0x0002, 0x0227, 0x0002, 0x0228, 0x0002, 0x0229, - 0x0002, 0x022A, 0x0002, 0x022B, 0x0010, 0x022C, 0xFFFF, 0x0000}; - + 0x0002, 0x022A, 0x0002, 0x022B, 0x0010, 0x022C, A_END}; AnimationFrame D_801555A8[] = { 0x0002, 0x062F, 0x0002, 0x0630, 0x0002, 0x0631, 0x0002, 0x0632, - 0x0002, 0x0633, 0x0002, 0x0634, 0x0010, 0x0635, 0xFFFF, 0x0000}; - + 0x0002, 0x0633, 0x0002, 0x0634, 0x0010, 0x0635, A_END}; AnimationFrame D_801555C8[] = { 0x0002, 0x0836, 0x0002, 0x0837, 0x0002, 0x0428, 0x0002, 0x0429, - 0x0002, 0x042A, 0x0002, 0x042B, 0x0010, 0x042C, 0xFFFF, 0x0000}; - + 0x0002, 0x042A, 0x0002, 0x042B, 0x0010, 0x042C, A_END}; AnimationFrame D_801555E8[] = { 0x0002, 0x0226, 0x0002, 0x0227, 0x0002, 0x0228, 0x0002, 0x0229, - 0x0003, 0x022A, 0x0010, 0x022D, 0x0006, 0x022E, 0xFFFF, 0x0000}; - -AnimationFrame D_80155608[] = { - 0x0002, 0x0226, 0x0002, 0x0227, 0x0002, 0x0228, 0x0002, 0x0229, - 0x0002, 0x022A, 0x0006, 0x022D, 0x0002, 0x022E, 0x0002, 0x0228, - 0x0002, 0x0229, 0x0003, 0x022A, 0x0002, 0x022D, 0x0000, 0x0007}; - + 0x0003, 0x022A, 0x0010, 0x022D, 0x0006, 0x022E, A_END}; +AnimationFrame ric_anim_throw_daggers[] = { + 0x0002, 0x0226, 0x0002, 0x0227, 0x0002, 0x0228, 0x0002, 0x0229, + 0x0002, 0x022A, 0x0006, 0x022D, 0x0002, 0x022E, 0x0002, 0x0228, + 0x0002, 0x0229, 0x0003, 0x022A, 0x0002, 0x022D, A_LOOP_AT(7)}; AnimationFrame D_80155638[] = { 0x0002, 0x0836, 0x0002, 0x0837, 0x0002, 0x0428, 0x0002, 0x0429, - 0x0003, 0x042A, 0x0010, 0x042D, 0x0006, 0x042E, 0xFFFF, 0x0000}; - -AnimationFrame D_80155658[] = {0x0005, 0x0013, 0x0001, 0x001A, 0x0001, 0x0019, - 0x0006, 0x007D, 0x0020, 0x007E, 0x0000, 0x0004}; - -AnimationFrame D_80155670[] = { - 0x0003, 0x1281, 0x0003, 0x1282, 0x0003, 0x1283, 0x0003, 0x1284, 0x0003, - 0x1285, 0x0003, 0x1286, 0x0003, 0x127F, 0x0003, 0x1280, 0x0000, 0x0000}; - -AnimationFrame D_80155694[] = {0x0040, 0x0820, 0xFFFF, 0x0000}; - + 0x0003, 0x042A, 0x0010, 0x042D, 0x0006, 0x042E, A_END}; +AnimationFrame ric_anim_stand_in_air[] = { + {5, FRAME(19, 0)}, {1, FRAME(26, 0)}, {1, FRAME(25, 0)}, + {6, FRAME(125, 0)}, {32, FRAME(126, 0)}, A_LOOP_AT(4)}; +AnimationFrame ric_anim_run[] = { + 0x0003, 0x1281, 0x0003, 0x1282, 0x0003, 0x1283, 0x0003, 0x1284, 0x0003, + 0x1285, 0x0003, 0x1286, 0x0003, 0x127F, 0x0003, 0x1280, A_LOOP_AT(0)}; +AnimationFrame ric_anim_stun[] = {{64, FRAME(32, 8)}, A_END}; AnimationFrame D_8015569C[] = { 0x0001, 0x02CE, 0x0001, 0x02CF, 0x0001, 0x02CE, 0x0003, 0x02CF, 0x0003, 0x02CE, 0x0005, 0x02CF, 0x0001, 0x0226, - 0x0001, 0x022E, 0x0020, 0x0202, 0xFFFF, 0x0000}; - + 0x0001, 0x022E, 0x0020, 0x0202, A_END}; AnimationFrame D_801556C4[] = { 0x0001, 0x08B7, 0x0002, 0x08B8, 0x0001, 0x08B6, 0x0001, 0x08B7, 0x0001, 0x08B9, 0x0001, 0x08B6, 0x0001, 0x08B7, 0x0001, 0x08BA, 0x0001, 0x08B6, 0x0001, 0x08B7, 0x0001, 0x08BC, 0x0001, 0x08B7, - 0x0001, 0x08BB, 0x0001, 0x08B7, 0x0020, 0x08B6, 0xFFFF, 0x0000}; - + 0x0001, 0x08BB, 0x0001, 0x08B7, 0x0020, 0x08B6, A_END}; AnimationFrame D_80155704[] = { - 0x0001, 0x06C8, 0x0001, 0x06C9, 0x0001, 0x06C8, 0x0002, 0x06C9, - 0x0002, 0x06C8, 0x0003, 0x06C9, 0x0003, 0x06C8, 0x0005, 0x06C9, - 0x0001, 0x062F, 0x0001, 0x0611, 0xFFFF, 0x0000}; - -AnimationFrame D_80155730[] = {0x0080, 0x02D0, 0xFFFF, 0x0000}; - -AnimationFrame D_80155738[] = {0x0080, 0x06D1, 0xFFFF, 0x0000}; - -AnimationFrame D_80155740[] = {0x0080, 0x08D2, 0xFFFF, 0x0000}; - -AnimationFrame D_80155748[] = {0x0080, 0x0011, 0xFFFF, 0x0000}; - + 0x0001, 0x06C8, 0x0001, 0x06C9, 0x0001, 0x06C8, 0x0002, + 0x06C9, 0x0002, 0x06C8, 0x0003, 0x06C9, 0x0003, 0x06C8, + 0x0005, 0x06C9, 0x0001, 0x062F, 0x0001, 0x0611, A_END}; +AnimationFrame D_80155730[] = {0x0080, 0x02D0, A_END}; +AnimationFrame D_80155738[] = {0x0080, 0x06D1, A_END}; +AnimationFrame D_80155740[] = {0x0080, 0x08D2, A_END}; +AnimationFrame D_80155748[] = {0x0080, 0x0011, A_END}; AnimationFrame D_80155750[] = { - 0x0002, 0x0218, 0x0002, 0x0487, 0x0002, 0x0488, 0x0001, 0x0642, - 0x0008, 0x1489, 0x0010, 0x148A, 0x0008, 0x1489, 0x0002, 0x0642, - 0x0002, 0x0641, 0x0002, 0x0611, 0xFFFF, 0x0000}; - -AnimationFrame D_8015577C[] = {0x0016, 0x228C, 0x0080, 0x228D, 0xFFFF, 0x0000}; - -AnimationFrame D_80155788[] = {0x0003, 0x081B, 0x0003, 0x081A, 0x0003, - 0x0819, 0x0030, 0x0418, 0xFFFF, 0x0000}; - -AnimationFrame D_8015579C[] = { - 0x0001, 0x089B, 0x0001, 0x089C, 0x0010, 0x089B, 0xFFFF, 0x0000}; - -AnimationFrame D_801557AC[] = { - 0x0002, 0x00A4, 0x0002, 0x00A5, 0x0001, 0x00A4, 0x0001, 0x00A5, - 0x000D, 0x00A4, 0x0002, 0x00A6, 0x0003, 0x00A7, 0x0002, 0x00A6, - 0x0080, 0x00A6, 0x0002, 0x0026, 0xFFFF, 0x0000}; - -AnimationFrame D_801557D8[] = { + 0x0002, 0x0218, 0x0002, 0x0487, 0x0002, 0x0488, 0x0001, + 0x0642, 0x0008, 0x1489, 0x0010, 0x148A, 0x0008, 0x1489, + 0x0002, 0x0642, 0x0002, 0x0641, 0x0002, 0x0611, A_END}; +AnimationFrame D_8015577C[] = {0x0016, 0x228C, 0x0080, 0x228D, A_END}; +AnimationFrame D_80155788[] = { + 0x0003, 0x081B, 0x0003, 0x081A, 0x0003, 0x0819, 0x0030, 0x0418, A_END}; +AnimationFrame ric_anim_high_jump[] = { + 0x0001, 0x089B, 0x0001, 0x089C, 0x0010, 0x089B, A_END}; +AnimationFrame ric_anim_point_finger_up[] = { + 0x0002, 0x00A4, 0x0002, 0x00A5, 0x0001, 0x00A4, 0x0001, + 0x00A5, 0x000D, 0x00A4, 0x0002, 0x00A6, 0x0003, 0x00A7, + 0x0002, 0x00A6, 0x0080, 0x00A6, 0x0002, 0x0026, A_END}; +AnimationFrame ric_anim_blade_dash[] = { 0x0001, 0x0008, 0x0001, 0x0038, 0x0001, 0x0092, 0x0001, 0x0093, 0x0001, 0x0094, 0x0001, 0x0095, 0x0001, 0x0096, 0x0001, 0x0097, 0x0001, 0x0094, 0x0001, 0x0095, 0x0001, 0x0096, 0x0001, 0x0097, 0x0001, 0x0093, 0x0001, 0x0094, 0x0001, 0x0095, 0x0001, 0x0096, 0x0001, 0x0097, 0x0010, 0x0092, 0x0002, 0x0037, 0x0001, 0x0090, 0x0002, 0x0091, 0x0003, 0x0090, 0x0004, - 0x0091, 0x000C, 0x0090, 0x0004, 0x0010, 0xFFFF, 0x0000}; - -AnimationFrame D_80155840[] = { + 0x0091, 0x000C, 0x0090, 0x0004, 0x0010, A_END}; +AnimationFrame ric_anim_flame_whip[] = { 0x0004, 0x02A2, 0x0001, 0x02A8, 0x0002, 0x02A9, 0x0018, 0x02A8, 0x0004, 0x02AC, 0x0001, 0x02AA, 0x0002, 0x02AB, 0x0018, 0x02AA, 0x0008, 0x02AC, 0x0005, 0x02AD, 0x0004, 0x02AC, 0x0003, 0x02AD, 0x0002, 0x02AE, 0x0002, 0x02AD, 0x0001, 0x02AE, 0x0001, 0x02AF, 0x0001, 0x02AE, 0x000C, 0x02AF, 0x0001, 0x02B0, 0x0002, 0x02B1, 0x0001, 0x02B2, 0x0001, 0x02B3, 0x0001, 0x02B4, 0x0001, 0x02B5, 0x0001, 0x02B4, 0x0001, 0x02B3, 0x0001, 0x02B2, - 0x0030, 0x02B0, 0xFFFF, 0x0000}; - + 0x0030, 0x02B0, A_END}; AnimationFrame D_801558B4[] = { 0x0005, 0x0013, 0x0001, 0x001A, 0x0001, 0x0019, 0x0006, 0x007D, - 0x0083, 0x007E, 0x0080, 0x007E, 0x0080, 0x0019, 0xFFFF, 0x0000}; - -AnimationFrame D_801558D4[] = {0x000C, 0x0019, 0xFFFF, 0x0000}; - -AnimationFrame D_801558DC[] = {0x0006, 0x001A, 0xFFFF, 0x0000}; - + 0x0083, 0x007E, 0x0080, 0x007E, 0x0080, 0x0019, A_END}; +AnimationFrame D_801558D4[] = {0x000C, 0x0019, A_END}; +AnimationFrame D_801558DC[] = {0x0006, 0x001A, A_END}; AnimationFrame D_801558E4[] = { - 0x0002, 0x0237, 0x0001, 0x0290, 0x0002, 0x0291, 0x0003, - 0x0290, 0x0004, 0x0291, 0x0005, 0x0291, 0x0005, 0x0290, - 0x0005, 0x0291, 0x0005, 0x0291, 0x0005, 0x0290, 0x0005, - 0x0291, 0x000C, 0x0290, 0x0010, 0x0226, 0xFFFF, 0x0000}; - + 0x0002, 0x0237, 0x0001, 0x0290, 0x0002, 0x0291, 0x0003, 0x0290, 0x0004, + 0x0291, 0x0005, 0x0291, 0x0005, 0x0290, 0x0005, 0x0291, 0x0005, 0x0291, + 0x0005, 0x0290, 0x0005, 0x0291, 0x000C, 0x0290, 0x0010, 0x0226, A_END}; AnimationFrame D_8015591C[] = { 0x0002, 0x00A4, 0x0002, 0x00A5, 0x0001, 0x00A4, 0x0001, 0x00A5, 0x000D, 0x00A4, 0x0002, 0x00A6, 0x0003, 0x00A7, 0x0002, 0x00A6, 0x0080, 0x00A6, - 0x0080, 0x00A6, 0x0080, 0x00A6, 0x0080, 0x00A6, 0xFFFF, 0x0000}; - + 0x0080, 0x00A6, 0x0080, 0x00A6, 0x0080, 0x00A6, A_END}; AnimationFrame D_80155950[] = { - 0x0080, 0x00A6, 0x0080, 0x00A6, 0x0080, - 0x00A6, 0x0002, 0x0026, 0xFFFF, 0x0000, -}; + 0x0080, 0x00A6, 0x0080, 0x00A6, 0x0080, 0x00A6, 0x0002, 0x0026, A_END}; FrameProperty D_80155964[] = { 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x14, 0x02, 0x05, 0x07, 0x0C, diff --git a/src/ric/d_19C70.c b/src/ric/d_19C70.c index 0691b7dae..536f7e463 100644 --- a/src/ric/d_19C70.c +++ b/src/ric/d_19C70.c @@ -61,26 +61,21 @@ u16 D_80155DDC[] = { 0xE318, 0xE318, 0xE318, 0xE318, 0xE318, 0xDEF7, 0xDAD6, 0xD6B5, 0xD294, 0xCE73, 0xCA52, 0xC631, 0xC210, 0xBDEF, 0xB9CE, 0xB5AD, 0xB18C, 0xAD6B, 0xA94A, 0xA529, 0xA108, 0x9CE7, 0x98C6, 0x94A5}; - RECT D_80155E3C = {0x0301, 0x01F8, 0x0030, 0x0001}; - AnimationFrame D_80155E44[] = { - 0x0024, 0x0001, 0x0001, 0x0002, 0x0001, 0x0003, 0x0001, 0x0004, 0x0001, - 0x0005, 0x0001, 0x0006, 0x0001, 0x0007, 0x0001, 0x0008, 0x0000, 0x0000}; - -s16 D_80155E68[] = {0x0009, 0x000A, 0x000B, 0x000C}; - + {36, FRAME(1, 0)}, {1, FRAME(2, 0)}, {1, FRAME(3, 0)}, + {1, FRAME(4, 0)}, {1, FRAME(5, 0)}, {1, FRAME(6, 0)}, + {1, FRAME(7, 0)}, {1, FRAME(8, 0)}, A_LOOP_AT(0)}; +s16 D_80155E68[] = {9, 10, 11, 12}; u8 D_80155E70[][4] = { 0x4F, 0x4F, 0x4F, 0x00, 0x4F, 0x4F, 0x4F, 0x00, 0x4F, 0x4F, 0x4F, 0x00, 0x3F, 0x3F, 0x5F, 0x00, 0x3F, 0x3F, 0x5F, 0x00, 0x3F, 0x3F, 0x5F, 0x00, 0x2F, 0x2F, 0x6F, 0x00, 0x2F, 0x2F, 0x6F, 0x00, 0x1F, 0x1F, 0x7F, 0x00, 0x1F, 0x1F, 0x7F, 0x00}; - s16 D_80155E98[] = {0xFFFB, 0xFFF7, 0xFFFD, 0xFFF3, 0xFFFB, 0x0001, 0xFFF9, 0xFFFF}; - AnimationFrame D_80155EA8[] = { - 0x0003, 0x0001, 0x0003, 0x0002, 0x0003, 0x0003, 0x0003, - 0x0004, 0x0003, 0x0005, 0x0003, 0x0006, 0x0003, 0x0007, - 0x0003, 0x0008, 0x0003, 0x0009, 0x0003, 0x000A, 0x0003, - 0x000B, 0x0003, 0x000C, 0x0003, 0x000D, 0x0000, 0x0000}; + {3, FRAME(1, 0)}, {3, FRAME(2, 0)}, {3, FRAME(3, 0)}, {3, FRAME(4, 0)}, + {3, FRAME(5, 0)}, {3, FRAME(6, 0)}, {3, FRAME(7, 0)}, {3, FRAME(8, 0)}, + {3, FRAME(9, 0)}, {3, FRAME(10, 0)}, {3, FRAME(11, 0)}, {3, FRAME(12, 0)}, + {3, FRAME(13, 0)}, A_LOOP_AT(0)}; diff --git a/src/ric/d_19EE0.c b/src/ric/d_19EE0.c index 981779624..52e99460c 100644 --- a/src/ric/d_19EE0.c +++ b/src/ric/d_19EE0.c @@ -1,105 +1,56 @@ #include "ric.h" s32 D_80155EE0[] = {0x00000F80, 0x00000100, 0x00000700, 0x00000880}; - s16 D_80155EF0[] = {0x0400, 0x06AB, 0x0955, 0x0C00, 0x0EAB, 0x1155}; SVECTOR D_80155EFC = {-8, -72, -4, 0}; - SVECTOR D_80155F04 = {8, -72, -4, 0}; - SVECTOR D_80155F0C = {-48, -32, -4, 0}; - SVECTOR D_80155F14 = {-8, -32, -4, 0}; - SVECTOR D_80155F1C = {8, -32, -4, 0}; - SVECTOR D_80155F24 = {48, -32, -4, 0}; - SVECTOR D_80155F2C = {-48, -16, -4, 0}; - SVECTOR D_80155F34 = {-8, -16, -4, 0}; - SVECTOR D_80155F3C = {8, -16, -4, 0}; - SVECTOR D_80155F44 = {48, -16, -4, 0}; - SVECTOR D_80155F4C = {-8, 72, -4, 0}; - SVECTOR D_80155F54 = {8, 72, -4, 0}; - SVECTOR D_80155F5C = {-24, -48, -4, 0}; - SVECTOR D_80155F64 = {-8, -48, -4, 0}; - SVECTOR D_80155F6C = {8, -48, -4, 0}; - SVECTOR D_80155F74 = {24, -48, -4, 0}; - SVECTOR D_80155F7C = {-24, -32, -4, 0}; - SVECTOR D_80155F84 = {24, -32, -4, 0}; - SVECTOR D_80155F8C = {-24, -16, -4, 0}; - SVECTOR D_80155F94 = {24, -16, -4, 0}; - SVECTOR D_80155F9C = {-24, 0, -4, 0}; - SVECTOR D_80155FA4 = {-8, 0, -4, 0}; - SVECTOR D_80155FAC = {8, 0, -4, 0}; - SVECTOR D_80155FB4 = {24, 0, -4, 0}; - SVECTOR D_80155FBC = {-8, -72, 4, 0}; - SVECTOR D_80155FC4 = {8, -72, 4, 0}; - SVECTOR D_80155FCC = {-48, -32, 4, 0}; - SVECTOR D_80155FD4 = {-8, -32, 4, 0}; - SVECTOR D_80155FDC = {8, -32, 4, 0}; - SVECTOR D_80155FE4 = {48, -32, 4, 0}; - SVECTOR D_80155FEC = {-48, -16, 4, 0}; - SVECTOR D_80155FF4 = {-8, -16, 4, 0}; - SVECTOR D_80155FFC = {8, -16, 4, 0}; - SVECTOR D_80156004 = {48, -16, 4, 0}; - SVECTOR D_8015600C = {-8, 72, 4, 0}; - SVECTOR D_80156014 = {8, 72, 4, 0}; - SVECTOR D_8015601C = {-24, -48, 4, 0}; - SVECTOR D_80156024 = {-8, -48, 4, 0}; - SVECTOR D_8015602C = {8, -48, 4, 0}; - SVECTOR D_80156034 = {24, -48, 4, 0}; - SVECTOR D_8015603C = {-24, -32, 4, 0}; - SVECTOR D_80156044 = {24, -32, 4, 0}; - SVECTOR D_8015604C = {-24, -16, 4, 0}; - SVECTOR D_80156054 = {24, -16, 4, 0}; - SVECTOR D_8015605C = {-24, 0, 4, 0}; - SVECTOR D_80156064 = {-8, 0, 4, 0}; - SVECTOR D_8015606C = {8, 0, 4, 0}; - SVECTOR D_80156074 = {24, 0, 4, 0}; - SVECTOR* D_8015607C[][4] = { &D_80155F14, &D_80155F1C, &D_80155F3C, &D_80155F34, &D_8015601C, &D_80156024, &D_80155FD4, &D_8015603C, &D_8015602C, &D_80156034, diff --git a/src/ric/d_00000.c b/src/ric/pl_header.c similarity index 53% rename from src/ric/d_00000.c rename to src/ric/pl_header.c index ac296f008..b5f15dab0 100644 --- a/src/ric/d_00000.c +++ b/src/ric/pl_header.c @@ -1,15 +1,15 @@ #include "ric.h" -void UpdateEntityRichter(void); -void func_80156F40(s16 arg0); +void RicMain(void); +void RicInit(s16 arg0); void func_801603C4(void); void func_8015E7B4(Unkstruct_8010BF64* arg0); -PlayerOvl RichterBelmont[] = { - /* 0x00 */ UpdateEntityRichter, - /* 0x04 */ func_80156F40, - /* 0x08 */ func_801603C4, - /* 0x0C */ func_8015E7B4, +PlayerOvl RIC_player = { + RicMain, + RicInit, + func_801603C4, + func_8015E7B4, }; s32* D_8013C010[4] = { diff --git a/src/ric/ric.h b/src/ric/ric.h index 017481f7e..53649e76c 100644 --- a/src/ric/ric.h +++ b/src/ric/ric.h @@ -1,7 +1,5 @@ -#include "common.h" -#include "game.h" -#include "objects.h" -#include "sfx.h" +#include +#include typedef enum { E_NONE, @@ -11,13 +9,68 @@ typedef enum { // Richter mostly uses the same steps as Alucard, or uses unused Alucard steps. // There are a couple steps that mean one thing for Alucard, and another for // Richter. This enum handles Richter's version of the ones that overlap. -typedef enum { - Player_RichterWalk = 1, - Player_RichterCrouch = 2, - Player_RichterHighJump = 8, - Player_RichterBladeDash = 24, - Player_RichterSprint = 25 -} Richter_PlayerSteps; +enum RicSteps { + PL_S_STAND, + PL_S_WALK, + PL_S_CROUCH, + PL_S_FALL, + PL_S_JUMP, + PL_S_5, + PL_S_6, + PL_S_7, + PL_S_HIGHJUMP, + PL_S_9, + PL_S_HIT, + PL_S_11, + PL_S_BOSS_GRAB, + PL_S_13, + PL_S_14, + PL_S_15, + PL_S_DEAD, + PL_S_17, + PL_S_STAND_IN_AIR, + PL_S_FLAME_WHIP, + PL_S_HYDROSTORM, + PL_S_THROW_DAGGERS, + PL_S_22, + PL_S_23, + PL_S_BLADEDASH, + PL_S_RUN, + PL_S_26, + PL_S_SUBWPN_CRASH, + + PL_S_DEBUG = 0xF0, +}; + +enum RicSfxs { + SFX_GRUNT_A = 0x6F9, + SFX_GRUNT_B, + SFX_GRUNT_C, + SFX_GRUNT_SUBWPN_A, + SFX_HYDROSTORM = 0x700, + SFX_CROSS_CRASH, +}; + +enum RicTimers { + PL_T_POISON, + PL_T_CURSE, + PL_T_2, + PL_T_3, + PL_T_4, + PL_T_5, + PL_T_6, + PL_T_7, + PL_T_8, + PL_T_9, + PL_T_10, + PL_T_RUN, + PL_T_12, + PL_T_INVINCIBLE, + PL_T_INVINCIBILITY_CONSUMABLE, + PL_T_15, +}; + +#define NO_AFTERIMAGE 0x08000000 extern s16* D_801530AC[]; extern SpriteParts* D_80153AA0[]; @@ -28,21 +81,21 @@ extern s16 D_80154FBC[][10]; extern void func_80159C04(void); extern void DestroyEntity(Entity* entity); extern void func_8015BB80(void); -extern void HandleBladeDash(void); -extern void RicSetPlayerStep(PlayerSteps step); -void func_8015C920(AnimationFrame* unk0); +extern void RicHandleBladeDash(void); +extern void RicSetStep(int step); +void RicSetAnimation(AnimationFrame* anim); extern void RicDecelerateX(s32 speed); -extern s32 func_8015C9CC(void); +extern s32 RicCheckMovement(void); extern void RicSetSpeedX(s32 speed); -extern void func_8015CCC8(s32 arg0, s32 velocityX); -extern void func_8015CD98(s32 velocityX); -extern void func_8015CDE0(s32); -extern void func_8015CE7C(void); +extern void RicSetCrouch(s32 arg0, s32 velocityX); +extern void RicSetStand(s32 velocityX); +extern void RicSetWalk(s32); +extern void RicSetRun(void); extern void func_8015CF08(void); extern bool func_8015DBB0(s32); static void DebugShowWaitInfo(const char* str); extern void func_8015F9F0(Entity* entity); -extern void func_8015FAB8(Entity*); +extern void RicSetSubweaponParams(Entity*); extern s32 func_8015FDB0(POLY_GT4* poly, s16 posX, s16 posY); extern Entity* RicCreateEntFactoryFromEntity( Entity* entity, u32 arg1, s32 arg2); @@ -118,7 +171,7 @@ extern void RicEntityTeleport(Entity* self); extern s32 func_8016840C(s16 x, s16 y); extern s16 D_80154568[]; -extern s32 D_80154570; +extern s32 g_IsPrologueStage; extern s16 D_80154574[]; extern s16 D_80154594[]; extern s32 D_8015459C; @@ -144,7 +197,7 @@ extern SubweaponDef D_80154688[]; extern u8 D_801548F4[6][8]; extern AnimationFrame D_80154924[]; extern PfnEntityUpdate D_8015495C[]; -extern s32 D_80154ED4[]; +extern AnimationFrame D_80154ED4[]; extern AnimationFrame D_80154EF8[]; extern Point16* D_80155244[72]; extern s32 D_80155368[]; @@ -169,13 +222,13 @@ extern s16 D_80155364[]; extern AnimationFrame* D_8015538C[]; extern AnimationFrame D_80155394[]; extern AnimationFrame D_8015539C[]; -extern AnimationFrame D_801553BC[]; +extern AnimationFrame anim_stand[]; extern AnimationFrame D_80155480[]; -extern AnimationFrame D_80155488[]; -extern AnimationFrame D_801554B0[]; -extern AnimationFrame D_801554C0[]; -extern AnimationFrame D_801554C8[]; -extern AnimationFrame D_801554D0[]; +extern AnimationFrame ric_anim_walk[]; +extern AnimationFrame anim_land_strong_impact[]; +extern AnimationFrame anim_crouch[]; +extern AnimationFrame anim_land_from_run[]; +extern AnimationFrame anim_crouch_from_stand[]; extern AnimationFrame D_801554E0[]; extern AnimationFrame D_801554F0[]; extern AnimationFrame D_8015550C[]; @@ -187,11 +240,11 @@ extern AnimationFrame D_80155588[]; extern AnimationFrame D_801555A8[]; extern AnimationFrame D_801555C8[]; extern AnimationFrame D_801555E8[]; -extern AnimationFrame D_80155608[]; +extern AnimationFrame ric_anim_throw_daggers[]; extern AnimationFrame D_80155638[]; -extern AnimationFrame D_80155658[]; -extern AnimationFrame D_80155670[]; -extern AnimationFrame D_80155694[]; +extern AnimationFrame ric_anim_stand_in_air[]; +extern AnimationFrame ric_anim_run[]; +extern AnimationFrame ric_anim_stun[]; extern AnimationFrame D_8015569C[]; extern AnimationFrame D_801556C4[]; extern AnimationFrame D_80155704[]; @@ -202,11 +255,11 @@ extern AnimationFrame D_80155748[]; extern AnimationFrame D_80155750[]; extern AnimationFrame D_8015577C[]; extern AnimationFrame D_80155788[]; -extern AnimationFrame D_8015579C[]; +extern AnimationFrame ric_anim_high_jump[]; extern AnimationFrame D_80155738[]; -extern AnimationFrame D_801557AC[]; -extern AnimationFrame D_801557D8[]; -extern AnimationFrame D_80155840[]; +extern AnimationFrame ric_anim_point_finger_up[]; +extern AnimationFrame ric_anim_blade_dash[]; +extern AnimationFrame ric_anim_flame_whip[]; extern AnimationFrame D_801558B4[]; extern AnimationFrame D_801558D4[]; extern AnimationFrame D_801558E4[]; @@ -279,9 +332,9 @@ extern Entity* D_801758CC[]; extern u32 D_801758D0; extern ButtonComboState g_bladeDashButtons; extern ButtonComboState D_801758E4; -extern u16 D_80175950; -extern u16 D_80175952; -extern u16 D_80175954; -extern s16 D_80175956; +extern u16 g_RicDebugCurFrame; +extern u16 g_RicDebugDrawFlags; +extern u16 g_RicDebugPalette; +extern s16 g_IsRicDebugEnter; extern s32 D_80175958[]; extern s32 D_801759D8[];