From 099ef8db300fc776539694c766dcb58a4a948952 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Wed, 27 Nov 2019 22:29:38 +0000 Subject: PSP: Make the PspTimer class a subclass of DefaultTimerManager --- backends/platform/psp/osys_psp.cpp | 18 ++---------------- backends/platform/psp/osys_psp.h | 6 ------ 2 files changed, 2 insertions(+), 22 deletions(-) (limited to 'backends/platform/psp') diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 2febf91b04..f09e8498d2 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -39,7 +39,7 @@ #include "backends/platform/psp/rtc.h" #include "backends/saves/default/default-saves.h" -#include "backends/timer/default/default-timer.h" +#include "backends/timer/psp/timer.h" #include "graphics/surface.h" #include "audio/mixer_intern.h" @@ -50,12 +50,6 @@ #define SAMPLES_PER_SEC 44100 -static int timer_handler(int t) { - DefaultTimerManager *tm = (DefaultTimerManager *)g_system->getTimerManager(); - tm->handler(); - return t; -} - OSystem_PSP::~OSystem_PSP() {} #define PSP_SCREEN_WIDTH 480 @@ -97,13 +91,11 @@ void OSystem_PSP::initBackend() { _savefileManager = new DefaultSaveFileManager(PSP_DEFAULT_SAVE_PATH); - _timerManager = new DefaultTimerManager(); + _timerManager = new PspTimerManager(); PSP_DEBUG_PRINT("calling keyboard.load()\n"); _keyboard.load(); // Load virtual keyboard files into memory - setTimerCallback(&timer_handler, 10); - setupMixer(); EventsBaseBackend::initBackend(); @@ -358,12 +350,6 @@ void OSystem_PSP::delayMillis(uint msecs) { PspThread::delayMillis(msecs); } -void OSystem_PSP::setTimerCallback(TimerProc callback, int interval) { - _pspTimer.setCallback((PspTimer::CallbackFunc)callback); - _pspTimer.setIntervalMs(interval); - _pspTimer.start(); -} - OSystem::MutexRef OSystem_PSP::createMutex(void) { return (MutexRef) new PspMutex(true); // start with a full mutex } diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index ff9dd101d2..80f68329d8 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -39,7 +39,6 @@ #include "backends/platform/psp/display_manager.h" #include "backends/platform/psp/input.h" #include "backends/platform/psp/audio.h" -#include "backends/timer/psp/timer.h" #include "backends/platform/psp/thread.h" class OSystem_PSP : public EventsBaseBackend, public PaletteManager { @@ -57,7 +56,6 @@ private: PSPKeyboard _keyboard; InputHandler _inputHandler; PspAudio _audio; - PspTimer _pspTimer; ImageViewer _imageViewer; public: @@ -127,10 +125,6 @@ public: uint32 getMillis(bool skipRecord = false); void delayMillis(uint msecs); - // Timer - typedef int (*TimerProc)(int interval); - void setTimerCallback(TimerProc callback, int interval); - // Mutex MutexRef createMutex(void); void lockMutex(MutexRef mutex); -- cgit v1.2.3