Skip to content

Instantly share code, notes, and snippets.

@remy
Last active January 29, 2022 11:36
Show Gist options
  • Save remy/bdb7280dcc31529be2ad7f5fd412fae6 to your computer and use it in GitHub Desktop.
Save remy/bdb7280dcc31529be2ad7f5fd412fae6 to your computer and use it in GitHub Desktop.

I get red snake on "Tiles" in main.c line 12 (when only the main.c is open) - no idea why.

Can anyone advise?

The error is:

identifier "Tiles" is undefinedC/C++(20)

{
"//": "note that this file lives in .vscode/ not the root",
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}",
"/opt/gbdk/include"
],
"defines": [],
"macFrameworkPath": [],
"compilerPath": "/usr/local/bin/arm-none-eabi-gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "macos-gcc-arm"
}
],
"version": 4
}
#include <gb/gb.h>
#include <stdio.h>
#include "Tiles.c"
void main()
{
set_bkg_data(0, 16, Tiles); // red snakes here
DISPLAY_ON;
}
/*
TILES.C
Tile Source File.
Info:
Form : All tiles as one unit.
Format : Gameboy 4 color.
Compression : None.
Counter : None.
Tile size : 8 x 8
Tiles : 0 to 16
Palette colors : None.
SGB Palette : None.
CGB Palette : None.
Convert to metatiles : No.
This file was generated by GBTD v2.2
*/
/* Start of tile array. */
unsigned char Tiles[] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,
0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,
0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,
0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x00,0x00,0x7E,0x00,0x7E,0x00,0x7E,0x00,
0x7E,0x00,0x7E,0x00,0x7E,0x00,0x00,0x00,
0x00,0x00,0x00,0x7E,0x00,0x7E,0x00,0x7E,
0x00,0x7E,0x00,0x7E,0x00,0x7E,0x00,0x00,
0x00,0x00,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,
0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x00,0x00,
0xFF,0x00,0x81,0x00,0x81,0x00,0x81,0x00,
0x81,0x00,0x81,0x00,0x81,0x00,0xFF,0x00,
0xFF,0x00,0x81,0x7E,0x81,0x7E,0x81,0x7E,
0x81,0x7E,0x81,0x7E,0x81,0x7E,0xFF,0x00,
0xFF,0x00,0xFF,0x7E,0xFF,0x7E,0xFF,0x7E,
0xFF,0x7E,0xFF,0x7E,0xFF,0x7E,0xFF,0x00,
0x00,0xFF,0x00,0x81,0x00,0x81,0x00,0x81,
0x00,0x81,0x00,0x81,0x00,0x81,0x00,0xFF,
0x00,0xFF,0x7E,0x81,0x7E,0x81,0x7E,0x81,
0x7E,0x81,0x7E,0x81,0x7E,0x81,0x00,0xFF,
0x00,0xFF,0x7E,0xFF,0x7E,0xFF,0x7E,0xFF,
0x7E,0xFF,0x7E,0xFF,0x7E,0xFF,0x00,0xFF,
0xAA,0x00,0x55,0x00,0xAA,0x00,0x55,0x00,
0xAA,0x00,0x55,0x00,0xAA,0x00,0x55,0x00,
0xAA,0xAA,0x55,0x55,0xAA,0xAA,0x55,0x55,
0xAA,0xAA,0x55,0x55,0xAA,0xAA,0x55,0x55,
0xAA,0xFF,0x55,0xFF,0xAA,0xFF,0x55,0xFF,
0xAA,0xFF,0x55,0xFF,0xAA,0xFF,0x55,0xFF,
0xFF,0xAA,0xFF,0x55,0xFF,0xAA,0xFF,0x55,
0xFF,0xAA,0xFF,0x55,0xFF,0xAA,0xFF,0x55
};
/* End of TILES.C */
/*
TILES.H
Include File.
Info:
Form : All tiles as one unit.
Format : Gameboy 4 color.
Compression : None.
Counter : None.
Tile size : 8 x 8
Tiles : 0 to 16
Palette colors : None.
SGB Palette : None.
CGB Palette : None.
Convert to metatiles : No.
This file was generated by GBTD v2.2
*/
/* Bank of tiles. */
#define TilesBank 0
/* Start of tile array. */
extern unsigned char Tiles[];
/* End of TILES.H */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment