forked from albe/libpspvram
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvramalloc.h
43 lines (32 loc) · 980 Bytes
/
vramalloc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Helper for use with the PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed as 'free to use and modify as long as credited appropriately'
*
* vramalloc.c - Standard C library VRAM allocation routines.
*
* Copyright (c) 2006 Alexander Berl <[email protected]>
*
*/
#ifndef _VRAMALLOC_H
#define _VRAMALLOC_H
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
#define vrelptr vGuPointer
#define vabsptr vCPUPointer
size_t vgetMemorySize(unsigned int width, unsigned int height, unsigned int psm);
// Return a pointer relative to VRAM Base address useable by GU
void* vGuPointer( void* ptr );
// Return an absolute pointer useable by CPU
void* vCPUPointer( void* ptr );
// Returns an absolute pointer useable by CPU
void* vramalloc( size_t size );
void vfree( void* ptr );
size_t vmemavail();
size_t vlargestblock();
#ifdef __cplusplus
}
#endif
#endif // _VRAMALLOC_H