示例#1
0
        public LevelPointers(MetroidRom rom, Level level)
        {
            this.Rom   = rom;
            this.Level = level;

            structs = new PointerTable(rom, (pRom)StructTableOffset, CalculateStructCount());
        }
示例#2
0
        private void LoadPalette()
        {
            PalettePointers = new PointerTable(
                rom,
                (pRom)(NesPalette.LevelPalettePointerTableOffset + Bank.Offset),
                0x1c);

            _SpritePalette = NesPalette.FromLevel_SPR(this);
            _BgPalette     = NesPalette.FromLevel_BG(this);
            if (Format.SupportsAltBgPalette)
            {
                _BgAltPalette = NesPalette.FromLevel_BG_Alt(this);
            }
            else
            {
                _BgAltPalette = _BgPalette;
            }
            if (Format.SupportsAltSpritePalette)
            {
                _SpriteAltPalette = NesPalette.FromLevel_SPR_Alt(this);
            }
            else
            {
                _SpriteAltPalette = _SpritePalette;
            }


            switch (this.index)
            {
            case LevelIndex.Brinstar:
                enemyPalettes = new int[] { 0, 0, 0, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                break;

            case LevelIndex.Norfair:
                enemyPalettes = new int[] { 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 3, 2, 3, 2, 0 };
                break;

            case LevelIndex.Tourian:
                enemyPalettes = new int[] { 0, 3, 3, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0 };
                break;

            case LevelIndex.Kraid:
                enemyPalettes = new int[] { 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0 };
                break;

            case LevelIndex.Ridley:
                enemyPalettes = new int[] { 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 3, 2, 3, 2, 0, 2, 3, 2, 0, 2, 3, 2, 0 };
                break;
            }
        }