mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2024-11-23 13:09:44 +00:00
Format code
This commit is contained in:
parent
0eb6abb573
commit
b07e7e7411
233
include/dra.h
233
include/dra.h
@ -2,18 +2,16 @@
|
||||
#define DRA_H
|
||||
#include "main.h"
|
||||
|
||||
typedef void (*PfnEntityUpdate)(struct Entity*);
|
||||
typedef void (*PfnEntityUpdate)(struct Entity *);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
unsigned char width;
|
||||
unsigned char height;
|
||||
unsigned short unk2;
|
||||
unsigned char data[0];
|
||||
} ImgSrc;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
s16 cursorX;
|
||||
s16 cursorY;
|
||||
s16 unk4;
|
||||
@ -25,47 +23,40 @@ typedef struct
|
||||
s16 unk1A;
|
||||
} MenuContext;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u8 tileLayoutId;
|
||||
u8 tilesetId;
|
||||
u8 objGfxId;
|
||||
u8 objLayoutId;
|
||||
} RoomLoadDef;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u8 left, top, right, bottom;
|
||||
RoomLoadDef load;
|
||||
} RoomHeader;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
s16 pressed;
|
||||
s16 previous;
|
||||
s16 tapped;
|
||||
s16 repeat;
|
||||
} Pad;
|
||||
|
||||
typedef union
|
||||
{
|
||||
typedef union {
|
||||
s32 value;
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
s16 low;
|
||||
s16 high;
|
||||
} Data;
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
s8 unk0;
|
||||
s8 unk1;
|
||||
s16 unk2;
|
||||
} Data1;
|
||||
|
||||
|
||||
} Unkunion1; // big assumption here...
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u8 _[0];
|
||||
Unkunion1 posX;
|
||||
Unkunion1 posY;
|
||||
@ -147,16 +138,14 @@ typedef struct
|
||||
u8 unkBB;
|
||||
} Entity;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
char unk0[0xA];
|
||||
s16 unkA;
|
||||
s16 unkC;
|
||||
s16 unkE;
|
||||
} Unkstruct4;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u16 posX;
|
||||
u16 posY;
|
||||
u16 flags;
|
||||
@ -164,8 +153,7 @@ typedef struct
|
||||
u16 unk8;
|
||||
} ObjectInit;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
s16 unk0;
|
||||
s16 unk2;
|
||||
u16 unk4;
|
||||
@ -207,8 +195,7 @@ typedef struct {
|
||||
s32 sp30;
|
||||
} Unkstruct7;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
void *addr1;
|
||||
void *addr2;
|
||||
u16 unk8;
|
||||
@ -217,8 +204,7 @@ typedef struct
|
||||
u16 unkE;
|
||||
} Unkstruct8;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u16 animationSet;
|
||||
u16 zPriority;
|
||||
u16 unk4;
|
||||
@ -228,11 +214,10 @@ typedef struct
|
||||
u8 unkA;
|
||||
u8 unkB;
|
||||
u32 unkC;
|
||||
u8* unk10;
|
||||
u8 *unk10;
|
||||
} ObjInit2;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
u16 programId;
|
||||
u16 unk2;
|
||||
u16 unk4;
|
||||
@ -241,17 +226,17 @@ typedef struct
|
||||
} Unkstruct10;
|
||||
|
||||
// main
|
||||
extern Unkstruct5* D_8003C704;
|
||||
extern Unkstruct5 *D_8003C704;
|
||||
extern u16 D_8003C708;
|
||||
extern s32 D_8003C730;
|
||||
extern s32 D_8003C734;
|
||||
extern void (*D_8003C744)(s32, s32);
|
||||
extern void (*g_pfnUpdateStageEntities)(void);
|
||||
extern RoomHeader* D_8003C784;
|
||||
extern void (*D_8003C7BC)(s32, s32, Unkstruct7*, s32);
|
||||
extern RoomHeader *D_8003C784;
|
||||
extern void (*D_8003C7BC)(s32, s32, Unkstruct7 *, s32);
|
||||
extern void (*g_pfnPlaySfx)(s32);
|
||||
extern void (*g_pfnFreePolygons)(s32);
|
||||
extern Unkstruct5* D_8003C808;
|
||||
extern Unkstruct5 *D_8003C808;
|
||||
extern void (*D_8003C848)(s32, s32);
|
||||
extern s32 D_8003C8C4;
|
||||
extern s32 g_roomCount;
|
||||
@ -262,22 +247,22 @@ extern s32 D_8003CACC;
|
||||
|
||||
// dra
|
||||
#define PAD_COUNT 2
|
||||
#define PAD_L2 0x0001
|
||||
#define PAD_R2 0x0002
|
||||
#define PAD_L1 0x0004
|
||||
#define PAD_R1 0x0008
|
||||
#define PAD_TRIANGLE 0x0010
|
||||
#define PAD_CIRCLE 0x0020
|
||||
#define PAD_CROSS 0x0040
|
||||
#define PAD_SQUARE 0x0080
|
||||
#define PAD_SELECT 0x0100
|
||||
#define PAD_L3 0x0200
|
||||
#define PAD_R3 0x0400
|
||||
#define PAD_START 0x0800
|
||||
#define PAD_UP 0x1000
|
||||
#define PAD_RIGHT 0x2000
|
||||
#define PAD_DOWN 0x4000
|
||||
#define PAD_LEFT 0x8000
|
||||
#define PAD_L2 0x0001
|
||||
#define PAD_R2 0x0002
|
||||
#define PAD_L1 0x0004
|
||||
#define PAD_R1 0x0008
|
||||
#define PAD_TRIANGLE 0x0010
|
||||
#define PAD_CIRCLE 0x0020
|
||||
#define PAD_CROSS 0x0040
|
||||
#define PAD_SQUARE 0x0080
|
||||
#define PAD_SELECT 0x0100
|
||||
#define PAD_L3 0x0200
|
||||
#define PAD_R3 0x0400
|
||||
#define PAD_START 0x0800
|
||||
#define PAD_UP 0x1000
|
||||
#define PAD_RIGHT 0x2000
|
||||
#define PAD_DOWN 0x4000
|
||||
#define PAD_LEFT 0x8000
|
||||
|
||||
#define RENDERFLAGS_NOSHADOW 2
|
||||
#define PLAYER_ALUCARD 0
|
||||
@ -319,23 +304,23 @@ extern s32 D_8003CACC;
|
||||
#define PROGRAM_NO3 0x41
|
||||
#define PROGRAM_INVERTEDCASTLE_FLAG 0x20
|
||||
|
||||
#define LBA_BIN_F_GAME 0x61CE
|
||||
#define LBA_BIN_F_GAME2 0x6252
|
||||
#define LBA_STAGE_MAD_ART 0x7D6F
|
||||
#define LBA_STAGE_MAD_VH 0x7DEF
|
||||
#define LBA_STAGE_MAD_BIN 0x7E28
|
||||
#define LBA_STAGE_NO0_ART 0x7E5D
|
||||
#define LBA_STAGE_NO0_VH 0x7EDD
|
||||
#define LBA_STAGE_NO0_BIN 0x7F16
|
||||
#define LBA_STAGE_NO3_ART 0x8297
|
||||
#define LBA_STAGE_NO3_VH 0x8317
|
||||
#define LBA_STAGE_NO3_BIN 0x834F
|
||||
#define LBA_STAGE_ST0_ART 0x9044
|
||||
#define LBA_STAGE_ST0_VH 0x90C4
|
||||
#define LBA_STAGE_ST0_BIN 0x90F9
|
||||
#define LBA_STAGE_NP3_ART 0x917F
|
||||
#define LBA_STAGE_NP3_VH 0x91FF
|
||||
#define LBA_STAGE_NP3_BIN 0x9235
|
||||
#define LBA_BIN_F_GAME 0x61CE
|
||||
#define LBA_BIN_F_GAME2 0x6252
|
||||
#define LBA_STAGE_MAD_ART 0x7D6F
|
||||
#define LBA_STAGE_MAD_VH 0x7DEF
|
||||
#define LBA_STAGE_MAD_BIN 0x7E28
|
||||
#define LBA_STAGE_NO0_ART 0x7E5D
|
||||
#define LBA_STAGE_NO0_VH 0x7EDD
|
||||
#define LBA_STAGE_NO0_BIN 0x7F16
|
||||
#define LBA_STAGE_NO3_ART 0x8297
|
||||
#define LBA_STAGE_NO3_VH 0x8317
|
||||
#define LBA_STAGE_NO3_BIN 0x834F
|
||||
#define LBA_STAGE_ST0_ART 0x9044
|
||||
#define LBA_STAGE_ST0_VH 0x90C4
|
||||
#define LBA_STAGE_ST0_BIN 0x90F9
|
||||
#define LBA_STAGE_NP3_ART 0x917F
|
||||
#define LBA_STAGE_NP3_VH 0x91FF
|
||||
#define LBA_STAGE_NP3_BIN 0x9235
|
||||
|
||||
extern s32 D_8006BAFC;
|
||||
extern s32 D_8006BB00;
|
||||
@ -343,7 +328,7 @@ extern s32 D_8006C374;
|
||||
extern s32 D_8006C398;
|
||||
extern s32 g_backbufferX;
|
||||
extern s32 g_backbufferY;
|
||||
extern Entity* D_8006C3B8;
|
||||
extern Entity *D_8006C3B8;
|
||||
extern Unkstruct4 D_80072B34;
|
||||
extern s32 D_80072F20;
|
||||
extern s32 D_80072F2C;
|
||||
@ -375,20 +360,20 @@ extern s32 D_800733E0;
|
||||
extern s32 D_800733E4;
|
||||
extern u16 D_800733EC;
|
||||
extern u16 D_800733EE;
|
||||
extern s8 D_800733F0;
|
||||
extern u8 D_800733F1;
|
||||
extern s8 D_800733F0;
|
||||
extern u8 D_800733F1;
|
||||
extern s16 D_80073404;
|
||||
extern u16 D_80073406;
|
||||
extern u16 D_8007340A;
|
||||
extern u16 D_8007341C;
|
||||
extern /*?*/s32 *D_80073424;
|
||||
extern /*?*/ s32 *D_80073424;
|
||||
extern s16 D_80073428;
|
||||
extern s16 D_8007342A;
|
||||
extern u16 D_8007342E;
|
||||
extern s8 D_80073510;
|
||||
extern s8 D_80073511;
|
||||
extern s8 D_80073512;
|
||||
extern s8 D_80073513;
|
||||
extern s8 D_80073510;
|
||||
extern s8 D_80073511;
|
||||
extern s8 D_80073512;
|
||||
extern s8 D_80073513;
|
||||
extern Entity D_800762D8[]; // D_800733D8 + 0x40
|
||||
extern Unkstruct8 g_CurrentRoomTileLayout;
|
||||
extern Entity D_8007A958[];
|
||||
@ -396,7 +381,7 @@ extern Entity D_8007D858[];
|
||||
extern u16 D_80097408;
|
||||
extern s32 D_80097428[];
|
||||
extern Entity D_8007EF1C;
|
||||
extern void* D_8007EFD8;
|
||||
extern void *D_8007EFD8;
|
||||
extern POLY_GT4 D_80086FEC[];
|
||||
extern s32 playerX;
|
||||
extern s32 playerY;
|
||||
@ -414,9 +399,9 @@ extern s32 g_mapProgramId;
|
||||
extern s32 D_800974AC;
|
||||
extern s32 D_80097908;
|
||||
extern s32 D_8009790C;
|
||||
extern u8 D_8009796E;
|
||||
extern u8 D_8009798A;
|
||||
extern u8 D_80097A8D;
|
||||
extern u8 D_8009796E;
|
||||
extern u8 D_8009798A;
|
||||
extern u8 D_80097A8D;
|
||||
extern s32 g_playerLevel;
|
||||
extern s32 g_playerExp;
|
||||
extern s32 g_playerGold;
|
||||
@ -436,22 +421,22 @@ extern s32 D_80097C98;
|
||||
|
||||
extern s32 D_800A2438;
|
||||
extern Unkstruct10 D_800A2464[];
|
||||
extern const char* c_strALUCARD;
|
||||
extern const char* c_strSTR;
|
||||
extern const char* c_strCON;
|
||||
extern const char* c_strINT;
|
||||
extern const char* c_strLCK;
|
||||
extern const char* c_strEXP;
|
||||
extern const char* c_strNEXT;
|
||||
extern const char* c_strGOLD;
|
||||
extern const char* c_strLEVEL;
|
||||
extern const char* c_strTIME;
|
||||
extern const char* c_strROOMS;
|
||||
extern const char *c_strALUCARD;
|
||||
extern const char *c_strSTR;
|
||||
extern const char *c_strCON;
|
||||
extern const char *c_strINT;
|
||||
extern const char *c_strLCK;
|
||||
extern const char *c_strEXP;
|
||||
extern const char *c_strNEXT;
|
||||
extern const char *c_strGOLD;
|
||||
extern const char *c_strLEVEL;
|
||||
extern const char *c_strTIME;
|
||||
extern const char *c_strROOMS;
|
||||
extern const char *c_strKILLS;
|
||||
extern const char* c_strHP;
|
||||
extern const char* c_strMP;
|
||||
extern const char* c_strHEART;
|
||||
extern const char* c_strSTATUS;
|
||||
extern const char *c_strHP;
|
||||
extern const char *c_strMP;
|
||||
extern const char *c_strHEART;
|
||||
extern const char *c_strSTATUS;
|
||||
extern const char *c_strButton;
|
||||
extern const char *c_strCloak;
|
||||
extern const char *c_strCloak2;
|
||||
@ -471,7 +456,7 @@ extern const char *c_strStereo;
|
||||
extern const char *c_strMono;
|
||||
extern const char *c_strWindow;
|
||||
extern const char *c_strTime;
|
||||
extern const char* c_strALUCART;
|
||||
extern const char *c_strALUCART;
|
||||
extern const char *c_strSSword;
|
||||
extern s32 D_800A4B04;
|
||||
extern s32 D_800A7718;
|
||||
@ -486,13 +471,13 @@ extern const char *c_strSpecial2;
|
||||
extern s32 D_800ACC64;
|
||||
extern RECT c_backbufferClear;
|
||||
extern s16 D_800BD07C[];
|
||||
extern u8 D_80137460;
|
||||
extern RoomLoadDef* D_801375BC;
|
||||
extern u8 D_80137460;
|
||||
extern RoomLoadDef *D_801375BC;
|
||||
extern s32 D_801375C8;
|
||||
extern s32 D_801375DC;
|
||||
extern s32 D_801375FC;
|
||||
extern s32 D_80137618;
|
||||
extern s8 D_80137638;
|
||||
extern s8 D_80137638;
|
||||
extern s32 D_80137844;
|
||||
extern s32 D_80137848;
|
||||
extern s32 D_8013784C;
|
||||
@ -518,9 +503,9 @@ extern s32 D_80138F7C;
|
||||
extern s16 D_80139000;
|
||||
extern s16 D_80139008;
|
||||
extern s16 D_8013901C;
|
||||
extern u8 D_80139020;
|
||||
extern s8 D_801390C4;
|
||||
extern u8 D_801390D8;
|
||||
extern u8 D_80139020;
|
||||
extern s8 D_801390C4;
|
||||
extern u8 D_801390D8;
|
||||
extern s16 D_801390DC;
|
||||
extern s16 D_801390DE;
|
||||
extern s16 D_801390E0;
|
||||
@ -528,13 +513,13 @@ extern s16 D_801396EA;
|
||||
extern u16 D_801396F4;
|
||||
extern s32 D_801397FC;
|
||||
extern s32 D_8013980C;
|
||||
extern u8 D_80139810;
|
||||
extern u8 D_80139810;
|
||||
extern s32 D_80139828;
|
||||
extern s32 D_80139834[];
|
||||
extern s16 D_80139868;
|
||||
extern s16 D_80139A70;
|
||||
extern s32 D_8013AE9C;
|
||||
extern u8 D_8013AEEC;
|
||||
extern u8 D_8013AEEC;
|
||||
extern s32 D_8013B158;
|
||||
extern s32 D_8013B3D0;
|
||||
extern s16 D_8013B3E8[];
|
||||
@ -543,12 +528,12 @@ extern s32 D_8013B61C;
|
||||
extern s16 D_8013B658;
|
||||
extern s32 D_8013B660;
|
||||
extern s16 D_8013B668;
|
||||
extern u8 D_8013B680;
|
||||
extern u8 D_8013B680;
|
||||
extern s8 D_8013B684;
|
||||
extern s32 D_8013B694;
|
||||
extern s32 D_80138784[487];
|
||||
extern ImgSrc* g_imgUnk8013C200;
|
||||
extern ImgSrc* g_imgUnk8013C270;
|
||||
extern ImgSrc *g_imgUnk8013C200;
|
||||
extern ImgSrc *g_imgUnk8013C270;
|
||||
|
||||
void func_800E4124(s32 arg0);
|
||||
void func_800E8D24(void);
|
||||
@ -571,19 +556,21 @@ void func_800F4F48(void);
|
||||
void func_800F4FD0(void);
|
||||
bool IsAlucart();
|
||||
void func_800F53A4(void);
|
||||
s32 IsSpriteOutsideDrawArea(s32 x0, s32 x1, s32 y0, s32 y1, MenuContext* a5);
|
||||
bool ScissorSprite(SPRT* arg0, MenuContext* arg1);
|
||||
void func_800F5904(void*, s32 x, s32 y, s32 w, u32 h, s32 u, s32 v, s32 unk1, s32 unk2, bool disableTexShade, s32 unk4);
|
||||
void func_800F5E68(MenuContext*, s32 iOption, s32 x, s32 y, s32 w, s32 h, s32, s32);
|
||||
s32 IsSpriteOutsideDrawArea(s32 x0, s32 x1, s32 y0, s32 y1, MenuContext *a5);
|
||||
bool ScissorSprite(SPRT *arg0, MenuContext *arg1);
|
||||
void func_800F5904(void *, s32 x, s32 y, s32 w, u32 h, s32 u, s32 v, s32 unk1,
|
||||
s32 unk2, bool disableTexShade, s32 unk4);
|
||||
void func_800F5E68(MenuContext *, s32 iOption, s32 x, s32 y, s32 w, s32 h, s32,
|
||||
s32);
|
||||
s32 func_800F62E8(s32 arg0);
|
||||
void DrawMenuChar(char ch, int x, int y, MenuContext* context);
|
||||
void DrawMenuStr(const char* str, s32 x, s32 y, MenuContext* context);
|
||||
void DrawMenuInt(s32 value, s32 x, s32 y, MenuContext*);
|
||||
void DrawSettingsReverseCloak(MenuContext* context);
|
||||
void DrawSettingsSound(MenuContext* context);
|
||||
void DrawMenuChar(char ch, int x, int y, MenuContext *context);
|
||||
void DrawMenuStr(const char *str, s32 x, s32 y, MenuContext *context);
|
||||
void DrawMenuInt(s32 value, s32 x, s32 y, MenuContext *);
|
||||
void DrawSettingsReverseCloak(MenuContext *context);
|
||||
void DrawSettingsSound(MenuContext *context);
|
||||
void DrawPauseMenu(s32 arg0);
|
||||
void func_800F82F4(void);
|
||||
void func_800F8858(MenuContext* context);
|
||||
void func_800F8858(MenuContext *context);
|
||||
void func_800FABEC(s32 arg0);
|
||||
void func_800FAC30(void);
|
||||
s32 func_800FD4C0(s32, s32);
|
||||
@ -591,17 +578,19 @@ s32 func_800FD664(s32 arg0);
|
||||
u8 *func_800FD744(s32 arg0);
|
||||
u8 *func_800FD760(s32 arg0);
|
||||
s32 func_800FD77C(s32 arg0, s32 arg1);
|
||||
bool func_800FD7C0(s32, s32);;
|
||||
bool func_800FD7C0(s32, s32);
|
||||
;
|
||||
void func_800FD874(u16 arg0, s32 arg1);
|
||||
void func_800FDE00(void);
|
||||
void func_800FF0A0(s32 arg0);
|
||||
void func_80102DEC(s32 arg0);
|
||||
void func_80103EAC(void);
|
||||
void func_80106590(Entity*);
|
||||
void func_80106590(Entity *);
|
||||
void func_801065F4(s16 startIndex);
|
||||
void func_801071CC(POLY_GT4 *poly, u8, s32);
|
||||
void func_80107250(POLY_GT4 *poly, s32 arg1);
|
||||
void func_80107360(POLY_GT4 *poly, s32 x, s32 y, s32 width, s32 height, u8 u, u8 v);
|
||||
void func_80107360(POLY_GT4 *poly, s32 x, s32 y, s32 width, s32 height, u8 u,
|
||||
u8 v);
|
||||
void SetPolyRect(POLY_GT4 *poly, s32 x, s32 y, s32 width, s32 height);
|
||||
void func_8010D584(s16 arg0);
|
||||
void func_8010E0A8(void);
|
||||
|
@ -8,18 +8,15 @@
|
||||
|
||||
#ifndef INCLUDE_ASM
|
||||
|
||||
#define INCLUDE_ASM(FOLDER, NAME) \
|
||||
__asm__( \
|
||||
".section .text\n" \
|
||||
"\t.align\t2\n" \
|
||||
"\t.globl\t"#NAME"\n" \
|
||||
"\t.ent\t"#NAME"\n" \
|
||||
#NAME ":\n" \
|
||||
".include \""FOLDER"/"#NAME".s\"\n" \
|
||||
"\t.set reorder\n" \
|
||||
"\t.set at\n" \
|
||||
"\t.end\t"#NAME \
|
||||
);
|
||||
#define INCLUDE_ASM(FOLDER, NAME) \
|
||||
__asm__(".section .text\n" \
|
||||
"\t.align\t2\n" \
|
||||
"\t.globl\t" #NAME "\n" \
|
||||
"\t.ent\t" #NAME "\n" #NAME ":\n" \
|
||||
".include \"" FOLDER "/" #NAME ".s\"\n" \
|
||||
"\t.set reorder\n" \
|
||||
"\t.set at\n" \
|
||||
"\t.end\t" #NAME);
|
||||
#endif
|
||||
|
||||
// omit .global
|
||||
@ -29,5 +26,4 @@ __asm__(".include \"macro.inc\"\n");
|
||||
#define INCLUDE_ASM(FOLDER, NAME)
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,73 +1,73 @@
|
||||
|
||||
#define DescMask 0xff000000
|
||||
#define DescTH DescMask
|
||||
#define DescHW 0xf0000000
|
||||
#define DescEV 0xf1000000
|
||||
#define DescRC 0xf2000000
|
||||
#define DescUEV 0xf3000000 /* User event */
|
||||
#define DescSW 0xf4000000 /* BIOS */
|
||||
#define DescMask 0xff000000
|
||||
#define DescTH DescMask
|
||||
#define DescHW 0xf0000000
|
||||
#define DescEV 0xf1000000
|
||||
#define DescRC 0xf2000000
|
||||
#define DescUEV 0xf3000000 /* User event */
|
||||
#define DescSW 0xf4000000 /* BIOS */
|
||||
|
||||
#define HwVBLANK (DescHW|0x01) /* VBLANK */
|
||||
#define HwGPU (DescHW|0x02) /* GPU */
|
||||
#define HwCdRom (DescHW|0x03) /* CDROM Decorder */
|
||||
#define HwDMAC (DescHW|0x04) /* DMA controller */
|
||||
#define HwRTC0 (DescHW|0x05) /* RTC0 */
|
||||
#define HwRTC1 (DescHW|0x06) /* RTC1 */
|
||||
#define HwRTC2 (DescHW|0x07) /* RTC2 */
|
||||
#define HwCNTL (DescHW|0x08) /* Controller */
|
||||
#define HwSPU (DescHW|0x09) /* SPU */
|
||||
#define HwPIO (DescHW|0x0a) /* PIO */
|
||||
#define HwSIO (DescHW|0x0b) /* SIO */
|
||||
#define HwVBLANK (DescHW | 0x01) /* VBLANK */
|
||||
#define HwGPU (DescHW | 0x02) /* GPU */
|
||||
#define HwCdRom (DescHW | 0x03) /* CDROM Decorder */
|
||||
#define HwDMAC (DescHW | 0x04) /* DMA controller */
|
||||
#define HwRTC0 (DescHW | 0x05) /* RTC0 */
|
||||
#define HwRTC1 (DescHW | 0x06) /* RTC1 */
|
||||
#define HwRTC2 (DescHW | 0x07) /* RTC2 */
|
||||
#define HwCNTL (DescHW | 0x08) /* Controller */
|
||||
#define HwSPU (DescHW | 0x09) /* SPU */
|
||||
#define HwPIO (DescHW | 0x0a) /* PIO */
|
||||
#define HwSIO (DescHW | 0x0b) /* SIO */
|
||||
|
||||
#define HwCPU (DescHW|0x10) /* Exception */
|
||||
#define HwCARD (DescHW|0x11) /* memory card */
|
||||
#define HwCARD_0 (DescHW|0x12) /* memory card */
|
||||
#define HwCARD_1 (DescHW|0x13) /* memory card */
|
||||
#define SwCARD (DescSW|0x01) /* memory card */
|
||||
#define SwMATH (DescSW|0x02) /* libmath */
|
||||
#define HwCPU (DescHW | 0x10) /* Exception */
|
||||
#define HwCARD (DescHW | 0x11) /* memory card */
|
||||
#define HwCARD_0 (DescHW | 0x12) /* memory card */
|
||||
#define HwCARD_1 (DescHW | 0x13) /* memory card */
|
||||
#define SwCARD (DescSW | 0x01) /* memory card */
|
||||
#define SwMATH (DescSW | 0x02) /* libmath */
|
||||
|
||||
#define RCntCNT0 (DescRC|0x00) /* <20>\<5C><><EFBFBD>s<EFBFBD>N<EFBFBD>Z<EFBFBD><5A> */
|
||||
#define RCntCNT1 (DescRC|0x01) /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
#define RCntCNT2 (DescRC|0x02) /* <20>V<EFBFBD>X<EFBFBD>e<EFBFBD><65><EFBFBD>N<EFBFBD><4E><EFBFBD>b<EFBFBD>N<EFBFBD>W<EFBFBD><57><EFBFBD><EFBFBD> */
|
||||
#define RCntCNT3 (DescRC|0x03) /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>^<5E>[<5B>Q<EFBFBD>b<EFBFBD>g<EFBFBD>l<EFBFBD>͂P<CD82>ɌŒ<C98C> */
|
||||
#define RCntCNT0 (DescRC | 0x00) /* <20>\<5C><><EFBFBD>s<EFBFBD>N<EFBFBD>Z<EFBFBD><5A> */
|
||||
#define RCntCNT1 (DescRC | 0x01) /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
#define RCntCNT2 (DescRC | 0x02) /* <20>V<EFBFBD>X<EFBFBD>e<EFBFBD><65><EFBFBD>N<EFBFBD><4E><EFBFBD>b<EFBFBD>N<EFBFBD>W<EFBFBD><57><EFBFBD><EFBFBD> */
|
||||
#define RCntCNT3 (DescRC | 0x03) /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>^<5E>[<5B>Q<EFBFBD>b<EFBFBD>g<EFBFBD>l<EFBFBD>͂P<CD82>ɌŒ<C98C> */
|
||||
|
||||
#define RCntMdINTR 0x1000
|
||||
#define RCntMdNOINTR 0x2000
|
||||
#define RCntMdSC 0x0001
|
||||
#define RCntMdSP 0x0000
|
||||
#define RCntMdFR 0x0000
|
||||
#define RCntMdGATE 0x0010
|
||||
#define RCntMdINTR 0x1000
|
||||
#define RCntMdNOINTR 0x2000
|
||||
#define RCntMdSC 0x0001
|
||||
#define RCntMdSP 0x0000
|
||||
#define RCntMdFR 0x0000
|
||||
#define RCntMdGATE 0x0010
|
||||
|
||||
#define EvSpCZ 0x0001 /* counter becomes zero */
|
||||
#define EvSpINT 0x0002 /* interrupted */
|
||||
#define EvSpIOE 0x0004 /* end of i/o */
|
||||
#define EvSpCLOSE 0x0008 /* file was closed */
|
||||
#define EvSpACK 0x0010 /* command acknowledged */
|
||||
#define EvSpCOMP 0x0020 /* command completed */
|
||||
#define EvSpDR 0x0040 /* data ready */
|
||||
#define EvSpDE 0x0080 /* data end */
|
||||
#define EvSpTIMOUT 0x0100 /* time out */
|
||||
#define EvSpUNKNOWN 0x0200 /* unknown command */
|
||||
#define EvSpIOER 0x0400 /* end of read buffer */
|
||||
#define EvSpIOEW 0x0800 /* end of write buffer */
|
||||
#define EvSpTRAP 0x1000 /* general interrupt */
|
||||
#define EvSpNEW 0x2000 /* new device */
|
||||
#define EvSpSYSCALL 0x4000 /* system call instruction */
|
||||
#define EvSpERROR 0x8000 /* error happned */
|
||||
#define EvSpPERROR 0x8001 /* previous write error happned */
|
||||
#define EvSpEDOM 0x0301 /* domain error in libmath */
|
||||
#define EvSpERANGE 0x0302 /* range error in libmath */
|
||||
#define EvSpCZ 0x0001 /* counter becomes zero */
|
||||
#define EvSpINT 0x0002 /* interrupted */
|
||||
#define EvSpIOE 0x0004 /* end of i/o */
|
||||
#define EvSpCLOSE 0x0008 /* file was closed */
|
||||
#define EvSpACK 0x0010 /* command acknowledged */
|
||||
#define EvSpCOMP 0x0020 /* command completed */
|
||||
#define EvSpDR 0x0040 /* data ready */
|
||||
#define EvSpDE 0x0080 /* data end */
|
||||
#define EvSpTIMOUT 0x0100 /* time out */
|
||||
#define EvSpUNKNOWN 0x0200 /* unknown command */
|
||||
#define EvSpIOER 0x0400 /* end of read buffer */
|
||||
#define EvSpIOEW 0x0800 /* end of write buffer */
|
||||
#define EvSpTRAP 0x1000 /* general interrupt */
|
||||
#define EvSpNEW 0x2000 /* new device */
|
||||
#define EvSpSYSCALL 0x4000 /* system call instruction */
|
||||
#define EvSpERROR 0x8000 /* error happned */
|
||||
#define EvSpPERROR 0x8001 /* previous write error happned */
|
||||
#define EvSpEDOM 0x0301 /* domain error in libmath */
|
||||
#define EvSpERANGE 0x0302 /* range error in libmath */
|
||||
|
||||
#define EvMdINTR 0x1000
|
||||
#define EvMdNOINTR 0x2000
|
||||
#define EvMdINTR 0x1000
|
||||
#define EvMdNOINTR 0x2000
|
||||
|
||||
#define EvStUNUSED 0x0000
|
||||
#define EvStWAIT 0x1000
|
||||
#define EvStACTIVE 0x2000
|
||||
#define EvStALREADY 0x4000
|
||||
#define EvStUNUSED 0x0000
|
||||
#define EvStWAIT 0x1000
|
||||
#define EvStACTIVE 0x2000
|
||||
#define EvStALREADY 0x4000
|
||||
|
||||
#define TcbMdRT 0x1000 /* reserved by system */
|
||||
#define TcbMdPRI 0x2000 /* reserved by system */
|
||||
#define TcbMdRT 0x1000 /* reserved by system */
|
||||
#define TcbMdPRI 0x2000 /* reserved by system */
|
||||
|
||||
#define TcbStUNUSED 0x1000
|
||||
#define TcbStACTIVE 0x4000
|
||||
#define TcbStUNUSED 0x1000
|
||||
#define TcbStACTIVE 0x4000
|
||||
|
@ -1,19 +1,19 @@
|
||||
|
||||
struct EXEC {
|
||||
unsigned long pc0;
|
||||
unsigned long gp0;
|
||||
unsigned long t_addr;
|
||||
unsigned long t_size;
|
||||
unsigned long d_addr;
|
||||
unsigned long d_size;
|
||||
unsigned long b_addr;
|
||||
unsigned long b_size;
|
||||
unsigned long s_addr;
|
||||
unsigned long s_size;
|
||||
unsigned long sp,fp,gp,ret,base;
|
||||
struct EXEC {
|
||||
unsigned long pc0;
|
||||
unsigned long gp0;
|
||||
unsigned long t_addr;
|
||||
unsigned long t_size;
|
||||
unsigned long d_addr;
|
||||
unsigned long d_size;
|
||||
unsigned long b_addr;
|
||||
unsigned long b_size;
|
||||
unsigned long s_addr;
|
||||
unsigned long s_size;
|
||||
unsigned long sp, fp, gp, ret, base;
|
||||
};
|
||||
|
||||
extern void InitHeap (unsigned long *, unsigned long);
|
||||
extern void InitHeap(unsigned long *, unsigned long);
|
||||
extern long Load(char *, struct EXEC *);
|
||||
extern long Exec(struct EXEC *, long, char **);
|
||||
// GPU_cw
|
||||
@ -24,18 +24,18 @@ extern long read(long, void *, long);
|
||||
extern long write(long, void *, long);
|
||||
extern long close(long);
|
||||
extern long format(char *);
|
||||
extern struct DIRENTRY * firstfile(char *, struct DIRENTRY *);
|
||||
extern struct DIRENTRY * nextfile(struct DIRENTRY *);
|
||||
extern struct DIRENTRY *firstfile(char *, struct DIRENTRY *);
|
||||
extern struct DIRENTRY *nextfile(struct DIRENTRY *);
|
||||
extern long erase(char *);
|
||||
extern long Krom2RawAdd(unsigned long);
|
||||
extern void ChangeClearPAD(long);
|
||||
extern void StopPAD(void);
|
||||
int PAD_init(s32/*??*/, s32 */*??*/);
|
||||
int PAD_init(s32 /*??*/, s32 * /*??*/);
|
||||
// PAD_dr
|
||||
extern void FlushCache(void);
|
||||
extern void DeliverEvent(unsigned long, unsigned long);
|
||||
extern long TestEvent(long);
|
||||
extern long OpenEvent(unsigned long,long,long,long (*func)());
|
||||
extern long OpenEvent(unsigned long, long, long, long (*func)());
|
||||
extern long EnableEvent(long);
|
||||
// ChangeClearRCnt
|
||||
extern void _96_remove(void);
|
||||
|
@ -1,11 +1,11 @@
|
||||
extern void exit();
|
||||
extern void puts(char *);
|
||||
// setjmp
|
||||
extern char *strcat (char *, char *);
|
||||
extern char *strcpy (char *, char *);
|
||||
extern int strlen (char *);
|
||||
extern void *memcpy (unsigned char *, unsigned char *, int);
|
||||
extern void *memset (unsigned char *, unsigned char, int);
|
||||
extern char *strcat(char *, char *);
|
||||
extern char *strcpy(char *, char *);
|
||||
extern int strlen(char *);
|
||||
extern void *memcpy(unsigned char *, unsigned char *, int);
|
||||
extern void *memset(unsigned char *, unsigned char, int);
|
||||
extern int rand(void);
|
||||
extern void srand(unsigned int);
|
||||
extern void *malloc(size_t);
|
||||
|
@ -1,32 +1,32 @@
|
||||
|
||||
/* Location */
|
||||
typedef struct {
|
||||
u_char minute;
|
||||
u_char second;
|
||||
u_char sector;
|
||||
u_char track;
|
||||
u_char minute;
|
||||
u_char second;
|
||||
u_char sector;
|
||||
u_char track;
|
||||
} CdlLOC;
|
||||
|
||||
/* Attenuator */
|
||||
typedef struct {
|
||||
u_char val0; /* volume for CD(L) -> SPU (L) */
|
||||
u_char val1; /* volume for CD(L) -> SPU (R) */
|
||||
u_char val2; /* volume for CD(R) -> SPU (L) */
|
||||
u_char val3; /* volume for CD(R) -> SPU (R) */
|
||||
u_char val0; /* volume for CD(L) -> SPU (L) */
|
||||
u_char val1; /* volume for CD(L) -> SPU (R) */
|
||||
u_char val2; /* volume for CD(R) -> SPU (L) */
|
||||
u_char val3; /* volume for CD(R) -> SPU (R) */
|
||||
} CdlATV;
|
||||
|
||||
/* Low Level File System for CdSearchFile() */
|
||||
#define CdlMAXFILE 64 /* max number of files in a directory */
|
||||
#define CdlMAXDIR 128 /* max number of total directories */
|
||||
#define CdlMAXLEVEL 8 /* max levels of directories */
|
||||
#define CdlMAXFILE 64 /* max number of files in a directory */
|
||||
#define CdlMAXDIR 128 /* max number of total directories */
|
||||
#define CdlMAXLEVEL 8 /* max levels of directories */
|
||||
|
||||
typedef struct {
|
||||
CdlLOC pos; /* file location */
|
||||
u_long size; /* file size */
|
||||
char name[16]; /* file name (body) */
|
||||
CdlLOC pos; /* file location */
|
||||
u_long size; /* file size */
|
||||
char name[16]; /* file name (body) */
|
||||
} CdlFILE;
|
||||
|
||||
typedef void (*CdlCB)(u_char,u_char *);
|
||||
typedef void (*CdlCB)(u_char, u_char *);
|
||||
|
||||
void def_cbsync(u_char intr, u_char *result);
|
||||
void def_cbready(u_char intr, u_char *result);
|
||||
@ -47,12 +47,11 @@ int CdControlB(u_char com, u_char *param, u_char *result);
|
||||
int CdControlF(u_char com, u_char *param);
|
||||
int CdMix(CdlATV *vol);
|
||||
int CdGetSector(void *madr, int size);
|
||||
void (*CdDataCallback(void (*func)()));
|
||||
CdlLOC *CdIntToPos(int i, CdlLOC *p) ;
|
||||
void(*CdDataCallback(void (*func)()));
|
||||
CdlLOC *CdIntToPos(int i, CdlLOC *p);
|
||||
int CdPosToInt(CdlLOC *p);
|
||||
CdlFILE *CdSearchFile(CdlFILE *fp, char *name);
|
||||
int CdRead(int sectors, u_long *buf, int mode);
|
||||
int CdReadSync(int mode, u_char *result);
|
||||
CdlCB CdReadCallback(CdlCB func);
|
||||
int CdRead2(long mode);
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
#ifndef LIBETC_H
|
||||
#define LIBETC_H
|
||||
|
||||
struct Callbacks
|
||||
{
|
||||
struct Callbacks {
|
||||
void (*unk0)(void);
|
||||
void* (*DMACallback)(int dma, void (*func)());
|
||||
void *(*DMACallback)(int dma, void (*func)());
|
||||
void (*unk8)(void);
|
||||
int (*ResetCallback)(void);
|
||||
int (*StopCallback)(void);
|
||||
|
@ -3,96 +3,106 @@
|
||||
#include <types.h>
|
||||
|
||||
typedef struct {
|
||||
short x, y; /* offset point on VRAM */
|
||||
short w, h; /* width and height */
|
||||
short x, y; /* offset point on VRAM */
|
||||
short w, h; /* width and height */
|
||||
} RECT;
|
||||
|
||||
typedef struct {
|
||||
u_long tag;
|
||||
u_long code[15];
|
||||
} DR_ENV; /* Packed Drawing Environment */
|
||||
u_long tag;
|
||||
u_long code[15];
|
||||
} DR_ENV; /* Packed Drawing Environment */
|
||||
|
||||
typedef struct {
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char u0, v0; u_short clut;
|
||||
u_char r1, g1, b1, p1;
|
||||
short x1, y1;
|
||||
u_char u1, v1; u_short tpage;
|
||||
u_char r2, g2, b2, p2;
|
||||
short x2, y2;
|
||||
u_char u2, v2; u_short pad2;
|
||||
} POLY_GT3; /* Gouraud Textured Triangle */
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char u0, v0;
|
||||
u_short clut;
|
||||
u_char r1, g1, b1, p1;
|
||||
short x1, y1;
|
||||
u_char u1, v1;
|
||||
u_short tpage;
|
||||
u_char r2, g2, b2, p2;
|
||||
short x2, y2;
|
||||
u_char u2, v2;
|
||||
u_short pad2;
|
||||
} POLY_GT3; /* Gouraud Textured Triangle */
|
||||
|
||||
typedef struct {
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char r1, g1, b1, pad1;
|
||||
short x1, y1;
|
||||
u_char r2, g2, b2, pad2;
|
||||
short x2, y2;
|
||||
u_char r3, g3, b3, pad3;
|
||||
short x3, y3;
|
||||
} POLY_G4; /* Gouraud Quadrangle */
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char r1, g1, b1, pad1;
|
||||
short x1, y1;
|
||||
u_char r2, g2, b2, pad2;
|
||||
short x2, y2;
|
||||
u_char r3, g3, b3, pad3;
|
||||
short x3, y3;
|
||||
} POLY_G4; /* Gouraud Quadrangle */
|
||||
|
||||
typedef struct {
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char u0, v0; u_short clut;
|
||||
u_char r1, g1, b1, p1;
|
||||
short x1, y1;
|
||||
u_char u1, v1; u_short tpage;
|
||||
u_char r2, g2, b2, p2;
|
||||
short x2, y2;
|
||||
u_char u2, v2; u_short pad2;
|
||||
u_char r3, g3, b3, p3;
|
||||
short x3, y3;
|
||||
u_char u3, v3; u_short pad3;
|
||||
} POLY_GT4; /* Gouraud Textured Quadrangle */
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char u0, v0;
|
||||
u_short clut;
|
||||
u_char r1, g1, b1, p1;
|
||||
short x1, y1;
|
||||
u_char u1, v1;
|
||||
u_short tpage;
|
||||
u_char r2, g2, b2, p2;
|
||||
short x2, y2;
|
||||
u_char u2, v2;
|
||||
u_short pad2;
|
||||
u_char r3, g3, b3, p3;
|
||||
short x3, y3;
|
||||
u_char u3, v3;
|
||||
u_short pad3;
|
||||
} POLY_GT4; /* Gouraud Textured Quadrangle */
|
||||
|
||||
typedef struct {
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char u0, v0; u_short clut;
|
||||
short w, h;
|
||||
} SPRT; /* free size Sprite */
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char u0, v0;
|
||||
u_short clut;
|
||||
short w, h;
|
||||
} SPRT; /* free size Sprite */
|
||||
|
||||
typedef struct {
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char u0, v0; u_short clut;
|
||||
} SPRT_16; /* 16x16 Sprite */
|
||||
|
||||
typedef struct {
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char u0, v0; u_short clut;
|
||||
} SPRT_8; /* 8x8 Sprite */
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char u0, v0;
|
||||
u_short clut;
|
||||
} SPRT_16; /* 16x16 Sprite */
|
||||
|
||||
typedef struct {
|
||||
RECT clip; /* clip area */
|
||||
short ofs[2]; /* drawing offset */
|
||||
RECT tw; /* texture window */
|
||||
u_short tpage; /* texture page */
|
||||
u_char dtd; /* dither flag (0:off, 1:on) */
|
||||
u_char dfe; /* flag to draw on display area (0:off 1:on) */
|
||||
u_char isbg; /* enable to auto-clear */
|
||||
u_char r0, g0, b0; /* initital background color */
|
||||
DR_ENV dr_env; /* reserved */
|
||||
u_long tag;
|
||||
u_char r0, g0, b0, code;
|
||||
short x0, y0;
|
||||
u_char u0, v0;
|
||||
u_short clut;
|
||||
} SPRT_8; /* 8x8 Sprite */
|
||||
|
||||
typedef struct {
|
||||
RECT clip; /* clip area */
|
||||
short ofs[2]; /* drawing offset */
|
||||
RECT tw; /* texture window */
|
||||
u_short tpage; /* texture page */
|
||||
u_char dtd; /* dither flag (0:off, 1:on) */
|
||||
u_char dfe; /* flag to draw on display area (0:off 1:on) */
|
||||
u_char isbg; /* enable to auto-clear */
|
||||
u_char r0, g0, b0; /* initital background color */
|
||||
DR_ENV dr_env; /* reserved */
|
||||
} DRAWENV;
|
||||
|
||||
|
||||
typedef struct {
|
||||
RECT disp; /* display area */
|
||||
RECT screen; /* display start point */
|
||||
u_char isinter; /* interlace 0: off 1: on */
|
||||
u_char isrgb24; /* RGB24 bit mode */
|
||||
u_char pad0, pad1; /* reserved */
|
||||
RECT disp; /* display area */
|
||||
RECT screen; /* display start point */
|
||||
u_char isinter; /* interlace 0: off 1: on */
|
||||
u_char isrgb24; /* RGB24 bit mode */
|
||||
u_char pad0, pad1; /* reserved */
|
||||
} DISPENV;
|
||||
|
||||
extern void SetShadeTex(void *p, int tge);
|
||||
|
@ -1,10 +1,10 @@
|
||||
#ifndef LIBSND_H
|
||||
#define LIBSND_H
|
||||
|
||||
extern void SsSeqClose (short);
|
||||
extern void SsSeqClose(short);
|
||||
|
||||
extern void SsSetMVol (short, short);
|
||||
extern void SsSetSerialAttr (char, char, char);
|
||||
extern void SsSetSerialVol (char, short, short);
|
||||
extern void SsSetMVol(short, short);
|
||||
extern void SsSetSerialAttr(char, char, char);
|
||||
extern void SsSetSerialVol(char, short, short);
|
||||
|
||||
#endif
|
||||
|
@ -1,8 +1,8 @@
|
||||
s32 AnimateEntity(u8* frames, Entity* entity) {
|
||||
s32 AnimateEntity(u8 *frames, Entity *entity) {
|
||||
s32 flag = 0;
|
||||
u16 currentFrameIndex = entity->animationFrameIndex * 2;
|
||||
u8 *currentFrame = frames + currentFrameIndex;
|
||||
|
||||
|
||||
if (entity->animationFrameDuration == 0) {
|
||||
if (currentFrame[0] > 0) {
|
||||
flag = 0x80;
|
||||
@ -13,9 +13,7 @@ s32 AnimateEntity(u8* frames, Entity* entity) {
|
||||
entity->animationFrameDuration = *currentFrame++;
|
||||
entity->animationFrame = *currentFrame++;
|
||||
entity->animationFrameIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
currentFrame = frames;
|
||||
entity->animationFrameIndex = 0;
|
||||
entity->animationFrameDuration = 0;
|
||||
@ -25,7 +23,7 @@ s32 AnimateEntity(u8* frames, Entity* entity) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
entity->animationFrameDuration = entity->animationFrameDuration - 1;
|
||||
entity->animationFrame = currentFrame[-1];
|
||||
flag |= true;
|
||||
|
@ -6,13 +6,13 @@
|
||||
|
||||
s32 Random();
|
||||
void UpdateStageEntities(void);
|
||||
void CreateEntity(Entity *entity, ObjectInit* initDesc);
|
||||
void CreateEntity(Entity *entity, ObjectInit *initDesc);
|
||||
void DestroyEntity(Entity *);
|
||||
void DestroyEntityFromIndex(s16 index);
|
||||
s32 AnimateEntity(u8 *frames, Entity *entity);
|
||||
void MoveEntity(void);
|
||||
void FallEntity(void);
|
||||
Entity *AllocEntity(Entity* start, Entity* end);
|
||||
Entity *AllocEntity(Entity *start, Entity *end);
|
||||
void InitializeEntity(u16 *arg0);
|
||||
|
||||
#endif
|
||||
|
427
src/dra/42398.c
427
src/dra/42398.c
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
#include "common.h"
|
||||
#include <psxsdk/libetc.h>
|
||||
#include <psxsdk/libapi.h>
|
||||
#include <main.h>
|
||||
#include <psxsdk/libapi.h>
|
||||
#include <psxsdk/libetc.h>
|
||||
|
||||
INCLUDE_ASM("asm/main/nonmatchings/5A38", PadInit);
|
||||
// void PadInit(s32 arg0) {
|
||||
@ -28,9 +28,7 @@ INCLUDE_ASM("asm/main/nonmatchings/5A38", v_wait);
|
||||
|
||||
INCLUDE_ASM("asm/main/nonmatchings/5A38", ChangeClearRCnt);
|
||||
|
||||
int ResetCallback(void) {
|
||||
return D_8002D340->ResetCallback();
|
||||
}
|
||||
int ResetCallback(void) { return D_8002D340->ResetCallback(); }
|
||||
|
||||
INCLUDE_ASM("asm/main/nonmatchings/5A38", InterruptCallback);
|
||||
|
||||
@ -47,14 +45,8 @@ int VSyncCallbacks(int ch, void (*f)()) {
|
||||
return D_8002D340->VSyncCallbacks(ch, f);
|
||||
}
|
||||
|
||||
int StopCallback(void) {
|
||||
return D_8002D340->StopCallback();
|
||||
}
|
||||
int StopCallback(void) { return D_8002D340->StopCallback(); }
|
||||
|
||||
int RestartCallback(void) {
|
||||
return D_8002D340->RestartCallback();
|
||||
}
|
||||
int RestartCallback(void) { return D_8002D340->RestartCallback(); }
|
||||
|
||||
u16 CheckCallback(void) {
|
||||
return D_8002C2BA;
|
||||
}
|
||||
u16 CheckCallback(void) { return D_8002C2BA; }
|
@ -186,7 +186,7 @@ int CdInit() {
|
||||
int i;
|
||||
|
||||
for (i = 4; i != -1; i--) {
|
||||
if ( CdReset(1) ) {
|
||||
if (CdReset(1)) {
|
||||
CdSyncCallback(def_cbsync);
|
||||
CdReadyCallback(def_cbready);
|
||||
CdReadCallback(def_cbread);
|
||||
@ -199,17 +199,10 @@ int CdInit() {
|
||||
}
|
||||
#endif
|
||||
|
||||
void def_cbsync(u_char intr, u_char *result)
|
||||
{
|
||||
DeliverEvent( HwCdRom, EvSpCOMP );
|
||||
void def_cbsync(u_char intr, u_char *result) {
|
||||
DeliverEvent(HwCdRom, EvSpCOMP);
|
||||
}
|
||||
|
||||
void def_cbready(u_char intr, u_char *result)
|
||||
{
|
||||
DeliverEvent( HwCdRom, EvSpDR );
|
||||
}
|
||||
void def_cbready(u_char intr, u_char *result) { DeliverEvent(HwCdRom, EvSpDR); }
|
||||
|
||||
void def_cbread(u_char intr, u_char *result)
|
||||
{
|
||||
DeliverEvent( HwCdRom, EvSpDR );
|
||||
}
|
||||
void def_cbread(u_char intr, u_char *result) { DeliverEvent(HwCdRom, EvSpDR); }
|
||||
|
@ -5,14 +5,8 @@ extern u8 CD_status;
|
||||
extern u8 CD_mode;
|
||||
extern u8 CD_com;
|
||||
|
||||
int CdStatus(void) {
|
||||
return CD_status;
|
||||
}
|
||||
int CdStatus(void) { return CD_status; }
|
||||
|
||||
int CdMode(void) {
|
||||
return CD_mode;
|
||||
}
|
||||
int CdMode(void) { return CD_mode; }
|
||||
|
||||
int CdLastCom(void) {
|
||||
return CD_com;
|
||||
}
|
||||
int CdLastCom(void) { return CD_com; }
|
||||
|
@ -1,7 +1,5 @@
|
||||
#include "common.h"
|
||||
|
||||
extern u16* g_InterruptMask;
|
||||
extern u16 *g_InterruptMask;
|
||||
|
||||
u16 GetIntrMask(void) {
|
||||
return *g_InterruptMask;
|
||||
}
|
||||
u16 GetIntrMask(void) { return *g_InterruptMask; }
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include "dra.h"
|
||||
|
||||
extern s32 D_801553BC;
|
||||
extern /*?*/s32 D_8015591C;
|
||||
extern /*?*/s32 D_80155950;
|
||||
extern /*?*/ s32 D_8015591C;
|
||||
extern /*?*/ s32 D_80155950;
|
||||
extern u8 D_80174FAC;
|
||||
extern u8 D_80174FB0;
|
||||
extern u8 D_80174FB4;
|
||||
@ -16,7 +16,7 @@ extern s16 D_80175956;
|
||||
|
||||
void func_80156C60(Entity *entity) {
|
||||
int i, length;
|
||||
u32* ptr;
|
||||
u32 *ptr;
|
||||
|
||||
if (entity->unk34 & 0x800000) {
|
||||
g_pfnFreePolygons(entity->firstPolygonIndex);
|
||||
@ -42,9 +42,7 @@ INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_80157A50);
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", UpdateEntityRichter);
|
||||
|
||||
void func_801587C0() {
|
||||
D_80175956 = 0;
|
||||
}
|
||||
void func_801587C0() { D_80175956 = 0; }
|
||||
|
||||
void func_801587D0(void) {
|
||||
D_80175956 = 1;
|
||||
@ -57,7 +55,7 @@ void func_80158814(void) {
|
||||
D_80175956 = 0;
|
||||
D_8007341C = 0;
|
||||
D_8007342E = D_80175950;
|
||||
D_800733F1 = *(u8*)&D_80175952;
|
||||
D_800733F1 = *(u8 *)&D_80175952;
|
||||
D_800733EE = D_80175954;
|
||||
}
|
||||
|
||||
@ -74,7 +72,7 @@ void func_80158F38(void) {
|
||||
func_8015CD98(0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (D_80073406 == 0) {
|
||||
func_8015CA84(0x14000);
|
||||
}
|
||||
@ -89,8 +87,7 @@ INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_801595D8);
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_80159670);
|
||||
|
||||
void func_80159BC8(void)
|
||||
{
|
||||
void func_80159BC8(void) {
|
||||
D_8007342A = 0;
|
||||
D_80073428 = 0;
|
||||
D_80072F64 = 0;
|
||||
@ -156,7 +153,7 @@ INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_8015C6D4);
|
||||
|
||||
void func_8015C908(s32 unk0) {
|
||||
D_80073404 = unk0;
|
||||
D_80073406= 0;
|
||||
D_80073406 = 0;
|
||||
}
|
||||
|
||||
void func_8015C920(s32 unk0) {
|
||||
@ -171,8 +168,7 @@ void func_8015C93C(s32 speed) {
|
||||
if (D_8006C3B8->accelerationX > 0) {
|
||||
D_8006C3B8->accelerationX = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
D_8006C3B8->accelerationX -= speed;
|
||||
if (D_8006C3B8->accelerationX < 0)
|
||||
D_8006C3B8->accelerationX = 0;
|
||||
@ -210,22 +206,18 @@ void func_8015CAAC(s32 speed) {
|
||||
D_800733E0 = phi_a0;
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_8015CAD4);
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_8015CB58);
|
||||
|
||||
void func_8015CC28(void)
|
||||
{
|
||||
void func_8015CC28(void) {
|
||||
D_80073513 = 0;
|
||||
D_80073512 = 0;
|
||||
D_80073511 = 0;
|
||||
D_80073510 = 0;
|
||||
}
|
||||
|
||||
void func_8015CC50() {
|
||||
func_8015C908(0xF0);
|
||||
}
|
||||
void func_8015CC50() { func_8015C908(0xF0); }
|
||||
|
||||
void func_8015CC70(s16 arg0) {
|
||||
D_80073406 = arg0;
|
||||
@ -249,7 +241,6 @@ void func_8015CD98(s32 arg0) {
|
||||
func_8015C920(&D_801553BC);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_8015CDE0);
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_8015CE7C);
|
||||
@ -268,9 +259,7 @@ INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_8015D3CC);
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_8015D678);
|
||||
|
||||
void func_8015D9B4() {
|
||||
func_8015C908(0x16);
|
||||
}
|
||||
void func_8015D9B4() { func_8015C908(0x16); }
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_8015D9D4);
|
||||
|
||||
@ -320,11 +309,9 @@ INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_8015FEA8);
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_801601DC);
|
||||
|
||||
void func_801603B4(void) {
|
||||
}
|
||||
void func_801603B4(void) {}
|
||||
|
||||
void func_801603BC(void) {
|
||||
}
|
||||
void func_801603BC(void) {}
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_801603C4);
|
||||
|
||||
@ -356,8 +343,7 @@ INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_80162604);
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_80162870);
|
||||
|
||||
void func_80162C7C(void) {
|
||||
}
|
||||
void func_80162C7C(void) {}
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_80162C84);
|
||||
|
||||
@ -393,14 +379,11 @@ INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_8016779C);
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_80167964);
|
||||
|
||||
void func_80167A58(void) {
|
||||
}
|
||||
void func_80167A58(void) {}
|
||||
|
||||
void func_80167A60(void) {
|
||||
}
|
||||
void func_80167A60(void) {}
|
||||
|
||||
void func_80167A68(void) {
|
||||
}
|
||||
void func_80167A68(void) {}
|
||||
|
||||
INCLUDE_ASM("asm/ric/nonmatchings/1AC60", func_80167A70);
|
||||
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
// OFFSET FIXED
|
||||
extern void (*D_8003C6B0)(s32);
|
||||
extern void (*D_8003C6B8)(s32, s32, Unkstruct7*, s32);
|
||||
extern void (*D_8003C6B8)(s32, s32, Unkstruct7 *, s32);
|
||||
extern void (*D_8003C6D8)(s32);
|
||||
extern s32 g_pfnLoadObjLayout; // It's 8003C8C4!
|
||||
extern Entity* D_8006C26C;
|
||||
extern Entity *D_8006C26C;
|
||||
extern u16 D_80072B3E;
|
||||
extern u16 D_80072B42;
|
||||
extern u16 D_80072B58;
|
||||
@ -14,7 +14,7 @@ extern s16 D_80072E8E;
|
||||
extern Entity D_80072E88[];
|
||||
extern Entity D_8007D308[];
|
||||
extern Entity D_8007E9CC;
|
||||
extern Entity* D_8007EA88;
|
||||
extern Entity *D_8007EA88;
|
||||
extern u16 D_80096EB8;
|
||||
extern s32 D_80096EC0;
|
||||
extern s32 D_80096EC4;
|
||||
@ -30,19 +30,19 @@ extern POLY_GT4 D_800973B8[];
|
||||
|
||||
// ST/MAD
|
||||
extern u16 D_801804F0[];
|
||||
extern u8* D_80180644[];
|
||||
extern u8 *D_80180644[];
|
||||
extern u8 D_80180664[];
|
||||
extern u8 D_8018066C[];
|
||||
extern u16 D_80180674[];
|
||||
extern u8 D_80180684[];
|
||||
extern s16 D_801809EC[];
|
||||
extern RoomHeader g_rooms[];
|
||||
extern ObjectInit* g_pStObjLayout[];
|
||||
extern ObjectInit** D_801803C8[];
|
||||
extern ObjectInit *g_pStObjLayout[];
|
||||
extern ObjectInit **D_801803C8[];
|
||||
extern PfnEntityUpdate PfnEntityUpdates[];
|
||||
|
||||
extern ObjectInit *D_801997D8;
|
||||
extern ObjectInit* D_801997DC;
|
||||
extern ObjectInit *D_801997DC;
|
||||
extern u8 D_801997E0;
|
||||
extern s8 D_801997E4;
|
||||
|
||||
@ -53,8 +53,8 @@ void func_80190C78(s16);
|
||||
void SpawnExplosionEntity(u16, Entity *);
|
||||
u8 func_80192914(s16 arg0, s16 arg1);
|
||||
void ReplaceCandleWithDrop(Entity *);
|
||||
void EntityCandleDrop(Entity*);
|
||||
void EntityCandleHeartDrop(Entity*);
|
||||
void EntityCandleDrop(Entity *);
|
||||
void EntityCandleHeartDrop(Entity *);
|
||||
void func_80194218(Entity *);
|
||||
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_8018D8C8);
|
||||
@ -69,26 +69,25 @@ void func_8018DF0C(s32 arg0, s32 arg1) {
|
||||
s32 phi_v1;
|
||||
s16 phi_a2;
|
||||
s32 phi_a3;
|
||||
s16* phi_t0;
|
||||
s16 *phi_t0;
|
||||
s32 phi_a3_2;
|
||||
s16* phi_a2_2;
|
||||
s16 *phi_a2_2;
|
||||
s32 phi_v1_2;
|
||||
s32 phi_a3_3;
|
||||
s16* phi_a2_3;
|
||||
s16 *phi_a2_3;
|
||||
s32 phi_v1_3;
|
||||
s32 phi_a3_4;
|
||||
s16* phi_a2_4;
|
||||
s16 *phi_a2_4;
|
||||
s32 phi_v1_4;
|
||||
s32 phi_a3_5;
|
||||
s16* phi_a1;
|
||||
s16 *phi_a1;
|
||||
s32 phi_v1_5;
|
||||
|
||||
for (phi_a3 = 0; phi_a3 < 0x10; phi_a3++) {
|
||||
phi_t0 = arg0;
|
||||
phi_v1_2 = 0;
|
||||
|
||||
for (phi_v1 = 0; phi_v1 < 0x20; phi_v1++)
|
||||
{
|
||||
for (phi_v1 = 0; phi_v1 < 0x20; phi_v1++) {
|
||||
phi_a2 = -(((phi_a3 - 2) < 0xCU) ^ 1) & 3;
|
||||
if (phi_v1 - 2 >= 0x1C) {
|
||||
phi_a2 = 3;
|
||||
@ -102,7 +101,7 @@ void func_8018DF0C(s32 arg0, s32 arg1) {
|
||||
if (arg1 & 4) {
|
||||
for (phi_a3_2 = 6; phi_a3_2 < 0xA; phi_a3_2++) {
|
||||
phi_a2_2 = arg0;
|
||||
loop_9:
|
||||
loop_9:
|
||||
*((phi_a3_2 << 5) + phi_a2_2) = 0;
|
||||
phi_a2_2++;
|
||||
phi_v1_2++;
|
||||
@ -116,7 +115,7 @@ loop_9:
|
||||
for (phi_a3_3 = 6; phi_a3_3 < 0xA; phi_a3_3++) {
|
||||
phi_a2_3 = arg0 + 0x3C;
|
||||
phi_v1_3 = 0x1E;
|
||||
loop_14:
|
||||
loop_14:
|
||||
*((phi_a3_3 << 5) + phi_a2_3) = 0;
|
||||
phi_a2_3++;
|
||||
phi_v1_3++;
|
||||
@ -125,12 +124,12 @@ loop_14:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (arg1 & 1) {
|
||||
for (phi_a3_4 = 0; phi_a3_4 < 2; phi_a3_4++) {
|
||||
phi_a2_4 = arg0 + 0xC;
|
||||
phi_v1_4 = 6;
|
||||
loop_19:
|
||||
loop_19:
|
||||
*((phi_a3_4 << 6) + ((((arg1 & 8) == 0) << 5) + phi_a2_4)) = 0;
|
||||
phi_a2_4++;
|
||||
phi_v1_4++;
|
||||
@ -139,12 +138,12 @@ loop_19:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (arg1 & 2) {
|
||||
for (phi_a3_5 = 0xE; phi_a3_5 < 0x10; phi_a3_5++) {
|
||||
phi_a1 = arg0 + 0xC;
|
||||
phi_v1_5 = 6;
|
||||
loop_24:
|
||||
loop_24:
|
||||
*((phi_a3_5 << 6) + ((((arg1 & 8) == 0) << 5) + phi_a1)) = 0;
|
||||
phi_a1++;
|
||||
phi_v1_5++;
|
||||
@ -176,7 +175,8 @@ void EntityCandle(Entity *entity) {
|
||||
if (entity->unk44) { // If the candle is destroyed
|
||||
Entity *entityDropItem;
|
||||
D_8003C6D8(0x635);
|
||||
entityDropItem = AllocEntity(D_8007D308, D_8007D308 + MaxEntityCount);
|
||||
entityDropItem =
|
||||
AllocEntity(D_8007D308, D_8007D308 + MaxEntityCount);
|
||||
if (entityDropItem != NULL) {
|
||||
SpawnExplosionEntity(EntityExplosionID, entityDropItem);
|
||||
entityDropItem->subId = D_8018066C[temp_s0];
|
||||
@ -206,8 +206,8 @@ extern u16 D_80199E54[];
|
||||
|
||||
void UpdateStageEntities(void) {
|
||||
s16 i;
|
||||
Entity* entity;
|
||||
s32* unk;
|
||||
Entity *entity;
|
||||
s32 *unk;
|
||||
|
||||
for (i = 0; i < 0x20; i++) {
|
||||
if (D_80199E54[i]) {
|
||||
@ -225,7 +225,7 @@ void UpdateStageEntities(void) {
|
||||
for (entity = D_80075D88; entity < &D_8007EA88; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
|
||||
if (entity->initState) {
|
||||
s32 unk34 = entity->unk34;
|
||||
if (unk34 < 0) {
|
||||
@ -236,28 +236,26 @@ void UpdateStageEntities(void) {
|
||||
DestroyEntity(entity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if ((u16)(posX + 128) > 512 || (u16)(posY + 128) > 480) {
|
||||
DestroyEntity(entity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((unk34 & 0x02000000)) {
|
||||
s16 posY = entity->posY.Data.high + D_80072B42;
|
||||
s16 test = (D_80072B58 * 256) + 128;
|
||||
if (posY > test)
|
||||
{
|
||||
if (posY > test) {
|
||||
DestroyEntity(entity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (unk34 & 0xF) {
|
||||
entity->palette = D_801806B4[(entity->unk49 << 1) | (unk34 & 1)];
|
||||
entity->palette =
|
||||
D_801806B4[(entity->unk49 << 1) | (unk34 & 1)];
|
||||
entity->unk34--;
|
||||
if ((entity->unk34 & 0xF) == 0) {
|
||||
entity->palette = entity->unk6A;
|
||||
@ -267,10 +265,10 @@ void UpdateStageEntities(void) {
|
||||
|
||||
if (!(unk34 & 0x20000000) || (unk34 & 0x10000000) ||
|
||||
((u16)(entity->posX.Data.high + 64) <= 384) &&
|
||||
((u16)(entity->posY.Data.high + 64) <= 352))
|
||||
{
|
||||
((u16)(entity->posY.Data.high + 64) <= 352)) {
|
||||
if (!entity->unk58 || (entity->unk58--, unk34 & 0x100000)) {
|
||||
if (!D_80096EAC || unk34 & 0x2100 || (unk34 & 0x200 && !(g_pfnLoadObjLayout & 3))) {
|
||||
if (!D_80096EAC || unk34 & 0x2100 ||
|
||||
(unk34 & 0x200 && !(g_pfnLoadObjLayout & 3))) {
|
||||
D_8006C26C = entity;
|
||||
entity->pfnUpdate(entity);
|
||||
entity->unk44 = 0;
|
||||
@ -297,7 +295,7 @@ INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_8018FEA0);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", CreateEntity);
|
||||
#else
|
||||
void CreateEntity(Entity* entity, ObjectInit* initDesc) {
|
||||
void CreateEntity(Entity *entity, ObjectInit *initDesc) {
|
||||
DestroyEntity(entity);
|
||||
entity->objectId = initDesc->flags & 0x3FF;
|
||||
entity->pfnUpdate = PfnEntityUpdates[entity->objectId];
|
||||
@ -312,23 +310,24 @@ void CreateEntity(Entity* entity, ObjectInit* initDesc) {
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_80190608);
|
||||
#else
|
||||
void func_80190608(ObjectInit* initDesc) {
|
||||
void func_80190608(ObjectInit *initDesc) {
|
||||
s16 temp_a2;
|
||||
s16 temp_v1_2;
|
||||
s16 phi_a0;
|
||||
Entity* entity;
|
||||
Entity *entity;
|
||||
|
||||
temp_a2 = D_80072B42 + 0x120;
|
||||
phi_a0 = D_80072B42 - 0x40;
|
||||
if (phi_a0 < 0) {
|
||||
phi_a0 = 0;
|
||||
}
|
||||
|
||||
|
||||
temp_v1_2 = initDesc->posY;
|
||||
if (temp_v1_2 >= phi_a0 && temp_a2 >= temp_v1_2 && (initDesc->flags & 0xE000) != 0x8000) {
|
||||
if (temp_v1_2 >= phi_a0 && temp_a2 >= temp_v1_2 &&
|
||||
(initDesc->flags & 0xE000) != 0x8000) {
|
||||
switch (initDesc->flags & 0xE000) {
|
||||
case 0x0:
|
||||
entity = &D_80075D88[*(u8*)&initDesc->unk6];
|
||||
entity = &D_80075D88[*(u8 *)&initDesc->unk6];
|
||||
if (entity->objectId != 0) {
|
||||
break;
|
||||
}
|
||||
@ -360,7 +359,8 @@ void func_80190884(s32 arg0) {
|
||||
arg0 = (s16)arg0;
|
||||
a2 = 0xFFFE;
|
||||
loop_1:
|
||||
if (D_801997D8->posX == a3 || (arg0 < D_801997D8->posX) && (D_801997D8->posX != a2)) {
|
||||
if (D_801997D8->posX == a3 ||
|
||||
(arg0 < D_801997D8->posX) && (D_801997D8->posX != a2)) {
|
||||
D_801997D8--;
|
||||
goto loop_1;
|
||||
}
|
||||
@ -372,7 +372,7 @@ INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_801908DC);
|
||||
void func_801908DC(s16 arg0) {
|
||||
u32 temp_a0, temp_v1_2;
|
||||
if (D_801997E0 != 0) {
|
||||
func_80190838((s16) (arg0 - D_800973B4));
|
||||
func_80190838((s16)(arg0 - D_800973B4));
|
||||
D_801997E0 = 0;
|
||||
}
|
||||
|
||||
@ -380,9 +380,10 @@ void func_801908DC(s16 arg0) {
|
||||
if (D_801997D8->posX == 0xFFFF || arg0 < D_801997D8->posX)
|
||||
break;
|
||||
|
||||
temp_a0 = ((u32) D_801997D8->unk6 >> 8) + 0xFF;
|
||||
temp_a0 = ((u32)D_801997D8->unk6 >> 8) + 0xFF;
|
||||
temp_v1_2 = temp_a0 & 0xFF;
|
||||
if (temp_v1_2 == 0xFF || (((1 << (temp_a0 & 0x1F)) & D_80096ED8[temp_v1_2 >> 5]) == 0)) {
|
||||
if (temp_v1_2 == 0xFF ||
|
||||
(((1 << (temp_a0 & 0x1F)) & D_80096ED8[temp_v1_2 >> 5]) == 0)) {
|
||||
func_80190608(D_801997D8);
|
||||
}
|
||||
D_801997D8++;
|
||||
@ -403,8 +404,7 @@ loop_1:
|
||||
}
|
||||
|
||||
void func_80190B24(s32 arg0) {
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
if (D_801997DC->posY == 0xFFFF)
|
||||
D_801997DC--;
|
||||
else if ((s16)arg0 >= D_801997DC->posY || D_801997DC->posY == 0xFFFE)
|
||||
@ -423,13 +423,13 @@ INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", LoadObjLayout);
|
||||
#else
|
||||
void LoadObjLayout(s32 objLayoutId) {
|
||||
s16 temp_s0;
|
||||
u16* pObjLayoutStart;
|
||||
ObjectInit* temp_v1;
|
||||
ObjectInit* temp_v0_2;
|
||||
u16 *pObjLayoutStart;
|
||||
ObjectInit *temp_v1;
|
||||
ObjectInit *temp_v0_2;
|
||||
s32 phi_a0;
|
||||
s16 phi_a1;
|
||||
s16 phi_a1_2;
|
||||
Unkstruct4* s1;
|
||||
Unkstruct4 *s1;
|
||||
|
||||
pObjLayoutStart = g_pStObjLayout[objLayoutId];
|
||||
D_801997D8 = pObjLayoutStart;
|
||||
@ -438,20 +438,19 @@ void LoadObjLayout(s32 objLayoutId) {
|
||||
if (*pObjLayoutStart != 0xFFFE) {
|
||||
D_801997D8 = pObjLayoutStart + 1;
|
||||
phi_a0 = Random() & 0xFF;
|
||||
|
||||
for (phi_a1 = 0; ; phi_a1++)
|
||||
{
|
||||
|
||||
for (phi_a1 = 0;; phi_a1++) {
|
||||
s32 temp_v0 = phi_a0 - D_801997D8->posX;
|
||||
D_801997D8 = (u16*)D_801997D8 + 1;
|
||||
D_801997D8 = (u16 *)D_801997D8 + 1;
|
||||
phi_a0 = temp_v0;
|
||||
if (temp_v0 << 0x10 < 0)
|
||||
break;
|
||||
|
||||
D_801997D8 = (u32*)D_801997D8 + 1;
|
||||
D_801997D8 = (u32 *)D_801997D8 + 1;
|
||||
}
|
||||
|
||||
D_801997D8 = (temp_v1->flags << 0x10) + temp_v1->posY;
|
||||
temp_v0_2 = (u32*)D_801997DC + (phi_a1 + 1);
|
||||
temp_v0_2 = (u32 *)D_801997DC + (phi_a1 + 1);
|
||||
D_801997DC = temp_v0_2;
|
||||
D_801997DC = (temp_v0_2->posY << 0x10) + temp_v0_2->posX;
|
||||
}
|
||||
@ -461,7 +460,7 @@ void LoadObjLayout(s32 objLayoutId) {
|
||||
if (phi_a1_2 < 0) {
|
||||
phi_a1_2 = 0;
|
||||
}
|
||||
|
||||
|
||||
D_801997E0 = 0;
|
||||
D_801997E4 = 0;
|
||||
func_80190838(phi_a1_2);
|
||||
@ -471,7 +470,7 @@ void LoadObjLayout(s32 objLayoutId) {
|
||||
#endif
|
||||
|
||||
void func_80190F04(void) {
|
||||
Unkstruct4* s0 = &D_80072B34;
|
||||
Unkstruct4 *s0 = &D_80072B34;
|
||||
s32 temp_v0_2;
|
||||
|
||||
if (D_800973B4 != 0) {
|
||||
@ -481,7 +480,7 @@ void func_80190F04(void) {
|
||||
else
|
||||
func_801909D8(temp_a0 - 0x40);
|
||||
}
|
||||
|
||||
|
||||
temp_v0_2 = D_800973B8[0].tag;
|
||||
if (temp_v0_2 != 0) {
|
||||
s16 temp_a0_2 = s0->unkE;
|
||||
@ -510,9 +509,9 @@ INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_801910A8);
|
||||
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_80191120);
|
||||
|
||||
void DestroyEntity(Entity* item) {
|
||||
void DestroyEntity(Entity *item) {
|
||||
int i, length;
|
||||
u32* ptr;
|
||||
u32 *ptr;
|
||||
|
||||
if (item->unk34 & 0x800000) {
|
||||
D_8003C6B0(item->firstPolygonIndex);
|
||||
@ -598,12 +597,10 @@ INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_80192408);
|
||||
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_80192618);
|
||||
|
||||
Entity* AllocEntity(Entity* start, Entity* end) {
|
||||
Entity* current = start;
|
||||
while (current < end)
|
||||
{
|
||||
if (current->objectId == 0)
|
||||
{
|
||||
Entity *AllocEntity(Entity *start, Entity *end) {
|
||||
Entity *current = start;
|
||||
while (current < end) {
|
||||
if (current->objectId == 0) {
|
||||
DestroyEntity(current);
|
||||
return current;
|
||||
}
|
||||
@ -617,17 +614,13 @@ Entity* AllocEntity(Entity* start, Entity* end) {
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_80192860);
|
||||
s32 func_80192860(u8 arg0, s16 arg1);
|
||||
#else
|
||||
s32 func_80192860(u8 arg0, s16 arg1) {
|
||||
return D_801809EC[arg0 & 0xFF] * arg1;
|
||||
}
|
||||
s32 func_80192860(u8 arg0, s16 arg1) { return D_801809EC[arg0 & 0xFF] * arg1; }
|
||||
#endif
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_8019288C);
|
||||
#else
|
||||
s16 func_8019288C(s32 arg0) {
|
||||
return D_801809EC[arg0 & 0xFF];
|
||||
}
|
||||
s16 func_8019288C(s32 arg0) { return D_801809EC[arg0 & 0xFF]; }
|
||||
#endif
|
||||
|
||||
void func_801928A8(s32 arg0, s16 arg1) {
|
||||
@ -635,11 +628,9 @@ void func_801928A8(s32 arg0, s16 arg1) {
|
||||
D_8006C26C->accelerationY = func_80192860(arg0 - 0x40, arg1);
|
||||
}
|
||||
|
||||
u8 func_80192914(s16 x, s16 y) {
|
||||
return ((ratan2(y, x) >> 4) + 0x40);
|
||||
}
|
||||
u8 func_80192914(s16 x, s16 y) { return ((ratan2(y, x) >> 4) + 0x40); }
|
||||
|
||||
u8 func_8019294C(Entity* a, Entity* b) {
|
||||
u8 func_8019294C(Entity *a, Entity *b) {
|
||||
s32 diffX = (u16)b->posX.Data.high - (u16)a->posX.Data.high;
|
||||
s32 diffY = (u16)b->posY.Data.high - (u16)a->posY.Data.high;
|
||||
return func_80192914(diffX, diffY);
|
||||
@ -662,13 +653,13 @@ u8 func_801929DC(s32 arg0, s32 arg1, s32 arg2) {
|
||||
s32 phi_v0_2 = temp_a2 << 0x18 ? (arg1 - arg0) : (arg1 + arg0);
|
||||
return phi_v0_2;
|
||||
}
|
||||
|
||||
|
||||
return arg2;
|
||||
}
|
||||
#endif
|
||||
|
||||
void func_80192A34(u16 slope, s16 speed) {
|
||||
Entity* entity;
|
||||
Entity *entity;
|
||||
s32 moveX;
|
||||
s32 moveY;
|
||||
|
||||
@ -687,11 +678,9 @@ void func_80192A34(u16 slope, s16 speed) {
|
||||
entity->accelerationY = moveY >> 4;
|
||||
}
|
||||
|
||||
u16 func_80192AC0(s16 x, s16 y) {
|
||||
return ratan2(y, x);
|
||||
}
|
||||
u16 func_80192AC0(s16 x, s16 y) { return ratan2(y, x); }
|
||||
|
||||
u16 func_80192AF0(Entity* a, Entity* b) {
|
||||
u16 func_80192AF0(Entity *a, Entity *b) {
|
||||
s32 diffX = b->posX.Data.high - a->posX.Data.high;
|
||||
s32 diffY = b->posY.Data.high - a->posY.Data.high;
|
||||
return ratan2(diffY, diffX);
|
||||
@ -709,7 +698,7 @@ INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_80192B70);
|
||||
u16 func_80192B70(s32 arg0, s32 arg1, s32 arg2) {
|
||||
u32 temp_a2 = arg2 - arg1;
|
||||
u16 phi_v0 = temp_a2 & 0x800 ? (0x800 - temp_a2) & 0x7FF : temp_a2;
|
||||
|
||||
|
||||
if ((u16)arg0 < phi_v0) {
|
||||
u16 ret = temp_a2 & 0x800 ? (arg1 - arg0) : (arg1 + arg0);
|
||||
return ret;
|
||||
@ -720,14 +709,14 @@ u16 func_80192B70(s32 arg0, s32 arg1, s32 arg2) {
|
||||
#endif
|
||||
|
||||
void func_80192BD0(s32 arg0) {
|
||||
D_8006C26C->initState = (s16) (arg0 & 0xFF);
|
||||
D_8006C26C->initState = (s16)(arg0 & 0xFF);
|
||||
D_8006C26C->unk2E = 0;
|
||||
D_8006C26C->animationFrameIndex = 0;
|
||||
D_8006C26C->animationFrameDuration = 0;
|
||||
}
|
||||
|
||||
void func_80192BF0(s32 arg0) {
|
||||
D_8006C26C->unk2E = (s16) (arg0 & 0xFF);
|
||||
D_8006C26C->unk2E = (s16)(arg0 & 0xFF);
|
||||
D_8006C26C->animationFrameIndex = 0;
|
||||
D_8006C26C->animationFrameDuration = 0;
|
||||
}
|
||||
@ -780,7 +769,7 @@ void InitializeEntity(u16 *arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_80192DA8(Entity* arg0) {
|
||||
void func_80192DA8(Entity *arg0) {
|
||||
if (arg0->initState == 0) {
|
||||
arg0->initState++;
|
||||
}
|
||||
@ -857,12 +846,9 @@ INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_8019362C);
|
||||
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_801936E0);
|
||||
|
||||
void func_801937BC(void) {
|
||||
}
|
||||
void func_801937BC(void) {}
|
||||
|
||||
void func_801937C4(void) {
|
||||
DestroyEntity(D_8006C26C);
|
||||
}
|
||||
void func_801937C4(void) { DestroyEntity(D_8006C26C); }
|
||||
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_801937EC);
|
||||
|
||||
@ -878,11 +864,9 @@ void CollectLifeVessel(void) {
|
||||
DestroyEntity(D_8006C26C);
|
||||
}
|
||||
|
||||
void func_8019399C(void) {
|
||||
DestroyEntity(D_8006C26C);
|
||||
}
|
||||
void func_8019399C(void) { DestroyEntity(D_8006C26C); }
|
||||
|
||||
Entity* func_801939C4(void) {
|
||||
Entity *func_801939C4(void) {
|
||||
D_8006C26C->initState = 3;
|
||||
D_8006C26C->subId = 4;
|
||||
return D_8006C26C;
|
||||
@ -949,7 +933,7 @@ INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_80195B44);
|
||||
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_80195C38);
|
||||
|
||||
bool func_80195E68(Unkstruct6* unk) {
|
||||
bool func_80195E68(Unkstruct6 *unk) {
|
||||
Unkstruct7 a;
|
||||
|
||||
FallEntity();
|
||||
@ -1012,9 +996,9 @@ INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_80199388);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_801994D8);
|
||||
#else
|
||||
POLY_GT4* func_801994D8(POLY_GT4* arg0) {
|
||||
POLY_GT4 *func_801994D8(POLY_GT4 *arg0) {
|
||||
if (arg0 != NULL) {
|
||||
loop_1:
|
||||
loop_1:
|
||||
if (arg0->p3 != NULL) {
|
||||
arg0 = arg0->tag;
|
||||
if (arg0 != NULL) {
|
||||
@ -1028,8 +1012,8 @@ loop_1:
|
||||
|
||||
INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_80199508);
|
||||
|
||||
POLY_GT4* func_80199584(POLY_GT4* startPoly, s32 count) {
|
||||
POLY_GT4* poly;
|
||||
POLY_GT4 *func_80199584(POLY_GT4 *startPoly, s32 count) {
|
||||
POLY_GT4 *poly;
|
||||
s8 unk;
|
||||
s32 i;
|
||||
|
||||
@ -1054,48 +1038,48 @@ POLY_GT4* func_80199584(POLY_GT4* startPoly, s32 count) {
|
||||
return 0;
|
||||
poly->p3 = unk;
|
||||
}
|
||||
|
||||
|
||||
return poly;
|
||||
}
|
||||
|
||||
void func_8019960C(POLY_GT4* arg0) {
|
||||
void func_8019960C(POLY_GT4 *arg0) {
|
||||
arg0->p1 = 0;
|
||||
arg0->p2 = 0;
|
||||
arg0->p3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y0 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x0 = 0;
|
||||
((POLY_GT4*)arg0->tag)->clut = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->u0 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->b1 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->r1 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->u1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->tpage = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->r2 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->b2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->u2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->v2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->r3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->b3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y0 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x0 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->clut = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->u0 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->b1 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->r1 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->u1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->tpage = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->r2 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->b2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->u2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->v2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->r3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->b3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y2 = 0;
|
||||
}
|
||||
|
||||
void func_801996EC(POLY_GT4* arg0) {
|
||||
void func_801996EC(POLY_GT4 *arg0) {
|
||||
func_8019960C(arg0);
|
||||
arg0->p3 = 8;
|
||||
((POLY_GT4*)arg0->tag)->p3 = 1;
|
||||
((POLY_GT4*)arg0->tag)->code = 2;
|
||||
((POLY_GT4*)arg0->tag)->pad3 = 0xA;
|
||||
((POLY_GT4 *)arg0->tag)->p3 = 1;
|
||||
((POLY_GT4 *)arg0->tag)->code = 2;
|
||||
((POLY_GT4 *)arg0->tag)->pad3 = 0xA;
|
||||
}
|
||||
|
||||
void func_80199740(POLY_GT4* arg0) {
|
||||
void func_80199740(POLY_GT4 *arg0) {
|
||||
arg0->p3 = 0;
|
||||
arg0->pad3 = 8;
|
||||
((POLY_GT4*)arg0->tag)->p3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->code = 4;
|
||||
((POLY_GT4*)arg0->tag)->pad3 = 8;
|
||||
((POLY_GT4 *)arg0->tag)->p3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->code = 4;
|
||||
((POLY_GT4 *)arg0->tag)->pad3 = 8;
|
||||
}
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
@ -1103,19 +1087,19 @@ INCLUDE_ASM("asm/st/mad/nonmatchings/D8C8", func_8019976C);
|
||||
#else
|
||||
s32 func_8019976C(s32 arg0, s32 value) {
|
||||
s32 temp_t0;
|
||||
u8* phi_v1;
|
||||
u8* phi_a0;
|
||||
u8 *phi_v1;
|
||||
u8 *phi_a0;
|
||||
int i;
|
||||
s32 phi_a2;
|
||||
s32 phi_a2_2;
|
||||
|
||||
phi_v1 = arg0 + 4;
|
||||
phi_a2 = 0;
|
||||
for (i = 0, phi_a2_2 = 0; i < 4; i++) {
|
||||
for (i = 0, phi_a2_2 = 0; i < 4; i++) {
|
||||
phi_v1 = phi_a0;
|
||||
loop_2:
|
||||
loop_2:
|
||||
*phi_v1 -= value;
|
||||
if ((u32) *phi_v1 >= 0xF9) {
|
||||
if ((u32)*phi_v1 >= 0xF9) {
|
||||
*phi_v1 = 0;
|
||||
} else {
|
||||
phi_a2 |= 1;
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "stage.h"
|
||||
|
||||
extern ObjectInit* g_pStObjLayout[];
|
||||
extern u8* D_80180850;
|
||||
extern ObjectInit *g_pStObjLayout[];
|
||||
extern u8 *D_80180850;
|
||||
extern u16 D_80180AAC[];
|
||||
extern u8* D_80180E50[];
|
||||
extern u8 *D_80180E50[];
|
||||
extern u8 D_80180E70[];
|
||||
extern u8 D_80180E78[];
|
||||
extern u16 D_80180E80[];
|
||||
@ -18,8 +18,8 @@ extern s8 D_801D711C;
|
||||
|
||||
void SpawnExplosionEntity(u16, Entity *);
|
||||
void ReplaceCandleWithDrop(Entity *);
|
||||
void EntityCandleDrop(Entity*);
|
||||
void EntityCandleHeartDrop(Entity*);
|
||||
void EntityCandleDrop(Entity *);
|
||||
void EntityCandleHeartDrop(Entity *);
|
||||
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801B77D4);
|
||||
|
||||
@ -35,7 +35,8 @@ void EntityCandle(Entity *entity) {
|
||||
if (entity->unk44) { // If the candle is destroyed
|
||||
Entity *entityDropItem;
|
||||
g_pfnPlaySfx(0x634);
|
||||
entityDropItem = AllocEntity(D_8007D858, D_8007D858 + MaxEntityCount);
|
||||
entityDropItem =
|
||||
AllocEntity(D_8007D858, D_8007D858 + MaxEntityCount);
|
||||
if (entityDropItem != NULL) {
|
||||
SpawnExplosionEntity(EntityExplosionID, entityDropItem);
|
||||
entityDropItem->subId = D_80180E78[temp_s0];
|
||||
@ -179,7 +180,7 @@ INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", EntityDamage);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", CreateEntity);
|
||||
#else
|
||||
void CreateEntity(Entity* entity, ObjectInit* initDesc) {
|
||||
void CreateEntity(Entity *entity, ObjectInit *initDesc) {
|
||||
DestroyEntity(entity);
|
||||
entity->objectId = initDesc->flags & 0x3FF;
|
||||
entity->pfnUpdate = PfnEntityUpdates[entity->objectId];
|
||||
@ -211,7 +212,8 @@ void func_801C377C(s32 arg0) {
|
||||
arg0 = (s16)arg0;
|
||||
a2 = 0xFFFE;
|
||||
loop_1:
|
||||
if (D_801D7110->posX == a3 || (arg0 < D_801D7110->posX) && (D_801D7110->posX != a2)) {
|
||||
if (D_801D7110->posX == a3 ||
|
||||
(arg0 < D_801D7110->posX) && (D_801D7110->posX != a2)) {
|
||||
D_801D7110--;
|
||||
goto loop_1;
|
||||
}
|
||||
@ -231,8 +233,7 @@ loop_1:
|
||||
}
|
||||
}
|
||||
void func_801C3A30(s32 arg0) {
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
if (D_801D7114->posY == 0xFFFF)
|
||||
D_801D7114--;
|
||||
else if ((s16)arg0 >= D_801D7114->posY || D_801D7114->posY == 0xFFFE)
|
||||
@ -249,13 +250,12 @@ INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C3B84);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", LoadObjLayout);
|
||||
#else
|
||||
void LoadObjLayout(s32 objLayoutId)
|
||||
{
|
||||
void LoadObjLayout(s32 objLayoutId) {
|
||||
s16 temp_s0;
|
||||
s16 var_a1_2;
|
||||
u16 temp_v1_2;
|
||||
u16* pObjLayoutStart;
|
||||
Unkstruct8* layout;
|
||||
u16 *pObjLayoutStart;
|
||||
Unkstruct8 *layout;
|
||||
|
||||
pObjLayoutStart = g_pStObjLayout[objLayoutId];
|
||||
layout = &g_CurrentRoomTileLayout;
|
||||
@ -264,15 +264,15 @@ void LoadObjLayout(s32 objLayoutId)
|
||||
if (*pObjLayoutStart != 0xFFFE) {
|
||||
s32 var_a0;
|
||||
s16 var_a1;
|
||||
u16* temp_v1;
|
||||
u16 *temp_v1;
|
||||
|
||||
D_801D7110 = pObjLayoutStart + 1;
|
||||
var_a0 = Random() & 0xFF;
|
||||
|
||||
for (var_a1 = 0; ; var_a1++) {
|
||||
for (var_a1 = 0;; var_a1++) {
|
||||
s32 temp_v0;
|
||||
temp_v1 = D_801D7110;
|
||||
D_801D7110 = (u16*)D_801D7110 + 1;
|
||||
D_801D7110 = (u16 *)D_801D7110 + 1;
|
||||
temp_v0 = var_a0 - temp_v1[0];
|
||||
var_a0 = temp_v0;
|
||||
if ((s16)temp_v0 < 0)
|
||||
@ -281,10 +281,10 @@ void LoadObjLayout(s32 objLayoutId)
|
||||
}
|
||||
|
||||
D_801D7110 = (temp_v1[2] << 0x10) + temp_v1[1];
|
||||
D_801D7114 = (var_a1 * 2) + 2 + (u16*)D_801D7114;
|
||||
D_801D7114 = ( ((u16*)D_801D7114)[1] << 0x10) + ((u16*)D_801D7114)[0];
|
||||
D_801D7114 = (var_a1 * 2) + 2 + (u16 *)D_801D7114;
|
||||
D_801D7114 = (((u16 *)D_801D7114)[1] << 0x10) + ((u16 *)D_801D7114)[0];
|
||||
}
|
||||
|
||||
|
||||
var_a1_2 = (s16)layout->unkA - 0x40;
|
||||
temp_s0 = layout->unkA + 0x140;
|
||||
if (var_a1_2 < 0) {
|
||||
@ -308,9 +308,9 @@ INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C3FB4);
|
||||
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C402C);
|
||||
|
||||
void DestroyEntity(Entity* item) {
|
||||
void DestroyEntity(Entity *item) {
|
||||
int i, length;
|
||||
u32* ptr;
|
||||
u32 *ptr;
|
||||
|
||||
if (item->unk34 & 0x800000) {
|
||||
g_pfnFreePolygons(item->firstPolygonIndex);
|
||||
@ -357,12 +357,10 @@ INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C5074);
|
||||
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C52EC);
|
||||
|
||||
Entity* AllocEntity(Entity* start, Entity* end) {
|
||||
Entity* current = start;
|
||||
while (current < end)
|
||||
{
|
||||
if (current->objectId == 0)
|
||||
{
|
||||
Entity *AllocEntity(Entity *start, Entity *end) {
|
||||
Entity *current = start;
|
||||
while (current < end) {
|
||||
if (current->objectId == 0) {
|
||||
DestroyEntity(current);
|
||||
return current;
|
||||
}
|
||||
@ -377,9 +375,7 @@ INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C5534);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C5560);
|
||||
#else
|
||||
s16 func_801C5560(s32 arg0) {
|
||||
return D_801820C4[arg0 & 0xFF];
|
||||
}
|
||||
s16 func_801C5560(s32 arg0) { return D_801820C4[arg0 & 0xFF]; }
|
||||
#endif
|
||||
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C557C);
|
||||
@ -444,7 +440,7 @@ void InitializeEntity(u16 *arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_801C5A70(Entity* arg0) {
|
||||
void func_801C5A70(Entity *arg0) {
|
||||
if (arg0->initState == 0) {
|
||||
arg0->initState++;
|
||||
}
|
||||
@ -505,9 +501,7 @@ INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C6568);
|
||||
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C660C);
|
||||
|
||||
void func_801C665C(void) {
|
||||
DestroyEntity(D_8006C3B8);
|
||||
}
|
||||
void func_801C665C(void) { DestroyEntity(D_8006C3B8); }
|
||||
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", EntityCandleDrop);
|
||||
|
||||
@ -539,7 +533,7 @@ INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C8F8C);
|
||||
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801C9080);
|
||||
|
||||
bool func_801C92B0(Unkstruct6* unk) {
|
||||
bool func_801C92B0(Unkstruct6 *unk) {
|
||||
Unkstruct7 a;
|
||||
|
||||
FallEntity();
|
||||
@ -693,8 +687,8 @@ INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801D6DB8);
|
||||
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801D6DE8);
|
||||
|
||||
POLY_GT4* func_801D6E64(POLY_GT4* startPoly, s32 count) {
|
||||
POLY_GT4* poly;
|
||||
POLY_GT4 *func_801D6E64(POLY_GT4 *startPoly, s32 count) {
|
||||
POLY_GT4 *poly;
|
||||
s8 unk;
|
||||
s32 i;
|
||||
|
||||
@ -719,48 +713,48 @@ POLY_GT4* func_801D6E64(POLY_GT4* startPoly, s32 count) {
|
||||
return 0;
|
||||
poly->p3 = unk;
|
||||
}
|
||||
|
||||
|
||||
return poly;
|
||||
}
|
||||
|
||||
void func_801D6EEC(POLY_GT4* arg0) {
|
||||
void func_801D6EEC(POLY_GT4 *arg0) {
|
||||
arg0->p1 = 0;
|
||||
arg0->p2 = 0;
|
||||
arg0->p3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y0 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x0 = 0;
|
||||
((POLY_GT4*)arg0->tag)->clut = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->u0 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->b1 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->r1 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->u1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->tpage = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->r2 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->b2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->u2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->v2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->r3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->b3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y0 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x0 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->clut = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->u0 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->b1 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->r1 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->u1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->tpage = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->r2 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->b2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->u2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->v2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->r3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->b3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y2 = 0;
|
||||
}
|
||||
|
||||
void func_801D6FCC(POLY_GT4* arg0) {
|
||||
void func_801D6FCC(POLY_GT4 *arg0) {
|
||||
func_801D6EEC(arg0);
|
||||
arg0->p3 = 8;
|
||||
((POLY_GT4*)arg0->tag)->p3 = 1;
|
||||
((POLY_GT4*)arg0->tag)->code = 2;
|
||||
((POLY_GT4*)arg0->tag)->pad3 = 0xA;
|
||||
((POLY_GT4 *)arg0->tag)->p3 = 1;
|
||||
((POLY_GT4 *)arg0->tag)->code = 2;
|
||||
((POLY_GT4 *)arg0->tag)->pad3 = 0xA;
|
||||
}
|
||||
|
||||
void func_801D7020(POLY_GT4* arg0) {
|
||||
void func_801D7020(POLY_GT4 *arg0) {
|
||||
arg0->p3 = 0;
|
||||
arg0->pad3 = 8;
|
||||
((POLY_GT4*)arg0->tag)->p3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->code = 4;
|
||||
((POLY_GT4*)arg0->tag)->pad3 = 8;
|
||||
((POLY_GT4 *)arg0->tag)->p3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->code = 4;
|
||||
((POLY_GT4 *)arg0->tag)->pad3 = 8;
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/st/no3/nonmatchings/377D4", func_801D704C);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stage.h"
|
||||
|
||||
extern u16 D_80180A3C[];
|
||||
extern u8* D_80180E28[];
|
||||
extern u8 *D_80180E28[];
|
||||
extern u8 D_80180E48[];
|
||||
extern u8 D_80180E50[];
|
||||
extern u16 D_80180E58[];
|
||||
@ -26,7 +26,8 @@ void EntityCandle(Entity *entity) {
|
||||
if (entity->unk44) { // If the candle is destroyed
|
||||
Entity *entityDropItem;
|
||||
g_pfnPlaySfx(0x634);
|
||||
entityDropItem = AllocEntity(D_8007D858, D_8007D858 + MaxEntityCount);
|
||||
entityDropItem =
|
||||
AllocEntity(D_8007D858, D_8007D858 + MaxEntityCount);
|
||||
if (entityDropItem != NULL) {
|
||||
SpawnExplosionEntity(EntityExplosionID, entityDropItem);
|
||||
entityDropItem->subId = D_80180E50[temp_s0];
|
||||
@ -128,7 +129,7 @@ INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", EntityDamage);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", CreateEntity);
|
||||
#else
|
||||
void CreateEntity(Entity* entity, ObjectInit* initDesc) {
|
||||
void CreateEntity(Entity *entity, ObjectInit *initDesc) {
|
||||
DestroyEntity(entity);
|
||||
entity->objectId = initDesc->flags & 0x3FF;
|
||||
entity->pfnUpdate = PfnEntityUpdates[entity->objectId];
|
||||
@ -172,9 +173,9 @@ INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BB824);
|
||||
|
||||
INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BB89C);
|
||||
|
||||
void DestroyEntity(Entity* item) {
|
||||
void DestroyEntity(Entity *item) {
|
||||
int i, length;
|
||||
u32* ptr;
|
||||
u32 *ptr;
|
||||
|
||||
if (item->unk34 & 0x800000) {
|
||||
g_pfnFreePolygons(item->firstPolygonIndex);
|
||||
@ -214,12 +215,10 @@ INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BC8E4);
|
||||
|
||||
INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BCB5C);
|
||||
|
||||
Entity* AllocEntity(Entity* start, Entity* end) {
|
||||
Entity* current = start;
|
||||
while (current < end)
|
||||
{
|
||||
if (current->objectId == 0)
|
||||
{
|
||||
Entity *AllocEntity(Entity *start, Entity *end) {
|
||||
Entity *current = start;
|
||||
while (current < end) {
|
||||
if (current->objectId == 0) {
|
||||
DestroyEntity(current);
|
||||
return current;
|
||||
}
|
||||
@ -234,9 +233,7 @@ INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BCDA4);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BCDD0);
|
||||
#else
|
||||
s16 func_801BCDD0(s32 arg0) {
|
||||
return D_80181A50[arg0 & 0xFF];
|
||||
}
|
||||
s16 func_801BCDD0(s32 arg0) { return D_80181A50[arg0 & 0xFF]; }
|
||||
#endif
|
||||
|
||||
INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BCDEC);
|
||||
@ -260,14 +257,14 @@ INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BD06C);
|
||||
INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BD0B4);
|
||||
|
||||
void func_801BD114(s32 arg0) {
|
||||
D_8006C3B8->initState = (s16) (arg0 & 0xFF);
|
||||
D_8006C3B8->initState = (s16)(arg0 & 0xFF);
|
||||
D_8006C3B8->unk2E = 0;
|
||||
D_8006C3B8->animationFrameIndex = 0;
|
||||
D_8006C3B8->animationFrameDuration = 0;
|
||||
}
|
||||
|
||||
void func_801BD134(s32 arg0) {
|
||||
D_8006C3B8->unk2E = (s16) (arg0 & 0xFF);
|
||||
D_8006C3B8->unk2E = (s16)(arg0 & 0xFF);
|
||||
D_8006C3B8->animationFrameIndex = 0;
|
||||
D_8006C3B8->animationFrameDuration = 0;
|
||||
}
|
||||
@ -301,7 +298,7 @@ void InitializeEntity(u16 *arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_801BD2E0(Entity* arg0) {
|
||||
void func_801BD2E0(Entity *arg0) {
|
||||
if (arg0->initState == 0) {
|
||||
arg0->initState++;
|
||||
}
|
||||
@ -329,9 +326,7 @@ INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BDDD8);
|
||||
|
||||
INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801BDE7C);
|
||||
|
||||
void func_801BDECC(void) {
|
||||
DestroyEntity(D_8006C3B8);
|
||||
}
|
||||
void func_801BDECC(void) { DestroyEntity(D_8006C3B8); }
|
||||
|
||||
INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", EntityCandleDrop);
|
||||
|
||||
@ -550,8 +545,8 @@ INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801D2470);
|
||||
|
||||
INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801D24A0);
|
||||
|
||||
POLY_GT4* func_801D251C(POLY_GT4* startPoly, s32 count) {
|
||||
POLY_GT4* poly;
|
||||
POLY_GT4 *func_801D251C(POLY_GT4 *startPoly, s32 count) {
|
||||
POLY_GT4 *poly;
|
||||
s8 unk;
|
||||
s32 i;
|
||||
|
||||
@ -576,48 +571,48 @@ POLY_GT4* func_801D251C(POLY_GT4* startPoly, s32 count) {
|
||||
return 0;
|
||||
poly->p3 = unk;
|
||||
}
|
||||
|
||||
|
||||
return poly;
|
||||
}
|
||||
|
||||
void func_801D25A4(POLY_GT4* arg0) {
|
||||
void func_801D25A4(POLY_GT4 *arg0) {
|
||||
arg0->p1 = 0;
|
||||
arg0->p2 = 0;
|
||||
arg0->p3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y0 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x0 = 0;
|
||||
((POLY_GT4*)arg0->tag)->clut = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->u0 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->b1 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->r1 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->u1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->tpage = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->r2 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->b2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->u2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->v2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->r3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->b3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y0 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x0 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->clut = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->u0 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->b1 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->r1 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->u1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->tpage = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->r2 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->b2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->u2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->v2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->r3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->b3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y2 = 0;
|
||||
}
|
||||
|
||||
void func_801D2684(POLY_GT4* arg0) {
|
||||
void func_801D2684(POLY_GT4 *arg0) {
|
||||
func_801D25A4(arg0);
|
||||
arg0->p3 = 8;
|
||||
((POLY_GT4*)arg0->tag)->p3 = 1;
|
||||
((POLY_GT4*)arg0->tag)->code = 2;
|
||||
((POLY_GT4*)arg0->tag)->pad3 = 0xA;
|
||||
((POLY_GT4 *)arg0->tag)->p3 = 1;
|
||||
((POLY_GT4 *)arg0->tag)->code = 2;
|
||||
((POLY_GT4 *)arg0->tag)->pad3 = 0xA;
|
||||
}
|
||||
|
||||
void func_801D26D8(POLY_GT4* arg0) {
|
||||
void func_801D26D8(POLY_GT4 *arg0) {
|
||||
arg0->p3 = 0;
|
||||
arg0->pad3 = 8;
|
||||
((POLY_GT4*)arg0->tag)->p3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->code = 4;
|
||||
((POLY_GT4*)arg0->tag)->pad3 = 8;
|
||||
((POLY_GT4 *)arg0->tag)->p3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->code = 4;
|
||||
((POLY_GT4 *)arg0->tag)->pad3 = 8;
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/st/np3/nonmatchings/3246C", func_801D2704);
|
||||
|
@ -8,7 +8,7 @@ void func_801B3BDC(u16 objectId, Entity *source, Entity *entity);
|
||||
s32 func_801B4C78();
|
||||
void MoveEntity();
|
||||
void func_801B5794(u8);
|
||||
void func_801B6B60(Entity*);
|
||||
void func_801B6B60(Entity *);
|
||||
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801A7D64);
|
||||
|
||||
@ -123,7 +123,7 @@ INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", EntityCutscene);
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", EntitySecretButton);
|
||||
|
||||
extern u16 D_80180628[];
|
||||
void EntitySecretStairsEmitter(Entity* entity) {
|
||||
void EntitySecretStairsEmitter(Entity *entity) {
|
||||
switch (entity->initState) {
|
||||
case 0:
|
||||
InitializeEntity(D_80180628);
|
||||
@ -165,7 +165,7 @@ INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801AC458);
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", EntityDracula);
|
||||
|
||||
extern u16 D_801805E0[];
|
||||
void EntityDraculaBody(Entity* entity) {
|
||||
void EntityDraculaBody(Entity *entity) {
|
||||
if (g_isDraculaFirstFormDefeated) {
|
||||
DestroyEntity(entity);
|
||||
}
|
||||
@ -199,7 +199,7 @@ void EntityDraculaBody(Entity* entity) {
|
||||
|
||||
extern u16 D_801805EC[];
|
||||
extern u8 D_8018097C[];
|
||||
void EntityDraculaFireball(Entity* entity) {
|
||||
void EntityDraculaFireball(Entity *entity) {
|
||||
u16 temp_v0;
|
||||
u16 temp_v1;
|
||||
s32 phi_v0;
|
||||
@ -219,8 +219,7 @@ void EntityDraculaFireball(Entity* entity) {
|
||||
InitializeEntity(D_801805EC);
|
||||
if (entity->unk14 == 0) {
|
||||
entity->accelerationX = -0x20000;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
entity->accelerationX = 0x20000;
|
||||
}
|
||||
|
||||
@ -252,7 +251,7 @@ extern u8 D_80180990[];
|
||||
extern u8 D_801809B0[];
|
||||
extern s16 D_80180A60[];
|
||||
extern s16 D_80180A62[];
|
||||
void EntityDraculaMeteorball(Entity* entity) {
|
||||
void EntityDraculaMeteorball(Entity *entity) {
|
||||
s32 speedX;
|
||||
|
||||
if (g_isDraculaFirstFormDefeated) {
|
||||
@ -290,16 +289,18 @@ void EntityDraculaMeteorball(Entity* entity) {
|
||||
} else {
|
||||
entity->accelerationX -= speedX;
|
||||
}
|
||||
|
||||
|
||||
if ((D_8003C998 & 3) == 0) {
|
||||
Entity* newEntity = AllocEntity(D_8007D858, D_8007D858 + 0x20);
|
||||
Entity *newEntity = AllocEntity(D_8007D858, D_8007D858 + 0x20);
|
||||
if (newEntity != 0) {
|
||||
s32 randomPosXYIndex;
|
||||
func_801B3BDC(0x1E, entity, newEntity);
|
||||
newEntity->zPriority = entity->zPriority + 1;
|
||||
randomPosXYIndex = (Random() & 3) * 2;
|
||||
newEntity->posX.Data.high = newEntity->posX.Data.high + D_80180A60[randomPosXYIndex];
|
||||
newEntity->posY.Data.high = newEntity->posY.Data.high + D_80180A62[randomPosXYIndex];
|
||||
newEntity->posX.Data.high =
|
||||
newEntity->posX.Data.high + D_80180A60[randomPosXYIndex];
|
||||
newEntity->posY.Data.high =
|
||||
newEntity->posY.Data.high + D_80180A62[randomPosXYIndex];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -309,7 +310,7 @@ void EntityDraculaMeteorball(Entity* entity) {
|
||||
|
||||
extern u16 D_801805EC[];
|
||||
extern u8 D_801809E0[];
|
||||
void func_801AD838(Entity* entity) {
|
||||
void func_801AD838(Entity *entity) {
|
||||
if (g_isDraculaFirstFormDefeated) {
|
||||
DestroyEntity(entity);
|
||||
return;
|
||||
@ -330,7 +331,7 @@ void func_801AD838(Entity* entity) {
|
||||
|
||||
extern u16 D_801805EC[];
|
||||
extern u8 D_80180A40[];
|
||||
void EntityDraculaGlass(Entity* entity) {
|
||||
void EntityDraculaGlass(Entity *entity) {
|
||||
switch (entity->initState) {
|
||||
case 0:
|
||||
InitializeEntity(D_801805EC);
|
||||
@ -364,7 +365,8 @@ void EntityDraculaGlass(Entity* entity) {
|
||||
if (AnimateEntity(D_80180A40, entity) == 0) {
|
||||
s32 i;
|
||||
for (i = 0; i < 8; i++) {
|
||||
Entity *glassShardEntity = AllocEntity(D_8007D858, D_8007D858 + MaxEntityCount);
|
||||
Entity *glassShardEntity =
|
||||
AllocEntity(D_8007D858, D_8007D858 + MaxEntityCount);
|
||||
if (glassShardEntity != 0) {
|
||||
func_801B3BDC(31, entity, glassShardEntity);
|
||||
glassShardEntity->subId = 1;
|
||||
@ -385,14 +387,13 @@ void EntityDraculaGlass(Entity* entity) {
|
||||
|
||||
bool func_801ADAC8(s32 arg0) {
|
||||
s32 unk = 0xD0;
|
||||
Entity* entity = D_8006C3B8;
|
||||
s16 temp_v1 = entity->posY.Data.high + arg0;
|
||||
Entity *entity = D_8006C3B8;
|
||||
s16 temp_v1 = entity->posY.Data.high + arg0;
|
||||
|
||||
if (temp_v1 >= unk) {
|
||||
entity->posY.Data.high = unk - temp_v1 + entity->posY.Data.high;
|
||||
entity->posY.Data.high = unk - temp_v1 + entity->posY.Data.high;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -455,8 +456,8 @@ extern u16 D_801C2584[];
|
||||
|
||||
void UpdateStageEntities(void) {
|
||||
s16 i;
|
||||
Entity* entity;
|
||||
s32* unk;
|
||||
Entity *entity;
|
||||
s32 *unk;
|
||||
|
||||
for (i = 0; i < 0x20; i++) {
|
||||
if (D_801C2584[i]) {
|
||||
@ -474,7 +475,7 @@ void UpdateStageEntities(void) {
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
|
||||
if (entity->initState) {
|
||||
s32 unk34 = entity->unk34;
|
||||
if (unk34 < 0) {
|
||||
@ -485,28 +486,26 @@ void UpdateStageEntities(void) {
|
||||
DestroyEntity(entity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if ((u16)(posX + 128) > 512 || (u16)(posY + 128) > 480) {
|
||||
DestroyEntity(entity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((unk34 & 0x02000000)) {
|
||||
s16 posY = entity->posY.Data.high + D_80073092;
|
||||
s16 test = (g_CurrentRoomVSize * 256) + 128;
|
||||
if (posY > test)
|
||||
{
|
||||
if (posY > test) {
|
||||
DestroyEntity(entity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (unk34 & 0xF) {
|
||||
entity->palette = D_801815EC[(entity->unk49 << 1) | (unk34 & 1)];
|
||||
entity->palette =
|
||||
D_801815EC[(entity->unk49 << 1) | (unk34 & 1)];
|
||||
entity->unk34--;
|
||||
if ((entity->unk34 & 0xF) == 0) {
|
||||
entity->palette = entity->unk6A;
|
||||
@ -516,10 +515,10 @@ void UpdateStageEntities(void) {
|
||||
|
||||
if (!(unk34 & 0x20000000) || (unk34 & 0x10000000) ||
|
||||
((u16)(entity->posX.Data.high + 64) <= 384) &&
|
||||
((u16)(entity->posY.Data.high + 64) <= 352))
|
||||
{
|
||||
((u16)(entity->posY.Data.high + 64) <= 352)) {
|
||||
if (!entity->unk58 || (entity->unk58--, unk34 & 0x100000)) {
|
||||
if (!D_800973FC || unk34 & 0x2100 || (unk34 & 0x200 && !(D_8003C8C4 & 3))) {
|
||||
if (!D_800973FC || unk34 & 0x2100 ||
|
||||
(unk34 & 0x200 && !(D_8003C8C4 & 3))) {
|
||||
D_8006C3B8 = entity;
|
||||
entity->pfnUpdate(entity);
|
||||
entity->unk44 = 0;
|
||||
@ -587,9 +586,9 @@ INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B3C58);
|
||||
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B3CD0);
|
||||
|
||||
void DestroyEntity(Entity* item) {
|
||||
void DestroyEntity(Entity *item) {
|
||||
int i, length;
|
||||
u32* ptr;
|
||||
u32 *ptr;
|
||||
|
||||
if (item->unk34 & 0x800000) {
|
||||
g_pfnFreePolygons(item->firstPolygonIndex);
|
||||
@ -646,12 +645,10 @@ INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B4FD4);
|
||||
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B51E4);
|
||||
|
||||
Entity *AllocEntity(Entity* start, Entity* end) {
|
||||
Entity* current = start;
|
||||
while (current < end)
|
||||
{
|
||||
if (current->objectId == 0)
|
||||
{
|
||||
Entity *AllocEntity(Entity *start, Entity *end) {
|
||||
Entity *current = start;
|
||||
while (current < end) {
|
||||
if (current->objectId == 0) {
|
||||
DestroyEntity(current);
|
||||
return current;
|
||||
}
|
||||
@ -720,8 +717,7 @@ INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B60A8);
|
||||
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B615C);
|
||||
|
||||
void func_801B61D4(void) {
|
||||
}
|
||||
void func_801B61D4(void) {}
|
||||
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B61DC);
|
||||
|
||||
@ -735,13 +731,13 @@ INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B6358);
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B6B60);
|
||||
void func_801B6B60(Entity* entity);
|
||||
void func_801B6B60(Entity *entity);
|
||||
#else
|
||||
extern u16 D_8018058C[];
|
||||
extern u32 D_80181D7C[];
|
||||
extern u16 D_80181E28[][2];
|
||||
|
||||
void func_801B6B60(Entity* entity) {
|
||||
void func_801B6B60(Entity *entity) {
|
||||
if (entity->initState == 0) {
|
||||
u32 zPriority;
|
||||
|
||||
@ -750,7 +746,7 @@ void func_801B6B60(Entity* entity) {
|
||||
entity->animationFrameIndex = 0;
|
||||
entity->animationFrameDuration = 0;
|
||||
entity->unk18 = 0x30;
|
||||
|
||||
|
||||
if (entity->subId & 0xF0) {
|
||||
entity->palette = 0x8195;
|
||||
entity->unk18 = 0x10;
|
||||
@ -763,9 +759,7 @@ void func_801B6B60(Entity* entity) {
|
||||
|
||||
entity->subId = entity->subId & 0xF;
|
||||
entity->accelerationY = D_80181D7C[entity->subId];
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
s32 posY = entity->posY.value;
|
||||
posY += entity->accelerationY;
|
||||
entity->posY.value = posY;
|
||||
@ -796,7 +790,7 @@ INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B8014);
|
||||
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801B8108);
|
||||
|
||||
bool func_801B8338(Unkstruct6* unk) {
|
||||
bool func_801B8338(Unkstruct6 *unk) {
|
||||
Unkstruct7 a;
|
||||
|
||||
FallEntity();
|
||||
@ -860,7 +854,7 @@ INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", EntityCutscenePhotographFire);
|
||||
extern u16 D_801805D4[];
|
||||
extern u8 D_801824CC[];
|
||||
|
||||
void EntityCutscenePhotographFire(Entity* entity) {
|
||||
void EntityCutscenePhotographFire(Entity *entity) {
|
||||
switch (entity->initState) {
|
||||
case 0:
|
||||
InitializeEntity(D_801805D4);
|
||||
@ -898,8 +892,8 @@ INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801BD5F8);
|
||||
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801BD628);
|
||||
|
||||
POLY_GT4* func_801BD6A4(POLY_GT4* startPoly, s32 count) {
|
||||
POLY_GT4* poly;
|
||||
POLY_GT4 *func_801BD6A4(POLY_GT4 *startPoly, s32 count) {
|
||||
POLY_GT4 *poly;
|
||||
s8 unk;
|
||||
s32 i;
|
||||
|
||||
@ -924,48 +918,48 @@ POLY_GT4* func_801BD6A4(POLY_GT4* startPoly, s32 count) {
|
||||
return 0;
|
||||
poly->p3 = unk;
|
||||
}
|
||||
|
||||
|
||||
return poly;
|
||||
}
|
||||
|
||||
void func_801BD72C(POLY_GT4* arg0) {
|
||||
void func_801BD72C(POLY_GT4 *arg0) {
|
||||
arg0->p1 = 0;
|
||||
arg0->p2 = 0;
|
||||
arg0->p3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y0 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x0 = 0;
|
||||
((POLY_GT4*)arg0->tag)->clut = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->u0 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->b1 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->r1 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->u1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->tpage = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->r2 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->b2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->u2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->v2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->r3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->b3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y0 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x0 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->clut = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->u0 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->b1 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->r1 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->u1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->tpage = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->r2 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->b2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->u2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->v2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->r3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->b3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y2 = 0;
|
||||
}
|
||||
|
||||
void func_801BD80C(POLY_GT4* arg0) {
|
||||
void func_801BD80C(POLY_GT4 *arg0) {
|
||||
func_801BD72C(arg0);
|
||||
arg0->p3 = 8;
|
||||
((POLY_GT4*)arg0->tag)->p3 = 1;
|
||||
((POLY_GT4*)arg0->tag)->code = 2;
|
||||
((POLY_GT4*)arg0->tag)->pad3 = 0xA;
|
||||
((POLY_GT4 *)arg0->tag)->p3 = 1;
|
||||
((POLY_GT4 *)arg0->tag)->code = 2;
|
||||
((POLY_GT4 *)arg0->tag)->pad3 = 0xA;
|
||||
}
|
||||
|
||||
void func_801BD860(POLY_GT4* arg0) {
|
||||
void func_801BD860(POLY_GT4 *arg0) {
|
||||
arg0->p3 = 0;
|
||||
arg0->pad3 = 8;
|
||||
((POLY_GT4*)arg0->tag)->p3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->code = 4;
|
||||
((POLY_GT4*)arg0->tag)->pad3 = 8;
|
||||
((POLY_GT4 *)arg0->tag)->p3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->code = 4;
|
||||
((POLY_GT4 *)arg0->tag)->pad3 = 8;
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/st/st0/nonmatchings/27D64", func_801BD88C);
|
||||
|
@ -1,14 +1,14 @@
|
||||
#include "stage.h"
|
||||
|
||||
extern RoomHeader* g_stRooms[];
|
||||
extern ObjectInit* g_pStObjLayout[];
|
||||
extern u8* D_80180310;
|
||||
extern RoomHeader *g_stRooms[];
|
||||
extern ObjectInit *g_pStObjLayout[];
|
||||
extern u8 *D_80180310;
|
||||
extern PfnEntityUpdate PfnEntityUpdates[];
|
||||
extern u16 D_80180440[];
|
||||
extern u16 D_80180458[];
|
||||
extern u16 D_80180494[];
|
||||
extern ObjInit2 D_801804E0[];
|
||||
extern u8* D_801805B8[];
|
||||
extern u8 *D_801805B8[];
|
||||
extern u8 D_801805D8[];
|
||||
extern u8 D_801805E0[];
|
||||
extern u16 D_801805E8[];
|
||||
@ -19,7 +19,7 @@ extern s32 D_80180E08[];
|
||||
extern s32 c_GoldPrizes[];
|
||||
extern s8 c_HeartPrizes[];
|
||||
extern s32 D_80180EC4[];
|
||||
extern u8* D_80180F70[];
|
||||
extern u8 *D_80180F70[];
|
||||
extern u16 D_80180FF8[];
|
||||
extern s32 D_80181008[];
|
||||
extern s32 D_80181020[];
|
||||
@ -35,8 +35,8 @@ extern s8 D_80193ABC;
|
||||
|
||||
void SpawnExplosionEntity(u16, Entity *);
|
||||
void ReplaceCandleWithDrop(Entity *);
|
||||
void EntityCandleDrop(Entity*);
|
||||
void EntityCandleHeartDrop(Entity*);
|
||||
void EntityCandleDrop(Entity *);
|
||||
void EntityCandleHeartDrop(Entity *);
|
||||
void func_8018D894(Entity *);
|
||||
void func_801916C4(s32);
|
||||
void func_80192F40(s32, s32);
|
||||
@ -88,13 +88,11 @@ void func_801870B0(Entity *entity) {
|
||||
temp_v1 = temp_s1;
|
||||
if (temp_v1 > 3) {
|
||||
if (temp_v1 > 5) {
|
||||
if (temp_v1 != 6)
|
||||
{
|
||||
test_2:
|
||||
if (g_CurrentRoomX) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (temp_v1 != 6) {
|
||||
test_2:
|
||||
if (g_CurrentRoomX)
|
||||
return;
|
||||
} else {
|
||||
if (g_pads->pressed & PAD_TRIANGLE) {
|
||||
g_CurrentRoomX = 0;
|
||||
g_CurrentRoomWidth = 1280;
|
||||
@ -102,9 +100,8 @@ test_2:
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
goto test_2;
|
||||
} else {
|
||||
goto test_2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,10 +115,10 @@ test_2:
|
||||
|
||||
unk = phi_v1 + temp_s1 * 8;
|
||||
temp_v0_2 = D_80180538 + unk;
|
||||
g_CurrentRoomX = (s32) *temp_v0_2++;
|
||||
g_CurrentRoomY = (s32) *temp_v0_2++;
|
||||
g_CurrentRoomWidth = (s32) *temp_v0_2++;
|
||||
g_CurrentRoomHeight = (s32) *temp_v0_2++;
|
||||
g_CurrentRoomX = (s32)*temp_v0_2++;
|
||||
g_CurrentRoomY = (s32)*temp_v0_2++;
|
||||
g_CurrentRoomWidth = (s32)*temp_v0_2++;
|
||||
g_CurrentRoomHeight = (s32)*temp_v0_2++;
|
||||
}
|
||||
} else {
|
||||
u8 temp_v0_5;
|
||||
@ -131,9 +128,7 @@ test_2:
|
||||
if (temp_v0_5 != 0) {
|
||||
entity->hitboxWidth = D_80180528[temp_s1];
|
||||
entity->hitboxHeight = 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
entity->hitboxWidth = 16;
|
||||
entity->hitboxHeight = D_80180528[temp_s1];
|
||||
}
|
||||
@ -151,7 +146,8 @@ void EntityCandle(Entity *entity) {
|
||||
if (entity->unk44) { // If the candle is destroyed
|
||||
Entity *entityDropItem;
|
||||
g_pfnPlaySfx(0x634);
|
||||
entityDropItem = AllocEntity(D_8007D858, D_8007D858 + MaxEntityCount);
|
||||
entityDropItem =
|
||||
AllocEntity(D_8007D858, D_8007D858 + MaxEntityCount);
|
||||
if (entityDropItem != NULL) {
|
||||
SpawnExplosionEntity(EntityExplosionID, entityDropItem);
|
||||
entityDropItem->subId = D_801805E0[temp_s0];
|
||||
@ -184,8 +180,8 @@ extern u16 D_80194728[];
|
||||
|
||||
void UpdateStageEntities(void) {
|
||||
s16 i;
|
||||
Entity* entity;
|
||||
s32* unk;
|
||||
Entity *entity;
|
||||
s32 *unk;
|
||||
|
||||
for (i = 0; i < 0x20; i++) {
|
||||
if (D_80194728[i]) {
|
||||
@ -203,7 +199,7 @@ void UpdateStageEntities(void) {
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
|
||||
|
||||
if (entity->initState) {
|
||||
s32 unk34 = entity->unk34;
|
||||
if (unk34 < 0) {
|
||||
@ -214,28 +210,26 @@ void UpdateStageEntities(void) {
|
||||
DestroyEntity(entity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if ((u16)(posX + 128) > 512 || (u16)(posY + 128) > 480) {
|
||||
DestroyEntity(entity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((unk34 & 0x02000000)) {
|
||||
s16 posY = entity->posY.Data.high + D_80073092;
|
||||
s16 test = (g_CurrentRoomVSize * 256) + 128;
|
||||
if (posY > test)
|
||||
{
|
||||
if (posY > test) {
|
||||
DestroyEntity(entity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (unk34 & 0xF) {
|
||||
entity->palette = D_80180690[(entity->unk49 << 1) | (unk34 & 1)];
|
||||
entity->palette =
|
||||
D_80180690[(entity->unk49 << 1) | (unk34 & 1)];
|
||||
entity->unk34--;
|
||||
if ((entity->unk34 & 0xF) == 0) {
|
||||
entity->palette = entity->unk6A;
|
||||
@ -245,10 +239,10 @@ void UpdateStageEntities(void) {
|
||||
|
||||
if (!(unk34 & 0x20000000) || (unk34 & 0x10000000) ||
|
||||
((u16)(entity->posX.Data.high + 64) <= 384) &&
|
||||
((u16)(entity->posY.Data.high + 64) <= 352))
|
||||
{
|
||||
((u16)(entity->posY.Data.high + 64) <= 352)) {
|
||||
if (!entity->unk58 || (entity->unk58--, unk34 & 0x100000)) {
|
||||
if (!D_800973FC || unk34 & 0x2100 || (unk34 & 0x200 && !(D_8003C8C4 & 3))) {
|
||||
if (!D_800973FC || unk34 & 0x2100 ||
|
||||
(unk34 & 0x200 && !(D_8003C8C4 & 3))) {
|
||||
D_8006C3B8 = entity;
|
||||
entity->pfnUpdate(entity);
|
||||
entity->unk44 = 0;
|
||||
@ -270,7 +264,7 @@ void UpdateStageEntities(void) {
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_80188514);
|
||||
#else
|
||||
void func_80188514(void) {
|
||||
Entity* entity;
|
||||
Entity *entity;
|
||||
for (entity = D_800762D8; entity < &D_8007EFD8; entity++) {
|
||||
if (!entity->pfnUpdate)
|
||||
continue;
|
||||
@ -278,15 +272,16 @@ void func_80188514(void) {
|
||||
if (entity->initState) {
|
||||
if (entity->unk34 & 0x10000) {
|
||||
if (entity->unk34 & 0xF) {
|
||||
entity->palette = D_80180690[entity->unk49 << 1 | entity->unk34 & 1];
|
||||
entity->palette =
|
||||
D_80180690[entity->unk49 << 1 | entity->unk34 & 1];
|
||||
entity->unk34--;
|
||||
if ((entity->unk34 & 0xF) == 0) {
|
||||
entity->palette = entity->unk6A;
|
||||
entity->unk6A = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else continue;
|
||||
} else
|
||||
continue;
|
||||
}
|
||||
|
||||
D_8006C3B8 = entity;
|
||||
@ -305,7 +300,7 @@ INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_80189734);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", CreateEntity);
|
||||
#else
|
||||
void CreateEntity(Entity *entity, ObjectInit* initDesc) {
|
||||
void CreateEntity(Entity *entity, ObjectInit *initDesc) {
|
||||
DestroyEntity(entity);
|
||||
entity->objectId = initDesc->flags & 0x3FF;
|
||||
entity->pfnUpdate = PfnEntityUpdates[entity->objectId];
|
||||
@ -337,7 +332,8 @@ void func_8018A118(s32 arg0) {
|
||||
arg0 = (s16)arg0;
|
||||
a2 = 0xFFFE;
|
||||
loop_1:
|
||||
if (D_80193AB0->posX == a3 || (arg0 < D_80193AB0->posX) && (D_80193AB0->posX != a2)) {
|
||||
if (D_80193AB0->posX == a3 ||
|
||||
(arg0 < D_80193AB0->posX) && (D_80193AB0->posX != a2)) {
|
||||
D_80193AB0--;
|
||||
goto loop_1;
|
||||
}
|
||||
@ -360,8 +356,7 @@ loop_1:
|
||||
}
|
||||
|
||||
void func_8018A3CC(s32 arg0) {
|
||||
while (true)
|
||||
{
|
||||
while (true) {
|
||||
if (D_80193AB4->posY == 0xFFFF)
|
||||
D_80193AB4--;
|
||||
else if ((s16)arg0 >= D_80193AB4->posY || D_80193AB4->posY == 0xFFFE)
|
||||
@ -375,26 +370,25 @@ void func_8018A3CC(s32 arg0) {
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018A424);
|
||||
void func_8018A424(s16 arg0);
|
||||
#else
|
||||
void func_80189FB4(ObjectInit*);
|
||||
void func_80189FB4(ObjectInit *);
|
||||
extern s32 D_80097428[];
|
||||
extern u8 D_80193ABC;
|
||||
|
||||
void func_8018A424(s16 arg0) {
|
||||
if (D_80193ABC) {
|
||||
func_8018A380((s16) (arg0 - D_8009790C));
|
||||
func_8018A380((s16)(arg0 - D_8009790C));
|
||||
D_80193ABC = 0;
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
||||
while (true) {
|
||||
if (D_80193AB4->posY != -1 && arg0 >= D_80193AB4->posY) {
|
||||
u8 flag = (D_80193AB4->unk6 >> 8) + 0xFF;
|
||||
if (flag == 0xFF || (1 << (flag & 0x1F) & D_80097428[flag >> 5]) == 0) {
|
||||
if (flag == 0xFF ||
|
||||
(1 << (flag & 0x1F) & D_80097428[flag >> 5]) == 0) {
|
||||
func_80189FB4(D_80193AB4);
|
||||
}
|
||||
D_80193AB4++;
|
||||
}
|
||||
else
|
||||
} else
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -406,13 +400,12 @@ void func_8018A520(s16);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", LoadObjLayout);
|
||||
#else
|
||||
void LoadObjLayout(s32 objLayoutId)
|
||||
{
|
||||
void LoadObjLayout(s32 objLayoutId) {
|
||||
s16 temp_s0;
|
||||
s16 var_a1_2;
|
||||
u16 temp_v1_2;
|
||||
u16* pObjLayoutStart;
|
||||
Unkstruct8* layout;
|
||||
u16 *pObjLayoutStart;
|
||||
Unkstruct8 *layout;
|
||||
|
||||
pObjLayoutStart = g_pStObjLayout[objLayoutId];
|
||||
layout = &g_CurrentRoomTileLayout;
|
||||
@ -421,15 +414,15 @@ void LoadObjLayout(s32 objLayoutId)
|
||||
if (*pObjLayoutStart != 0xFFFE) {
|
||||
s32 var_a0;
|
||||
s16 var_a1;
|
||||
u16* temp_v1;
|
||||
u16 *temp_v1;
|
||||
|
||||
D_80193AB0 = pObjLayoutStart + 1;
|
||||
var_a0 = Random() & 0xFF;
|
||||
|
||||
for (var_a1 = 0; ; var_a1++) {
|
||||
for (var_a1 = 0;; var_a1++) {
|
||||
s32 temp_v0;
|
||||
temp_v1 = D_80193AB0;
|
||||
D_80193AB0 = (u16*)D_80193AB0 + 1;
|
||||
D_80193AB0 = (u16 *)D_80193AB0 + 1;
|
||||
temp_v0 = var_a0 - temp_v1[0];
|
||||
var_a0 = temp_v0;
|
||||
if ((s16)temp_v0 < 0)
|
||||
@ -438,10 +431,10 @@ void LoadObjLayout(s32 objLayoutId)
|
||||
}
|
||||
|
||||
D_80193AB0 = (temp_v1[2] << 0x10) + temp_v1[1];
|
||||
D_80193AB4 = (var_a1 * 2) + 2 + (u16*)D_80193AB4;
|
||||
D_80193AB4 = ( ((u16*)D_80193AB4)[1] << 0x10) + ((u16*)D_80193AB4)[0];
|
||||
D_80193AB4 = (var_a1 * 2) + 2 + (u16 *)D_80193AB4;
|
||||
D_80193AB4 = (((u16 *)D_80193AB4)[1] << 0x10) + ((u16 *)D_80193AB4)[0];
|
||||
}
|
||||
|
||||
|
||||
var_a1_2 = (s16)layout->unkA - 0x40;
|
||||
temp_s0 = layout->unkA + 0x140;
|
||||
if (var_a1_2 < 0) {
|
||||
@ -465,7 +458,7 @@ void func_8018A7AC(void) {
|
||||
else
|
||||
func_8018A26C(tmp - 0x40);
|
||||
}
|
||||
|
||||
|
||||
if (D_8009790C) {
|
||||
s16 tmp = s0->unkE;
|
||||
if (D_8009790C > 0)
|
||||
@ -475,7 +468,6 @@ void func_8018A7AC(void) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", SpawnExplosionEntity);
|
||||
#else
|
||||
@ -505,9 +497,9 @@ INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018A950);
|
||||
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018A9C8);
|
||||
|
||||
void DestroyEntity(Entity* item) {
|
||||
void DestroyEntity(Entity *item) {
|
||||
int i, length;
|
||||
u32* ptr;
|
||||
u32 *ptr;
|
||||
|
||||
if (item->unk34 & 0x800000) {
|
||||
g_pfnFreePolygons(item->firstPolygonIndex);
|
||||
@ -527,7 +519,7 @@ void DestroyEntityFromIndex(s16 index) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8018B6E8(Entity* entity) {
|
||||
void func_8018B6E8(Entity *entity) {
|
||||
if (entity->unk32) {
|
||||
u32 bit = entity->unk32 - 1;
|
||||
u16 index = bit >> 5;
|
||||
@ -572,12 +564,10 @@ INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018BA10);
|
||||
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018BC88);
|
||||
|
||||
Entity *AllocEntity(Entity* start, Entity* end) {
|
||||
Entity* current = start;
|
||||
while (current < end)
|
||||
{
|
||||
if (current->objectId == 0)
|
||||
{
|
||||
Entity *AllocEntity(Entity *start, Entity *end) {
|
||||
Entity *current = start;
|
||||
while (current < end) {
|
||||
if (current->objectId == 0) {
|
||||
DestroyEntity(current);
|
||||
return current;
|
||||
}
|
||||
@ -591,17 +581,13 @@ Entity *AllocEntity(Entity* start, Entity* end) {
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018BED0);
|
||||
s32 func_8018BED0(u8 arg0, s16 arg1);
|
||||
#else
|
||||
s32 func_8018BED0(u8 arg0, s16 arg1) {
|
||||
return D_80180A94[arg0 & 0xFF] * arg1;
|
||||
}
|
||||
s32 func_8018BED0(u8 arg0, s16 arg1) { return D_80180A94[arg0 & 0xFF] * arg1; }
|
||||
#endif
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018BEFC);
|
||||
#else
|
||||
s16 func_8018BEFC(s32 arg0) {
|
||||
return D_80180A94[arg0 & 0xFF];
|
||||
}
|
||||
s16 func_8018BEFC(s32 arg0) { return D_80180A94[arg0 & 0xFF]; }
|
||||
#endif
|
||||
|
||||
void func_8018BF18(s32 arg0, s16 arg1) {
|
||||
@ -609,11 +595,9 @@ void func_8018BF18(s32 arg0, s16 arg1) {
|
||||
D_8006C3B8->accelerationY = func_8018BED0(arg0 - 0x40, arg1);
|
||||
}
|
||||
|
||||
u8 func_8018BF84(s16 x, s16 y) {
|
||||
return ((ratan2(y, x) >> 4) + 0x40);
|
||||
}
|
||||
u8 func_8018BF84(s16 x, s16 y) { return ((ratan2(y, x) >> 4) + 0x40); }
|
||||
|
||||
u8 func_8018BFBC(Entity* a, Entity* b) {
|
||||
u8 func_8018BFBC(Entity *a, Entity *b) {
|
||||
s32 diffX = (u16)b->posX.Data.high - (u16)a->posX.Data.high;
|
||||
s32 diffY = (u16)b->posY.Data.high - (u16)a->posY.Data.high;
|
||||
return func_8018BF84(diffX, diffY);
|
||||
@ -628,7 +612,7 @@ u8 func_8018C004(s32 x, s32 y) {
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018C04C);
|
||||
|
||||
void func_8018C0A4(u16 slope, s16 speed) {
|
||||
Entity* entity;
|
||||
Entity *entity;
|
||||
s32 moveX;
|
||||
s32 moveY;
|
||||
|
||||
@ -647,11 +631,9 @@ void func_8018C0A4(u16 slope, s16 speed) {
|
||||
entity->accelerationY = moveY >> 4;
|
||||
}
|
||||
|
||||
u16 func_8018C130(s16 x, s16 y) {
|
||||
return ratan2(y, x);
|
||||
}
|
||||
u16 func_8018C130(s16 x, s16 y) { return ratan2(y, x); }
|
||||
|
||||
u16 func_8018C160(Entity* a, Entity* b) {
|
||||
u16 func_8018C160(Entity *a, Entity *b) {
|
||||
s32 diffX = b->posX.Data.high - a->posX.Data.high;
|
||||
s32 diffY = b->posY.Data.high - a->posY.Data.high;
|
||||
return ratan2(diffY, diffX);
|
||||
@ -666,14 +648,14 @@ u16 func_8018C198(s32 x, s32 y) {
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018C1E0);
|
||||
|
||||
void func_8018C240(s32 arg0) {
|
||||
D_8006C3B8->initState = (s16) (arg0 & 0xFF);
|
||||
D_8006C3B8->initState = (s16)(arg0 & 0xFF);
|
||||
D_8006C3B8->unk2E = 0;
|
||||
D_8006C3B8->animationFrameIndex = 0;
|
||||
D_8006C3B8->animationFrameDuration = 0;
|
||||
}
|
||||
|
||||
void func_8018C260(s32 arg0) {
|
||||
D_8006C3B8->unk2E = (s16) (arg0 & 0xFF);
|
||||
D_8006C3B8->unk2E = (s16)(arg0 & 0xFF);
|
||||
D_8006C3B8->animationFrameIndex = 0;
|
||||
D_8006C3B8->animationFrameDuration = 0;
|
||||
}
|
||||
@ -726,7 +708,7 @@ void InitializeEntity(u16 *arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_8018C40C(Entity* arg0) {
|
||||
void func_8018C40C(Entity *arg0) {
|
||||
if (arg0->initState == 0) {
|
||||
arg0->initState++;
|
||||
}
|
||||
@ -770,7 +752,7 @@ INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018CB34);
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", CollectHeart);
|
||||
#else
|
||||
void CollectHeart(u16 heartSize) {
|
||||
s32* hearts;
|
||||
s32 *hearts;
|
||||
|
||||
g_pfnPlaySfx(0x67A);
|
||||
hearts = &g_playerHeart;
|
||||
@ -834,9 +816,7 @@ void CollectLifeVessel(void) {
|
||||
DestroyEntity(D_8006C3B8);
|
||||
}
|
||||
|
||||
void func_8018CFF8(void) {
|
||||
DestroyEntity(D_8006C3B8);
|
||||
}
|
||||
void func_8018CFF8(void) { DestroyEntity(D_8006C3B8); }
|
||||
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", EntityCandleDrop);
|
||||
|
||||
@ -863,9 +843,7 @@ void func_8018D894(Entity *entity) {
|
||||
}
|
||||
entity->subId &= 15;
|
||||
entity->accelerationY = D_80180EC4[entity->subId];
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
entity->posY.value += entity->accelerationY;
|
||||
if (!AnimateEntity(D_80180F70[entity->subId], entity)) {
|
||||
DestroyEntity(entity);
|
||||
@ -883,7 +861,7 @@ void func_8018D990(Entity *arg0, s32 renderFlags) {
|
||||
u8 colorIntensity;
|
||||
|
||||
poly = &D_80086FEC[arg0->firstPolygonIndex];
|
||||
|
||||
|
||||
left = arg0->posX.Data.high - 7;
|
||||
right = arg0->posX.Data.high + 7;
|
||||
poly->x2 = left;
|
||||
@ -933,16 +911,16 @@ INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018F620);
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018F750);
|
||||
#else
|
||||
extern void func_8018F928(Entity*);
|
||||
void func_8018F750(Entity *source, s8 count, s16 xOffset, s16 yOffset, s16 xDistance) {
|
||||
extern void func_8018F928(Entity *);
|
||||
void func_8018F750(Entity *source, s8 count, s16 xOffset, s16 yOffset,
|
||||
s16 xDistance) {
|
||||
Entity *entity;
|
||||
s16 x, y;
|
||||
u8 i;
|
||||
|
||||
y = source->posY.Data.high + yOffset;
|
||||
x = source->posX.Data.high + xOffset;
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
for (i = 0; i < count; i++) {
|
||||
entity = AllocEntity(D_8007A958, D_8007A958 + MaxEntityCount);
|
||||
if (entity != NULL) {
|
||||
entity->objectId = 21;
|
||||
@ -970,9 +948,7 @@ void func_8018F838(Entity *entity) {
|
||||
entity->unk18 = 16;
|
||||
entity->initState = entity->initState + 1;
|
||||
entity->animationFrame = D_80181038[entity->subId];
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
entity->animationFrameDuration++;
|
||||
entity->posY.value = entity->posY.value - entity->accelerationY;
|
||||
if ((entity->animationFrameDuration & 1) == 0) {
|
||||
@ -1000,9 +976,7 @@ void func_8018F928(Entity *arg0) {
|
||||
arg0->unk1C = temp_v0;
|
||||
arg0->accelerationY = D_80181008[arg0->subId];
|
||||
arg0->initState++;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
arg0->animationFrameDuration++;
|
||||
arg0->posY.value -= arg0->accelerationY;
|
||||
if ((arg0->animationFrameDuration & 1) == 0) {
|
||||
@ -1016,7 +990,7 @@ void func_8018F928(Entity *arg0) {
|
||||
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_8018FA1C);
|
||||
|
||||
bool func_8018FC4C(Unkstruct6* unk) {
|
||||
bool func_8018FC4C(Unkstruct6 *unk) {
|
||||
Unkstruct7 a;
|
||||
|
||||
FallEntity();
|
||||
@ -1128,7 +1102,7 @@ void func_8019055C(void) {
|
||||
|
||||
temp_s4 = Random() & 3;
|
||||
temp_s3 = ((Random() & 0xF) << 8) - 0x800;
|
||||
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
entity = AllocEntity(D_8007D858, D_8007D858 + MaxEntityCount);
|
||||
if (entity != NULL) {
|
||||
@ -1182,7 +1156,6 @@ void func_80192E54(Entity *arg0) {
|
||||
AnimateEntity(objInit->unk10, arg0);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_80192F40);
|
||||
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_80193270);
|
||||
@ -1223,8 +1196,8 @@ POLY_GT4 *func_801937D8(POLY_GT4 *poly, u8 index) {
|
||||
}
|
||||
#endif
|
||||
|
||||
POLY_GT4* func_80193854(POLY_GT4* startPoly, s32 count) {
|
||||
POLY_GT4* poly;
|
||||
POLY_GT4 *func_80193854(POLY_GT4 *startPoly, s32 count) {
|
||||
POLY_GT4 *poly;
|
||||
s8 unk;
|
||||
s32 i;
|
||||
|
||||
@ -1249,66 +1222,66 @@ POLY_GT4* func_80193854(POLY_GT4* startPoly, s32 count) {
|
||||
return 0;
|
||||
poly->p3 = unk;
|
||||
}
|
||||
|
||||
|
||||
return poly;
|
||||
}
|
||||
|
||||
void func_801938DC(POLY_GT4* arg0) {
|
||||
void func_801938DC(POLY_GT4 *arg0) {
|
||||
arg0->p1 = 0;
|
||||
arg0->p2 = 0;
|
||||
arg0->p3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y0 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x0 = 0;
|
||||
((POLY_GT4*)arg0->tag)->clut = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->u0 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->b1 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->r1 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->u1 = 0;
|
||||
((POLY_GT4*)arg0->tag)->tpage = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->r2 = 0;
|
||||
*(u16*)&((POLY_GT4*)arg0->tag)->b2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->u2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->v2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->r3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->b3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->x2 = 0;
|
||||
((POLY_GT4*)arg0->tag)->y2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y0 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x0 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->clut = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->u0 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->b1 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->r1 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->u1 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->tpage = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->r2 = 0;
|
||||
*(u16 *)&((POLY_GT4 *)arg0->tag)->b2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->u2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->v2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->r3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->b3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->x2 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->y2 = 0;
|
||||
}
|
||||
|
||||
void func_801939BC(POLY_GT4* arg0) {
|
||||
void func_801939BC(POLY_GT4 *arg0) {
|
||||
func_801938DC(arg0);
|
||||
arg0->p3 = 8;
|
||||
((POLY_GT4*)arg0->tag)->p3 = 1;
|
||||
((POLY_GT4*)arg0->tag)->code = 2;
|
||||
((POLY_GT4*)arg0->tag)->pad3 = 0xA;
|
||||
((POLY_GT4 *)arg0->tag)->p3 = 1;
|
||||
((POLY_GT4 *)arg0->tag)->code = 2;
|
||||
((POLY_GT4 *)arg0->tag)->pad3 = 0xA;
|
||||
}
|
||||
|
||||
void func_80193A10(POLY_GT4* arg0) {
|
||||
void func_80193A10(POLY_GT4 *arg0) {
|
||||
arg0->p3 = 0;
|
||||
arg0->pad3 = 8;
|
||||
((POLY_GT4*)arg0->tag)->p3 = 0;
|
||||
((POLY_GT4*)arg0->tag)->code = 4;
|
||||
((POLY_GT4*)arg0->tag)->pad3 = 8;
|
||||
((POLY_GT4 *)arg0->tag)->p3 = 0;
|
||||
((POLY_GT4 *)arg0->tag)->code = 4;
|
||||
((POLY_GT4 *)arg0->tag)->pad3 = 8;
|
||||
}
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
INCLUDE_ASM("asm/st/wrp/nonmatchings/6FD0", func_80193A3C);
|
||||
#else
|
||||
s32 func_80193A3C(u8* arg0, u8 arg1) {
|
||||
s32 func_80193A3C(u8 *arg0, u8 arg1) {
|
||||
s32 temp_v0;
|
||||
u8 phi_v0;
|
||||
u8 *phi_a0;
|
||||
s32 i;
|
||||
s32 phi_a2;
|
||||
|
||||
|
||||
phi_a2 = 0;
|
||||
phi_a0 = arg0 + 4;
|
||||
for (i = 0; i < 4; i++) {
|
||||
u8 *phi_v1 = phi_a0;
|
||||
s32 end = phi_a0 + 3;
|
||||
loop_2:
|
||||
loop_2:
|
||||
temp_v0 = *phi_v1 - arg1;
|
||||
phi_v0 = temp_v0;
|
||||
if (temp_v0 < 0) {
|
||||
@ -1323,7 +1296,6 @@ loop_2:
|
||||
}
|
||||
|
||||
phi_a0 += 0xC;
|
||||
|
||||
}
|
||||
|
||||
return phi_a2;
|
||||
|
Loading…
Reference in New Issue
Block a user