| 1 |
struct Registers { |
| 2 |
struct DMAControl { |
| 3 |
uint2 targetmode; |
| 4 |
uint2 sourcemode; |
| 5 |
uint1 repeat; |
| 6 |
uint1 size; |
| 7 |
uint1 drq; |
| 8 |
uint2 timingmode; |
| 9 |
uint1 irq; |
| 10 |
uint1 enable; |
| 11 |
|
| 12 |
operator uint16() const; |
| 13 |
uint16 operator=(uint16 source); |
| 14 |
DMAControl& operator=(const DMAControl&) = delete; |
| 15 |
}; |
| 16 |
|
| 17 |
struct DMA { |
| 18 |
varuint source; |
| 19 |
varuint target; |
| 20 |
varuint length; |
| 21 |
DMAControl control; |
| 22 |
|
| 23 |
//internal |
| 24 |
bool pending; |
| 25 |
struct Run { |
| 26 |
varuint target; |
| 27 |
varuint source; |
| 28 |
varuint length; |
| 29 |
} run; |
| 30 |
} dma[4]; |
| 31 |
|
| 32 |
struct TimerControl { |
| 33 |
uint2 frequency; |
| 34 |
uint1 cascade; |
| 35 |
uint1 irq; |
| 36 |
uint1 enable; |
| 37 |
|
| 38 |
operator uint16() const; |
| 39 |
uint16 operator=(uint16 source); |
| 40 |
TimerControl& operator=(const TimerControl&) = delete; |
| 41 |
}; |
| 42 |
|
| 43 |
struct Timer { |
| 44 |
uint16 period; |
| 45 |
uint16 reload; |
| 46 |
TimerControl control; |
| 47 |
} timer[4]; |
| 48 |
|
| 49 |
struct SerialControl { |
| 50 |
uint1 shiftclockselect; |
| 51 |
uint1 shiftclockfrequency; |
| 52 |
uint1 transferenablereceive; |
| 53 |
uint1 transferenablesend; |
| 54 |
uint1 startbit; |
| 55 |
uint1 transferlength; |
| 56 |
uint1 irqenable; |
| 57 |
|
| 58 |
operator uint16() const; |
| 59 |
uint16 operator=(uint16 source); |
| 60 |
SerialControl& operator=(const SerialControl&) = delete; |
| 61 |
}; |
| 62 |
|
| 63 |
struct Serial { |
| 64 |
uint16 data[4]; |
| 65 |
SerialControl control; |
| 66 |
uint8 data8; |
| 67 |
} serial; |
| 68 |
|
| 69 |
struct KeypadControl { |
| 70 |
uint1 flag[10]; |
| 71 |
uint1 enable; |
| 72 |
uint1 condition; |
| 73 |
|
| 74 |
operator uint16() const; |
| 75 |
uint16 operator=(uint16 source); |
| 76 |
KeypadControl& operator=(const KeypadControl&) = delete; |
| 77 |
}; |
| 78 |
|
| 79 |
struct Keypad { |
| 80 |
KeypadControl control; |
| 81 |
} keypad; |
| 82 |
|
| 83 |
struct JoybusSettings { |
| 84 |
uint1 sc; |
| 85 |
uint1 sd; |
| 86 |
uint1 si; |
| 87 |
uint1 so; |
| 88 |
uint1 scmode; |
| 89 |
uint1 sdmode; |
| 90 |
uint1 simode; |
| 91 |
uint1 somode; |
| 92 |
uint1 irqenable; |
| 93 |
uint2 mode; |
| 94 |
|
| 95 |
operator uint16() const; |
| 96 |
uint16 operator=(uint16 source); |
| 97 |
JoybusSettings& operator=(const JoybusSettings&) = delete; |
| 98 |
}; |
| 99 |
|
| 100 |
struct JoybusControl { |
| 101 |
uint1 resetsignal; |
| 102 |
uint1 receivecomplete; |
| 103 |
uint1 sendcomplete; |
| 104 |
uint1 irqenable; |
| 105 |
|
| 106 |
operator uint16() const; |
| 107 |
uint16 operator=(uint16 source); |
| 108 |
JoybusControl& operator=(const JoybusControl&) = delete; |
| 109 |
}; |
| 110 |
|
| 111 |
struct JoybusStatus { |
| 112 |
uint1 receiveflag; |
| 113 |
uint1 sendflag; |
| 114 |
uint2 generalflag; |
| 115 |
|
| 116 |
operator uint16() const; |
| 117 |
uint16 operator=(uint16 source); |
| 118 |
JoybusStatus& operator=(const JoybusStatus&) = delete; |
| 119 |
}; |
| 120 |
|
| 121 |
struct Joybus { |
| 122 |
JoybusSettings settings; |
| 123 |
JoybusControl control; |
| 124 |
uint32 receive; |
| 125 |
uint32 transmit; |
| 126 |
JoybusStatus status; |
| 127 |
} joybus; |
| 128 |
|
| 129 |
uint1 ime; |
| 130 |
|
| 131 |
struct Interrupt { |
| 132 |
uint1 vblank; |
| 133 |
uint1 hblank; |
| 134 |
uint1 vcoincidence; |
| 135 |
uint1 timer[4]; |
| 136 |
uint1 serial; |
| 137 |
uint1 dma[4]; |
| 138 |
uint1 keypad; |
| 139 |
uint1 cartridge; |
| 140 |
|
| 141 |
operator uint16() const; |
| 142 |
uint16 operator=(uint16 source); |
| 143 |
Interrupt& operator=(const Interrupt&) = delete; |
| 144 |
}; |
| 145 |
|
| 146 |
struct IRQ { |
| 147 |
Interrupt enable; |
| 148 |
Interrupt flag; |
| 149 |
} irq; |
| 150 |
|
| 151 |
struct WaitControl { |
| 152 |
uint2 nwait[4]; |
| 153 |
uint2 swait[4]; |
| 154 |
uint2 phi; |
| 155 |
uint1 prefetch; |
| 156 |
uint1 gametype; |
| 157 |
|
| 158 |
operator uint16() const; |
| 159 |
uint16 operator=(uint16 source); |
| 160 |
WaitControl& operator=(const WaitControl&) = delete; |
| 161 |
}; |
| 162 |
|
| 163 |
struct Wait { |
| 164 |
WaitControl control; |
| 165 |
} wait; |
| 166 |
|
| 167 |
struct MemoryControl { |
| 168 |
uint1 disable; |
| 169 |
uint3 unknown1; |
| 170 |
uint1 ewram; |
| 171 |
uint4 ewramwait; |
| 172 |
uint4 unknown2; |
| 173 |
|
| 174 |
operator uint32() const; |
| 175 |
uint32 operator=(uint32 source); |
| 176 |
MemoryControl& operator=(const MemoryControl&) = delete; |
| 177 |
}; |
| 178 |
|
| 179 |
struct Memory { |
| 180 |
MemoryControl control; |
| 181 |
} memory; |
| 182 |
|
| 183 |
uint1 postboot; |
| 184 |
enum class Mode : unsigned { Normal, Halt, Stop } mode; |
| 185 |
unsigned clock; |
| 186 |
} regs; |