Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libsnes/bsnes/gameboy/gameboy.hpp
2 views
1
#ifndef GAMEBOY_HPP
2
#define GAMEBOY_HPP
3
4
#include <base/base.hpp>
5
6
namespace GameBoy {
7
namespace Info {
8
static const char Name[] = "bgameboy";
9
static const unsigned SerializerVersion = 3;
10
}
11
}
12
13
/*
14
bgameboy - Game Boy, Super Game Boy, and Game Boy Color emulator
15
author: byuu
16
license: GPLv3
17
project started: 2010-12-27
18
*/
19
20
#include <libco/libco.h>
21
#include <nall/gameboy/cartridge.hpp>
22
23
namespace GameBoy {
24
struct Processor {
25
cothread_t thread;
26
unsigned frequency;
27
int64 clock;
28
29
inline void create(void (*entrypoint)(), unsigned frequency) {
30
if(thread) co_delete(thread);
31
thread = co_create(65536 * sizeof(void*), entrypoint);
32
this->frequency = frequency;
33
clock = 0;
34
}
35
36
inline void serialize(serializer &s) {
37
s.integer(frequency);
38
s.integer(clock);
39
}
40
41
inline Processor() : thread(nullptr) {
42
}
43
44
inline ~Processor() {
45
if(thread) co_delete(thread);
46
}
47
};
48
49
#include <gameboy/memory/memory.hpp>
50
#include <gameboy/system/system.hpp>
51
#include <gameboy/scheduler/scheduler.hpp>
52
#include <gameboy/cartridge/cartridge.hpp>
53
#include <gameboy/cpu/cpu.hpp>
54
#include <gameboy/apu/apu.hpp>
55
#include <gameboy/lcd/lcd.hpp>
56
#include <gameboy/cheat/cheat.hpp>
57
#include <gameboy/video/video.hpp>
58
};
59
60
#endif
61
62