예제 #1
0
        private int UpdateLineDescriptionsWithStars(byte initMask, List <LineDescriptionEx> descriptions, int maxShown)
        {
            int totalStars = 0;

            for (int i = 0; i < descriptions.Count; i++)
            {
                if (descriptions[i] is StarsLineDescription sld)
                {
                    int eeprom = sld.offset;

                    LevelOffsetsDescription levelOffsets = LevelInfo.FindByEEPOffset(eeprom);
                    if (levelOffsets == null)
                    {
                        continue;
                    }

                    int romOffset = levelOffsets.ROMOffset;

                    int levelAddressStart = ReadInt32(courseBaseAddress + romOffset * 0x14 + 0x04); //base offset + offset for descriptor + address in descriptor
                    int levelAddressEnd   = ReadInt32();

                    sld.starMask = GenerateStarMask(initMask, levelAddressStart, levelAddressEnd);
                    totalStars  += MemoryManager.countStars(sld.starMask, maxShown);
                }
            }
            return(totalStars);
        }
예제 #2
0
        public WarpDialog(byte level)
        {
            InitializeComponent();

            this.level = level;
            LevelOffsetsDescription lod = LevelInfo.FindByLevel(level);

            offsetComboBox.SelectedIndex = (lod == null) ? -1 : lod.NaturalIndex;
        }
예제 #3
0
        private int PrepareAddresses(int level, out int levelAddressStart, out int levelAddressEnd, out int levelOffset)
        {
            LevelOffsetsDescription levelOffsets = LevelInfo.FindByLevel(level);

            if (levelOffsets == null)
            {
                levelAddressStart = 0; levelAddressEnd = 0; levelOffset = 0; return(-1);
            }

            int romOffset = levelOffsets.ROMOffset;

            levelAddressStart = ReadInt32(courseBaseAddress + romOffset * 0x14 + 0x04); //base offset + offset for descriptor + address in descriptor
            levelAddressEnd   = ReadInt32(courseBaseAddress + romOffset * 0x14 + 0x08);
            levelOffset       = ReadInt32(courseBaseAddress + romOffset * 0x14 + 0x0C) & 0x0000FFFF;
            return(0);
        }
예제 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!Byte.TryParse(warpTextBox.Text, out warp))
            {
                warp = 0x0A;
            }

            if (!Byte.TryParse(areaTextBox.Text, out area))
            {
                area = 0x01;
            }
            ;
            LevelOffsetsDescription lod = LevelInfo.FindByNaturalIndex(offsetComboBox.SelectedIndex);

            level = (byte)((lod == null) ? 1 : lod.Level);
            Close();
        }