Exemplo n.º 1
0
        private void PushTileMapData()
        {
            _state.Memory.CgRam   = SnesDebugApi.GetMemoryState(SnesMemoryType.CGRam);
            _state.Memory.PpuData = SnesDebugApi.GetMemoryState(SnesMemoryType.VideoRam);
            _state.SnesState      = _state.SnesState = SnesDebugApi.GetState();

            GetTileMapData();
            if (OnRegisterUpdate != null)
            {
                OnRegisterUpdate(_state);
            }
        }
Exemplo n.º 2
0
        private void GetCharacterData()
        {
            _tileViewOptions.Format   = (TileFormat)_state.CharacterData.ColorMode;
            _tileViewOptions.Width    = 16;
            _tileViewOptions.PageSize = 0x10000;
            var source  = SnesDebugApi.GetMemoryState(SnesMemoryType.VideoRam);
            var address = 0;
            var size    = Math.Min(source.Length - address, _tileViewOptions.PageSize);

            Array.Copy(source, address, _tileSource, 0, size);
            _state.CharacterData.Width  = 128;
            _state.CharacterData.Height = GetChrHeight(_tileViewOptions, _state.CharacterData.ColorMode);
            SnesDebugApi.GetTileView(_tileViewOptions, _tileSource, _tileSource.Length, _state.Memory.CgRam, _state.CharacterData.PixelData[0]);
        }
Exemplo n.º 3
0
        protected override void EmitDebugData()
        {
            if (OnRegisterUpdate == null)
            {
                return;
            }

            _state.SnesState      = SnesDebugApi.GetState();
            _state.Memory.PpuData = SnesDebugApi.GetMemoryState(SnesMemoryType.VideoRam);
            _state.Memory.OamData = SnesDebugApi.GetMemoryState(SnesMemoryType.SpriteRam);
            _state.Memory.CgRam   = SnesDebugApi.GetMemoryState(SnesMemoryType.CGRam);
            _state.Memory.CpuData = SnesDebugApi.GetMemoryState(SnesMemoryType.CpuMemory);
            _state.Memory.X       = _state.SnesState.Cpu.X & (_state.SnesState.Cpu.PS.HasFlag(ProcFlags.IndexMode8) ? 0xFF : 0xFFFF);
            _state.Memory.Y       = _state.SnesState.Cpu.Y & (_state.SnesState.Cpu.PS.HasFlag(ProcFlags.IndexMode8) ? 0xFF : 0xFFFF);
            SnesDebugApi.GetSpritePreview(_spriteOptions, _state.SnesState.Ppu, _state.Memory.PpuData, _state.Memory.OamData, _state.Memory.CgRam, _state.Sprites.PixelData);
            _state.Sprites.Details = Sprite.GetSnesSprites(_state.Memory.OamData, _state.SnesState.Ppu.OamMode);

            GetCharacterData();
            GetTileMapData();

            OnRegisterUpdate(_state);
        }