mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-08-22 05:49:04 -04:00
Implement THA and THA_GA
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
#ifndef THA_GA_H
|
||||
#define THA_GA_H
|
||||
|
||||
#include "TwoHeadArena.h"
|
||||
#include "PR/mbi.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
size_t size;
|
||||
Gfx* buf_p;
|
||||
Gfx* head_p;
|
||||
Gfx* tail_p;
|
||||
} TwoHeadArenaGfx_t;
|
||||
|
||||
typedef TwoHeadArenaGfx_t TwoHeadArenaGfx;
|
||||
|
||||
typedef union {
|
||||
TwoHeadArena tha;
|
||||
TwoHeadArenaGfx thaGfx;
|
||||
} THA_GA_t;
|
||||
|
||||
typedef THA_GA_t THA_GA;
|
||||
|
||||
extern void THA_GA_ct(THA_GA* this, Gfx* p, size_t n);
|
||||
extern void THA_GA_dt(THA_GA* this); /* @unused */
|
||||
extern int THA_GA_isCrash(THA_GA* this);
|
||||
extern void THA_GA_init(THA_GA* this); /* @unused*/
|
||||
extern int THA_GA_getFreeBytes(THA_GA* this);
|
||||
extern void* THA_GA_getTailPtr(THA_GA* this); /* @unused */
|
||||
extern void* THA_GA_nextPtrN(THA_GA* this, size_t n); /* @unused */
|
||||
extern void* THA_GA_nextPtr1(THA_GA* this); /* @unused */
|
||||
extern Gfx* THA_GA_NEXT_DISP(THA_GA* this); /* @unused */
|
||||
extern void* THA_GA_getHeadPtr(THA_GA* this); /* @unused */
|
||||
extern void THA_GA_setHeadPtr(THA_GA* this, void *p); /* @unused */
|
||||
extern Mtx* THA_GA_alloc(THA_GA* this, size_t n); /* @unused */
|
||||
extern Mtx* THA_GA_allocMtxN(THA_GA* this, size_t n); /* @unused */
|
||||
extern Mtx* THA_GA_allocMtx1(THA_GA* this); /* @unused */
|
||||
extern Vtx* THA_GA_allocVtxN(THA_GA* this, size_t n); /* @unused */
|
||||
extern Vtx* THA_GA_allocVtx1(THA_GA* this); /* @unused */
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef TWOHEADARENA_H
|
||||
#define TWOHEADARENA_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
size_t size;
|
||||
char *buf_p;
|
||||
char *head_p;
|
||||
char *tail_p;
|
||||
} TwoHeadArena_t;
|
||||
typedef TwoHeadArena_t TwoHeadArena;
|
||||
typedef TwoHeadArena_t THA;
|
||||
|
||||
extern void THA_ct(TwoHeadArena* this, char* p, size_t n);
|
||||
extern void THA_dt(TwoHeadArena* this);
|
||||
extern void* THA_getHeadPtr(TwoHeadArena* this); /* @unused */
|
||||
extern void THA_setHeadPtr(TwoHeadArena* this, void* p); /* @unused */
|
||||
extern void* THA_getTailPtr(TwoHeadArena* this); /* @unused */
|
||||
extern void* THA_nextPtrN(TwoHeadArena* this, size_t n); /* @unused */
|
||||
extern void* THA_nextPtr1(TwoHeadArena* this); /* @unused */
|
||||
extern void* THA_alloc(TwoHeadArena* this, size_t siz);
|
||||
extern void* THA_alloc16(TwoHeadArena* this, size_t siz);
|
||||
extern void* THA_allocAlign(TwoHeadArena* this, size_t siz, int mask);
|
||||
extern int THA_isCrash(TwoHeadArena* this);
|
||||
extern void THA_init(TwoHeadArena* this);
|
||||
extern int THA_getFreeBytes16(TwoHeadArena* this);
|
||||
extern int THA_getFreeBytes(TwoHeadArena* this);
|
||||
extern int THA_getFreeBytesAlign(TwoHeadArena* this, int mask);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -13,6 +13,6 @@ void osWritebackDCache(void* vaddr, u32 nbytes);
|
||||
u32 osGetCount(void);
|
||||
OSTime osGetTime(void);
|
||||
|
||||
static s32 osAppNMIBuffer[15];
|
||||
extern s32 osAppNMIBuffer[];
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user