base16 offset static assertions

This commit is contained in:
Zack Buhman 2024-08-30 02:44:20 -05:00
parent f3b11ed49f
commit 3e2f9fddc1
3 changed files with 253 additions and 253 deletions

View File

@ -38,7 +38,7 @@ def c_source(registers):
def c_asserts(registers):
for register in registers:
yield f"static_assert((offsetof (struct {struct_name}, {register.name})) == {register.offset});"
yield f"static_assert((offsetof (struct {struct_name}, {register.name})) == 0x{register.offset:03x});"
print('#include <stdint.h>')
print('#include <stddef.h>')

View File

@ -250,219 +250,219 @@ struct graphics_engine_a {
volatile uint32_t VECMTX_RESULT_7;
volatile uint32_t VECMTX_RESULT_8;
};
static_assert((offsetof (struct graphics_engine_a, DISPCNT)) == 0);
static_assert((offsetof (struct graphics_engine_a, DISPSTAT)) == 4);
static_assert((offsetof (struct graphics_engine_a, VCOUNT)) == 6);
static_assert((offsetof (struct graphics_engine_a, BG0CNT)) == 8);
static_assert((offsetof (struct graphics_engine_a, BG1CNT)) == 10);
static_assert((offsetof (struct graphics_engine_a, BG2CNT)) == 12);
static_assert((offsetof (struct graphics_engine_a, BG3CNT)) == 14);
static_assert((offsetof (struct graphics_engine_a, BG0HOFS)) == 16);
static_assert((offsetof (struct graphics_engine_a, BG0VOFS)) == 18);
static_assert((offsetof (struct graphics_engine_a, BG1HOFS)) == 20);
static_assert((offsetof (struct graphics_engine_a, BG1VOFS)) == 22);
static_assert((offsetof (struct graphics_engine_a, BG2HOFS)) == 24);
static_assert((offsetof (struct graphics_engine_a, BG2VOFS)) == 26);
static_assert((offsetof (struct graphics_engine_a, BG3HOFS)) == 28);
static_assert((offsetof (struct graphics_engine_a, BG3VOFS)) == 30);
static_assert((offsetof (struct graphics_engine_a, BG2PA)) == 32);
static_assert((offsetof (struct graphics_engine_a, BG2PB)) == 34);
static_assert((offsetof (struct graphics_engine_a, BG2PC)) == 36);
static_assert((offsetof (struct graphics_engine_a, BG2PD)) == 38);
static_assert((offsetof (struct graphics_engine_a, BG2X)) == 40);
static_assert((offsetof (struct graphics_engine_a, BG2Y)) == 44);
static_assert((offsetof (struct graphics_engine_a, BG3PA)) == 48);
static_assert((offsetof (struct graphics_engine_a, BG3PB)) == 50);
static_assert((offsetof (struct graphics_engine_a, BG3PC)) == 52);
static_assert((offsetof (struct graphics_engine_a, BG3PD)) == 54);
static_assert((offsetof (struct graphics_engine_a, BG3X)) == 56);
static_assert((offsetof (struct graphics_engine_a, BG3Y)) == 60);
static_assert((offsetof (struct graphics_engine_a, WIN0H)) == 64);
static_assert((offsetof (struct graphics_engine_a, WIN1H)) == 66);
static_assert((offsetof (struct graphics_engine_a, WIN0V)) == 68);
static_assert((offsetof (struct graphics_engine_a, WIN1V)) == 70);
static_assert((offsetof (struct graphics_engine_a, WININ)) == 72);
static_assert((offsetof (struct graphics_engine_a, WINOUT)) == 74);
static_assert((offsetof (struct graphics_engine_a, MOSAIC)) == 76);
static_assert((offsetof (struct graphics_engine_a, BLDCNT)) == 80);
static_assert((offsetof (struct graphics_engine_a, BLDALPHA)) == 82);
static_assert((offsetof (struct graphics_engine_a, BLDY)) == 84);
static_assert((offsetof (struct graphics_engine_a, DISP3DCNT)) == 96);
static_assert((offsetof (struct graphics_engine_a, DISPCAPCNT)) == 100);
static_assert((offsetof (struct graphics_engine_a, DISP_MMEM_FIFO)) == 104);
static_assert((offsetof (struct graphics_engine_a, MASTER_BRIGHT)) == 108);
static_assert((offsetof (struct graphics_engine_a, DMA0SAD)) == 176);
static_assert((offsetof (struct graphics_engine_a, DMA0DAD)) == 180);
static_assert((offsetof (struct graphics_engine_a, DMA0CNT)) == 184);
static_assert((offsetof (struct graphics_engine_a, DMA1SAD)) == 188);
static_assert((offsetof (struct graphics_engine_a, DMA1DAD)) == 192);
static_assert((offsetof (struct graphics_engine_a, DMA1CNT)) == 196);
static_assert((offsetof (struct graphics_engine_a, DMA2SAD)) == 200);
static_assert((offsetof (struct graphics_engine_a, DMA2DAD)) == 204);
static_assert((offsetof (struct graphics_engine_a, DMA2CNT)) == 208);
static_assert((offsetof (struct graphics_engine_a, DMA3SAD)) == 212);
static_assert((offsetof (struct graphics_engine_a, DMA3DAD)) == 216);
static_assert((offsetof (struct graphics_engine_a, DMA3CNT)) == 220);
static_assert((offsetof (struct graphics_engine_a, TM0CNT_L)) == 256);
static_assert((offsetof (struct graphics_engine_a, TM0CNT_H)) == 258);
static_assert((offsetof (struct graphics_engine_a, TM1CNT_L)) == 260);
static_assert((offsetof (struct graphics_engine_a, TM1CNT_H)) == 262);
static_assert((offsetof (struct graphics_engine_a, TM2CNT_L)) == 264);
static_assert((offsetof (struct graphics_engine_a, TM2CNT_H)) == 266);
static_assert((offsetof (struct graphics_engine_a, TM3CNT_L)) == 268);
static_assert((offsetof (struct graphics_engine_a, TM3CNT_H)) == 270);
static_assert((offsetof (struct graphics_engine_a, KEYINPUT)) == 304);
static_assert((offsetof (struct graphics_engine_a, KEYCNT)) == 306);
static_assert((offsetof (struct graphics_engine_a, EXMEMCNT)) == 516);
static_assert((offsetof (struct graphics_engine_a, IME)) == 520);
static_assert((offsetof (struct graphics_engine_a, IE)) == 528);
static_assert((offsetof (struct graphics_engine_a, IF)) == 532);
static_assert((offsetof (struct graphics_engine_a, VRAMCNT)) == 576);
static_assert((offsetof (struct graphics_engine_a, WVRAMCNT)) == 580);
static_assert((offsetof (struct graphics_engine_a, VRAM_HI_CNT)) == 584);
static_assert((offsetof (struct graphics_engine_a, DIVCNT)) == 640);
static_assert((offsetof (struct graphics_engine_a, DIV_NUMER)) == 656);
static_assert((offsetof (struct graphics_engine_a, DIV_DENOM)) == 664);
static_assert((offsetof (struct graphics_engine_a, DIV_RESULT)) == 672);
static_assert((offsetof (struct graphics_engine_a, DIVREM_RESULT)) == 680);
static_assert((offsetof (struct graphics_engine_a, SQRTCNT)) == 688);
static_assert((offsetof (struct graphics_engine_a, SQRT_RESULT)) == 692);
static_assert((offsetof (struct graphics_engine_a, SQRT_PARAM)) == 696);
static_assert((offsetof (struct graphics_engine_a, POWCNT)) == 772);
static_assert((offsetof (struct graphics_engine_a, RDLINES_COUNT)) == 800);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_0_L)) == 816);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_0_H)) == 818);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_1_L)) == 820);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_1_H)) == 822);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_2_L)) == 824);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_2_H)) == 826);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_3_L)) == 828);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_3_H)) == 830);
static_assert((offsetof (struct graphics_engine_a, ALPHA_TEST_REF)) == 832);
static_assert((offsetof (struct graphics_engine_a, CLEAR_COLOR)) == 848);
static_assert((offsetof (struct graphics_engine_a, CLEAR_DEPTH)) == 852);
static_assert((offsetof (struct graphics_engine_a, CLRIMAGE_OFFSET)) == 854);
static_assert((offsetof (struct graphics_engine_a, FOG_COLOR)) == 856);
static_assert((offsetof (struct graphics_engine_a, FOG_OFFSET)) == 860);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_0_L)) == 864);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_0_H)) == 866);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_1_L)) == 868);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_1_H)) == 870);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_2_L)) == 872);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_2_H)) == 874);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_3_L)) == 876);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_3_H)) == 878);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_4_L)) == 880);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_4_H)) == 882);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_5_L)) == 884);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_5_H)) == 886);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_6_L)) == 888);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_6_H)) == 890);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_7_L)) == 892);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_7_H)) == 894);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_0_L)) == 896);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_0_H)) == 898);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_1_L)) == 900);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_1_H)) == 902);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_2_L)) == 904);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_2_H)) == 906);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_3_L)) == 908);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_3_H)) == 910);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_4_L)) == 912);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_4_H)) == 914);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_5_L)) == 916);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_5_H)) == 918);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_6_L)) == 920);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_6_H)) == 922);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_7_L)) == 924);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_7_H)) == 926);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_8_L)) == 928);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_8_H)) == 930);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_9_L)) == 932);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_9_H)) == 934);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_10_L)) == 936);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_10_H)) == 938);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_11_L)) == 940);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_11_H)) == 942);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_12_L)) == 944);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_12_H)) == 946);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_13_L)) == 948);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_13_H)) == 950);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_14_L)) == 952);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_14_H)) == 954);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_15_L)) == 956);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_15_H)) == 958);
static_assert((offsetof (struct graphics_engine_a, GXFIFO)) == 1024);
static_assert((offsetof (struct graphics_engine_a, MTX_MODE)) == 1088);
static_assert((offsetof (struct graphics_engine_a, MTX_PUSH)) == 1092);
static_assert((offsetof (struct graphics_engine_a, MTX_POP)) == 1096);
static_assert((offsetof (struct graphics_engine_a, MTX_STORE)) == 1100);
static_assert((offsetof (struct graphics_engine_a, MTX_RESTORE)) == 1104);
static_assert((offsetof (struct graphics_engine_a, MTX_IDENTITY)) == 1108);
static_assert((offsetof (struct graphics_engine_a, MTX_LOAD_4X4)) == 1112);
static_assert((offsetof (struct graphics_engine_a, MTX_LOAD_4X3)) == 1116);
static_assert((offsetof (struct graphics_engine_a, MTX_MULT_4X4)) == 1120);
static_assert((offsetof (struct graphics_engine_a, MTX_MULT_4X3)) == 1124);
static_assert((offsetof (struct graphics_engine_a, MTX_MULT_3X3)) == 1128);
static_assert((offsetof (struct graphics_engine_a, MTX_SCALE)) == 1132);
static_assert((offsetof (struct graphics_engine_a, MTX_TRANS)) == 1136);
static_assert((offsetof (struct graphics_engine_a, COLOR)) == 1152);
static_assert((offsetof (struct graphics_engine_a, NORMAL)) == 1156);
static_assert((offsetof (struct graphics_engine_a, TEXCOORD)) == 1160);
static_assert((offsetof (struct graphics_engine_a, VTX_16)) == 1164);
static_assert((offsetof (struct graphics_engine_a, VTX_10)) == 1168);
static_assert((offsetof (struct graphics_engine_a, VTX_XY)) == 1172);
static_assert((offsetof (struct graphics_engine_a, VTX_XZ)) == 1176);
static_assert((offsetof (struct graphics_engine_a, VTX_YZ)) == 1180);
static_assert((offsetof (struct graphics_engine_a, VTX_DIFF)) == 1184);
static_assert((offsetof (struct graphics_engine_a, POLYGON_ATTR)) == 1188);
static_assert((offsetof (struct graphics_engine_a, TEXIMAGE_PARAM)) == 1192);
static_assert((offsetof (struct graphics_engine_a, TEXPLTT_BASE)) == 1196);
static_assert((offsetof (struct graphics_engine_a, DIF_AMB)) == 1216);
static_assert((offsetof (struct graphics_engine_a, SPE_EMI)) == 1220);
static_assert((offsetof (struct graphics_engine_a, LIGHT_VECTOR)) == 1224);
static_assert((offsetof (struct graphics_engine_a, LIGHT_COLOR)) == 1228);
static_assert((offsetof (struct graphics_engine_a, SHININESS)) == 1232);
static_assert((offsetof (struct graphics_engine_a, BEGIN_VTXS)) == 1280);
static_assert((offsetof (struct graphics_engine_a, END_VTXS)) == 1284);
static_assert((offsetof (struct graphics_engine_a, SWAP_BUFFERS)) == 1344);
static_assert((offsetof (struct graphics_engine_a, VIEWPORT)) == 1408);
static_assert((offsetof (struct graphics_engine_a, BOX_TEST)) == 1472);
static_assert((offsetof (struct graphics_engine_a, POS_TEST)) == 1476);
static_assert((offsetof (struct graphics_engine_a, VEC_TEST)) == 1480);
static_assert((offsetof (struct graphics_engine_a, GXSTAT)) == 1536);
static_assert((offsetof (struct graphics_engine_a, LISTRAM_COUNT)) == 1540);
static_assert((offsetof (struct graphics_engine_a, VTXRAM_COUNT)) == 1542);
static_assert((offsetof (struct graphics_engine_a, DISP_1DOT_DEPTH)) == 1552);
static_assert((offsetof (struct graphics_engine_a, POS_RESULT_X)) == 1568);
static_assert((offsetof (struct graphics_engine_a, POS_RESULT_Y)) == 1572);
static_assert((offsetof (struct graphics_engine_a, POS_RESULT_Z)) == 1576);
static_assert((offsetof (struct graphics_engine_a, POS_RESULT_W)) == 1580);
static_assert((offsetof (struct graphics_engine_a, VEC_RESULT_X)) == 1584);
static_assert((offsetof (struct graphics_engine_a, VEC_RESULT_Y)) == 1586);
static_assert((offsetof (struct graphics_engine_a, VEC_RESULT_Z)) == 1588);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_0)) == 1600);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_1)) == 1604);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_2)) == 1608);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_3)) == 1612);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_4)) == 1616);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_5)) == 1620);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_6)) == 1624);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_7)) == 1628);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_8)) == 1632);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_9)) == 1636);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_10)) == 1640);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_11)) == 1644);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_12)) == 1648);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_13)) == 1652);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_14)) == 1656);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_15)) == 1660);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_0)) == 1664);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_1)) == 1668);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_2)) == 1672);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_3)) == 1676);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_4)) == 1680);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_5)) == 1684);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_6)) == 1688);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_7)) == 1692);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_8)) == 1696);
static_assert((offsetof (struct graphics_engine_a, DISPCNT)) == 0x000);
static_assert((offsetof (struct graphics_engine_a, DISPSTAT)) == 0x004);
static_assert((offsetof (struct graphics_engine_a, VCOUNT)) == 0x006);
static_assert((offsetof (struct graphics_engine_a, BG0CNT)) == 0x008);
static_assert((offsetof (struct graphics_engine_a, BG1CNT)) == 0x00a);
static_assert((offsetof (struct graphics_engine_a, BG2CNT)) == 0x00c);
static_assert((offsetof (struct graphics_engine_a, BG3CNT)) == 0x00e);
static_assert((offsetof (struct graphics_engine_a, BG0HOFS)) == 0x010);
static_assert((offsetof (struct graphics_engine_a, BG0VOFS)) == 0x012);
static_assert((offsetof (struct graphics_engine_a, BG1HOFS)) == 0x014);
static_assert((offsetof (struct graphics_engine_a, BG1VOFS)) == 0x016);
static_assert((offsetof (struct graphics_engine_a, BG2HOFS)) == 0x018);
static_assert((offsetof (struct graphics_engine_a, BG2VOFS)) == 0x01a);
static_assert((offsetof (struct graphics_engine_a, BG3HOFS)) == 0x01c);
static_assert((offsetof (struct graphics_engine_a, BG3VOFS)) == 0x01e);
static_assert((offsetof (struct graphics_engine_a, BG2PA)) == 0x020);
static_assert((offsetof (struct graphics_engine_a, BG2PB)) == 0x022);
static_assert((offsetof (struct graphics_engine_a, BG2PC)) == 0x024);
static_assert((offsetof (struct graphics_engine_a, BG2PD)) == 0x026);
static_assert((offsetof (struct graphics_engine_a, BG2X)) == 0x028);
static_assert((offsetof (struct graphics_engine_a, BG2Y)) == 0x02c);
static_assert((offsetof (struct graphics_engine_a, BG3PA)) == 0x030);
static_assert((offsetof (struct graphics_engine_a, BG3PB)) == 0x032);
static_assert((offsetof (struct graphics_engine_a, BG3PC)) == 0x034);
static_assert((offsetof (struct graphics_engine_a, BG3PD)) == 0x036);
static_assert((offsetof (struct graphics_engine_a, BG3X)) == 0x038);
static_assert((offsetof (struct graphics_engine_a, BG3Y)) == 0x03c);
static_assert((offsetof (struct graphics_engine_a, WIN0H)) == 0x040);
static_assert((offsetof (struct graphics_engine_a, WIN1H)) == 0x042);
static_assert((offsetof (struct graphics_engine_a, WIN0V)) == 0x044);
static_assert((offsetof (struct graphics_engine_a, WIN1V)) == 0x046);
static_assert((offsetof (struct graphics_engine_a, WININ)) == 0x048);
static_assert((offsetof (struct graphics_engine_a, WINOUT)) == 0x04a);
static_assert((offsetof (struct graphics_engine_a, MOSAIC)) == 0x04c);
static_assert((offsetof (struct graphics_engine_a, BLDCNT)) == 0x050);
static_assert((offsetof (struct graphics_engine_a, BLDALPHA)) == 0x052);
static_assert((offsetof (struct graphics_engine_a, BLDY)) == 0x054);
static_assert((offsetof (struct graphics_engine_a, DISP3DCNT)) == 0x060);
static_assert((offsetof (struct graphics_engine_a, DISPCAPCNT)) == 0x064);
static_assert((offsetof (struct graphics_engine_a, DISP_MMEM_FIFO)) == 0x068);
static_assert((offsetof (struct graphics_engine_a, MASTER_BRIGHT)) == 0x06c);
static_assert((offsetof (struct graphics_engine_a, DMA0SAD)) == 0x0b0);
static_assert((offsetof (struct graphics_engine_a, DMA0DAD)) == 0x0b4);
static_assert((offsetof (struct graphics_engine_a, DMA0CNT)) == 0x0b8);
static_assert((offsetof (struct graphics_engine_a, DMA1SAD)) == 0x0bc);
static_assert((offsetof (struct graphics_engine_a, DMA1DAD)) == 0x0c0);
static_assert((offsetof (struct graphics_engine_a, DMA1CNT)) == 0x0c4);
static_assert((offsetof (struct graphics_engine_a, DMA2SAD)) == 0x0c8);
static_assert((offsetof (struct graphics_engine_a, DMA2DAD)) == 0x0cc);
static_assert((offsetof (struct graphics_engine_a, DMA2CNT)) == 0x0d0);
static_assert((offsetof (struct graphics_engine_a, DMA3SAD)) == 0x0d4);
static_assert((offsetof (struct graphics_engine_a, DMA3DAD)) == 0x0d8);
static_assert((offsetof (struct graphics_engine_a, DMA3CNT)) == 0x0dc);
static_assert((offsetof (struct graphics_engine_a, TM0CNT_L)) == 0x100);
static_assert((offsetof (struct graphics_engine_a, TM0CNT_H)) == 0x102);
static_assert((offsetof (struct graphics_engine_a, TM1CNT_L)) == 0x104);
static_assert((offsetof (struct graphics_engine_a, TM1CNT_H)) == 0x106);
static_assert((offsetof (struct graphics_engine_a, TM2CNT_L)) == 0x108);
static_assert((offsetof (struct graphics_engine_a, TM2CNT_H)) == 0x10a);
static_assert((offsetof (struct graphics_engine_a, TM3CNT_L)) == 0x10c);
static_assert((offsetof (struct graphics_engine_a, TM3CNT_H)) == 0x10e);
static_assert((offsetof (struct graphics_engine_a, KEYINPUT)) == 0x130);
static_assert((offsetof (struct graphics_engine_a, KEYCNT)) == 0x132);
static_assert((offsetof (struct graphics_engine_a, EXMEMCNT)) == 0x204);
static_assert((offsetof (struct graphics_engine_a, IME)) == 0x208);
static_assert((offsetof (struct graphics_engine_a, IE)) == 0x210);
static_assert((offsetof (struct graphics_engine_a, IF)) == 0x214);
static_assert((offsetof (struct graphics_engine_a, VRAMCNT)) == 0x240);
static_assert((offsetof (struct graphics_engine_a, WVRAMCNT)) == 0x244);
static_assert((offsetof (struct graphics_engine_a, VRAM_HI_CNT)) == 0x248);
static_assert((offsetof (struct graphics_engine_a, DIVCNT)) == 0x280);
static_assert((offsetof (struct graphics_engine_a, DIV_NUMER)) == 0x290);
static_assert((offsetof (struct graphics_engine_a, DIV_DENOM)) == 0x298);
static_assert((offsetof (struct graphics_engine_a, DIV_RESULT)) == 0x2a0);
static_assert((offsetof (struct graphics_engine_a, DIVREM_RESULT)) == 0x2a8);
static_assert((offsetof (struct graphics_engine_a, SQRTCNT)) == 0x2b0);
static_assert((offsetof (struct graphics_engine_a, SQRT_RESULT)) == 0x2b4);
static_assert((offsetof (struct graphics_engine_a, SQRT_PARAM)) == 0x2b8);
static_assert((offsetof (struct graphics_engine_a, POWCNT)) == 0x304);
static_assert((offsetof (struct graphics_engine_a, RDLINES_COUNT)) == 0x320);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_0_L)) == 0x330);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_0_H)) == 0x332);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_1_L)) == 0x334);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_1_H)) == 0x336);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_2_L)) == 0x338);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_2_H)) == 0x33a);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_3_L)) == 0x33c);
static_assert((offsetof (struct graphics_engine_a, EDGE_COLOR_3_H)) == 0x33e);
static_assert((offsetof (struct graphics_engine_a, ALPHA_TEST_REF)) == 0x340);
static_assert((offsetof (struct graphics_engine_a, CLEAR_COLOR)) == 0x350);
static_assert((offsetof (struct graphics_engine_a, CLEAR_DEPTH)) == 0x354);
static_assert((offsetof (struct graphics_engine_a, CLRIMAGE_OFFSET)) == 0x356);
static_assert((offsetof (struct graphics_engine_a, FOG_COLOR)) == 0x358);
static_assert((offsetof (struct graphics_engine_a, FOG_OFFSET)) == 0x35c);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_0_L)) == 0x360);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_0_H)) == 0x362);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_1_L)) == 0x364);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_1_H)) == 0x366);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_2_L)) == 0x368);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_2_H)) == 0x36a);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_3_L)) == 0x36c);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_3_H)) == 0x36e);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_4_L)) == 0x370);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_4_H)) == 0x372);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_5_L)) == 0x374);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_5_H)) == 0x376);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_6_L)) == 0x378);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_6_H)) == 0x37a);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_7_L)) == 0x37c);
static_assert((offsetof (struct graphics_engine_a, FOG_TABLE_7_H)) == 0x37e);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_0_L)) == 0x380);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_0_H)) == 0x382);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_1_L)) == 0x384);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_1_H)) == 0x386);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_2_L)) == 0x388);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_2_H)) == 0x38a);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_3_L)) == 0x38c);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_3_H)) == 0x38e);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_4_L)) == 0x390);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_4_H)) == 0x392);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_5_L)) == 0x394);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_5_H)) == 0x396);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_6_L)) == 0x398);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_6_H)) == 0x39a);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_7_L)) == 0x39c);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_7_H)) == 0x39e);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_8_L)) == 0x3a0);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_8_H)) == 0x3a2);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_9_L)) == 0x3a4);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_9_H)) == 0x3a6);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_10_L)) == 0x3a8);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_10_H)) == 0x3aa);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_11_L)) == 0x3ac);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_11_H)) == 0x3ae);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_12_L)) == 0x3b0);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_12_H)) == 0x3b2);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_13_L)) == 0x3b4);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_13_H)) == 0x3b6);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_14_L)) == 0x3b8);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_14_H)) == 0x3ba);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_15_L)) == 0x3bc);
static_assert((offsetof (struct graphics_engine_a, TOON_TABLE_15_H)) == 0x3be);
static_assert((offsetof (struct graphics_engine_a, GXFIFO)) == 0x400);
static_assert((offsetof (struct graphics_engine_a, MTX_MODE)) == 0x440);
static_assert((offsetof (struct graphics_engine_a, MTX_PUSH)) == 0x444);
static_assert((offsetof (struct graphics_engine_a, MTX_POP)) == 0x448);
static_assert((offsetof (struct graphics_engine_a, MTX_STORE)) == 0x44c);
static_assert((offsetof (struct graphics_engine_a, MTX_RESTORE)) == 0x450);
static_assert((offsetof (struct graphics_engine_a, MTX_IDENTITY)) == 0x454);
static_assert((offsetof (struct graphics_engine_a, MTX_LOAD_4X4)) == 0x458);
static_assert((offsetof (struct graphics_engine_a, MTX_LOAD_4X3)) == 0x45c);
static_assert((offsetof (struct graphics_engine_a, MTX_MULT_4X4)) == 0x460);
static_assert((offsetof (struct graphics_engine_a, MTX_MULT_4X3)) == 0x464);
static_assert((offsetof (struct graphics_engine_a, MTX_MULT_3X3)) == 0x468);
static_assert((offsetof (struct graphics_engine_a, MTX_SCALE)) == 0x46c);
static_assert((offsetof (struct graphics_engine_a, MTX_TRANS)) == 0x470);
static_assert((offsetof (struct graphics_engine_a, COLOR)) == 0x480);
static_assert((offsetof (struct graphics_engine_a, NORMAL)) == 0x484);
static_assert((offsetof (struct graphics_engine_a, TEXCOORD)) == 0x488);
static_assert((offsetof (struct graphics_engine_a, VTX_16)) == 0x48c);
static_assert((offsetof (struct graphics_engine_a, VTX_10)) == 0x490);
static_assert((offsetof (struct graphics_engine_a, VTX_XY)) == 0x494);
static_assert((offsetof (struct graphics_engine_a, VTX_XZ)) == 0x498);
static_assert((offsetof (struct graphics_engine_a, VTX_YZ)) == 0x49c);
static_assert((offsetof (struct graphics_engine_a, VTX_DIFF)) == 0x4a0);
static_assert((offsetof (struct graphics_engine_a, POLYGON_ATTR)) == 0x4a4);
static_assert((offsetof (struct graphics_engine_a, TEXIMAGE_PARAM)) == 0x4a8);
static_assert((offsetof (struct graphics_engine_a, TEXPLTT_BASE)) == 0x4ac);
static_assert((offsetof (struct graphics_engine_a, DIF_AMB)) == 0x4c0);
static_assert((offsetof (struct graphics_engine_a, SPE_EMI)) == 0x4c4);
static_assert((offsetof (struct graphics_engine_a, LIGHT_VECTOR)) == 0x4c8);
static_assert((offsetof (struct graphics_engine_a, LIGHT_COLOR)) == 0x4cc);
static_assert((offsetof (struct graphics_engine_a, SHININESS)) == 0x4d0);
static_assert((offsetof (struct graphics_engine_a, BEGIN_VTXS)) == 0x500);
static_assert((offsetof (struct graphics_engine_a, END_VTXS)) == 0x504);
static_assert((offsetof (struct graphics_engine_a, SWAP_BUFFERS)) == 0x540);
static_assert((offsetof (struct graphics_engine_a, VIEWPORT)) == 0x580);
static_assert((offsetof (struct graphics_engine_a, BOX_TEST)) == 0x5c0);
static_assert((offsetof (struct graphics_engine_a, POS_TEST)) == 0x5c4);
static_assert((offsetof (struct graphics_engine_a, VEC_TEST)) == 0x5c8);
static_assert((offsetof (struct graphics_engine_a, GXSTAT)) == 0x600);
static_assert((offsetof (struct graphics_engine_a, LISTRAM_COUNT)) == 0x604);
static_assert((offsetof (struct graphics_engine_a, VTXRAM_COUNT)) == 0x606);
static_assert((offsetof (struct graphics_engine_a, DISP_1DOT_DEPTH)) == 0x610);
static_assert((offsetof (struct graphics_engine_a, POS_RESULT_X)) == 0x620);
static_assert((offsetof (struct graphics_engine_a, POS_RESULT_Y)) == 0x624);
static_assert((offsetof (struct graphics_engine_a, POS_RESULT_Z)) == 0x628);
static_assert((offsetof (struct graphics_engine_a, POS_RESULT_W)) == 0x62c);
static_assert((offsetof (struct graphics_engine_a, VEC_RESULT_X)) == 0x630);
static_assert((offsetof (struct graphics_engine_a, VEC_RESULT_Y)) == 0x632);
static_assert((offsetof (struct graphics_engine_a, VEC_RESULT_Z)) == 0x634);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_0)) == 0x640);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_1)) == 0x644);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_2)) == 0x648);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_3)) == 0x64c);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_4)) == 0x650);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_5)) == 0x654);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_6)) == 0x658);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_7)) == 0x65c);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_8)) == 0x660);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_9)) == 0x664);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_10)) == 0x668);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_11)) == 0x66c);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_12)) == 0x670);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_13)) == 0x674);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_14)) == 0x678);
static_assert((offsetof (struct graphics_engine_a, CLIPMTX_RESULT_15)) == 0x67c);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_0)) == 0x680);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_1)) == 0x684);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_2)) == 0x688);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_3)) == 0x68c);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_4)) == 0x690);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_5)) == 0x694);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_6)) == 0x698);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_7)) == 0x69c);
static_assert((offsetof (struct graphics_engine_a, VECMTX_RESULT_8)) == 0x6a0);

