/// <summary> /// Checks if the disassembler should enter into Spectrum-specific mode after /// the specified disassembly item. /// </summary> /// <param name="item">Item used to check the Spectrum-specific mode</param> /// <returns> /// True, to move to the Spectrum-specific mode; otherwise, false /// </returns> private bool ShouldEnterSpectrumSpecificMode(DisassemblyItem item) { // --- Check if we find flags for the bank of the disassembly item var bank = item.Address >> 14; if (!DisassemblyFlags.TryGetValue(bank, out var flags) || flags == SpectrumSpecificDisassemblyFlags.None) { return(false); } // --- Check for Spectrum 48K RST #08 if ((flags & SpectrumSpecificDisassemblyFlags.Spectrum48Rst08) != 0 && item.OpCodes.Trim() == "CF") { _spectMode = SpectrumSpecificMode.Spectrum48Rst08; item.HardComment = "(Report error)"; return(true); } // --- Check for Spectrum 48K RST #28 if ((flags & SpectrumSpecificDisassemblyFlags.Spectrum48Rst28) != 0 && (item.OpCodes.Trim() == "EF" || // --- RST #28 item.OpCodes.Trim() == "CD 5E 33" || // --- CALL 335E item.OpCodes.Trim() == "CD 62 33")) // --- CALL 3362 { _spectMode = SpectrumSpecificMode.Spectrum48Rst28; _seriesCount = 0; item.HardComment = "(Invoke Calculator)"; return(true); } // --- Check for Spectrum 128K RST #28 if ((flags & SpectrumSpecificDisassemblyFlags.Spectrum128Rst28) != 0 && item.OpCodes.Trim() == "EF") { _spectMode = SpectrumSpecificMode.Spectrum128Rst8; item.HardComment = "(Call Spectrum 48 ROM)"; return(true); } return(false); }
/// <summary> /// Disassembles a region of a compiled HLSL code back into textual source. /// </summary> /// <param name="flags">The flags.</param> /// <param name="comments">The comments.</param> /// <param name="startByteOffset">The start byte offset.</param> /// <param name="numberOfInstructions">The number of instructions.</param> /// <param name="finishByteOffsetRef">The finish byte offset ref.</param> /// <returns>The textual source of the shader or effect.</returns> /// <unmanaged>HRESULT D3DDisassembleRegion([In, Buffer] const void* pSrcData,[In] SIZE_T SrcDataSize,[In] unsigned int Flags,[In, Optional] const char* szComments,[In] SIZE_T StartByteOffset,[In] SIZE_T NumInsts,[Out, Optional] SIZE_T* pFinishByteOffset,[Out] ID3D10Blob** ppDisassembly)</unmanaged> public unsafe string DisassembleRegion(DisassemblyFlags flags, string comments, PointerSize startByteOffset, PointerSize numberOfInstructions, out SharpDX.PointerSize finishByteOffsetRef) { Blob output; fixed (void* bufferPtr = Data) D3D.DisassembleRegion((IntPtr)bufferPtr, Data.Length, (int)flags, comments, startByteOffset, numberOfInstructions, out finishByteOffsetRef, out output); return Utilities.BlobToString(output); }
/// <summary> /// Disassembles compiled HLSL code back into textual source. /// </summary> /// <param name = "flags">Flags affecting the output of the disassembly.</param> /// <param name = "comments">Commenting information to embed in the disassembly.</param> /// <returns>The textual source of the shader or effect.</returns> public unsafe string Disassemble(DisassemblyFlags flags, string comments) { Blob output; fixed (void* bufferPtr = Data) D3D.Disassemble((IntPtr)bufferPtr, Data.Length, flags, comments, out output); return Utilities.BlobToString(output); }
/// <summary> /// Disassembles compiled HLSL code back into textual source. /// </summary> /// <param name = "flags">Flags affecting the output of the disassembly.</param> /// <returns>The textual source of the shader or effect.</returns> public string Disassemble(DisassemblyFlags flags) { return this.Disassemble(flags, null); }