diff --git a/src/test/kc/struct-ptr-35.c b/src/test/kc/struct-ptr-35.c new file mode 100644 index 000000000..8b97f2d14 --- /dev/null +++ b/src/test/kc/struct-ptr-35.c @@ -0,0 +1,22 @@ +struct Tile { + dword *Tiles; + word Offset; + byte Count; + char Name[20]; +}; + +dword PlayerSprites[12]; +dword Enemy2Sprites[12]; + +struct Tile S1 = {PlayerSprites, 20, 64, "Sven" }; +struct Tile S2 = {Enemy2Sprites, 50, 128, "Jesper" }; +struct Tile *TileDB[2] = {&S1, &S2}; + +void main() { + char * const SCREEN = 0x0400; + + for(int i:0..1) { + struct Tile *tile = TileDB[i]; + SCREEN[i] = tile->Count; + } +}