View File

@ -43,39 +43,39 @@ struct graphics_engine_a {
volatile uint8_t _pad2[22];
volatile uint16_t DB_MASTER_BRIGHT;
};
static_assert((offsetof (struct graphics_engine_a, DB_DISPCNT)) == 0);
static_assert((offsetof (struct graphics_engine_a, DB_BG0CNT)) == 8);
static_assert((offsetof (struct graphics_engine_a, DB_BG1CNT)) == 10);
static_assert((offsetof (struct graphics_engine_a, DB_BG2CNT)) == 12);
static_assert((offsetof (struct graphics_engine_a, DB_BG3CNT)) == 14);
static_assert((offsetof (struct graphics_engine_a, DB_BG0HOFS)) == 16);
static_assert((offsetof (struct graphics_engine_a, DB_BG0VOFS)) == 18);
static_assert((offsetof (struct graphics_engine_a, DB_BG1HOFS)) == 20);
static_assert((offsetof (struct graphics_engine_a, DB_BG1VOFS)) == 22);
static_assert((offsetof (struct graphics_engine_a, DB_BG2HOFS)) == 24);
static_assert((offsetof (struct graphics_engine_a, DB_BG2VOFS)) == 26);
static_assert((offsetof (struct graphics_engine_a, DB_BG3HOFS)) == 28);
static_assert((offsetof (struct graphics_engine_a, DB_BG3VOFS)) == 30);
static_assert((offsetof (struct graphics_engine_a, DB_BG2PA)) == 32);
static_assert((offsetof (struct graphics_engine_a, DB_BG2PB)) == 34);
static_assert((offsetof (struct graphics_engine_a, DB_BG2PC)) == 36);
static_assert((offsetof (struct graphics_engine_a, DB_BG2PD)) == 38);
static_assert((offsetof (struct graphics_engine_a, DB_BG2X)) == 40);
static_assert((offsetof (struct graphics_engine_a, DB_BG2Y)) == 44);
static_assert((offsetof (struct graphics_engine_a, DB_BG3PA)) == 48);
static_assert((offsetof (struct graphics_engine_a, DB_BG3PB)) == 50);
static_assert((offsetof (struct graphics_engine_a, DB_BG3PC)) == 52);
static_assert((offsetof (struct graphics_engine_a, DB_BG3PD)) == 54);
static_assert((offsetof (struct graphics_engine_a, DB_BG3X)) == 56);
static_assert((offsetof (struct graphics_engine_a, DB_BG3Y)) == 60);
static_assert((offsetof (struct graphics_engine_a, DB_WIN0H)) == 64);
static_assert((offsetof (struct graphics_engine_a, DB_WIN1H)) == 66);
static_assert((offsetof (struct graphics_engine_a, DB_WIN0V)) == 68);
static_assert((offsetof (struct graphics_engine_a, DB_WIN1V)) == 70);
static_assert((offsetof (struct graphics_engine_a, DB_WININ)) == 72);
static_assert((offsetof (struct graphics_engine_a, DB_WINOUT)) == 74);
static_assert((offsetof (struct graphics_engine_a, DB_MOSAIC)) == 76);
static_assert((offsetof (struct graphics_engine_a, DB_BLDCNT)) == 80);
static_assert((offsetof (struct graphics_engine_a, DB_BLDALPHA)) == 82);
static_assert((offsetof (struct graphics_engine_a, DB_BLDY)) == 84);
static_assert((offsetof (struct graphics_engine_a, DB_MASTER_BRIGHT)) == 108);
static_assert((offsetof (struct graphics_engine_a, DB_DISPCNT)) == 0x000);
static_assert((offsetof (struct graphics_engine_a, DB_BG0CNT)) == 0x008);
static_assert((offsetof (struct graphics_engine_a, DB_BG1CNT)) == 0x00a);
static_assert((offsetof (struct graphics_engine_a, DB_BG2CNT)) == 0x00c);
static_assert((offsetof (struct graphics_engine_a, DB_BG3CNT)) == 0x00e);
static_assert((offsetof (struct graphics_engine_a, DB_BG0HOFS)) == 0x010);
static_assert((offsetof (struct graphics_engine_a, DB_BG0VOFS)) == 0x012);
static_assert((offsetof (struct graphics_engine_a, DB_BG1HOFS)) == 0x014);
static_assert((offsetof (struct graphics_engine_a, DB_BG1VOFS)) == 0x016);
static_assert((offsetof (struct graphics_engine_a, DB_BG2HOFS)) == 0x018);
static_assert((offsetof (struct graphics_engine_a, DB_BG2VOFS)) == 0x01a);
static_assert((offsetof (struct graphics_engine_a, DB_BG3HOFS)) == 0x01c);
static_assert((offsetof (struct graphics_engine_a, DB_BG3VOFS)) == 0x01e);
static_assert((offsetof (struct graphics_engine_a, DB_BG2PA)) == 0x020);
static_assert((offsetof (struct graphics_engine_a, DB_BG2PB)) == 0x022);
static_assert((offsetof (struct graphics_engine_a, DB_BG2PC)) == 0x024);
static_assert((offsetof (struct graphics_engine_a, DB_BG2PD)) == 0x026);
static_assert((offsetof (struct graphics_engine_a, DB_BG2X)) == 0x028);
static_assert((offsetof (struct graphics_engine_a, DB_BG2Y)) == 0x02c);
static_assert((offsetof (struct graphics_engine_a, DB_BG3PA)) == 0x030);
static_assert((offsetof (struct graphics_engine_a, DB_BG3PB)) == 0x032);
static_assert((offsetof (struct graphics_engine_a, DB_BG3PC)) == 0x034);
static_assert((offsetof (struct graphics_engine_a, DB_BG3PD)) == 0x036);
static_assert((offsetof (struct graphics_engine_a, DB_BG3X)) == 0x038);
static_assert((offsetof (struct graphics_engine_a, DB_BG3Y)) == 0x03c);
static_assert((offsetof (struct graphics_engine_a, DB_WIN0H)) == 0x040);
static_assert((offsetof (struct graphics_engine_a, DB_WIN1H)) == 0x042);
static_assert((offsetof (struct graphics_engine_a, DB_WIN0V)) == 0x044);
static_assert((offsetof (struct graphics_engine_a, DB_WIN1V)) == 0x046);
static_assert((offsetof (struct graphics_engine_a, DB_WININ)) == 0x048);
static_assert((offsetof (struct graphics_engine_a, DB_WINOUT)) == 0x04a);
static_assert((offsetof (struct graphics_engine_a, DB_MOSAIC)) == 0x04c);
static_assert((offsetof (struct graphics_engine_a, DB_BLDCNT)) == 0x050);
static_assert((offsetof (struct graphics_engine_a, DB_BLDALPHA)) == 0x052);
static_assert((offsetof (struct graphics_engine_a, DB_BLDY)) == 0x054);
static_assert((offsetof (struct graphics_engine_a, DB_MASTER_BRIGHT)) == 0x06c);