Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libmeteor/include/ameteor.hpp
2 views
1
// Meteor - A Nintendo Gameboy Advance emulator
2
// Copyright (C) 2009-2011 Philippe Daouadi
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17
#ifndef __AMETEOR_H__
18
#define __AMETEOR_H__
19
20
#include "ameteor/memory.hpp"
21
#include "ameteor/io.hpp"
22
#include "ameteor/dma.hpp"
23
#include "ameteor/interpreter.hpp"
24
#include "ameteor/lcd.hpp"
25
#include "ameteor/clock.hpp"
26
#include "ameteor/timer.hpp"
27
#include "ameteor/sound.hpp"
28
#include "ameteor/keypad.hpp"
29
30
namespace AMeteor
31
{
32
extern Clock _clock;
33
extern Io _io;
34
extern Interpreter _cpu;
35
extern Memory _memory;
36
extern Dma _dma;
37
extern Lcd _lcd;
38
extern Sound _sound;
39
extern Keypad _keypad;
40
extern Timer _timer0;
41
extern Timer _timer1;
42
extern Timer _timer2;
43
extern Timer _timer3;
44
45
const uint32_t UNIT_CLOCK = 0x0001;
46
const uint32_t UNIT_IO = 0x0002;
47
const uint32_t UNIT_CPU = 0x0004;
48
const uint32_t UNIT_MEMORY = 0x0008;
49
const uint32_t UNIT_DMA = 0x0010;
50
const uint32_t UNIT_LCD = 0x0020;
51
const uint32_t UNIT_SOUND = 0x0040;
52
const uint32_t UNIT_KEYPAD = 0x0080;
53
const uint32_t UNIT_TIMER0 = 0x0100;
54
const uint32_t UNIT_TIMER1 = 0x0200;
55
const uint32_t UNIT_TIMER2 = 0x0400;
56
const uint32_t UNIT_TIMER3 = 0x0800;
57
const uint32_t UNIT_MEMORY_ROM = 0x1000;
58
const uint32_t UNIT_MEMORY_BIOS = 0x2000;
59
const uint32_t UNIT_ALL = 0x3FFF;
60
61
void Reset (uint32_t units);
62
63
bool SaveState (const char* filename);
64
bool LoadState (const char* filename);
65
66
bool SaveState (std::ostream& stream);
67
bool LoadState (std::istream& stream);
68
69
inline void Run (unsigned int cycles)
70
{
71
_cpu.Run(cycles);
72
}
73
74
inline void Stop ()
75
{
76
_cpu.Stop();
77
}
78
}
79
80
#endif
81
82