Skip to content

Commit

Permalink
76%
Browse files Browse the repository at this point in the history
  • Loading branch information
mkst committed Sep 16, 2024
1 parent ebe54ea commit ff204c2
Show file tree
Hide file tree
Showing 34 changed files with 1,592 additions and 802 deletions.
3 changes: 3 additions & 0 deletions include/2.0I/PR/mbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
#define _SHIFTR(v, s, w) \
((unsigned int)(((unsigned int)(v) >> (s)) & ((0x01 << (w)) - 1)))

/* decomp-permuter does not like this macro */
#if 0
#define _SHIFT _SHIFTL /* old, for compatibility only */
#endif

#define G_ON (1)
#define G_OFF (0)
Expand Down
2 changes: 1 addition & 1 deletion include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void set_fog_position_and_color(Gfx **dl);
s16 distance_from_player(s16 x, s16 z, s16 y);

// overlay2_6D9330
struct050 *spawn_animal(s16 x, s16 z, s16 y, s16 rotation, s16 health, s16 id, s8 arg6);
Animal2 *spawn_animal(s16 x, s16 z, s16 y, s16 rotation, s16 health, s16 id, s8 arg6);

// overlay2_6D9AF0
struct071 *spawn_object(u8 id, s16 x, s16 z, s16 y, s32 xVel, s32 zVel, s32 yVel, s16 zRotation, s16 yRotation, u16 scale);
Expand Down
2 changes: 1 addition & 1 deletion include/functions.us.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void func_802BD358_6CEA08(s16 *arg0);
void func_802BD40C_6CEABC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7, s16 *arg8, s16 *arg9, s16 *argA, s16 argB, s16 argC, s16 argD, s16 argE, s16 argF, s16 arg10, s16 arg11, s16 arg12, s16 *arg13, s16 *arg14, s16 *arg15, struct061 *arg16, s16 arg17); // tbd
void func_802BE1A0_6CF850(struct103 *arg0, s16 arg1, u16 arg2, u8 arg3, u16 arg4, s16 arg5, s16 arg6, s16 arg7, s16 arg8, struct077 *arg9, struct077 *argA, struct077 * argB, s8 argC);
void func_802BEAB0_6D0160(struct103 *arg0, s16 arg1, u16 arg2, u16 arg3, u16 arg4, s16 arg5, s16 arg6, s16 arg7, s16 arg8, struct077 *arg9, struct077 *argA, struct077 *argB, s8 argC);
void func_802BF3C0_6D0A70(s16 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s32 arg6, struct077 *arg7, struct077 *arg8, s16 arg9, s16 argA, s16 argB, s16 argC, s16 argD, s16 argE, s32 argF, s32 arg10, s32 arg11, struct061 *arg12);
void func_802BF3C0_6D0A70(s16 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, struct077 *arg6, struct077 *arg7, struct077 *arg8, s16 arg9, s16 argA, s16 argB, s16 argC, s16 argD, s16 argE, s32 argF, s32 arg10, s32 arg11, struct061 *arg12);
void func_802BFF84_6D1634(struct103 *arg0, s16 arg1, u16 arg2, u16 arg3, u16 arg4, s16 arg5, s16 arg6, struct077 *arg7, struct077 *arg8, struct077 *arg9, s8 argA);
void func_802C0364_6D1A14(s16 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s32 arg6, s32 arg7, s32 arg8, s16 arg9, s16 argA, s16 argB, s16 argC, s16 argD, s16 argE, struct077 *argF, struct077 *arg10, struct077 *arg11, struct061 *arg12);
void func_802C13E4_6D2A94(struct103 *arg0, s16 arg1, u16 arg2, u16 arg3, u16 arg4, s16 arg5, s16 arg6, struct077 *arg7, struct077 *arg8, struct077 *arg9, s8 argA);
Expand Down
2 changes: 1 addition & 1 deletion include/ld_symbols.us.h
Original file line number Diff line number Diff line change
Expand Up @@ -2929,7 +2929,7 @@ extern Addr overlay2_6D9AF0_c;
extern Addr overlay2_6DA670_c;
extern Addr overlay2_6DB610_c;
extern Addr overlay2_6DCA10_data__s;
extern Addr overlay2_6EC720_data__s;
extern Addr overlay2_6EC720_c;
extern Addr overlay2_6ECFF0_c;
extern Addr overlay2_6ED230_c;
extern Addr overlay2_6FA0A0_c;
Expand Down
1 change: 1 addition & 0 deletions include/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
// 61 some kind of sparkle
#define OBJECT_ACTIVE_TURRET 62
#define OBJECT_ACTIVE_MISSILE_TURRET 63

