SSBM Decomp
Loading...
Searching...
No Matches
grinishie1.c File Reference
#include "gr/grinishie1.h"
#include <platform.h>
#include "cm/camera.h"
#include "ef/efsync.h"
#include "gm/gm_unsplit.h"
#include "gr/forward.h"
#include "gr/grdisplay.h"
#include "gr/grlib.h"
#include "gr/grmaterial.h"
#include "gr/grzakogenerator.h"
#include "gr/inlines.h"
#include "gr/stage.h"
#include "it/it_266F.h"
#include "it/it_26B1.h"
#include "lb/lb_00B0.h"
#include "lb/lb_00F9.h"
#include "lb/lbaudio_ax.h"
#include "mp/forward.h"
#include "mp/mplib.h"
#include "sysdolphin/baselib/dobj.h"
#include "sysdolphin/baselib/gobjgxlink.h"
#include "sysdolphin/baselib/gobjproc.h"
#include "sysdolphin/baselib/jobj.h"
#include "sysdolphin/baselib/memory.h"
#include "sysdolphin/baselib/random.h"
#include <baselib/gobj.h>

Data Structures

struct  grInishie1_stuff
struct  grInishie1_StageData
struct  block_table_struct

Macros

#define invalid_state(line)
#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)

Functions

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)
void grInishie1_801FA908 (bool arg)
void grInishie1_801FA90C (void)
void grInishie1_801FA984 (void)
void grInishie1_801FA988 (void)
bool grInishie1_801FA9AC (void)
HSD_GObjgrInishie1_801FA9B4 (s32 arg0)
void grInishie1_801FAAA0 (Ground_GObj *gobj)
bool grInishie1_801FAACC (Ground_GObj *gobj)
void grInishie1_801FAAD4 (Ground_GObj *gobj)
void grInishie1_801FAAD8 (Ground_GObj *gobj)
void grInishie1_801FAADC (Ground_GObj *gobj)
bool grInishie1_801FAB60 (Ground_GObj *gobj)
void grInishie1_801FAB68 (Ground_GObj *gobj)
void grInishie1_801FABB0 (Ground_GObj *gobj)
void grInishie1_801FABB4 (Ground_GObj *gobj)
bool grInishie1_801FABF4 (Ground_GObj *gobj)
void grInishie1_801FABFC (Ground_GObj *gobj)
void grInishie1_801FAC00 (Ground_GObj *gobj)
void grInishie1_801FAC04 (Ground_GObj *gobj)
bool grInishie1_801FAC50 (Ground_GObj *gobj)
void grInishie1_801FAC58 (Ground_GObj *gobj)
void grInishie1_801FAD80 (Ground_GObj *gobj)
void grInishie1_801FAD84 (HSD_GObj *gobj)
void grInishie1_801FB0AC (HSD_GObj *gobj, u32 index)
void grInishie1_801FB3F0 (HSD_GObj *gobj)
void grInishie1_801FBA34 (HSD_GObj *gobj, HSD_JObj *jobj)
 gives item from hatena block upwards velocity, maybe handles spawning it as well
void grInishie1_801FBAA0 (HSD_GObj *gobj, s32 index)
 creates a hatena block
void grInishie1_801FBC4C (HSD_GObj *gobj, u32 index)
void grInishie1_801FBCEC (HSD_GObj *gobj, u32 index)
void fn_801FBF6C (Item_GObj *item_gobj, Ground *gp, Vec3 *pos, HSD_GObj *arg3, f32 arg4)
void grInishie1_801FC018 (HSD_GObj *gobj)
void grInishie1_801FC110 (HSD_GObj *gobj)
static s32 get_block_id (s32 block_id)
void fn_801FBEB8 (Ground *gr, s32 block_id, CollData *arg2, s32 arg3, mpLib_GroundEnum arg4, f32 dist)
void grInishie1_801FC4A0 (HSD_GObj *gobj)
void grInishie1_801FC664 (HSD_GObj *gobj)
void fn_801FC9AC (Ground *gr, s32 block_id, s32 arg2, s32 dist, enum mpLib_GroundEnum arg4)
bool grInishie1_801FCAAC (int line_id)
void grInishie1_801FCB10 (HSD_GObj *gobj)
DynamicsDescgrInishie1_801FCBB0 (enum_t arg)
bool grInishie1_801FCBB8 (Vec3 *arg, int arg0, HSD_JObj *jobj)

Variables

