Erwan
- fix issue 92 (purple screen). Many thanks to Yeshua and Raphael! - Switched valloc to vram, more recent and faster.
This commit is contained in:
@@ -83,10 +83,11 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static JRenderer* GetInstance();
|
||||
|
||||
/*
|
||||
//START PurpleScreen Debug
|
||||
static int debugged;
|
||||
//END PurpleScreen Debug
|
||||
|
||||
*/
|
||||
static void Destroy();
|
||||
|
||||
static void Set3DFlag(bool flag);
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#ifndef _VALLOC_H
|
||||
#define _VALLOC_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* valloc( size_t size );
|
||||
void vfree( void* ptr );
|
||||
|
||||
size_t vmemavail();
|
||||
size_t vlargestblock();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _VALLOC_H
|
||||
54
JGE/include/vram.h
Normal file
54
JGE/include/vram.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Helper for use with the PSP Software Development Kit - http://www.pspdev.org
|
||||
* -----------------------------------------------------------------------
|
||||
* Licensed under GPL
|
||||
*
|
||||
* vram.c - Standard C high performance VRAM allocation routines.
|
||||
*
|
||||
* Copyright (c) 2007 Alexander Berl 'Raphael' <raphael@fx-world.org>
|
||||
* http://wordpress.fx-world.org
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
#ifndef vram_h__
|
||||
#define vram_h__
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void* vrelptr( void *ptr ); // make a pointer relative to memory base address (ATTENTION: A NULL rel ptr is not illegal/invalid!)
|
||||
void* vabsptr( void *ptr ); // make a pointer absolute (default return type of valloc)
|
||||
|
||||
void* valloc( size_t size );
|
||||
void vfree( void* ptr );
|
||||
size_t vmemavail();
|
||||
size_t vlargestblock();
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
// Debug printf (to stdout) a trace of the current Memblocks
|
||||
void __memwalk();
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ifdef vram_h__
|
||||
Reference in New Issue
Block a user