/*---------------------------------------------------------------------------------


    Konami Logo for SNES Projects
    Author: digifox


---------------------------------------------------------------------------------*/
#include <snes.h>
#include "soundbank.h"

// ROM

#define BG0 0
#define BG1 1
#define BG2 2
#define BG3 3

#define PAL0 0
#define PAL1 1
#define PAL2 2
#define PAL3 3
#define PAL4 4
#define PAL5 5
#define PAL6 6
#define PAL7 7

#define transparentColor RGB5(0x1F, 0x00, 0x1F)
#define blackColor RGB5(0x00, 0x00, 0x00)

extern char SOUNDBANK__;

const u8 emptyPicture[] = {
    // First part
    0b00000000, 0b00000000, // Bit plane 1 + Bit plane 0
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000,

    // Second part
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000, 
    0b00000000, 0b00000000
};

// BG1
extern char companyFirePic, companyFirePic_end;
extern char companyFirePalette;

const u16 companyFireTileMap[] = {
// 1st page
00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 
01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 01 | (PAL6<<10), 
14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 14 | (PAL6<<10), 
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 
00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10),

// 2nd page
00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 
11 | (PAL6<<10), 12 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10),
24 | (PAL6<<10), 25 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10), 13 | (PAL6<<10),
00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 
00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10)
};

const u16 transparentCompanyTile[] = {
00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10), 00 | (PAL6<<10)
};

const u16 transparentCompanyFireLine2[] = {
02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10), 02 | (PAL6<<10),
15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10), 15 | (PAL6<<10)
};

const u16 transparentCompanyFireLine3[] = {
03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 03 | (PAL6<<10), 
16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10), 16 | (PAL6<<10)
};

const u16 transparentCompanyFireLine4[] = {
04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 04 | (PAL6<<10), 
17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10), 17 | (PAL6<<10)
};

