SSBM Decomp
Loading...
Searching...
No Matches
grinishie1.c File Reference
#include "grinishie1.h"
#include "grlib.h"
#include "grmaterial.h"
#include "grzakogenerator.h"
#include "inlines.h"
#include "stage.h"
#include "types.h"
#include <platform.h>
#include "cm/camera.h"
#include "ef/efsync.h"
#include "gm/gm_unsplit.h"
#include "it/it_26B1.h"
#include "it/itdrop.h"
#include "it/itspawn.h"
#include "lb/lb_00B0.h"
#include "lb/lbaudio_ax.h"
#include "lb/lbspdisplay.h"
#include "mp/mplib.h"
#include <dolphin/types.h>
#include <baselib/debug.h>
#include <baselib/gobj.h>
#include <sysdolphin/baselib/dobj.h>
#include <sysdolphin/baselib/gobjproc.h>
#include <sysdolphin/baselib/jobj.h>
#include <sysdolphin/baselib/memory.h>
#include <sysdolphin/baselib/random.h>

Data Structures

struct  grInishie1_YakumonoParam
struct  block_table_struct
struct  grInishie1_801FB3F0_Block
struct  grInishie1_801FB3F0_Vars

Macros

#define DOBJ_LOOP(jobj)
#define DOBJ_CLEAR_LOOP(jobj)
#define BLOCK_COUNT   19
 corresponds with the 3 - 13 - 3 block pattern on the stage
#define HATENA_APPEAR_CHECKLOOP(countdown, last_index, status_val, line)

Enumerations

enum  { HATENA_APPEAR_CHECKLOOP = 0x14 }

Functions

static void grInishie1_801FA908 (bool)
static void grInishie1_801FA90C (void)
static void grInishie1_801FA984 (void)
static void grInishie1_801FA988 (void)
static bool grInishie1_801FA9AC (void)
static Ground_GObjsetupStageCallbacks (int gobj_id)
static void grInishie1_801FAAA0 (Ground_GObj *)
static bool grInishie1_801FAACC (Ground_GObj *)
static void grInishie1_801FAAD4 (Ground_GObj *)
static void grInishie1_801FAAD8 (Ground_GObj *)
static void grInishie1_801FAADC (Ground_GObj *)
static bool grInishie1_801FAB60 (Ground_GObj *)
static void grInishie1_801FAB68 (Ground_GObj *)
static void grInishie1_801FABB0 (Ground_GObj *)
static void grInishie1_801FABB4 (Ground_GObj *)
static bool grInishie1_801FABF4 (Ground_GObj *)
static void grInishie1_801FABFC (Ground_GObj *)
static void grInishie1_801FAC00 (Ground_GObj *)
static void grInishie1_801FAC04 (Ground_GObj *)
static bool grInishie1_801FAC50 (Ground_GObj *)
static void grInishie1_801FAC58 (Ground_GObj *)
static void grInishie1_801FAD80 (Ground_GObj *)
static void grInishie1_801FAD84 (HSD_GObj *)
static void grInishie1_801FB0AC (HSD_GObj *, u32)
static void grInishie1_801FB3F0 (HSD_GObj *)
static void grInishie1_801FBA34 (HSD_GObj *gobj, HSD_JObj *jobj)
 gives item from hatena block upwards velocity, maybe handles spawning it as well
static void grInishie1_801FBAA0 (HSD_GObj *, s32)
static void grInishie1_801FBC4C (HSD_GObj *, u32)
static void grInishie1_801FBCEC (HSD_GObj *, u32)
static void fn_801FBEB8 (void *user_data, int joint_id, CollData *coll, int coll_x50, mpLib_GroundEnum ground_kind, float delta_y)
 Joint collision callback for ground surfaces.
static void fn_801FBF6C (Item_GObj *, Ground *, Vec3 *, HSD_GObj *, f32)
static void grInishie1_801FC018 (HSD_GObj *)
static void grInishie1_801FC110 (HSD_GObj *)
static void grInishie1_801FC4A0 (HSD_GObj *)
static void grInishie1_801FC664 (HSD_GObj *)
static void fn_801FC9AC (void *user_data, int joint_id, CollData *coll, int coll_x50, mpLib_GroundEnum ground_kind, float delta_y)
 Joint collision callback for ground surfaces.
static void grInishie1_801FCB10 (HSD_GObj *)
static DynamicsDescgrInishie1_801FCBB0 (enum_t)
static bool grInishie1_801FCBB8 (Vec3 *, int arg, HSD_JObj *jobj)
static void sdata2_order (void)
static s32 test_random (s32 val)
 these inlines are probably shared in other places
