Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
folium-app
GitHub Repository: folium-app/Folium
Path: blob/a-new-beginning/Cherry/Core/include/Input.h
2 views
1
/*
2
* Gearcoleco - ColecoVision Emulator
3
* Copyright (C) 2021 Ignacio Sanchez
4
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* any later version.
9
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see http://www.gnu.org/licenses/
17
*
18
*/
19
20
#ifndef INPUT_H
21
#define INPUT_H
22
23
#include "definitions.h"
24
25
class Processor;
26
27
class Input
28
{
29
public:
30
enum InputSegments
31
{
32
SegmentKeypadRightButtons,
33
SegmentJoystickLeftButtons
34
};
35
36
public:
37
Input(Processor* pProcessor);
38
void Init();
39
void Reset();
40
void KeyPressed(GC_Controllers controller, GC_Keys key);
41
void KeyReleased(GC_Controllers controller, GC_Keys key);
42
void Spinner1(int movement);
43
void Spinner2(int movement);
44
void SaveState(std::ostream& stream);
45
void LoadState(std::istream& stream);
46
void SetInputSegment(InputSegments segment);
47
u8 ReadInput(u8 port);
48
49
private:
50
Processor* m_pProcessor;
51
u8 m_Gamepad[2];
52
u8 m_Keypad[2];
53
InputSegments m_Segment;
54
int m_iSpinnerRel[2];
55
};
56
57
#endif /* INPUT_H */
58
59