// BG2
extern char companyLogoPic, companyLogoPic_end;
extern char companyLogoPalette;
const u16 companyLogoTileMap[] = {
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, 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, 0, 0, 0, 0, 0, 0, 0, 69 | (PAL4<<10), 70 | (PAL4<<10), 71 | (PAL4<<10), 72 | (PAL4<<10), 73 | (PAL4<<10), 74 | (PAL4<<10), 75 | (PAL4<<10), 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, 76 | (PAL4<<10), 77 | (PAL4<<10), 78 | (PAL4<<10), 79 | (PAL4<<10), 80 | (PAL4<<10), 81 | (PAL4<<10), 82 | (PAL4<<10), 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, 83 | (PAL4<<10), 84 | (PAL4<<10), 85 | (PAL4<<10), 86 | (PAL4<<10), 87 | (PAL4<<10), 88 | (PAL4<<10), 89 | (PAL4<<10), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90 | (PAL4<<10), 91 | (PAL4<<10), 92 | (PAL4<<10), 93 | (PAL4<<10), 94 | (PAL4<<10), 95 | (PAL4<<10), 96 | (PAL4<<10), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97 | (PAL4<<10), 98 | (PAL4<<10), 99 | (PAL4<<10), 100 | (PAL4<<10), 101 | (PAL4<<10), 102 | (PAL4<<10), 103 | (PAL4<<10), 104 | (PAL4<<10), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 105 | (PAL4<<10), 106 | (PAL4<<10), 107 | (PAL4<<10), 108 | (PAL4<<10), 109 | (PAL4<<10), 110 | (PAL4<<10), 111 | (PAL4<<10), 112 | (PAL4<<10), 113 | (PAL4<<10), 114 | (PAL4<<10), 0, 69 | (PAL5<<10), 70 | (PAL5<<10), 71 | (PAL5<<10), 72 | (PAL5<<10), 73 | (PAL5<<10), 74 | (PAL5<<10), 75 | (PAL5<<10), 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 115 | (PAL4<<10), 116 | (PAL4<<10), 117 | (PAL4<<10), 118 | (PAL4<<10), 119 | (PAL4<<10), 120 | (PAL4<<10), 121 | (PAL4<<10), 0, 0, 0, 0, 0, 76 | (PAL5<<10), 77 | (PAL5<<10), 78 | (PAL5<<10), 79 | (PAL5<<10), 80 | (PAL5<<10), 81 | (PAL5<<10), 82 | (PAL5<<10), 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 122 | (PAL4<<10), 123 | (PAL4<<10), 124 | (PAL4<<10), 125 | (PAL4<<10), 126 | (PAL4<<10), 127 | (PAL4<<10), 128 | (PAL4<<10), 0, 0, 0, 0, 0, 0, 83 | (PAL5<<10), 84 | (PAL5<<10), 85 | (PAL5<<10), 86 | (PAL5<<10), 87 | (PAL5<<10), 88 | (PAL5<<10), 89 | (PAL5<<10), 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 129 | (PAL4<<10), 130 | (PAL4<<10), 131 | (PAL4<<10), 132 | (PAL4<<10), 133 | (PAL4<<10), 134 | (PAL4<<10), 135 | (PAL4<<10), 0, 0, 0, 0, 0, 90 | (PAL5<<10), 91 | (PAL5<<10), 92 | (PAL5<<10), 93 | (PAL5<<10), 94 | (PAL5<<10), 95 | (PAL5<<10), 96 | (PAL5<<10), 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 136 | (PAL4<<10), 137 | (PAL4<<10), 138 | (PAL4<<10), 139 | (PAL4<<10), 140 | (PAL4<<10), 141 | (PAL4<<10), 142 | (PAL4<<10), 0, 0, 0, 97 | (PAL5<<10), 98 | (PAL5<<10), 99 | (PAL5<<10), 100 | (PAL5<<10), 101 | (PAL5<<10), 102 | (PAL5<<10), 103 | (PAL5<<10), 104 | (PAL5<<10), 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 143 | (PAL4<<10), 144 | (PAL4<<10), 145 | (PAL4<<10), 146 | (PAL4<<10), 147 | (PAL4<<10), 148 | (PAL4<<10), 149 | (PAL4<<10), 105 | (PAL5<<10), 106 | (PAL5<<10), 107 | (PAL5<<10), 108 | (PAL5<<10), 109 | (PAL5<<10), 110 | (PAL5<<10), 111 | (PAL5<<10), 112 | (PAL5<<10), 113 | (PAL5<<10), 114 | (PAL5<<10), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115 | (PAL5<<10), 116 | (PAL5<<10), 117 | (PAL5<<10), 118 | (PAL5<<10), 119 | (PAL5<<10), 120 | (PAL5<<10), 121 | (PAL5<<10), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122 | (PAL5<<10), 123 | (PAL5<<10), 124 | (PAL5<<10), 125 | (PAL5<<10), 126 | (PAL5<<10), 127 | (PAL5<<10), 128 | (PAL5<<10), 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, 129 | (PAL5<<10), 130 | (PAL5<<10), 131 | (PAL5<<10), 132 | (PAL5<<10), 133 | (PAL5<<10), 134 | (PAL5<<10), 135 | (PAL5<<10), 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, 136 | (PAL5<<10), 137 | (PAL5<<10), 138 | (PAL5<<10), 139 | (PAL5<<10), 140 | (PAL5<<10), 141 | (PAL5<<10), 142 | (PAL5<<10), 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, 143 | (PAL5<<10), 144 | (PAL5<<10), 145 | (PAL5<<10), 146 | (PAL5<<10), 147 | (PAL5<<10), 148 | (PAL5<<10), 149 | (PAL5<<10), 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, 68 | (PAL3<<10), 1 | (PAL3<<10), 2 | (PAL3<<10), 3 | (PAL3<<10), 4 | (PAL3<<10), 5 | (PAL3<<10), 6 | (PAL3<<10), 7 | (PAL3<<10), 8 | (PAL3<<10), 9 | (PAL3<<10), 10 | (PAL3<<10), 11 | (PAL3<<10), 12 | (PAL3<<10), 13 | (PAL3<<10), 14 | (PAL3<<10), 15 | (PAL3<<10), 16 | (PAL3<<10), 17 | (PAL3<<10), 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 18 | (PAL3<<10), 19 | (PAL3<<10), 20 | (PAL3<<10), 21 | (PAL3<<10), 22 | (PAL3<<10), 23 | (PAL3<<10), 24 | (PAL3<<10), 25 | (PAL3<<10), 26 | (PAL3<<10), 27 | (PAL3<<10), 28 | (PAL3<<10), 29 | (PAL3<<10), 30 | (PAL3<<10), 31 | (PAL3<<10), 32 | (PAL3<<10), 33 | (PAL3<<10), 34 | (PAL3<<10), 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 35 | (PAL3<<10), 36 | (PAL3<<10), 37 | (PAL3<<10), 38 | (PAL3<<10), 39 | (PAL3<<10), 40 | (PAL3<<10), 41 | (PAL3<<10), 42 | (PAL3<<10), 43 | (PAL3<<10), 44 | (PAL3<<10), 45 | (PAL3<<10), 46 | (PAL3<<10), 47 | (PAL3<<10), 48 | (PAL3<<10), 49 | (PAL3<<10), 50 | (PAL3<<10), 51 | (PAL3<<10), 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 52 | (PAL3<<10), 53 | (PAL3<<10), 54 | (PAL3<<10), 55 | (PAL3<<10), 56 | (PAL3<<10), 57 | (PAL3<<10), 58 | (PAL3<<10), 52 | (PAL3<<10), 59 | (PAL3<<10), 60 | (PAL3<<10), 61 | (PAL3<<10), 62 | (PAL3<<10), 63 | (PAL3<<10), 64 | (PAL3<<10), 65 | (PAL3<<10), 66 | (PAL3<<10), 67 | (PAL3<<10), 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, 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, 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,
};

