Merge pull request #90 from gizmo98/patch-2
[libretro-ppsspp.git] / Core / System.h
blob806b85bf953d85086cc3ee32f2f484c57aff31f7
1 // Copyright (C) 2012 PPSSPP Project
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, version 2.0 or later versions.
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // GNU General Public License 2.0 for more details.
12 // A copy of the GPL 2.0 should have been included with the program.
13 // If not, see http://www.gnu.org/licenses/
15 // Official git repository and contact information can be found at
16 // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
18 #pragma once
20 #include "Common/CommonTypes.h"
21 #include "Core/CoreParameter.h"
23 class MetaFileSystem;
24 class ParamSFOData;
26 extern MetaFileSystem pspFileSystem;
27 extern ParamSFOData g_paramSFO;
29 // To synchronize the two UIs, we need to know which state we're in.
30 enum GlobalUIState {
31 UISTATE_MENU,
32 UISTATE_PAUSEMENU,
33 UISTATE_INGAME,
34 UISTATE_EXIT,
37 // Use these in conjunction with GetSysDirectory.
38 enum PSPDirectories {
39 DIRECTORY_CHEATS,
40 DIRECTORY_SCREENSHOT,
41 DIRECTORY_SYSTEM,
42 DIRECTORY_GAME,
43 DIRECTORY_SAVEDATA,
44 DIRECTORY_PAUTH,
45 DIRECTORY_DUMP,
46 DIRECTORY_SAVESTATE,
47 DIRECTORY_CACHE,
51 void UpdateUIState(GlobalUIState newState);
52 GlobalUIState GetUIState();
54 bool PSP_Init(const CoreParameter &coreParam, std::string *error_string);
55 bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string);
56 bool PSP_InitUpdate(std::string *error_string);
57 bool PSP_IsIniting();
58 bool PSP_IsInited();
59 void PSP_Shutdown();
60 void PSP_RunLoopUntil(u64 globalticks);
61 void PSP_RunLoopFor(int cycles);
63 void Audio_Init();
65 bool IsOnSeparateCPUThread();
66 bool IsAudioInitialised();
68 void UpdateLoadedFile(FileLoader *fileLoader);
70 std::string GetSysDirectory(PSPDirectories directoryType);
71 #ifdef _WIN32
72 void InitSysDirectories();
73 #endif
75 // RUNNING must be at 0, NEXTFRAME must be at 1.
76 enum CoreState
78 CORE_RUNNING = 0,
79 CORE_NEXTFRAME = 1,
80 CORE_STEPPING,
81 CORE_POWERUP,
82 CORE_POWERDOWN,
83 CORE_ERROR,
86 extern volatile CoreState coreState;
87 extern volatile bool coreStatePending;
88 void Core_UpdateState(CoreState newState);
90 CoreParameter &PSP_CoreParameter();