mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-06 20:30:36 +08:00
psp: using the maximum amount of VRAM
This commit is contained in:
8
engine/platform/psp/ka/KernelAccess.S
Normal file
8
engine/platform/psp/ka/KernelAccess.S
Normal file
@@ -0,0 +1,8 @@
|
||||
.set noreorder
|
||||
|
||||
#include "pspstub.s"
|
||||
|
||||
STUB_START "KernelAccess",0x40090000,0x00020005
|
||||
STUB_FUNC 0x8A5C745F,kaGeEdramSetSize
|
||||
STUB_FUNC 0x71570ECF,kaGeEdramGetHwSize
|
||||
STUB_END
|
||||
30
engine/platform/psp/ka/ka.h
Normal file
30
engine/platform/psp/ka/ka.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
kamod.h - kernel access module header
|
||||
Copyright (C) 2022 Sergey Galushko
|
||||
|
||||
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 3 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.
|
||||
*/
|
||||
|
||||
#ifndef KAMOD_H
|
||||
#define KAMOD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
int kaGeEdramSetSize(int size);
|
||||
int kaGeEdramGetHwSize(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // KAMOD_H
|
||||
@@ -14,6 +14,7 @@ GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "platform/platform.h"
|
||||
#include "platform/psp/ka/ka.h"
|
||||
#include <pspsdk.h>
|
||||
#include <pspkernel.h>
|
||||
#include <psppower.h>
|
||||
@@ -256,11 +257,14 @@ int Platform_UnloadModule( SceUID modid, int *sce_code )
|
||||
return -1;
|
||||
|
||||
*sce_code = sceKernelUnloadModule( modid );
|
||||
return ( ( ( *sce_code ) < 0 ) ? -2 : 0 );
|
||||
return ( ( ( *sce_code ) < 0 ) ? -2 : 0 );
|
||||
}
|
||||
|
||||
void Platform_Init( void )
|
||||
{
|
||||
SceUID kamID;
|
||||
int result;
|
||||
|
||||
// disable fpu exceptions (division by zero and etc...)
|
||||
pspSdkDisableFPUExceptions();
|
||||
|
||||
@@ -269,6 +273,16 @@ void Platform_Init( void )
|
||||
|
||||
// set max cpu/gpu frequency
|
||||
scePowerSetClockFrequency( 333, 333, 166 );
|
||||
|
||||
// set max VRAM
|
||||
kamID = Platform_LoadModule( "ka.prx", 1, 0, NULL );
|
||||
if( kamID >= 0 )
|
||||
{
|
||||
result = kaGeEdramGetHwSize();
|
||||
if( result > 0 )
|
||||
result = kaGeEdramSetSize( result );
|
||||
Platform_UnloadModule( kamID, &result );
|
||||
}
|
||||
}
|
||||
|
||||
void Platform_Shutdown( void )
|
||||
|
||||
@@ -137,6 +137,7 @@ def build(bld):
|
||||
|
||||
if bld.env.DEST_OS == 'psp':
|
||||
source += bld.path.ant_glob(['platform/psp/*.c'])
|
||||
source += bld.path.ant_glob(['platform/psp/*/*.S'])
|
||||
|
||||
# add client files
|
||||
if not bld.env.DEDICATED:
|
||||
|
||||
Reference in New Issue
Block a user