const u16 logoDarkPalette[] = {
    transparentColor, 
    RGB5(0x00, 0x00, 0x00),

    RGB5(0x00, 0x00, 0x0C), 
    RGB5(0x00, 0x00, 0x11), 
    RGB5(0x00, 0x00, 0x16), 
    RGB5(0x00, 0x00, 0x1F),

    RGB5(0x00, 0x00, 0x00),
    RGB5(0x00, 0x00, 0x00),
    RGB5(0x00, 0x00, 0x00),
    RGB5(0x00, 0x00, 0x00),
    RGB5(0x00, 0x00, 0x00),
    RGB5(0x00, 0x00, 0x00),
    RGB5(0x00, 0x00, 0x00),
    RGB5(0x00, 0x01, 0x00),
    RGB5(0x00, 0x00, 0x00),
    RGB5(0x00, 0x00, 0x00)
};

// Type

typedef enum LogoState {
    LogoStateStart = 0,
    LogoStateContinue,
    LogoStateBiggerLine,
    LogoStateDiscover,
    LogoStateDark,
    LogoStateWillChangeLogoFlags,
    LogoStateWillChangeLogo,
    LogoStateWillFinish,
    LogoStateDidFinish
} LogoState;

// RAM

u16 konamiLogoPalette[] = {
    transparentColor, 
    RGB5(0x1F, 0x1F, 0x1F),

    RGB5(0x1B, 0x1B, 0x1B),
    RGB5(0x15, 0x15, 0x15),
    RGB5(0x10, 0x10, 0x10),
    RGB5(0x05, 0x05, 0x05),

    RGB5(0x16, 0x16, 0x19),
    RGB5(0x14, 0x14, 0x17),
    RGB5(0x12, 0x12, 0x15),
    RGB5(0x10, 0x10, 0x13),
    RGB5(0x0F, 0x0F, 0x12),
    RGB5(0x0D, 0x0D, 0x10),
    RGB5(0x0B, 0x0B, 0x0E),
    RGB5(0x0A, 0x0A, 0x0D),
    RGB5(0x08, 0x08, 0x0B),
    RGB5(0x05, 0x05, 0x08),
};

