public SpriteSetData(int index)
        {
            Index = index;
            // WRam starts at 0xC000
            AddressHead = 0x0100 + (index * 0x0010);

            PictureID                  = t(AddressHead);
            MovementStatus             = t(AddressHead + 0x0001);
            SpriteImageIndex           = t(AddressHead + 0x0002);
            YPositionDelta             = t(AddressHead + 0x0003);
            YPositionPixels            = t(AddressHead + 0x0004);
            XPositionDelta             = t(AddressHead + 0x0005);
            XPositionPixels            = t(AddressHead + 0x0006);
            IntraAnimationFrameCounter = t(AddressHead + 0x0007);
            AnimationFrameCounter      = t(AddressHead + 0x0008);
            FacingDirection            = t(AddressHead + 0x0009);

            WalkAnimationCounter = t(AddressHead + 0x0100);
            // 0x0101 does nothing
            YDisplacement  = t(AddressHead + 0x0102);
            XDisplacement  = t(AddressHead + 0x0103);
            YPositionSteps = t(AddressHead + 0x0104);
            XPositionSteps = t(AddressHead + 0x0105);
            MovementByte   = t(AddressHead + 0x0106);
            GrassRelated   = t(AddressHead + 0x0107);
            MovementDelay  = t(AddressHead + 0x0108);
        }
        public SpriteSetData(int index)
        {
            Index = index;
            // WRam starts at 0xC000
            AddressHead = 0x0100 + (index * 0x0010);

            PictureID = t(AddressHead);
            MovementStatus = t(AddressHead + 0x0001);
            SpriteImageIndex = t(AddressHead + 0x0002);
            YPositionDelta = t(AddressHead + 0x0003);
            YPositionPixels = t(AddressHead + 0x0004);
            XPositionDelta = t(AddressHead + 0x0005);
            XPositionPixels = t(AddressHead + 0x0006);
            IntraAnimationFrameCounter = t(AddressHead + 0x0007);
            AnimationFrameCounter = t(AddressHead + 0x0008);
            FacingDirection = t(AddressHead + 0x0009);

            WalkAnimationCounter = t(AddressHead + 0x0100);
            // 0x0101 does nothing
            YDisplacement = t(AddressHead + 0x0102);
            XDisplacement = t(AddressHead + 0x0103);
            YPositionSteps = t(AddressHead + 0x0104);
            XPositionSteps = t(AddressHead + 0x0105);
            MovementByte = t(AddressHead + 0x0106);
            GrassRelated = t(AddressHead + 0x0107);
            MovementDelay = t(AddressHead + 0x0108);
        }
        public void InitTrackers()
        {
            m_PositionXTracker = GetT(MemoryAddresses.PlayerXPosition);
            m_PositionYTracker = GetT(MemoryAddresses.PlayerYPosition);

            m_TalkTrackerA = GetT(MemoryAddresses.TalkingA);
            m_TalkTrackerB = GetT(MemoryAddresses.TalkingB);
        }
Beispiel #4
0
        public MemoryTracker GetTracker(int address)
        {
            if (MemoryTrackers.ContainsKey(address))
            {
                return(MemoryTrackers[address]);
            }
            var newTracker = new MemoryTracker()
            {
                Address = address, Tracking = true, Displaying = true, Values = new List <byte>()
            };

            newTracker.Values.Add(LatestDump.ValueAtAddress(address));
            MemoryTrackers.Add(address, newTracker);
            return(newTracker);
        }
Beispiel #5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            SessionData.Memory = new MemoryTools();
            SessionData.Memory.OnMemoryChanged += OnMemoryChanged;
            SessionData.Memory.CheckForNewDump();

            SessionData.Bot = new PokemonRedBot();
            SessionData.Bot.InitTrackers();

            m_TalkTrackerA = SessionData.Memory.GetTracker(MemoryAddresses.TalkingA);
            m_TalkTrackerB = SessionData.Memory.GetTracker(MemoryAddresses.TalkingB);

            m_MapIDTracker = SessionData.Memory.GetTracker(MemoryAddresses.CurrentMapID);

            m_SpriteData = new BindingList<SpriteSetData>();
            for(int i = 0; i < 16; i++) {
                m_SpriteData.Add(new SpriteSetData(i));
            }
            list_Sprites.DataSource = m_SpriteData;

            StartWRAMListener();
            VBAController.BringToFront();
        }
 public MemoryTracker GetTracker(int address)
 {
     if (MemoryTrackers.ContainsKey(address))
     {
         return MemoryTrackers[address];
     }
     var newTracker = new MemoryTracker() { Address = address, Tracking = true, Displaying = true, Values = new List<byte>() };
     newTracker.Values.Add(LatestDump.ValueAtAddress(address));
     MemoryTrackers.Add(address, newTracker);
     return newTracker;
 }