aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/psp
diff options
context:
space:
mode:
authorJoost Peters2009-08-19 16:23:44 +0000
committerJoost Peters2009-08-19 16:23:44 +0000
commitbbac75bc1c4e45bcdcb6fecd9f0f99d916ca80ef (patch)
tree4298f94bd2927a39c33a0cebc742587b363eaa69 /backends/platform/psp
parent88ac4190529f220c2d8ac0879815fba3e0d72d1f (diff)
downloadscummvm-rg350-bbac75bc1c4e45bcdcb6fecd9f0f99d916ca80ef.tar.gz
scummvm-rg350-bbac75bc1c4e45bcdcb6fecd9f0f99d916ca80ef.tar.bz2
scummvm-rg350-bbac75bc1c4e45bcdcb6fecd9f0f99d916ca80ef.zip
PSP: throttle the number of updateScreen() calls
svn-id: r43539
Diffstat (limited to 'backends/platform/psp')
-rw-r--r--backends/platform/psp/osys_psp.cpp2
-rw-r--r--backends/platform/psp/osys_psp.h1
-rw-r--r--backends/platform/psp/osys_psp_gu.cpp9
3 files changed, 11 insertions, 1 deletions
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 566db3014b..5e461f45e0 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -75,7 +75,7 @@ const OSystem::GraphicsMode OSystem_PSP::s_supportedGraphicsModes[] = {
};
-OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0), _overlayHeight(0), _offscreen(0), _overlayBuffer(0), _overlayVisible(false), _shakePos(0), _mouseBuf(0), _prevButtons(0), _lastPadCheck(0), _padAccel(0), _mixer(0) {
+OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0), _overlayHeight(0), _offscreen(0), _overlayBuffer(0), _overlayVisible(false), _shakePos(0), _lastScreenUpdate(0), _mouseBuf(0), _prevButtons(0), _lastPadCheck(0), _padAccel(0), _mixer(0) {
memset(_palette, 0, sizeof(_palette));
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 310efdc7d4..94488a92ce 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -59,6 +59,7 @@ protected:
uint16 _palette[256];
bool _overlayVisible;
uint32 _shakePos;
+ uint32 _lastScreenUpdate;
Graphics::Surface _framebuffer;
diff --git a/backends/platform/psp/osys_psp_gu.cpp b/backends/platform/psp/osys_psp_gu.cpp
index 0fb1b4aded..1c83aa4abf 100644
--- a/backends/platform/psp/osys_psp_gu.cpp
+++ b/backends/platform/psp/osys_psp_gu.cpp
@@ -38,6 +38,8 @@
#define MOUSE_SIZE 128
#define KBD_DATA_SIZE 130560
+#define MAX_FPS 30
+
unsigned int __attribute__((aligned(16))) list[262144];
unsigned short __attribute__((aligned(16))) clut256[256];
unsigned short __attribute__((aligned(16))) mouseClut[256];
@@ -295,6 +297,13 @@ void OSystem_PSP_GU::copyRectToScreen(const byte *buf, int pitch, int x, int y,
}
void OSystem_PSP_GU::updateScreen() {
+ u32 now = getMillis();
+ if (now - _lastScreenUpdate < 1000 / MAX_FPS)
+ return;
+
+ _lastScreenUpdate = now;
+
+
sceGuStart(0,list);
sceGuClearColor(0xff000000);