static s32 randi_between (s32 min, s32 max)
static f32 fabsf_inline (f32 x)
static f32 fclamp0 (f32 x)
static void order_data (void)
static void grInishie1_801FB3F0_update_blocks (HSD_GObj *gobj, grInishie1_801FB3F0_Vars *vars, Vec3 *pos)
ItemGET_ITEM2 (Item_GObj *arg0)
static s32 get_block_id (s32 block_id)
bool grInishie1_801FCAAC (int line_id)

Variables

static struct grInishie1_YakumonoParamyakumono_param
const Vec3 grI1_803B8268 = { 0.0f, 5.0f, 0.0f }
 initial velocity for items spawned from hatena blocks
GrJoint grI1_803E48C8 []
StageCallbacks grI1_StageCallbacks []
StageData grI1_StageData
struct block_table_struct grI1_803E49B8 [BLOCK_COUNT]

Macro Definition Documentation

◆ DOBJ_LOOP

#define DOBJ_LOOP ( jobj)
Value:
{ \
HSD_DObj* dobj = HSD_JObjGetDObj(jobj); \
while (dobj != NULL) { \
HSD_DObjSetFlags(dobj, 1U); \
dobj = (dobj != NULL) ? dobj->next : NULL; \
} \
};
HSD_DObj * HSD_JObjGetDObj(HSD_JObj *)
Definition jobj.c:935
#define NULL
Definition stddef.h:19
Definition dobj.h:17
HSD_DObj * next
Definition dobj.h:19

◆ DOBJ_CLEAR_LOOP

#define DOBJ_CLEAR_LOOP ( jobj)
Value:
{ \
HSD_DObj* dobj = HSD_JObjGetDObj(jobj); \
while (dobj != NULL) { \
HSD_DObjClearFlags(dobj, 1U); \
dobj = (dobj != NULL) ? dobj->next : NULL; \
} \
}

◆ BLOCK_COUNT

#define BLOCK_COUNT   19

corresponds with the 3 - 13 - 3 block pattern on the stage

◆ HATENA_APPEAR_CHECKLOOP

#define HATENA_APPEAR_CHECKLOOP ( countdown,
last_index,
status_val,
line )
Value:
if (countdown > 0) { \
countdown--; \
if (countdown == 0) { \
int i = 0; \
s32 index; \
\
do { \
index = HSD_Randi(0x13); \
if (index != last_index && vars->blocks[index].x0 == 0) { \
break; \
} \
i++; \
} while (i < HATENA_APPEAR_CHECKLOOP); \
\
HSD_ASSERT(line, i!=HATENA_APPEAR_CHECKLOOP); \
\
last_index = index; \
vars->blocks[index].x0 = status_val; \
grInishie1_801FBAA0(gobj, index); \
vars->blocks[index].x20 = 0; \
} \
}
#define HATENA_APPEAR_CHECKLOOP(countdown, last_index, status_val, line)
Definition grinishie1.c:592
signed long s32
Definition hsd_3B2B.h:1
s32 HSD_Randi(s32 max_val)
Definition random.c:18

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
HATENA_APPEAR_CHECKLOOP 

Function Documentation

◆ grInishie1_801FA908()

void grInishie1_801FA908 ( bool arg)
static

◆ grInishie1_801FA90C()

void grInishie1_801FA90C ( void )
static

◆ grInishie1_801FA984()

void grInishie1_801FA984 ( void )
static

◆ grInishie1_801FA988()

void grInishie1_801FA988 ( void )
static

◆ grInishie1_801FA9AC()

bool grInishie1_801FA9AC ( void )
static

◆ setupStageCallbacks()

Ground_GObj * setupStageCallbacks ( int gobj_id)
static

◆ grInishie1_801FAAA0()

void grInishie1_801FAAA0 ( Ground_GObj * gobj)
static

◆ grInishie1_801FAACC()

bool grInishie1_801FAACC ( Ground_GObj * gobj)
static

◆ grInishie1_801FAAD4()

void grInishie1_801FAAD4 ( Ground_GObj * gobj)
static

◆ grInishie1_801FAAD8()

void grInishie1_801FAAD8 ( Ground_GObj * gobj)
static

◆ grInishie1_801FAADC()

void grInishie1_801FAADC ( Ground_GObj * gobj)
static

◆ grInishie1_801FAB60()

bool grInishie1_801FAB60 ( Ground_GObj * gobj)
static

◆ grInishie1_801FAB68()

void grInishie1_801FAB68 ( Ground_GObj * gobj)
static

◆ grInishie1_801FABB0()

void grInishie1_801FABB0 ( Ground_GObj * gobj)
static

