Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libsnes/bsnes/snes/alt/ppu-performance/ppu.hpp
2 views
1
class PPU : public Processor, public PPUcounter {
2
public:
3
uint8 *vram; //[64 * 1024];
4
uint8 *oam; //[544];
5
uint8 *cgram; //[512];
6
7
enum : bool { Threaded = true };
8
alwaysinline void step(unsigned clocks);
9
alwaysinline void synchronize_cpu();
10
11
void latch_counters();
12
bool interlace() const;
13
bool overscan() const;
14
bool hires() const;
15
16
void enter();
17
void enable();
18
void power();
19
void reset();
20
void scanline();
21
void frame();
22
23
void layer_enable(unsigned layer, unsigned priority, bool enable);
24
void set_frameskip(unsigned frameskip);
25
26
void serialize(serializer&);
27
PPU();
28
~PPU();
29
void initialize();
30
31
private:
32
uint32 *surface;
33
uint32 *output;
34
35
#include "mmio/mmio.hpp"
36
#include "window/window.hpp"
37
#include "cache/cache.hpp"
38
#include "background/background.hpp"
39
#include "sprite/sprite.hpp"
40
#include "screen/screen.hpp"
41
42
Cache cache;
43
Background bg1;
44
Background bg2;
45
Background bg3;
46
Background bg4;
47
Sprite sprite;
48
Screen screen;
49
50
struct Display {
51
bool interlace;
52
bool overscan;
53
unsigned width;
54
unsigned height;
55
unsigned frameskip;
56
unsigned framecounter;
57
} display;
58
59
static void Enter();
60
void add_clocks(unsigned clocks);
61
void render_scanline();
62
63
friend class PPU::Cache;
64
friend class PPU::Background;
65
friend class PPU::Sprite;
66
friend class PPU::Screen;
67
friend class Video;
68
};
69
70
extern PPU ppu;
71
72