public void RefreshData() { _isGameboyMode = EmuApi.GetRomInfo().CoprocessorType == CoprocessorType.Gameboy; _state = DebugApi.GetState(); _vram = DebugApi.GetMemoryState(_isGameboyMode ? SnesMemoryType.GbVideoRam : SnesMemoryType.VideoRam); _cgram = DebugApi.GetMemoryState(SnesMemoryType.CGRam); }
public void RefreshData() { _state = DebugApi.GetState(); _vram = DebugApi.GetMemoryState(this.CpuType == CpuType.Gameboy ? SnesMemoryType.GbVideoRam : SnesMemoryType.VideoRam); _oamRam = DebugApi.GetMemoryState(this.CpuType == CpuType.Gameboy ? SnesMemoryType.GbSpriteRam : SnesMemoryType.SpriteRam); _cgram = DebugApi.GetMemoryState(SnesMemoryType.CGRam); }
private void RefreshData() { _state = DebugApi.GetState().Ppu; _vram = DebugApi.GetMemoryState(SnesMemoryType.VideoRam); _oamRam = DebugApi.GetMemoryState(SnesMemoryType.SpriteRam); _cgram = DebugApi.GetMemoryState(SnesMemoryType.CGRam); }
public void RefreshData() { if (EmuApi.GetRomInfo().CoprocessorType == CoprocessorType.Gameboy) { _cgRam = GetGameboyPalette(); } else { _cgRam = DebugApi.GetMemoryState(SnesMemoryType.CGRam); } }
public void RefreshData() { if (this.CpuType == CpuType.Gameboy) { _cgRam = GetGameboyPalette(); } else { _cgRam = DebugApi.GetMemoryState(SnesMemoryType.CGRam); } }
private void RefreshData() { _cgram = DebugApi.GetMemoryState(SnesMemoryType.CGRam); byte[] source = DebugApi.GetMemoryState(_memoryType); int size = Math.Min(source.Length - _addressOffset, 0x10000); _tileSource = new byte[0x10000]; Array.Copy(source, _addressOffset, _tileSource, 0, size); ctrlPaletteViewer.RefreshData(); }
public void RefreshData() { _state = DebugApi.GetState(); _cgram = DebugApi.GetMemoryState(SnesMemoryType.CGRam); byte[] source = DebugApi.GetMemoryState(_memoryType); int size = Math.Min(source.Length - _address, _options.PageSize); _tileSource = new byte[0x40000]; Array.Copy(source, _address, _tileSource, 0, size); ctrlPaletteViewer.RefreshData(); }
public void RefreshData(SnesMemoryType memoryType) { if (_memoryType != memoryType) { _memoryType = memoryType; _byteProvider = null; } byte[] data = DebugApi.GetMemoryState(this._memoryType); if (data != null) { bool changed = true; if (this._byteProvider != null && data.Length == this._byteProvider.Length) { changed = false; for (int i = 0; i < this._byteProvider.Length; i++) { if (this._byteProvider.Bytes[i] != data[i]) { changed = true; break; } } } if (changed) { if (_byteProvider == null || _byteProvider.Length != data.Length) { _byteProvider = new StaticByteProvider(data); _byteProvider.ByteChanged += (int byteIndex, byte newValue, byte oldValue) => { DebugApi.SetMemoryValue(_memoryType, (UInt32)byteIndex, newValue); }; _byteProvider.BytesChanged += (int byteIndex, byte[] values) => { DebugApi.SetMemoryValues(_memoryType, (UInt32)byteIndex, values, values.Length); }; this.ctrlHexBox.ByteProvider = _byteProvider; } else { _byteProvider.SetData(data); } this.ctrlHexBox.Refresh(); } } }
public void RefreshData() { _state = DebugApi.GetState(); if (EmuApi.GetRomInfo().CoprocessorType == CoprocessorType.Gameboy) { _cgram = ctrlPaletteViewer.GetGameboyPalette(); } else { _cgram = DebugApi.GetMemoryState(SnesMemoryType.CGRam); } byte[] source = DebugApi.GetMemoryState(_memoryType); int size = Math.Min(source.Length - _address, _options.PageSize); _tileSource = new byte[0x40000]; Array.Copy(source, _address, _tileSource, 0, size); ctrlPaletteViewer.RefreshData(); }
public void RefreshData() { _cgRam = DebugApi.GetMemoryState(SnesMemoryType.CGRam); }
private void BuildCdlData() { int prgSize = DebugApi.GetMemorySize(SnesMemoryType.PrgRom); if (prgSize <= 0) { return; } byte[] cdlFile = new byte[prgSize]; //Mark data/code regions foreach (SpanInfo span in _spans.Values) { int prgAddress = GetPrgAddress(span); if (prgAddress >= 0 && prgAddress < prgSize) { for (int i = 0; i < span.Size; i++) { if (cdlFile[prgAddress + i] != (byte)CdlFlags.Data && !span.IsData && span.Size <= 4) { cdlFile[prgAddress + i] = (byte)CdlFlags.Code; } else if (span.IsData) { cdlFile[prgAddress + i] = (byte)CdlFlags.Data; } else if (cdlFile[prgAddress + i] == 0) { //Mark bytes as tentative data, until we know that the bytes are actually code cdlFile[prgAddress + i] = 0x04; } } } } for (int i = 0; i < cdlFile.Length; i++) { if (cdlFile[i] == 0x04) { //Mark all bytes marked as tentative data as data cdlFile[i] = (byte)CdlFlags.Data; } } //Find/identify functions and jump targets byte[] prgRomContent = DebugApi.GetMemoryState(SnesMemoryType.PrgRom); foreach (SymbolInfo symbol in _symbols.Values) { LineInfo line; if (!symbol.SegmentID.HasValue) { //This is a constant, ignore it continue; } foreach (int reference in symbol.References) { if (_lines.TryGetValue(reference, out line) && line.SpanIDs.Count > 0) { SpanInfo span; if (_spans.TryGetValue(line.SpanIDs[0], out span) && !span.IsData && span.Size <= 3) { int referencePrgAddr = GetPrgAddress(span); if (referencePrgAddr >= 0 && referencePrgAddr < prgRomContent.Length) { byte opCode = prgRomContent[referencePrgAddr]; if (opCode == 0x20 || opCode == 0x10 || opCode == 0x30 || opCode == 0x50 || opCode == 0x70 || opCode == 0x80 || opCode == 0x90 || opCode == 0xB0 || opCode == 0xD0 || opCode == 0xF0 || opCode == 0x4C || opCode == 0x20 || opCode == 0x4C || opCode == 0x5C || opCode == 0x6C) { //This symbol is used with a JSR/jump instruction, so it's either a function or jump target bool isJsr = opCode == 0x20 || opCode == 0x22; //JSR/JSL SpanInfo definitionSpan = GetSymbolDefinitionSpan(symbol); if (definitionSpan != null) { int definitionPrgAddr = GetPrgAddress(definitionSpan); if (definitionPrgAddr >= 0 && definitionPrgAddr < prgRomContent.Length) { cdlFile[definitionPrgAddr] |= (byte)(isJsr ? CdlFlags.SubEntryPoint : CdlFlags.JumpTarget); break; } } } } } } } } DebugApi.SetCdlData(cdlFile, cdlFile.Length); }
private void BuildCdlData() { int prgSize = DebugApi.GetMemorySize(SnesMemoryType.PrgRom); if (prgSize <= 0) { return; } byte[] cdlFile = new byte[prgSize]; byte[] prgRomContent = DebugApi.GetMemoryState(SnesMemoryType.PrgRom); //Mark data/code regions foreach (SpanInfo span in _spans.Values) { if (_scopeSpans.Contains(span.ID)) { //Skip any span used by a scope, they don't correspond to an actual line of code continue; } int prgAddress = GetPrgAddress(span); if (prgAddress >= 0 && prgAddress < prgSize) { for (int i = 0; i < span.Size; i++) { if (cdlFile[prgAddress + i] != (byte)CdlFlags.Data && !span.IsData && span.Size <= 4) { cdlFile[prgAddress + i] = (byte)CdlFlags.Code; byte opCode = prgRomContent[prgAddress]; if (span.Size == 2) { if (IsVarWidthMemoryInstruction(opCode)) { //8-bit immediate memory operation, set M flag cdlFile[prgAddress + i] |= (byte)CdlFlags.MemoryMode8; } else if (IsVarWidthIndexInstruction(opCode)) { //8-bit immediate index operation, set X flag cdlFile[prgAddress + i] |= (byte)CdlFlags.IndexMode8; } } } else if (span.IsData) { cdlFile[prgAddress + i] = (byte)CdlFlags.Data; } else if (cdlFile[prgAddress + i] == 0) { //Mark bytes as tentative data, until we know that the bytes are actually code cdlFile[prgAddress + i] = 0x04; } } } } for (int i = 0; i < cdlFile.Length; i++) { if (cdlFile[i] == 0x04) { //Mark all bytes marked as tentative data as data cdlFile[i] = (byte)CdlFlags.Data; } } //Find/identify functions and jump targets foreach (SymbolInfo symbol in _symbols.Values) { LineInfo line; if (!symbol.SegmentID.HasValue) { //This is a constant, ignore it continue; } foreach (int reference in symbol.References) { if (_lines.TryGetValue(reference, out line) && line.SpanIDs.Count > 0) { SpanInfo span; if (_spans.TryGetValue(line.SpanIDs[0], out span) && !span.IsData && span.Size <= 4) { int referencePrgAddr = GetPrgAddress(span); if (referencePrgAddr >= 0 && referencePrgAddr < prgRomContent.Length) { byte opCode = prgRomContent[referencePrgAddr]; if (IsBranchInstruction(opCode)) { //This symbol is used with a JSR/jump instruction, so it's either a function or jump target bool isJsr = opCode == 0x20 || opCode == 0x22; //JSR/JSL SpanInfo definitionSpan = GetSymbolDefinitionSpan(symbol); if (definitionSpan != null) { int definitionPrgAddr = GetPrgAddress(definitionSpan); if (definitionPrgAddr >= 0 && definitionPrgAddr < prgRomContent.Length) { cdlFile[definitionPrgAddr] |= (byte)(isJsr ? CdlFlags.SubEntryPoint : CdlFlags.JumpTarget); break; } } } } } } } } DebugApi.SetCdlData(CpuType.Cpu, cdlFile, cdlFile.Length); }
public void RefreshData() { _state = DebugApi.GetState().Ppu; _vram = DebugApi.GetMemoryState(SnesMemoryType.VideoRam); _cgram = DebugApi.GetMemoryState(SnesMemoryType.CGRam); }