| 1 |
enum : unsigned { OBJ = 0, BG0 = 1, BG1 = 2, BG2 = 3, BG3 = 4, SFX = 5 }; |
| 2 |
enum : unsigned { In0 = 0, In1 = 1, Obj = 2, Out = 3 }; |
| 3 |
|
| 4 |
struct Registers { |
| 5 |
struct Control { |
| 6 |
uint3 bgmode; |
| 7 |
uint1 cgbmode; |
| 8 |
uint1 frame; |
| 9 |
uint1 hblank; |
| 10 |
uint1 objmapping; |
| 11 |
uint1 forceblank; |
| 12 |
uint1 enable[5]; |
| 13 |
uint1 enablewindow[3]; |
| 14 |
|
| 15 |
operator uint16() const; |
| 16 |
uint16 operator=(uint16 source); |
| 17 |
Control& operator=(const Control&) = delete; |
| 18 |
} control; |
| 19 |
|
| 20 |
uint1 greenswap; |
| 21 |
|
| 22 |
struct Status { |
| 23 |
uint1 vblank; |
| 24 |
uint1 hblank; |
| 25 |
uint1 vcoincidence; |
| 26 |
uint1 irqvblank; |
| 27 |
uint1 irqhblank; |
| 28 |
uint1 irqvcoincidence; |
| 29 |
uint8 vcompare; |
| 30 |
|
| 31 |
operator uint16() const; |
| 32 |
uint16 operator=(uint16 source); |
| 33 |
Status& operator=(const Status&) = delete; |
| 34 |
} status; |
| 35 |
|
| 36 |
uint16 vcounter; |
| 37 |
|
| 38 |
struct BackgroundControl { |
| 39 |
uint2 priority; |
| 40 |
uint2 characterbaseblock; |
| 41 |
uint1 mosaic; |
| 42 |
uint1 colormode; |
| 43 |
uint5 screenbaseblock; |
| 44 |
uint1 affinewrap; //BG2,3 only |
| 45 |
uint2 screensize; |
| 46 |
|
| 47 |
operator uint16() const; |
| 48 |
uint16 operator=(uint16 source); |
| 49 |
BackgroundControl& operator=(const BackgroundControl&) = delete; |
| 50 |
}; |
| 51 |
|
| 52 |
struct Background { |
| 53 |
BackgroundControl control; |
| 54 |
uint9 hoffset; |
| 55 |
uint9 voffset; |
| 56 |
|
| 57 |
//BG2,3 only |
| 58 |
int16 pa, pb, pc, pd; |
| 59 |
int28 x, y; |
| 60 |
|
| 61 |
//internal |
| 62 |
int28 lx, ly; |
| 63 |
unsigned vmosaic; |
| 64 |
unsigned hmosaic; |
| 65 |
unsigned id; |
| 66 |
} bg[4]; |
| 67 |
|
| 68 |
struct WindowFlags { |
| 69 |
uint1 enable[6]; |
| 70 |
|
| 71 |
operator uint8() const; |
| 72 |
uint8 operator=(uint8 source); |
| 73 |
WindowFlags& operator=(const WindowFlags&) = delete; |
| 74 |
}; |
| 75 |
|
| 76 |
struct Window { |
| 77 |
uint8 x1, x2; |
| 78 |
uint8 y1, y2; |
| 79 |
} window[2]; |
| 80 |
|
| 81 |
WindowFlags windowflags[4]; |
| 82 |
|
| 83 |
struct Mosaic { |
| 84 |
uint4 bghsize; |
| 85 |
uint4 bgvsize; |
| 86 |
uint4 objhsize; |
| 87 |
uint4 objvsize; |
| 88 |
} mosaic; |
| 89 |
|
| 90 |
struct BlendControl { |
| 91 |
uint1 above[6]; |
| 92 |
uint1 below[6]; |
| 93 |
uint2 mode; |
| 94 |
|
| 95 |
operator uint16() const; |
| 96 |
uint16 operator=(uint16 source); |
| 97 |
BlendControl& operator=(const BlendControl&) = delete; |
| 98 |
}; |
| 99 |
|
| 100 |
struct Blend { |
| 101 |
BlendControl control; |
| 102 |
uint5 eva; |
| 103 |
uint5 evb; |
| 104 |
uint5 evy; |
| 105 |
} blend; |
| 106 |
} regs; |