Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libsnes/bsnes/snes/alt/ppu-performance/background/background.hpp
2 views
1
class Background {
2
struct ID { enum { BG1, BG2, BG3, BG4 }; };
3
struct Mode { enum { BPP2, BPP4, BPP8, Mode7, Inactive }; };
4
struct ScreenSize { enum { Size32x32, Size32x64, Size64x32, Size64x64 }; };
5
struct TileSize { enum { Size8x8, Size16x16 }; };
6
7
bool priority0_enable;
8
bool priority1_enable;
9
10
struct Regs {
11
unsigned mode;
12
unsigned priority0;
13
unsigned priority1;
14
15
bool tile_size;
16
unsigned mosaic;
17
18
unsigned screen_addr;
19
unsigned screen_size;
20
unsigned tiledata_addr;
21
22
unsigned hoffset;
23
unsigned voffset;
24
25
bool main_enable;
26
bool sub_enable;
27
} regs;
28
29
uint16 **mosaic_table;
30
31
const unsigned id;
32
unsigned opt_valid_bit;
33
34
bool hires;
35
signed width;
36
37
unsigned tile_width;
38
unsigned tile_height;
39
40
unsigned mask_x;
41
unsigned mask_y;
42
43
unsigned scx;
44
unsigned scy;
45
46
unsigned hscroll;
47
unsigned vscroll;
48
49
unsigned mosaic_vcounter;
50
unsigned mosaic_voffset;
51
52
LayerWindow window;
53
54
alwaysinline unsigned get_tile(unsigned hoffset, unsigned voffset);
55
void offset_per_tile(unsigned x, unsigned y, unsigned &hoffset, unsigned &voffset);
56
void scanline();
57
void render();
58
void render_mode7();
59
60
void serialize(serializer&);
61
Background(PPU &self, unsigned id);
62
~Background();
63
64
PPU &self;
65
friend class PPU;
66
};
67
68