Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libsnes/bsnes/snes/alt/ppu-compatibility/ppu.hpp
2 views
1
class PPU : public Processor, public PPUcounter {
2
public:
3
uint8* vram; //[128 * 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
#include "memory/memory.hpp"
12
#include "mmio/mmio.hpp"
13
#include "render/render.hpp"
14
15
int uindex;
16
17
uint32 *surface;
18
uint32 *output;
19
20
uint8 ppu1_version;
21
uint8 ppu2_version;
22
23
static void Enter();
24
void add_clocks(unsigned clocks);
25
26
uint8 region;
27
unsigned line;
28
29
enum { NTSC = 0, PAL = 1 };
30
enum { BG1 = 0, BG2 = 1, BG3 = 2, BG4 = 3, OAM = 4, BACK = 5, COL = 5 };
31
enum { SC_32x32 = 0, SC_64x32 = 1, SC_32x64 = 2, SC_64x64 = 3 };
32
33
struct {
34
bool interlace;
35
bool overscan;
36
} display;
37
38
struct {
39
//$2101
40
uint8 oam_basesize;
41
uint8 oam_nameselect;
42
uint16 oam_tdaddr;
43
44
//$210d-$210e
45
uint16 m7_hofs, m7_vofs;
46
47
//$211b-$2120
48
uint16 m7a, m7b, m7c, m7d, m7x, m7y;
49
} cache;
50
51
alwaysinline bool interlace() const { return display.interlace; }
52
alwaysinline bool overscan() const { return display.overscan; }
53
alwaysinline bool hires() const { return (regs.pseudo_hires || regs.bg_mode == 5 || regs.bg_mode == 6); }
54
55
uint16 mosaic_table[16][4096];
56
void render_line();
57
58
void update_oam_status();
59
//required functions
60
void scanline();
61
void render_scanline();
62
void frame();
63
void enter();
64
void enter1();
65
void enter2();
66
void enter3();
67
void enter4();
68
void enable();
69
void power();
70
void reset();
71
72
bool layer_enabled[5][4];
73
void layer_enable(unsigned layer, unsigned priority, bool enable);
74
unsigned frameskip;
75
unsigned framecounter;
76
void set_frameskip(unsigned frameskip);
77
78
void serialize(serializer&);
79
void initialize();
80
PPU();
81
~PPU();
82
};
83
84
extern PPU ppu;
85
86