◆ grInishie1_801FABB4()

void grInishie1_801FABB4 ( Ground_GObj * gobj)
static

◆ grInishie1_801FABF4()

bool grInishie1_801FABF4 ( Ground_GObj * gobj)
static

◆ grInishie1_801FABFC()

void grInishie1_801FABFC ( Ground_GObj * gobj)
static

◆ grInishie1_801FAC00()

void grInishie1_801FAC00 ( Ground_GObj * gobj)
static

◆ grInishie1_801FAC04()

void grInishie1_801FAC04 ( Ground_GObj * gobj)
static

◆ grInishie1_801FAC50()

bool grInishie1_801FAC50 ( Ground_GObj * gobj)
static

◆ grInishie1_801FAC58()

void grInishie1_801FAC58 ( Ground_GObj * gobj)
static

◆ grInishie1_801FAD80()

void grInishie1_801FAD80 ( Ground_GObj * gobj)
static

◆ grInishie1_801FAD84()

void grInishie1_801FAD84 ( HSD_GObj * gobj)
static
Todo
same layout as grInishie1_801FB3F0_Vars; the shared grInishie1_GroundVars/grInishie1_Block structs are likely wrong (xC4 should be u16, block x4 is s16 and x10 is an f32)

◆ grInishie1_801FB0AC()

void grInishie1_801FB0AC ( HSD_GObj * gobj,
u32 ix )
static

◆ grInishie1_801FB3F0()

void grInishie1_801FB3F0 ( HSD_GObj * gobj)
static

◆ grInishie1_801FBA34()

void grInishie1_801FBA34 ( HSD_GObj * gobj,
HSD_JObj * jobj )
static

gives item from hatena block upwards velocity, maybe handles spawning it as well

◆ grInishie1_801FBAA0()

void grInishie1_801FBAA0 ( HSD_GObj * gobj,
s32 ix )
static

◆ grInishie1_801FBC4C()

void grInishie1_801FBC4C ( HSD_GObj * gobj,
u32 index )
static

◆ grInishie1_801FBCEC()

void grInishie1_801FBCEC ( HSD_GObj * gobj,
u32 index )
static

◆ fn_801FBEB8()

void fn_801FBEB8 ( void * user_data,
int joint_id,
CollData * coll,
int coll_x50,
mpLib_GroundEnum ground_kind,
float delta_y )
static

Joint collision callback for ground surfaces.

Parameters
user_dataSaved untyped data attached to the callback.
coll_x50Unknown, sourced from CollData::x50. dist according to fn_801FC9AC?
delta_yRelative y-offset since the collision started, equal to coll->cur_pos.y - coll->last_pos.y

◆ fn_801FBF6C()

void fn_801FBF6C ( Item_GObj * item_gobj,
Ground * gp,
Vec3 * pos,
HSD_GObj * arg3,
f32 arg4 )
static

◆ grInishie1_801FC018()

void grInishie1_801FC018 ( HSD_GObj * gobj)
static

◆ grInishie1_801FC110()

void grInishie1_801FC110 ( HSD_GObj * gobj)
static

◆ grInishie1_801FC4A0()

void grInishie1_801FC4A0 ( HSD_GObj * gobj)
static

◆ grInishie1_801FC664()

void grInishie1_801FC664 ( HSD_GObj * gobj)
static

◆ fn_801FC9AC()

void fn_801FC9AC ( void * user_data,
int joint_id,
CollData * coll,
int coll_x50,
mpLib_GroundEnum ground_kind,
float delta_y )
static

Joint collision callback for ground surfaces.

Parameters
user_dataSaved untyped data attached to the callback.
coll_x50Unknown, sourced from CollData::x50. dist according to fn_801FC9AC?
delta_yRelative y-offset since the collision started, equal to coll->cur_pos.y - coll->last_pos.y

◆ grInishie1_801FCB10()

void grInishie1_801FCB10 ( HSD_GObj * gobj)
static

◆ grInishie1_801FCBB0()

DynamicsDesc * grInishie1_801FCBB0 ( enum_t arg)
static

◆ grInishie1_801FCBB8()

bool grInishie1_801FCBB8 ( Vec3 * arg,
int arg,
HSD_JObj * jobj )
static

◆ sdata2_order()

void sdata2_order ( void )
static
Todo
Emitted only to lay out the .sdata2 literal pool in retail order.

◆ test_random()

s32 test_random ( s32 val)
inlinestatic

these inlines are probably shared in other places

◆ randi_between()

s32 randi_between ( s32 min,
s32 max )
inlinestatic

◆ fabsf_inline()