u16 yellowLogoPalette[] = {
    transparentColor, 
    RGB5(0x1F, 0x1F, 0x1F),

    RGB5(0x1E, 0x13, 0x00), 
    RGB5(0x1B, 0x11, 0x00), 
    RGB5(0x19, 0x0F, 0x00),
    RGB5(0x15, 0x0B, 0x01),

    RGB5(0x1F, 0x1C, 0x00),
    RGB5(0x1E, 0x1A, 0x00),
    RGB5(0x1D, 0x18, 0x00),
    RGB5(0x1C, 0x16, 0x00),
    RGB5(0x1B, 0x14, 0x00),
    RGB5(0x1A, 0x13, 0x00),
    RGB5(0x1A, 0x11, 0x00),
    RGB5(0x19, 0x0F, 0x00),
    RGB5(0x18, 0x0D, 0x00),
    RGB5(0x16, 0x0A, 0x00)
};

u16 redLogoPalette[] = {
    transparentColor, 
    RGB5(0x1F, 0x1F, 0x1F),

    RGB5(0x1E, 0x0D, 0x00), 
    RGB5(0x1B, 0x0A, 0x00), 
    RGB5(0x18, 0x08, 0x00),
    RGB5(0x12, 0x04, 0x01),

    RGB5(0x1F, 0x10, 0x00),
    RGB5(0x1E, 0x0C, 0x00),
    RGB5(0x1D, 0x08, 0x00),
    RGB5(0x1B, 0x00, 0x00),
    RGB5(0x19, 0x00, 0x00),
    RGB5(0x17, 0x00, 0x00),
    RGB5(0x15, 0x00, 0x00),
    RGB5(0x13, 0x00, 0x01),
    RGB5(0x11, 0x00, 0x01),
    RGB5(0x0E, 0x01, 0x02),
};

u16 framesCounter;
u8 logoBackgroundColor;
u8 logoFlagsSpeed;
u8 logoFlagsTimer;
u8 logoElementIndex;
u16 logoFirePosX;
u16 logoFirePosY;
u16 logoFirePosYOffset;
u16 logoLineOffset;
u16 logoBuffer1[] = { 5 | (PAL6<<10), 6 | (PAL6<<10) };
LogoState logoState;
u8 logoFireState;
u16 bg3TileMap[1024];
u16 palEntryTemp;
u16 bgTileIndex;

/*!\brief Load the logo music.
*/
void initLogoMusic() {
    spcSetBank(&SOUNDBANK__);
    spcLoad(0);
}

/*!\brief Copy the given background palette to CGRAM.
    \param palette the palette data
    \param paletteNumber the palette number
*/
void initBackgroundPalette(u8 *palette, u16 paletteNumber) {
    dmaCopyCGram(palette, paletteNumber<<4, 32);
}

/*!\brief Insert an element in an array.
    \param array the array of elements.
    \param index the index of the element to insert.
    \param value the value of the element to insert.
*/
void insertElement(u16 array[], u8 index, u16 value) {
    // Shift elements to make space for the new element
    logoElementIndex = 6;
    while (logoElementIndex < 15) {
        array[logoElementIndex] = array[logoElementIndex + 1];
        logoElementIndex++;
    }

    // Insert the new element at the specified index
    array[15] = value;
}

/*!\brief Set all the tiles to 0, set a palette number and a tile priority.
*/
void clearBgTextEx(u16 *tileMap, u8 paletteNumber, u8 priority) {
    for (bgTileIndex=0; bgTileIndex < 1024;) {
        tileMap[bgTileIndex] = 0 | (paletteNumber<<10) | (priority<<13);
        bgTileIndex += 1;
    }
}

/*!\brief Create a black background on B3.
*/
void initBg3Black() {
    bgSetMapPtr(BG2, 0x0000 + 2048, SC_32x32);
    bgSetGfxPtr(BG2, 0x5000);
    clearBgTextEx((u16 *)bg3TileMap, PAL0, 0);
    WaitForVBlank();
    setPaletteColor(PAL0, blackColor);
    dmaCopyVram((u8 *)bg3TileMap, 0x1000, 32*32*2);
    dmaCopyVram((u8 *)emptyPicture, 0x5000, 32);
}

