| 1 | struct Window { |
| 2 | struct { |
| 3 | bool bg1_one_enable; |
| 4 | bool bg1_one_invert; |
| 5 | bool bg1_two_enable; |
| 6 | bool bg1_two_invert; |
| 7 | |
| 8 | bool bg2_one_enable; |
| 9 | bool bg2_one_invert; |
| 10 | bool bg2_two_enable; |
| 11 | bool bg2_two_invert; |
| 12 | |
| 13 | bool bg3_one_enable; |
| 14 | bool bg3_one_invert; |
| 15 | bool bg3_two_enable; |
| 16 | bool bg3_two_invert; |
| 17 | |
| 18 | bool bg4_one_enable; |
| 19 | bool bg4_one_invert; |
| 20 | bool bg4_two_enable; |
| 21 | bool bg4_two_invert; |
| 22 | |
| 23 | bool oam_one_enable; |
| 24 | bool oam_one_invert; |
| 25 | bool oam_two_enable; |
| 26 | bool oam_two_invert; |
| 27 | |
| 28 | bool col_one_enable; |
| 29 | bool col_one_invert; |
| 30 | bool col_two_enable; |
| 31 | bool col_two_invert; |
| 32 | |
| 33 | uint8 one_left; |
| 34 | uint8 one_right; |
| 35 | uint8 two_left; |
| 36 | uint8 two_right; |
| 37 | |
| 38 | uint2 bg1_mask; |
| 39 | uint2 bg2_mask; |
| 40 | uint2 bg3_mask; |
| 41 | uint2 bg4_mask; |
| 42 | uint2 oam_mask; |
| 43 | uint2 col_mask; |
| 44 | |
| 45 | bool bg1_main_enable; |
| 46 | bool bg1_sub_enable; |
| 47 | bool bg2_main_enable; |
| 48 | bool bg2_sub_enable; |
| 49 | bool bg3_main_enable; |
| 50 | bool bg3_sub_enable; |
| 51 | bool bg4_main_enable; |
| 52 | bool bg4_sub_enable; |
| 53 | bool oam_main_enable; |
| 54 | bool oam_sub_enable; |
| 55 | |
| 56 | uint2 col_main_mask; |
| 57 | uint2 col_sub_mask; |
| 58 | } regs; |
| 59 | |
| 60 | struct Output { |
| 61 | struct Pixel { |
| 62 | bool color_enable; |
| 63 | } main, sub; |
| 64 | } output; |
| 65 | |
| 66 | struct { |
| 67 | unsigned x; |
| 68 | bool one; |
| 69 | bool two; |
| 70 | }; |
| 71 | |
| 72 | inline void scanline(); |
| 73 | inline void run(); |
| 74 | inline void reset(); |
| 75 | |
| 76 | inline void test( |
| 77 | bool& main, bool& sub, |
| 78 | bool one_enable, bool one_invert, |
| 79 | bool two_enable, bool two_invert, |
| 80 | uint8 mask, bool main_enable, bool sub_enable |
| 81 | ); |
| 82 | |
| 83 | inline void serialize(serializer&); |
| 84 | inline Window(PPU& self); |
| 85 | |
| 86 | PPU& self; |
| 87 | friend class PPU; |
| 88 | }; |