Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/HW/Display.h
3186 views
1
// Copyright (c) 2012- PPSSPP Project.
2
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.
6
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.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#pragma once
19
20
#include <cstdint>
21
#include <functional>
22
23
class PointerWrap;
24
25
typedef std::function<void()> VblankCallback;
26
// Listen for vblank events. Callbacks are cleared in DisplayHWShutdown().
27
void __DisplayListenVblank(VblankCallback callback);
28
typedef void (*FlipCallback)(void *userdata);
29
void __DisplayListenFlip(FlipCallback callback, void *userdata);
30
void __DisplayForgetFlip(FlipCallback callback, void *userdata);
31
32
int __DisplayGetFlipCount();
33
int __DisplayGetNumVblanks();
34
int __DisplayGetVCount();
35
bool DisplayIsVblank();
36
uint64_t DisplayFrameStartTicks();
37
uint32_t __DisplayGetCurrentHcount();
38
uint32_t __DisplayGetAccumulatedHcount();
39
void DisplayAdjustAccumulatedHcount(uint32_t diff);
40
41
void __DisplayGetDebugStats(char *stats, size_t bufsize);
42
void __DisplayGetAveragedFPS(float *out_vps, float *out_fps);
43
void __DisplayGetFPS(float *out_vps, float *out_fps, float *out_actual_fps);
44
void __DisplayGetVPS(float *out_vps);
45
float *__DisplayGetFrameTimes(int *out_valid, int *out_pos, float **out_sleep);
46
int DisplayGetSleepPos();
47
void DisplayNotifySleep(double t, int pos = -1);
48
bool DisplayIsRunningSlow();
49
50
void DisplayFireVblankStart();
51
void DisplayFireVblankEnd();
52
void DisplayFireFlip();
53
void DisplayFireActualFlip();
54
55
int DisplayCalculateFrameSkip();
56
57
void DisplayHWInit();
58
void DisplayHWReset();
59
void DisplayHWShutdown();
60
void DisplayHWDoState(PointerWrap &p, int hleCompatV2);
61
62