diff options
author | Yotam Barnoy | 2010-09-20 14:05:32 +0000 |
---|---|---|
committer | Yotam Barnoy | 2010-09-20 14:05:32 +0000 |
commit | b006082cf18120185a9ae18a2d926fddde76b941 (patch) | |
tree | eb7ca424e94bc390f40d032cb58c4fb6bf9c980c /backends/platform/psp/memory.h | |
parent | 971d5ca4b82707b76d3cb70d6e5904c3cb9bb318 (diff) | |
download | scummvm-rg350-b006082cf18120185a9ae18a2d926fddde76b941.tar.gz scummvm-rg350-b006082cf18120185a9ae18a2d926fddde76b941.tar.bz2 scummvm-rg350-b006082cf18120185a9ae18a2d926fddde76b941.zip |
PSP: moved VramAllocator to display_manager.cpp.
It didn't really belong in memory.cpp and we're going to want to include memory.h everywhere.
* * *
PSP: more Vram Allocator cleanup
svn-id: r52815
Diffstat (limited to 'backends/platform/psp/memory.h')
-rw-r--r-- | backends/platform/psp/memory.h | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/backends/platform/psp/memory.h b/backends/platform/psp/memory.h index 793bc94888..6d2d927b1b 100644 --- a/backends/platform/psp/memory.h +++ b/backends/platform/psp/memory.h @@ -27,12 +27,6 @@ #ifndef PSP_MEMORY_H #define PSP_MEMORY_H -#include "backends/platform/psp/psppixelformat.h" -#include "common/list.h" - -#define UNCACHED(x) ((byte *)(((uint32)(x)) | 0x40000000)) /* make an uncached access */ -#define CACHED(x) ((byte *)(((uint32)(x)) & 0xBFFFFFFF)) /* make an uncached access into a cached one */ - #define MIN_AMOUNT_FOR_COMPLEX_COPY 8 #define MIN_AMOUNT_FOR_MISALIGNED_COPY 8 @@ -91,41 +85,6 @@ public: } }; -/** - * Class that allocates memory in the VRAM - */ -class VramAllocator : public Common::Singleton<VramAllocator> { -public: - VramAllocator() : _bytesAllocated(0) {} - void *allocate(int32 size, bool smallAllocation = false); // smallAllocation e.g. palettes - void deallocate(void *pointer); - - static inline bool isAddressInVram(void *address) { - if ((uint32)(CACHED(address)) >= VRAM_START_ADDRESS && (uint32)(CACHED(address)) < VRAM_END_ADDRESS) - return true; - return false; - } - - -private: - /** - * Used to allocate in VRAM - */ - struct Allocation { - byte *address; - uint32 size; - void *getEnd() { return address + size; } - Allocation(void *Address, uint32 Size) : address((byte *)Address), size(Size) {} - Allocation() : address(0), size(0) {} - }; +#endif /* PSP_MEMORY_H */ - enum { - VRAM_START_ADDRESS = 0x04000000, - VRAM_END_ADDRESS = 0x04200000, - VRAM_SMALL_ADDRESS = VRAM_END_ADDRESS - (4 * 1024) // 4K in the end for small allocations - }; - Common::List <Allocation> _allocList; // List of allocations - uint32 _bytesAllocated; -}; -#endif /* PSP_MEMORY_H */ |