grInishie1_stuffgrI1_804D69F8
Vec3 grI1_803B8268
s16 grI1_803E48C8 [22]
StageCallbacks grI1_803E48F4 []
char grI1_803E4944 [] = "/GrI1.dat"
grInishie1_StageData grI1_803E4950
struct block_table_struct block_idx_table [BLOCK_COUNT]

Macro Definition Documentation

◆ invalid_state

#define invalid_state ( line)
Value:
OSReport("%s:%d: oioi..\n", "i!=HATENA_APPEAR_CHECKLOOP", line); \
while (true) { \
}
void OSReport(const char *)

◆ 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:939
#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 attempts = 0; \
s32 index; \
\
do { \
index = HSD_Randi(0x13); \
attempts++; \
} while ((index == last_index || \
gp->gv.inishie1.blocks[index].status != 0) && \
attempts < 0x14); \
\
if (attempts == 0x14) { \
__assert("grinishie1.c", line, "%s:%d: oioi..\n"); \
} \
\
last_index = index; \
gp->gv.inishie1.blocks[index].status = status_val; \
grInishie1_801FBAA0(gobj, index); \
gp->gv.inishie1.blocks[index].x20 = 0; \
} \
}
signed long s32
Definition hsd_3B2B.h:1
s32 HSD_Randi(s32 max_val)
Definition random.c:18

Function Documentation

◆ 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

◆ grInishie1_801FA908()

void grInishie1_801FA908 ( bool arg)

◆ grInishie1_801FA90C()

void grInishie1_801FA90C ( void )

◆ grInishie1_801FA984()

void grInishie1_801FA984 ( void )

◆ grInishie1_801FA988()

void grInishie1_801FA988 ( void )

◆ grInishie1_801FA9AC()

bool grInishie1_801FA9AC ( void )

◆ grInishie1_801FA9B4()

HSD_GObj * grInishie1_801FA9B4 ( s32 arg0)

◆ grInishie1_801FAAA0()

void grInishie1_801FAAA0 ( Ground_GObj * gobj)

◆ grInishie1_801FAACC()

bool grInishie1_801FAACC ( Ground_GObj * gobj)

◆ grInishie1_801FAAD4()

void grInishie1_801FAAD4 ( Ground_GObj * gobj)

◆ grInishie1_801FAAD8()

void grInishie1_801FAAD8 ( Ground_GObj * gobj)

◆ grInishie1_801FAADC()

void grInishie1_801FAADC ( Ground_GObj * gobj)

◆ grInishie1_801FAB60()

bool grInishie1_801FAB60 ( Ground_GObj * gobj)

◆ grInishie1_801FAB68()

void grInishie1_801FAB68 ( Ground_GObj * gobj)

◆ grInishie1_801FABB0()

void grInishie1_801FABB0 ( Ground_GObj * gobj)

◆ grInishie1_801FABB4()

void grInishie1_801FABB4 ( Ground_GObj * gobj)

◆ grInishie1_801FABF4()

bool grInishie1_801FABF4 ( Ground_GObj * gobj)

◆ grInishie1_801FABFC()

void grInishie1_801FABFC ( Ground_GObj * gobj)

◆ grInishie1_801FAC00()

void grInishie1_801FAC00 ( Ground_GObj * gobj)

◆ grInishie1_801FAC04()

void grInishie1_801FAC04 ( Ground_GObj * gobj)

◆ grInishie1_801FAC50()

bool grInishie1_801FAC50 ( Ground_GObj * gobj)

◆ grInishie1_801FAC58()

void grInishie1_801FAC58 ( Ground_GObj * gobj)

◆ grInishie1_801FAD80()

void grInishie1_801FAD80 ( Ground_GObj * gobj)

◆ grInishie1_801FAD84()

void grInishie1_801FAD84 ( HSD_GObj * gobj)

◆ grInishie1_801FB0AC()

void grInishie1_801FB0AC ( HSD_GObj * gobj,
u32 index )

◆ grInishie1_801FB3F0()

void grInishie1_801FB3F0 ( HSD_GObj * gobj)

◆ grInishie1_801FBA34()

void grInishie1_801FBA34 ( HSD_GObj * gobj,
HSD_JObj * jobj )

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

◆ grInishie1_801FBAA0()

void grInishie1_801FBAA0 ( HSD_GObj * gobj,
s32 index )

creates a hatena block

◆ grInishie1_801FBC4C()

void grInishie1_801FBC4C ( HSD_GObj * gobj,
u32 index )

◆ grInishie1_801FBCEC()

void grInishie1_801FBCEC ( HSD_GObj * gobj,
u32 index )

◆ fn_801FBF6C()

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

◆ grInishie1_801FC018()

