psp: using the maximum amount of VRAM

This commit is contained in:
Crow-bar
2022-08-10 16:58:20 +03:00
parent b8ff41eac9
commit 91d6fdd190
8 changed files with 208 additions and 111 deletions

View 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

View 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

View File

@@ -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 )