コード例 #1
0
        /// <summary>
        /// Define how to handle an unattached port
        /// </summary>
        /// <param name="addr">Port address</param>
        /// <returns>Port value for the unhandled port address</returns>
        public override byte UnhandledRead(ushort addr)
        {
            var tact    = HostVm.CurrentFrameTact % ScreenDevice.RenderingTactTable.Length;
            var rt      = ScreenDevice.RenderingTactTable[tact];
            var memAddr = (ushort)0;

            switch (rt.Phase)
            {
            case ScreenRenderingPhase.BorderFetchPixel:
            case ScreenRenderingPhase.DisplayB1FetchB2:
            case ScreenRenderingPhase.DisplayB2FetchB1:
                memAddr = rt.PixelByteToFetchAddress;
                break;

            case ScreenRenderingPhase.BorderFetchPixelAttr:
            case ScreenRenderingPhase.DisplayB1FetchA2:
            case ScreenRenderingPhase.DisplayB2FetchA1:
                memAddr = rt.AttributeToFetchAddress;
                break;
            }

            if (memAddr == 0)
            {
                return(0xFF);
            }
            var readValue = MemoryDevice.Read(memAddr, true);

            return(readValue);
        }
コード例 #2
0
ファイル: SpectrumEngine.cs プロジェクト: Toysoft/spectnetide
        /// <summary>
        /// Prepares the custom code for running, as if it were started
        /// with the RUN command
        /// </summary>
        public void PrepareRunMode()
        {
            // --- Set the keyboard in "L" mode
            var flags = MemoryDevice.Read(0x5C3B);

            flags |= 0x08;
            MemoryDevice.Write(0x5C3B, flags);
        }
コード例 #3
0
 /// <summary>
 /// Prepares the custom code for running, as if it were started
 /// with the RUN command
 /// </summary>
 public void PrepareRunMode(HashSet <string> options)
 {
     if (!options.Contains("cursork"))
     {
         // --- Set the keyboard in "L" mode
         var flags = MemoryDevice.Read(0x5C3B);
         flags |= 0x08;
         MemoryDevice.Write(0x5C3B, flags);
     }
 }
コード例 #4
0
        /// <summary>
        /// Prepares the custom code for running, as if it were started
        /// with the RUN command
        /// </summary>
        public void PrepareRunMode()
        {
            // --- Set the keyboard in "L" mode
            var flags = MemoryDevice.Read(0x5C3B);

            flags |= 0x08;
            MemoryDevice.Write(0x5C3B, flags);

            // --- Allow interrupts
            RunsInMaskableInterrupt = false;
        }