f32 fabsf_inline ( f32 x)
inlinestatic

◆ fclamp0()

f32 fclamp0 ( f32 x)
inlinestatic

◆ order_data()

void order_data ( void )
static

◆ grInishie1_801FB3F0_update_blocks()

void grInishie1_801FB3F0_update_blocks ( HSD_GObj * gobj,
grInishie1_801FB3F0_Vars * vars,
Vec3 * pos )
inlinestatic

◆ GET_ITEM2()

Item * GET_ITEM2 ( Item_GObj * arg0)
inline

◆ get_block_id()

s32 get_block_id ( s32 block_id)
inlinestatic

◆ grInishie1_801FCAAC()

bool grInishie1_801FCAAC ( int line_id)

Variable Documentation

◆ yakumono_param

struct grInishie1_YakumonoParam* yakumono_param
static

◆ grI1_803B8268

const Vec3 grI1_803B8268 = { 0.0f, 5.0f, 0.0f }

initial velocity for items spawned from hatena blocks

◆ grI1_803E48C8

GrJoint grI1_803E48C8[]
Initial value:
= {
{ 13, 3, 3 }, { 14, 3, 14 }, { 15, 3, 15 }, { 16, 3, 16 },
{ 17, 3, 17 }, { 18, 3, 18 }, { 19, 3, 19 },
}

◆ grI1_StageCallbacks

StageCallbacks grI1_StageCallbacks[]
Initial value:
= {
{
0,
},
{
0,
},
{
0,
},
{
(1 << 30) | (1 << 31),
},
}
static void grInishie1_801FAC58(Ground_GObj *)
Definition grinishie1.c:376
static void grInishie1_801FAAD8(Ground_GObj *)
Definition grinishie1.c:316
static bool grInishie1_801FAC50(Ground_GObj *)
Definition grinishie1.c:371
static bool grInishie1_801FAB60(Ground_GObj *)
Definition grinishie1.c:329
static bool grInishie1_801FAACC(Ground_GObj *)
Definition grinishie1.c:309
static void grInishie1_801FABB0(Ground_GObj *)
Definition grinishie1.c:343
static void grInishie1_801FAD80(Ground_GObj *)
Definition grinishie1.c:402
static void grInishie1_801FAADC(Ground_GObj *)
Definition grinishie1.c:318
static void grInishie1_801FABB4(Ground_GObj *)
Definition grinishie1.c:345
static void grInishie1_801FAB68(Ground_GObj *)
Definition grinishie1.c:334
static void grInishie1_801FAC00(Ground_GObj *)
Definition grinishie1.c:360
static void grInishie1_801FAAA0(Ground_GObj *)
Definition grinishie1.c:303
static bool grInishie1_801FABF4(Ground_GObj *)
Definition grinishie1.c:353
static void grInishie1_801FABFC(Ground_GObj *)
Definition grinishie1.c:358
static void grInishie1_801FAC04(Ground_GObj *)
Definition grinishie1.c:362
static void grInishie1_801FAAD4(Ground_GObj *)
Definition grinishie1.c:314

◆ grI1_StageData

StageData grI1_StageData
Initial value:
= {
"/GrI1.dat",
(1 << 0),
}
#define ARRAY_SIZE(arr)
Definition types.h:31
static void grInishie1_801FA984(void)
Definition grinishie1.c:256
static void grInishie1_801FA90C(void)
Definition grinishie1.c:243
static void grInishie1_801FA988(void)
Definition grinishie1.c:258
static bool grInishie1_801FCBB8(Vec3 *, int arg, HSD_JObj *jobj)
Definition grinishie1.c:1203
StageCallbacks grI1_StageCallbacks[]
Definition grinishie1.c:179
static DynamicsDesc * grInishie1_801FCBB0(enum_t)
Definition grinishie1.c:1198
static void grInishie1_801FA908(bool)
Definition grinishie1.c:231
GrJoint grI1_803E48C8[]
Definition grinishie1.c:174
static bool grInishie1_801FA9AC(void)
Definition grinishie1.c:263
@ Gr_Kind_Inishie1
Definition forward.h:79

◆ grI1_803E49B8

struct block_table_struct grI1_803E49B8
Initial value:
= {
{ 13, 3 }, { 14, 14 }, { 15, 15 }, { 16, 16 }, { 17, 17 },
{ 18, 18 }, { 19, 19 }, { 11, 20 }, { 12, 21 }, { 1, 4 },
{ 2, 5 }, { 3, 6 }, { 4, 7 }, { 5, 8 }, { 6, 9 },
{ 7, 10 }, { 8, 11 }, { 9, 12 }, { 10, 13 },
}