public static Bitmap GetFrame(int index, int frame)
        {
            var pd = GfxBattleAnimations.AnimEntries[index];

            // Get the gfx pointer
            var gfxEntry = GfxBattleTable.GetEntry(pd.GfxEntry);

            // Get the arrangement
            var arr = GfxBattleTable.GetArr(pd.ArrEntries[frame]);

            // Get the palette
            var pal = GfxBattleTable.GetPalettes(pd.PalEntry);

            // Render
            return(GfxProvider.RenderArrangement(arr, 32, 32, Rom, gfxEntry[0], pal, true, false));
        }
        public static void GetFrame(BitmapData bd, int index, int frame, int pal)
        {
            var s = Sequences[index];

            if (frame >= s.ArrLen)
            {
                throw new Exception("Frame number exceeded max value!");
            }

            int[] gfxEntry = GetEntry(s.GfxEntry);
            int[] palEntry = GetEntry(s.PalEntry);

            // Get the palette
            var palette = Palettes[pal];

            // Read the arrangement
            var arr = GetArr(s.ArrStart + frame);

            GfxProvider.RenderArrangement(bd, arr, 30, 20, Rom, gfxEntry[0], false, false);
        }
        public static void GetLayer(Bitmap bmp, BitmapData bd, int index, int t = 0)
        {
            var bg     = Bgs[index];
            var arr    = GfxBattleBgTable.GetArr(bg.ArrEntry);
            var tmpPal = (MPalette)bg.Palette.Clone();

            // Rotate the palette
            UpdatePal(tmpPal, bg, t);

            for (int i = 0; i < arr.Length; i++)
            {
                arr[i].Palette &= 1;
            }

            // Set the palette
            bmp.CopyPalette(tmpPal, false);

            int gfxPointer = GfxBattleBgTable.GetEntry(bg.GfxEntry)[0];

            GfxProvider.RenderArrangement(bd, arr, 32, 32, Rom, gfxPointer, true, false);
        }