예제 #1
0
        void Core_LoadTitleScreen()
        {
            try
            {
                if (Core.CurrentROM is FE6)
                {
                    Pointer address_mg_palette = Core.GetPointer("Title Screen MG/FG Palette");
                    Pointer address_mg_tileset = Core.GetPointer("Title Screen MG/FG Tileset");
                    Pointer address_fg_tileset = Core.GetPointer("Title Screen FG Tileset");
                    Pointer address_mg_tsa     = Core.GetPointer("Title Screen MG TSA");
                    Pointer address_bg_tileset = Core.GetPointer("Title Screen BG Tileset");
                    Pointer address_bg_palette = Core.GetPointer("Title Screen BG Palette");

                    Core_LoadTitleScreen_FE6(
                        Core.ReadPalette(address_mg_palette, Palette.LENGTH * 8),
                        new Tileset(Core.ReadData(address_mg_tileset, 0)),
                        new Tileset(Core.ReadData(address_fg_tileset, 0)),
                        Core.ReadTSA(address_mg_tsa, 32, 20, true, false),
                        Core.ReadPalette(address_bg_palette, Palette.LENGTH),
                        new Tileset(Core.ReadData(address_bg_tileset, 0)));
                }
                if (Core.CurrentROM is FE7)
                {
                    Pointer address_bg_palette = Core.GetPointer("Title Screen BG Palette");
                    Pointer address_bg_tileset = Core.GetPointer("Title Screen BG Tileset");
                    Pointer address_mg_palette = Core.GetPointer("Title Screen MG Palette");
                    Pointer address_mg_tileset = Core.GetPointer("Title Screen MG Tileset");
                    Pointer address_mg_tsa     = Core.GetPointer("Title Screen MG TSA");
                    Pointer address_fg_palette = Core.GetPointer("Title Screen FG Palette");
                    Pointer address_fg_tileset = Core.GetPointer("Title Screen FG Tileset");

                    bool tsa = (Core.CurrentROM.Version != GameVersion.JAP);
                    Core_LoadTitleScreen_FE7(
                        Core.ReadPalette(address_bg_palette, Palette.LENGTH),
                        new Tileset(Core.ReadData(address_bg_tileset, 0)),
                        Core.ReadPalette(address_mg_palette, Palette.LENGTH),
                        new Tileset(Core.ReadData(address_mg_tileset, 0)),
                        Core.ReadTSA(address_mg_tsa, GBA.Screen.W_TILES, GBA.Screen.H_TILES, tsa, true),
                        Core.ReadPalette(address_fg_palette, Palette.LENGTH * 5),
                        new Tileset(Core.ReadData(address_fg_tileset, 0)));
                }
                if (Core.CurrentROM is FE8)
                {
                    Pointer address_bg_palette  = Core.GetPointer("Title Screen BG Palette");
                    Pointer address_bg_tileset1 = Core.GetPointer("Title Screen BG Tileset 1");
                    Pointer address_bg_tileset2 = Core.GetPointer("Title Screen BG Tileset 2");
                    Pointer address_bg_tsa      = Core.GetPointer("Title Screen BG TSA");
                    Pointer address_mg_palette  = Core.GetPointer("Title Screen MG Palette");
                    Pointer address_mg_tileset  = Core.GetPointer("Title Screen MG Tileset");
                    Pointer address_mg_tsa      = Core.GetPointer("Title Screen MG TSA");
                    Pointer address_fg_palette  = Core.GetPointer("Title Screen FG Palette");
                    Pointer address_fg_tileset1 = Core.GetPointer("Title Screen FG Tileset 1");
                    Pointer address_fg_tileset2 = Core.GetPointer("Title Screen FG Tileset 2");

                    Tileset bg_tileset;
                    bg_tileset = new Tileset(Core.ReadData(address_bg_tileset1, 0));
                    bg_tileset.AddTileset(new Tileset(Core.ReadData(address_bg_tileset2, 0)));
                    Tileset fg_tileset;
                    fg_tileset = new Tileset(Core.ReadData(address_fg_tileset1, 0));
                    fg_tileset.AddTileset(new Tileset(Core.ReadData(address_fg_tileset2, 0)));

                    Core_LoadTitleScreen_FE8(
                        Core.ReadPalette(address_bg_palette, Palette.LENGTH), bg_tileset,
                        Core.ReadTSA(address_bg_tsa, 32, 32, true, false),
                        Core.ReadPalette(address_mg_palette, Palette.LENGTH),
                        new Tileset(Core.ReadData(address_mg_tileset, 0)),
                        Core.ReadTSA(address_mg_tsa, 32, 32, true, false),
                        Core.ReadPalette(address_fg_palette, Palette.LENGTH * 5), fg_tileset);
                }
            }
            catch (Exception ex)
            {
                Program.ShowError("There has been an error while trying to load the title screen.", ex);
            }
        }