-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcore.h
98 lines (78 loc) · 2.26 KB
/
core.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
Copyright 2019-2020 Hydr8gon
This file is part of NooDS.
NooDS 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.
NooDS 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 NooDS. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef CORE_H
#define CORE_H
#include <chrono>
#include <cstdint>
#include <string>
#include "cartridge.h"
#include "cp15.h"
#include "defines.h"
#include "div_sqrt.h"
#include "dma.h"
#include "gpu.h"
#include "gpu_2d.h"
#include "gpu_3d.h"
#include "gpu_3d_renderer.h"
#include "input.h"
#include "interpreter.h"
#include "ipc.h"
#include "memory.h"
#include "rtc.h"
#include "spi.h"
#include "spu.h"
#include "timers.h"
#include "wifi.h"
class Core
{
public:
Core(std::string ndsPath = "", std::string gbaPath = "");
int MEfpsCount = 0;
void runFrame() { (this->*runFunc)(); }
bool isGbaMode() { return gbaMode; }
int getFps() { return fps; }
int getMEFps() { return MEfps; }
bool SkipFrame = false;
bool SwapDisplayRender = true;
int CurrVcount = 0;
void enterGbaMode();
Cartridge cartridge;
Cp15 cp15;
DivSqrt divSqrt;
Dma dma[2];
Gpu gpu;
Gpu2D gpu2D[2];
Gpu3D gpu3D;
Gpu3DRenderer gpu3DRenderer;
Input input;
Interpreter interpreter[2];
Ipc ipc;
Memory memory;
Rtc rtc;
Spi spi;
Spu spu;
Timers timers[2];
Wifi wifi;
private:
bool gbaMode = false;
void (Core::*runFunc)() = &Core::runNdsFrame;
int fps = 0, fpsCount = 0, MEfps = 0;
std::chrono::steady_clock::time_point lastFpsTime;
int spuTimer = 0;
void runNdsFrame();
void runGbaFrame();
};
void WriteLog(char* msg);
#endif // CORE_H