#define OBJECT_PLANT_1 65
#define OBJECT_PLANT_2 66
#define OBJECT_BLACK_FOG 67
Expand Down
32 changes: 13 additions & 19 deletions include/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ typedef struct {
/* 0x0 */ u8 id;
} CmdType39; // CmdSetMusicTrack

typedef struct {
/* 0x0 */ u16 unk0;
} CmdType41; // sets D_803F2D50.unk1E / D_803F2D50.unk1C

typedef struct {
/* 0x0 */ u8 unk0;
/* 0x1 */ u8 unk1;
Expand Down Expand Up @@ -476,6 +480,7 @@ typedef struct {
CmdType37 type37;
CmdType38 type38;
CmdType39 type39;
CmdType41 type41;
CmdType50 type50;
CmdType51 type51;
CmdType52 type52;
Expand Down Expand Up @@ -671,18 +676,7 @@ typedef struct {
} WaypointData;

typedef struct {
union {
s32 w;
s16 h;
} unk0; // xPos
union {
s32 w;
s16 h;
} unk4; // xPos
union {
s32 w;
s16 h;
} unk8; // yPos
Position pos;
s32 unkC; // unkD0, size?
} struct043; // size 0x10

Expand Down Expand Up @@ -717,8 +711,8 @@ struct Animal {
/* 0x2A */ s16 unk2A; // 0..360
/* 0x2C */ s16 yRotation;
/* 0x2E */ s16 zRotation;
/* 0x30 */ s16 unk30;
/* 0x32 */ s16 unk32;
/* 0x30 */ s16 unk30; // width?
/* 0x32 */ s16 unk32; // depth?
/* 0x34 */ s16 unk34; // used in collision
/* 0x36 */ s16 unk36;
/* 0x38 */ s8 unk38;
Expand Down Expand Up @@ -1804,16 +1798,16 @@ typedef struct {
/* 0x0 */ s16 unk0;
/* 0x2 */ s16 unk2; // teleporter type
/* 0x4 */ s16 unk4;
/* 0x6 */ s16 unk6[12];
/* 0x1E */ s16 unk1E[12];
/* 0x6 */ s16 unk6[12]; // green?
/* 0x1E */ s16 unk1E[12]; // size?
/* 0x38 */ f32 unk38;
/* 0x3C */ f32 unk3C;
/* 0x40 */ s16 unk40;
/* 0x42 */ s16 unk42;
/* 0x44 */ s16 unk44;
/* 0x46 */ s16 unk46;
/* 0x48 */ s16 unk48;
/* 0x4A */ s16 unk4A;
/* 0x46 */ s16 unk46; // 2nd xPos
/* 0x48 */ s16 unk48; // 2nd zPos
/* 0x4A */ s16 unk4A; // 2nd yPos
/* 0x4C */ s16 unk4C;
/* 0x4E */ s16 unk4E;
/* 0x50 */ s16 unk50;
Expand Down
1 change: 0 additions & 1 deletion include/variables.us.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ extern struct089 D_803A05D0_7B1C80[68];
extern struct098 D_803A1BB0_7B3260[];
extern u16 D_803A20B0_7B3760[]; // colors
extern struct099 D_803A20C0_7B3770[];
extern struct076 D_803A2D90_7B4440[];

extern struct118 D_803A3990_7B5040[];
extern struct118 D_803A39C0_7B5070[];
Expand Down
19 changes: 7 additions & 12 deletions src.us/main_10DC0.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,13 @@ void func_801356C0(s32 x, s32 y, s32 x_size, s32 y_size, Gfx **dl, u8 *img, f32
gDPSetCycleType((*dl)++, G_CYC_1CYCLE);
}

#ifdef NON_MATCHING
// CURRENT (16)
// draw chunked images (e.g. 200 credz)
void draw_chunked_image(u32 startX, u32 startY, u32 width, u32 height, Gfx **dl, u8 *img) {

s32 yOffset;
s32 xx, yy;
s32 x, y;
void *imgAddr;
s32 yOffset;
u32 sp8C;
s32 x, y;

gDPPipeSync((*dl)++);

Expand All @@ -69,7 +66,6 @@ void draw_chunked_image(u32 startX, u32 startY, u32 width, u32 height, Gfx **dl,
sp8C = width / 32;

while (y < (startY + height)) {

x = startX;

if ((startY + height) < (y + 32)) {
Expand All @@ -79,11 +75,13 @@ void draw_chunked_image(u32 startX, u32 startY, u32 width, u32 height, Gfx **dl,
}

while (x < (startX + width)) {
s16 xx;
s8 yy;

xx = x - startX;
yy = y - startY;
yy = (s32)(y - startY) / 32;
xx = (s32)(x - startX) / 32;

imgAddr = (0, img) + (((u8) (((s8) (yy / 32) * sp8C) + (s16)(xx / 32))) * (32 * 32 * 2));
imgAddr = (0, img) + (((u8) ((yy * sp8C) + xx)) * (32 * 32 * 2));

gDPSetTextureImage((*dl)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, imgAddr);
gDPLoadSync((*dl)++);
Expand Down Expand Up @@ -122,9 +120,6 @@ void draw_chunked_image(u32 startX, u32 startY, u32 width, u32 height, Gfx **dl,
gDPPipeSync((*dl)++);
gDPSetCycleType((*dl)++, G_CYC_1CYCLE);
}
#else
#pragma GLOBAL_ASM("asm/nonmatchings/main_10DC0/draw_chunked_image.s")
#endif

void func_801360C8(Gfx **dl, uSprite *arg1, u16 width, u16 height, u16 scale_x, u16 scale_y, u8 flip_x, u8 flip_y, u16 p_screen_x, u16 p_screen_y, u16 z) {
gDPPipeSync((*dl)++);
Expand Down
19 changes: 11 additions & 8 deletions src.us/main_7890.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ typedef struct {
u8 unk4;
} struct014;


#ifdef NON_MATCHING
// unused. fakematch nonsense.
void func_8012C190(struct014 *arg0, u16 arg1, s16 arg2, s16 arg3) {
u8 i;
int new_var2;
struct014_inner *new_var;

for (i = 0; i < arg0->unk4; i++) {
// (arg0->unk0 + (i * 0xC))->unk8
if (arg1 >= arg0->unk0[i].unk8) {
if (arg0 && arg0 && arg0) {}
s32 tmp = arg1;
new_var = &arg0->unk0[i];

if (arg1 < (*new_var).unk8) {

} else {
new_var2 = (*new_var).unk8;
new_var2 = new_var2 && arg0;
}
}
}
#else
#pragma GLOBAL_ASM("asm/nonmatchings/main_7890/func_8012C190.s")
#endif
7 changes: 6 additions & 1 deletion src.us/overlay2_6ACF20.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ void func_8029BB94_6AD244(void) {
if (D_803D2D90.unk0 == 1) {
D_803D2D90.unk0 = 2;
D_803D2D90.unk4 = 0;

for (i = 0; i < 12; i++) {
D_803D2D90.unk6[i] = 0;
D_803D2D90.unk1E[i] = 0;
Expand All @@ -155,6 +156,7 @@ void func_8029BB94_6AD244(void) {
D_803D2DF8 = 0.25f;
do_rumble(0, 40, 8, 0x20, distance_from_player(D_803D2D90.unk4C, D_803D2D90.unk4E, D_803D2D90.unk50));
}

if (D_803D2D90.unk0 == 3) {
D_803D2D90.unk0 = 4;
D_803D2D90.unk4 = 0;
Expand All @@ -174,6 +176,7 @@ void func_8029BB94_6AD244(void) {
D_803D2DF8 = 0.25f;
do_rumble(0, 40, 8, 32, distance_from_player(D_803D2D90.unk52, D_803D2D90.unk54, D_803D2D90.unk56));
}

if (D_803D2D90.unk0 == 2) {
D_803D2D90.unk42++;
if (D_803D2D90.unk42 < 115) {
Expand Down Expand Up @@ -216,6 +219,7 @@ void func_8029BB94_6AD244(void) {
D_803D2D90.unk3C += D_803D2D90.unk38;
}
}

if (D_803D2D90.unk0 == 4) {
D_803D2D90.unk44++;
if (D_803D2D90.unk44 < 115) {
Expand Down Expand Up @@ -322,10 +326,11 @@ void func_8029BB94_6AD244(void) {
0xFFFF,
0);
}
// breathing in & out?
// vertex x/z position?
if (D_803D2D90.unk1E[sp8C] >= 2) {
D_803D2D90.unk1E[sp8C] -= 2;
}
// vertex green level?
if (D_803D2D90.unk6[sp8C] < 100) {
D_803D2D90.unk6[sp8C] += 1;
}
Expand Down
Loading

0 comments on commit ff204c2

Please sign in to comment.