void grInishie1_801FC018 ( HSD_GObj * gobj)

◆ grInishie1_801FC110()

void grInishie1_801FC110 ( HSD_GObj * gobj)

◆ get_block_id()

s32 get_block_id ( s32 block_id)
inlinestatic

◆ fn_801FBEB8()

void fn_801FBEB8 ( Ground * gr,
s32 block_id,
CollData * arg2,
s32 arg3,
mpLib_GroundEnum arg4,
f32 dist )

◆ grInishie1_801FC4A0()

void grInishie1_801FC4A0 ( HSD_GObj * gobj)

◆ grInishie1_801FC664()

void grInishie1_801FC664 ( HSD_GObj * gobj)

◆ fn_801FC9AC()

void fn_801FC9AC ( Ground * gr,
s32 block_id,
s32 arg2,
s32 dist,
enum mpLib_GroundEnum arg4 )

◆ grInishie1_801FCAAC()

bool grInishie1_801FCAAC ( int line_id)

◆ grInishie1_801FCB10()

void grInishie1_801FCB10 ( HSD_GObj * gobj)

◆ grInishie1_801FCBB0()

DynamicsDesc * grInishie1_801FCBB0 ( enum_t arg)

◆ grInishie1_801FCBB8()

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

Variable Documentation

◆ grI1_804D69F8

grInishie1_stuff* grI1_804D69F8

◆ grI1_803B8268

Vec3 grI1_803B8268

◆ grI1_803E48C8

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

◆ grI1_803E48F4

StageCallbacks grI1_803E48F4[]
Initial value:
= {
{
0,
},
{
0,
},
{
0,
},
{
0xC0000000,
},
}
void grInishie1_801FABB0(Ground_GObj *gobj)
Definition grinishie1.c:290
void grInishie1_801FAAD8(Ground_GObj *gobj)
Definition grinishie1.c:261
void grInishie1_801FAC58(Ground_GObj *gobj)
Definition grinishie1.c:323
void grInishie1_801FAD80(Ground_GObj *gobj)
Definition grinishie1.c:352
void grInishie1_801FAAD4(Ground_GObj *gobj)
Definition grinishie1.c:259
bool grInishie1_801FAC50(Ground_GObj *gobj)
Definition grinishie1.c:318
bool grInishie1_801FAB60(Ground_GObj *gobj)
Definition grinishie1.c:276
void grInishie1_801FABB4(Ground_GObj *gobj)
Definition grinishie1.c:292
void grInishie1_801FAC00(Ground_GObj *gobj)
Definition grinishie1.c:307
bool grInishie1_801FABF4(Ground_GObj *gobj)
Definition grinishie1.c:300
void grInishie1_801FABFC(Ground_GObj *gobj)
Definition grinishie1.c:305
void grInishie1_801FAB68(Ground_GObj *gobj)
Definition grinishie1.c:281
void grInishie1_801FAAA0(Ground_GObj *gobj)
Definition grinishie1.c:248
void grInishie1_801FAC04(Ground_GObj *gobj)
Definition grinishie1.c:309
void grInishie1_801FAADC(Ground_GObj *gobj)
Definition grinishie1.c:263
bool grInishie1_801FAACC(Ground_GObj *gobj)
Definition grinishie1.c:254

◆ grI1_803E4944

char grI1_803E4944[] = "/GrI1.dat"

◆ grI1_803E4950

grInishie1_StageData grI1_803E4950
Initial value:
= {
{
1,
(S16Vec3*) grI1_803E48C8,
7,
},
"%s:%d: couldn t get gobj(id=%d)\n",
}
DynamicsDesc * grInishie1_801FCBB0(enum_t arg)
Definition grinishie1.c:1074
void grInishie1_801FA984(void)
Definition grinishie1.c:203
void grInishie1_801FA908(bool arg)
Definition grinishie1.c:178
void grInishie1_801FA90C(void)
Definition grinishie1.c:190
s16 grI1_803E48C8[22]
Definition grinishie1.c:114
void grInishie1_801FA988(void)
Definition grinishie1.c:205
bool grInishie1_801FCBB8(Vec3 *arg, int arg0, HSD_JObj *jobj)
Definition grinishie1.c:1079
char grI1_803E4944[]
Definition grinishie1.c:150
bool grInishie1_801FA9AC(void)
Definition grinishie1.c:210
StageCallbacks grI1_803E48F4[]
Definition grinishie1.c:119
@ INISHIE1
Mushroom Kingdom.
Definition forward.h:115

◆ block_idx_table

struct block_table_struct block_idx_table[BLOCK_COUNT]