[Scummvm-cvs-logs] SF.net SVN: scummvm:[49179] scummvm/trunk/backends/platform/psp
Bluddy at users.sourceforge.net
Bluddy at users.sourceforge.net
Mon May 24 13:41:45 CEST 2010
Revision: 49179
http://scummvm.svn.sourceforge.net/scummvm/?rev=49179&view=rev
Author: Bluddy
Date: 2010-05-24 11:41:45 +0000 (Mon, 24 May 2010)
Log Message:
-----------
PSP: switched to using slightly faster delay and getMillis
Modified Paths:
--------------
scummvm/trunk/backends/platform/psp/Makefile
scummvm/trunk/backends/platform/psp/module.mk
scummvm/trunk/backends/platform/psp/osys_psp.cpp
scummvm/trunk/backends/platform/psp/thread.h
Added Paths:
-----------
scummvm/trunk/backends/platform/psp/thread.cpp
Modified: scummvm/trunk/backends/platform/psp/Makefile
===================================================================
--- scummvm/trunk/backends/platform/psp/Makefile 2010-05-24 09:19:40 UTC (rev 49178)
+++ scummvm/trunk/backends/platform/psp/Makefile 2010-05-24 11:41:45 UTC (rev 49179)
@@ -148,7 +148,8 @@
trace.o \
psploader.o \
pspkeyboard.o \
- audio.o
+ audio.o \
+ thread.o
# Include common Scummvm makefile
include $(srcdir)/Makefile.common
Modified: scummvm/trunk/backends/platform/psp/module.mk
===================================================================
--- scummvm/trunk/backends/platform/psp/module.mk 2010-05-24 09:19:40 UTC (rev 49178)
+++ scummvm/trunk/backends/platform/psp/module.mk 2010-05-24 11:41:45 UTC (rev 49179)
@@ -13,7 +13,8 @@
trace.o \
psploader.o \
pspkeyboard.o \
- audio.o
+ audio.o \
+ thread.o
MODULE_DIRS += \
backends/platform/psp/
Modified: scummvm/trunk/backends/platform/psp/osys_psp.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/osys_psp.cpp 2010-05-24 09:19:40 UTC (rev 49178)
+++ scummvm/trunk/backends/platform/psp/osys_psp.cpp 2010-05-24 11:41:45 UTC (rev 49179)
@@ -37,6 +37,7 @@
#include "backends/platform/psp/psppixelformat.h"
#include "backends/platform/psp/osys_psp.h"
#include "backends/platform/psp/powerman.h"
+#include "backends/platform/psp/thread.h"
#include "backends/saves/psp/psp-saves.h"
#include "backends/timer/default/default-timer.h"
@@ -298,17 +299,15 @@
return _inputHandler.getAllInputs(event);
}
-
uint32 OSystem_PSP::getMillis() {
- return SDL_GetTicks();
+ return PspThread::getMillis();
}
void OSystem_PSP::delayMillis(uint msecs) {
- SDL_Delay(msecs);
+ PspThread::delayMillis(msecs);
}
void OSystem_PSP::setTimerCallback(TimerProc callback, int interval) {
- //SDL_SetTimer(interval, (SDL_TimerCallback)callback);
_pspTimer.setCallback((PspTimer::CallbackFunc)callback);
_pspTimer.setIntervalMs(interval);
_pspTimer.start();
Added: scummvm/trunk/backends/platform/psp/thread.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/thread.cpp (rev 0)
+++ scummvm/trunk/backends/platform/psp/thread.cpp 2010-05-24 11:41:45 UTC (rev 49179)
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.h $
+ * $Id: osys_psp.h 49173 2010-05-24 03:05:17Z bluddy $
+ *
+ */
+
+#include <time.h>
+#include <psptypes.h>
+#include <psprtc.h>
+#include <pspthreadman.h>
+
+#include "backends/platform/psp/thread.h"
+
+void PspThread::delayMillis(uint32 ms) {
+ sceKernelDelayThread(ms * 1000);
+}
+
+void PspThread::delayMicros(uint32 us) {
+ sceKernelDelayThread(us);
+}
+
+uint32 PspThread::getMillis() {
+ uint32 ticks[2];
+ sceRtcGetCurrentTick((u64 *)ticks);
+ return (ticks[0]/1000);
+}
+
+uint32 PspThread::getMicros() {
+ uint32 ticks[2];
+ sceRtcGetCurrentTick((u64 *)ticks);
+ return ticks[0];
+}
+
Property changes on: scummvm/trunk/backends/platform/psp/thread.cpp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Modified: scummvm/trunk/backends/platform/psp/thread.h
===================================================================
--- scummvm/trunk/backends/platform/psp/thread.h 2010-05-24 09:19:40 UTC (rev 49178)
+++ scummvm/trunk/backends/platform/psp/thread.h 2010-05-24 11:41:45 UTC (rev 49179)
@@ -26,6 +26,16 @@
#ifndef PSP_THREAD_H
#define PSP_THREAD_H
+#include "common/scummsys.h"
+
+class PspThread {
+public:
+ static void delayMillis(uint32 ms);
+ static void delayMicros(uint32 us);
+ static uint32 getMillis();
+ static uint32 getMicros();
+};
+
enum ThreadPriority {
PRIORITY_MAIN_THREAD = 36,
PRIORITY_AUDIO_THREAD = 35, // We'll alternate between this and main thread priority
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list