/*!\brief Initialize the Konami logo screen.
*/
void initKonamiLogo() {
    dmaClearVram();

    logoState = LogoStateStart;
    framesCounter = 0;
    logoFlagsSpeed = 0;
    logoFirePosX = 256;
    logoFirePosY = 256;
    logoFirePosYOffset = 0;
    logoLineOffset = 0;
    logoFireState = 0;

    // Load company fire on BG1
    bgSetMapPtr(BG0, 0x0000, SC_64x32);
    bgInitTileSet(BG0, 
        &companyFirePic,
        &companyFirePalette,
        PAL6,
        (&companyFirePic_end - &companyFirePic),
        16*2,
        BG_16COLORS,
        0x2000);
    WaitForVBlank();
    dmaCopyVram((u8 *)companyFireTileMap, 0x0000, 64*32*2);

    // Load company logo on BG2
    bgSetMapPtr(BG1, 0x0000 + 2048, SC_32x32);
    bgInitTileSet(BG1, 
        &companyLogoPic,
        &companyLogoPalette,
        PAL3,
        (&companyLogoPic_end - &companyLogoPic),
        16*2*3,
        BG_16COLORS,
        0x3000);
    WaitForVBlank();
    initBackgroundPalette((u8 *)logoDarkPalette, PAL3);
    initBackgroundPalette((u8 *)logoDarkPalette, PAL4);
    initBackgroundPalette((u8 *)logoDarkPalette, PAL5);
    dmaCopyVram((u8 *)companyLogoTileMap, 0x0000 + 2048, 32*32*2);

    initBg3Black();

    bgSetScroll(BG0, logoFirePosX, logoFirePosY);

    WaitForVBlank();
    initLogoMusic();
    WaitForVBlank();
    
    setMode(BG_MODE1, 0);
    bgSetDisable(BG0);
    bgSetDisable(BG1);
    bgSetEnable(BG2);
    bgSetDisable(BG3);

    setFadeEffect(FADE_IN);
	WaitForVBlank();
}

