Skip to content

Commit

Permalink
LoadDprizeFromBrx added
Browse files Browse the repository at this point in the history
  • Loading branch information
LordBozo committed Aug 11, 2024
1 parent 96995c7 commit 76546e5
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 11 deletions.
3 changes: 3 additions & 0 deletions config/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ snd_SendIOPCommandNoWait = 0x11e8c8; // type:func
// P2/alo.c
////////////////////////////////////////////////////////////////
InitAlo__FP3ALO = 0x123ED0; // type:func
SnipAloObjects__FP3ALOiP4SNIP = 0x124DF8; // type:func
UpdateAlo__FP3ALOf = 0x124FC0; // type:func
LoadAloFromBrx__FP3ALOP18CBinaryInputStream = 0x1289C0; // type:func
SetAloTargetHitTest__FP3ALOi = 0x12AA28; // type:func

////////////////////////////////////////////////////////////////
// P2/binoc.c
Expand Down
29 changes: 29 additions & 0 deletions include/alo.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include <lo.h>
#include <dl.h>

// Forward
struct CBinaryInputStream;

struct FICG
{
uchar grficSweep;
Expand All @@ -17,6 +20,16 @@ struct FICG
uchar grficShock;
};

/**
* @brief Unknown
*/
struct SNIP
{
int grfsnip;
OID oid;
int ib;
};

/**
* @brief "Lightweight"
*
Expand Down Expand Up @@ -56,11 +69,27 @@ struct ALO : public LO
*/
void InitAlo(ALO *palo);

/**
* @brief unknown
*
*/
void SnipAloObjects(ALO *palo, int csnip, SNIP *asnip);

/**
* @brief Updates an ALO
*
* @param palo ALO to initialize
*/
void UpdateAlo(ALO *palo, float dt);

/**
* @brief unknown
*/
void LoadAloFromBrx(ALO *palo, CBinaryInputStream *pbis);

/**
* @brief unknown
*/
void SetAloTargetHitTest(ALO *palo, int fHitTest);

#endif // ALO_H
21 changes: 11 additions & 10 deletions include/coin.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ struct COIN;
struct KEY;
struct CHARM;

/**
* @brief Unknown
*/
struct SNIP
{
int grfsnip;
OID oid;
int ib;
};

/**
* @brief DPRIZE state.
*
Expand Down Expand Up @@ -125,6 +115,14 @@ struct CHARM : public DPRIZE
*/
void InitDprize(DPRIZE *pdprize);

/**
* @brief Loads a DPrize from an Input Stream
*
* @param pdprize DPrize to initialize
* @param pbis Input Stream
*/
void LoadDprizeFromBrx(DPRIZE *pdprize, CBinaryInputStream *pbis);

/**
* @brief Initializes a DPrize
*
Expand Down Expand Up @@ -152,4 +150,7 @@ void InitCharm(CHARM *pcharm);
*/
void InitKey(KEY *pkey);


extern SNIP s_asnipDprize[5];

#endif // COIN_H
7 changes: 6 additions & 1 deletion src/P2/coin.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ void InitDprize(DPRIZE *pdprize)
pdprize->fLastBounce = 1;
}

INCLUDE_ASM(const s32, "P2/coin", LoadDprizeFromBrx__FP6DPRIZEP18CBinaryInputStream);
void LoadDprizeFromBrx(DPRIZE *pdprize, CBinaryInputStream *pbis)
{
SetAloTargetHitTest(pdprize, 1);
LoadAloFromBrx(pdprize, pbis);
SnipAloObjects(pdprize, 5, s_asnipDprize);
}

INCLUDE_ASM(const s32, "P2/coin", CloneDprize__FP6DPRIZET0);

Expand Down

0 comments on commit 76546e5

Please sign in to comment.