title screen background tiles and palettes

This commit is contained in:
YamaArashi
2015-11-24 01:41:14 -08:00
parent 066d199fe3
commit 69d1b312f6
10 changed files with 338 additions and 16 deletions
+3 -3
View File
@@ -292,10 +292,10 @@ void ReadGbaPalette(char *path, struct Palette *palette)
int fileSize;
unsigned char *data = ReadWholeFile(path, &fileSize);
palette->numColors = fileSize / 2;
if (fileSize % 2 != 0)
FATAL_ERROR("The file size (%d) is not a multiple of 2.\n", fileSize);
if (palette->numColors != 16 && palette->numColors != 256)
FATAL_ERROR("\"%s\" contains %d colors, but the number of colors must be 16 or 256.\n", path, palette->numColors);
palette->numColors = fileSize / 2;
for (int i = 0; i < palette->numColors; i++) {
uint16_t paletteEntry = (data[i * 2 + 1] << 8) | data[i * 2];