mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-08-03 16:15:36 +00:00
Retro seemingly avoided using the Dolphin typedefs in most places, opting to use int/uint instead. This likely means they didn't use u8/s8/u16/s16/etc either. Former-commit-id: 133326ae406a0ebc76f56f8bcb489fda280be2be
26 lines
501 B
C++
26 lines
501 B
C++
#ifndef _CCIRCULARBUFFER
|
|
#define _CCIRCULARBUFFER
|
|
|
|
#include <types.h>
|
|
|
|
class CCircularBuffer {
|
|
public:
|
|
enum EOwnership { kOS_Owned, kOS_NotOwned };
|
|
|
|
CCircularBuffer(void* buf, int len, EOwnership owned = kOS_NotOwned);
|
|
bool IsWrappedMemory(int offset, int len);
|
|
void* Alloc(int len);
|
|
void Free(void* ptr, int len);
|
|
int GetAllocatedAmount() const;
|
|
|
|
private:
|
|
uchar x0_owned;
|
|
void* x4_ptr;
|
|
int x8_bufferLen;
|
|
int xc_;
|
|
int x10_nextFreeAddr;
|
|
int x14_;
|
|
};
|
|
|
|
#endif // _CCIRCULARBUFFER
|