/*!\brief Update the Konami logo animation.
    \return 1 when the logo animation is complete, 0 otherwise.
*/
u8 updateKonamiLogo() {
    switch(logoState) {
        case LogoStateStart:
            bgSetScroll(BG0, 256, 0);
            bgSetEnable(BG0);
            bgSetEnable(BG1);
            logoState = LogoStateContinue;
            break;

        case LogoStateContinue:
            if (logoFirePosX > 0) {
                logoFirePosX -= 8;
                bgSetScroll(BG0, logoFirePosX, logoFirePosY);

                if (logoFireState == 0) {
                    logoBuffer1[0] = 11 | (PAL6<<10);
                    logoBuffer1[1] = 12 | (PAL6<<10);
                    dmaCopyVram((u8 *)logoBuffer1, 0x0000 + 1024 + 32, 2*2);
    
                    logoBuffer1[0] = 24 | (PAL6<<10);
                    logoBuffer1[1] = 25 | (PAL6<<10);
                    dmaCopyVram((u8 *)logoBuffer1, 0x0000 + 1024 + 64, 2*2);

                } else if (logoFireState == 8) {
                    logoBuffer1[0] = 5 | (PAL6<<10);
                    logoBuffer1[1] = 6 | (PAL6<<10);
                    dmaCopyVram((u8 *)logoBuffer1, 0x0000 + 1024 + 32, 2*2);
    
                    logoBuffer1[0] = 18 | (PAL6<<10);
                    logoBuffer1[1] = 19 | (PAL6<<10);
                    dmaCopyVram((u8 *)logoBuffer1, 0x0000 + 1024 + 64, 2*2);

                } else if (logoFireState == 16) {
                    logoBuffer1[0] = 7 | (PAL6<<10);
                    logoBuffer1[1] = 8 | (PAL6<<10);
                    dmaCopyVram((u8 *)logoBuffer1, 0x0000 + 1024 + 32, 2*2);
    
                    logoBuffer1[0] = 20 | (PAL6<<10);
                    logoBuffer1[1] = 21 | (PAL6<<10);
                    dmaCopyVram((u8 *)logoBuffer1, 0x0000 + 1024 + 64, 2*2);

                } else if (logoFireState == 24) {
                    logoBuffer1[0] = 9 | (PAL6<<10);
                    logoBuffer1[1] = 10 | (PAL6<<10);
                    dmaCopyVram((u8 *)logoBuffer1, 0x0000 + 1024 + 32, 2*2);
    
                    logoBuffer1[0] = 22 | (PAL6<<10);
                    logoBuffer1[1] = 23 | (PAL6<<10);
                    dmaCopyVram((u8 *)logoBuffer1, 0x0000 + 1024 + 64, 2*2);

                } else if (logoFireState == 32) {
                    logoFireState = 0;
                }

                logoFireState += 4;
                
            } else {
                logoState = LogoStateBiggerLine;
                logoFireState = 0;
            }
            break;

        case LogoStateBiggerLine:
            if (logoFireState == 4) {
                dmaCopyVram((u8 *)transparentCompanyFireLine2, 0x0000 + 32, 64*2);

            } else if (logoFireState == 8) {
                dmaCopyVram((u8 *)transparentCompanyFireLine3, 0x0000 + 32, 64*2);

            } else if (logoFireState == 12) {
                dmaCopyVram((u8 *)transparentCompanyFireLine4, 0x0000 + 32, 64*2);

            } else if (logoFireState == 15) {
                logoState = LogoStateDiscover;
            }

            logoFireState += 1;
            break;

        case LogoStateDiscover:
            if (logoFirePosY == 32) {
                logoState = LogoStateDark;

            } else {
                logoFirePosY -= 2;
                logoFirePosYOffset += 2;
                bgSetScroll(BG0, logoFirePosX, logoFirePosY);

                if (logoFirePosYOffset == 8) {
                    logoLineOffset += 1;
                    dmaCopyVram((u8 *)transparentCompanyTile, 0x0000 + (1024 - (logoLineOffset << 5)), 32*2);
                    logoFirePosYOffset = 0;
                }
            }
            break;

        case LogoStateDark:
            if (framesCounter == 128 + 60) {
                dmaCopyCGram(&companyLogoPalette + 32, PAL4<<4, 32);

            } else if (framesCounter == 129 + 60) {
                dmaCopyCGram(&companyLogoPalette + 64, PAL5<<4, 32);

            } else if (framesCounter == 130 + 60) {
                logoState = LogoStateWillChangeLogoFlags;
                logoFlagsTimer = 0;
                spcPlay(0);
            }
            break;

        case LogoStateWillChangeLogoFlags:
            if (logoFlagsSpeed == 0) {
                insertElement(yellowLogoPalette, 6, yellowLogoPalette[6]);
                dmaCopyCGram((u8 *)yellowLogoPalette, PAL4<<4, 32);

                insertElement(redLogoPalette, 6, redLogoPalette[6]);
                dmaCopyCGram((u8 *)redLogoPalette, PAL5<<4, 32);

                logoFlagsSpeed = 1;

            } else {
                logoFlagsSpeed = 0;
            }
            
            if (logoFlagsTimer == 18) {
                logoState = LogoStateWillChangeLogo;
                logoFlagsTimer = 0;
                dmaCopyCGram(&companyLogoPalette, PAL3<<4, 32);

            } else {
                logoFlagsTimer++;
            }
            break;

        case LogoStateWillChangeLogo:
            insertElement(konamiLogoPalette, 6, konamiLogoPalette[6]);
            dmaCopyCGram((u8 *)konamiLogoPalette, PAL3<<4, 32);

            if (logoFlagsTimer == 9) {
                logoState = LogoStateWillFinish;
                logoBackgroundColor = 0;

            } else {
                logoFlagsTimer++;
            }
            break;

        case LogoStateWillFinish:
            if (logoBackgroundColor <= 31) {
                setPaletteColor(PAL0, RGB5(logoBackgroundColor, 
                    logoBackgroundColor, 
                    logoBackgroundColor));

                logoBackgroundColor++;

            } else {
                logoState = LogoStateDidFinish;
            }
            break;
    }

    if (framesCounter < 300) {
        spcProcess();

    } else if (framesCounter == 300) {
        spcStop();

    } else if (framesCounter == 301) {
        // Note: process spcStop() properly.
        spcProcess();

    } else if (framesCounter == 330) {
        return 1;
    }
    
    framesCounter++;

    return 0;
}
