Initial commit
This commit is contained in:
56
backends/events/psp2sdl/psp2sdl-events.cpp
Normal file
56
backends/events/psp2sdl/psp2sdl-events.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/* 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 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.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/scummsys.h"
|
||||
|
||||
#if defined(PSP2)
|
||||
|
||||
#include <psp2/kernel/processmgr.h>
|
||||
#include <psp2/touch.h>
|
||||
#include "backends/platform/sdl/psp2/psp2.h"
|
||||
#include "backends/events/psp2sdl/psp2sdl-events.h"
|
||||
#include "backends/platform/sdl/sdl.h"
|
||||
#include "engines/engine.h"
|
||||
|
||||
#include "common/util.h"
|
||||
#include "common/events.h"
|
||||
#include "common/config-manager.h"
|
||||
|
||||
#include "math.h"
|
||||
|
||||
void PSP2EventSource::preprocessEvents(SDL_Event *event) {
|
||||
|
||||
// prevent suspend (scummvm games contain a lot of cutscenes..)
|
||||
sceKernelPowerTick(SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND);
|
||||
sceKernelPowerTick(SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF);
|
||||
|
||||
SdlEventSource::preprocessEvents(event);
|
||||
}
|
||||
|
||||
bool PSP2EventSource::isTouchPortTouchpadMode(SDL_TouchID port) {
|
||||
return port != 1 || ConfMan.getBool("frontpanel_touchpad_mode");
|
||||
}
|
||||
|
||||
bool PSP2EventSource::isTouchPortActive(SDL_TouchID port) {
|
||||
return port == 1 || ConfMan.getBool("touchpad_mouse_mode");
|
||||
}
|
||||
|
||||
#endif
|
||||
39
backends/events/psp2sdl/psp2sdl-events.h
Normal file
39
backends/events/psp2sdl/psp2sdl-events.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/* 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 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.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(DISABLE_DEFAULT_EVENTMANAGER)
|
||||
#define BACKEND_EVENTS_PSP2_H
|
||||
|
||||
#include "backends/events/sdl/sdl-events.h"
|
||||
|
||||
/**
|
||||
* SDL Events manager for the PSP2.
|
||||
*/
|
||||
class PSP2EventSource : public SdlEventSource {
|
||||
public:
|
||||
PSP2EventSource() {}
|
||||
protected:
|
||||
void preprocessEvents(SDL_Event *event) override;
|
||||
bool isTouchPortTouchpadMode(SDL_TouchID port) override;
|
||||
bool isTouchPortActive(SDL_TouchID port) override;
|
||||
};
|
||||
|
||||
#endif /* BACKEND_EVENTS_PSP2_H */
|
||||
Reference in New Issue
Block a user