Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libsnes/bsnes/snes/ppu/sprite/sprite.hpp
2 views
1
struct Sprite {
2
struct SpriteItem {
3
uint16 x;
4
uint16 y;
5
uint8 character;
6
bool nameselect;
7
bool vflip;
8
bool hflip;
9
uint8 priority;
10
uint8 palette;
11
bool size;
12
unsigned width() const;
13
unsigned height() const;
14
} list[128];
15
16
struct TileItem {
17
uint16 x;
18
uint16 priority;
19
uint16 palette;
20
bool hflip;
21
uint8 d0, d1, d2, d3;
22
};
23
24
struct State {
25
unsigned x;
26
unsigned y;
27
28
unsigned item_count;
29
unsigned tile_count;
30
31
bool active;
32
uint8 item[2][32];
33
TileItem tile[2][34];
34
} t;
35
36
struct Regs {
37
bool main_enable;
38
bool sub_enable;
39
bool interlace;
40
41
uint3 base_size;
42
uint2 nameselect;
43
uint16 tiledata_addr;
44
uint8 first_sprite;
45
46
unsigned priority0;
47
unsigned priority1;
48
unsigned priority2;
49
unsigned priority3;
50
51
bool time_over;
52
bool range_over;
53
} regs;
54
55
struct Output {
56
struct Pixel {
57
unsigned priority; //0 = none (transparent)
58
uint8 palette;
59
} main, sub;
60
} output;
61
62
//list.cpp
63
void update(unsigned addr, uint8 data);
64
void synchronize();
65
66
//sprite.cpp
67
void address_reset();
68
void set_first_sprite();
69
void frame();
70
void scanline();
71
void run();
72
void tilefetch();
73
void reset();
74
75
bool on_scanline(SpriteItem&);
76
77
void serialize(serializer&);
78
Sprite(PPU &self);
79
80
PPU &self;
81
friend class PPU;
82
};
83
84