mirror of https://github.com/mgba-emu/mgba.git
GBA I/O: Improve legibility of long constants
This commit is contained in:
parent
6ed7341b5a
commit
bcb0073a4a
237
src/gba/io.c
237
src/gba/io.c
|
@ -200,133 +200,136 @@ const char* const GBAIORegisterNames[] = {
|
|||
};
|
||||
|
||||
static const int _isValidRegister[REG_INTERNAL_MAX >> 1] = {
|
||||
// Video
|
||||
1, 0, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 0,
|
||||
1, 1, 1, 0, 0, 0, 0, 0,
|
||||
// Audio
|
||||
1, 1, 1, 0, 1, 0, 1, 0,
|
||||
1, 1, 1, 0, 1, 0, 1, 0,
|
||||
1, 1, 1, 0, 1, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 0, 0, 0, 0,
|
||||
// DMA
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// Timers
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// SIO
|
||||
1, 1, 1, 1, 1, 0, 0, 0,
|
||||
1, 1, 1, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// Interrupts
|
||||
1, 1, 1, 0, 1, 0, 0, 0,
|
||||
/* 0 2 4 6 8 A C E */
|
||||
/* Video */
|
||||
/* 00 */ 1, 0, 1, 1, 1, 1, 1, 1,
|
||||
/* 01 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 02 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 03 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 04 */ 1, 1, 1, 1, 1, 1, 1, 0,
|
||||
/* 05 */ 1, 1, 1, 0, 0, 0, 0, 0,
|
||||
/* Audio */
|
||||
/* 06 */ 1, 1, 1, 0, 1, 0, 1, 0,
|
||||
/* 07 */ 1, 1, 1, 0, 1, 0, 1, 0,
|
||||
/* 08 */ 1, 1, 1, 0, 1, 0, 0, 0,
|
||||
/* 09 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0A */ 1, 1, 1, 1, 0, 0, 0, 0,
|
||||
/* DMA */
|
||||
/* 0B */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0C */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0D */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0E */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 0F */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* Timers */
|
||||
/* 10 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 11 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* SIO */
|
||||
/* 12 */ 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
/* 13 */ 1, 1, 1, 0, 0, 0, 0, 0,
|
||||
/* 14 */ 1, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 15 */ 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
/* 16 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 17 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 18 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 19 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1A */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1B */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1C */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1D */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1E */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1F */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* Interrupts */
|
||||
/* 20 */ 1, 1, 1, 0, 1, 0, 0, 0,
|
||||
// Internal registers
|
||||
1, 1
|
||||
};
|
||||
|
||||
static const int _isRSpecialRegister[REG_INTERNAL_MAX >> 1] = {
|
||||
// Video
|
||||
0, 0, 1, 1, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
// Audio
|
||||
0, 0, 1, 0, 0, 0, 1, 0,
|
||||
0, 0, 1, 0, 0, 0, 1, 0,
|
||||
0, 0, 0, 0, 1, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 0, 0, 0, 0,
|
||||
// DMA
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// Timers
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// SIO
|
||||
1, 1, 1, 1, 1, 0, 0, 0,
|
||||
1, 1, 1, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// Interrupts
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 0 2 4 6 8 A C E */
|
||||
/* Video */
|
||||
/* 00 */ 0, 0, 1, 1, 0, 0, 0, 0,
|
||||
/* 01 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 02 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 03 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 04 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 05 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* Audio */
|
||||
/* 06 */ 0, 0, 1, 0, 0, 0, 1, 0,
|
||||
/* 07 */ 0, 0, 1, 0, 0, 0, 1, 0,
|
||||
/* 08 */ 0, 0, 0, 0, 1, 0, 0, 0,
|
||||
/* 09 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0A */ 1, 1, 1, 1, 0, 0, 0, 0,
|
||||
/* DMA */
|
||||
/* 0B */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0C */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0D */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0E */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 0F */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* Timers */
|
||||
/* 10 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 11 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* SIO */
|
||||
/* 12 */ 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
/* 13 */ 1, 1, 1, 0, 0, 0, 0, 0,
|
||||
/* 14 */ 1, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 15 */ 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
/* 16 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 17 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 18 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 19 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1A */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1B */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1C */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1D */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1E */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1F */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* Interrupts */
|
||||
/* 20 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// Internal registers
|
||||
1, 1
|
||||
};
|
||||
|
||||
static const int _isWSpecialRegister[REG_INTERNAL_MAX >> 1] = {
|
||||
// Video
|
||||
0, 0, 1, 1, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// Audio
|
||||
0, 0, 1, 0, 0, 0, 1, 0,
|
||||
0, 0, 1, 0, 0, 0, 1, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 0, 0, 0, 0,
|
||||
// DMA
|
||||
0, 0, 0, 0, 0, 1, 0, 0,
|
||||
0, 0, 0, 1, 0, 0, 0, 0,
|
||||
0, 1, 0, 0, 0, 0, 0, 1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// Timers
|
||||
1, 1, 1, 1, 1, 1, 1, 1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// SIO
|
||||
1, 1, 1, 1, 1, 0, 0, 0,
|
||||
1, 1, 1, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// Interrupts
|
||||
1, 1, 0, 0, 1, 0, 0, 0,
|
||||
/* 0 2 4 6 8 A C E */
|
||||
/* Video */
|
||||
/* 00 */ 0, 0, 1, 1, 0, 0, 0, 0,
|
||||
/* 01 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 02 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 03 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 04 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 05 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* Audio */
|
||||
/* 06 */ 0, 0, 1, 0, 0, 0, 1, 0,
|
||||
/* 07 */ 0, 0, 1, 0, 0, 0, 1, 0,
|
||||
/* 08 */ 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
/* 09 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 0A */ 1, 1, 1, 1, 0, 0, 0, 0,
|
||||
/* DMA */
|
||||
/* 0B */ 0, 0, 0, 0, 0, 1, 0, 0,
|
||||
/* 0C */ 0, 0, 0, 1, 0, 0, 0, 0,
|
||||
/* 0D */ 0, 1, 0, 0, 0, 0, 0, 1,
|
||||
/* 0E */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 0F */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* Timers */
|
||||
/* 10 */ 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
/* 11 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* SIO */
|
||||
/* 12 */ 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
/* 13 */ 1, 1, 1, 0, 0, 0, 0, 0,
|
||||
/* 14 */ 1, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 15 */ 1, 1, 1, 1, 1, 0, 0, 0,
|
||||
/* 16 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 17 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 18 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 19 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1A */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1B */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1C */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1D */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1E */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 1F */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* Interrupts */
|
||||
/* 20 */ 1, 1, 0, 0, 1, 0, 0, 0,
|
||||
// Internal registers
|
||||
1, 1
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue