| 1 | |
| 2 | /** |
| 3 | * |
| 4 | * @file psvita.cpp |
| 5 | * |
| 6 | * Part of the OpenJazz project |
| 7 | * |
| 8 | * @par Licence: |
| 9 | * Copyright (c) 2015-2026 Carsten Teibes |
| 10 | * |
| 11 | * OpenJazz is distributed under the terms of |
| 12 | * the GNU General Public License, version 2.0 |
| 13 | * |
| 14 | */ |
| 15 | |
| 16 | #include "psvita.h" |
| 17 | |
| 18 | #ifdef __vita__ |
| 19 | |
| 20 | #include <psp2/ctrl.h> |
| 21 | #include <psp2/touch.h> |
| 22 | #include <kbdvita.h> |
| 23 | |
| 24 | #include "util.h" |
| 25 | #include "io/file.h" |
| 26 | |
| 27 | VitaPlatform::VitaPlatform() { |
| 28 | // controls |
| 29 | sceCtrlSetSamplingMode(SCE_CTRL_MODE_ANALOG_WIDE); |
| 30 | sceTouchSetSamplingState(SCE_TOUCH_PORT_FRONT, SCE_TOUCH_SAMPLING_STATE_START); |
| 31 | } |
| 32 | |
| 33 | void VitaPlatform::AddGamePaths() { |
| 34 | gamePaths.add(createString("ux0:data/jazz/"), PATH_TYPE_CONFIG); |
| 35 | } |
| 36 | |
| 37 | bool VitaPlatform::InputString(const char* hint, char*& current_string, char*& new_string) { |
| 38 | char* text = kbdvita_get(hint, current_string, STRING_LENGTH); |
| 39 | if (text != NULL) { |
| 40 | new_string = createString(text); |
| 41 | return true; |
| 42 | } |
| 43 | |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | #endif |