Fix textures on VC4

This commit is contained in:
Shinovon 2026-04-29 13:17:43 +05:00
parent 3eb71f2cc5
commit d5a130fc29
5 changed files with 78 additions and 31 deletions

View file

@ -12,6 +12,7 @@
#include <gles2/gl2.h>
#include <EGL/egl.h>
#include <locale.h>
#include <versioninfo.h>
#include "common.h"
#include "rwcore.h"
@ -74,6 +75,10 @@ static psGlobalType PsGlobal;
static TBool foreground;
bool moreVram;
static bool spinning;
void _InputTranslateShiftKeyUpDown(RsKeyCodes *rs) {
}
@ -82,6 +87,18 @@ const char* _psGetUserFilesFolder() {
}
void HandleExit() {
if (IsForegroundApp()) {
User::ResetInactivityTime();
}
RThread thread;
TInt error = KErrNone;
spinning = true;
while (thread.RequestCount()) {
if (!CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle))
continue;
User::WaitForAnyRequest();
}
spinning = false;
}
RwInt32 _psGetNumVideModes() {
@ -178,18 +195,15 @@ void psTerminate(void) {
RwBool psInitialize(void) {
CFileMgr::Initialise();
TInt memFree = 0;
if (HAL::Get(HALData::EMemoryRAMFree, memFree) == KErrNone) {
if (memFree > 40 * 1024 * 1024) {
_dwMemAvailPhys = 40 * 1024 * 1024;
} else if (memFree <= 0) {
_dwMemAvailPhys = 10 * 1024 * 1024;
} else {
_dwMemAvailPhys = memFree;
}
HAL::Get(HALData::EMemoryRAMFree, memFree);
if (memFree <= 0) {
_dwMemAvailPhys = 10 * 1024 * 1024;
} else if (memFree > 60 * 1024 * 1024) {
_dwMemAvailPhys = 60 * 1024 * 1024;
} else {
_dwMemAvailPhys = 40 * 1024 * 1024;
_dwMemAvailPhys = memFree;
}
C_PcSave::SetSaveDirectory(_psGetUserFilesFolder());
return TRUE;
@ -240,6 +254,8 @@ public:
return EFalse;
}
if (spinning) return ETrue;
switch (container->gGameState) {
case GS_START_UP:
foreground = true;
@ -311,17 +327,23 @@ public:
void RestartTimerL(TInt aInterval) {
if (iPeriodic) iPeriodic->Cancel();
else iPeriodic = CPeriodic::NewL(CActive::EPriorityStandard);
else iPeriodic = CPeriodic::NewL(CActive::EPriorityLow);
iPeriodic->Start(aInterval, aInterval, TCallBack(CCContainer::LoopCallBack, this));
}
void ConstructL(const TRect& aRect, CAknAppUi* aAppUi) {
iAppUi = aAppUi;
CreateWindowL();
iAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape);
SetExtentToWholeScreen();
Window().EnableAdvancedPointers();
EnableDragEvents();
ActivateL();
// VC4 check
VersionInfo::TPlatformVersion platformVersion;
VersionInfo::GetVersion(platformVersion);
moreVram = platformVersion.iMajorVersion == 5 && platformVersion.iMinorVersion >= 4;
TSize size = Size();
RsGlobal.width = size.iWidth;
@ -524,6 +546,7 @@ public:
void HandleCommandL(TInt aCommand) {
if (aCommand == EAknSoftkeyBack || aCommand == EEikCmdExit) {
RsGlobal.quit = 1;
// Exit();
}
}
};