Пример #1
0
        public Spectrum48K()
        {
            Memory = new Memory48K();
            Ula = new Spectrum48KULA();
            Cpu = new Z80CPU(Memory, Ula);

            Reset();
        }
Пример #2
0
        public ExecutionForm(Z80CPU z80)
        {
            this.z80 = z80;
            z80Disassembler = new Disassembler(z80);
            InitializeComponent();

            RefreshDisplay();
        }
Пример #3
0
        public MemoryForm(PagedMemory pagedMemory, Z80CPU z80)
        {
            this.pagedMemory = pagedMemory;
            this.z80 = z80;
            display = new SpectrumDisplay(pagedMemory.AllPages[1]);
            InitializeComponent();

            FollowCombo.SelectedIndex = 2;
            BankCombo.SelectedIndex = 0;
            RefreshDisplay();
        }
Пример #4
0
 public CPUForm(Z80CPU z80)
 {
     InitializeComponent();
     this.z80 = z80;
 }
Пример #5
0
        private String DecodeText(State state, Z80CPU.Op op)
        {
            if (op == null)
                return String.Format("DEFB " + HexByte, z80.Memory.ReadByte(state.Address));

            var text = op.Name;
            if (manipulateDecoded != null)
            {
                text = manipulateDecoded.Invoke(text);
                manipulateDecoded = null;
            }

            if (text.Contains("x"))
            {
                var x = state.IndexerOffset ?? (SByte)z80.Memory.ReadByte(state.Address++);
                text = text.Replace("x", x.ToString("+;-;") + String.Format(HexByte, x));
            }

            if (text.Contains("e"))
            {
                var e = (SByte)(z80.Memory.ReadByte(state.Address++));
                text = text.Replace("e", "$" + new LEWord((UInt16)(state.Address + e)));
                // + " (" + e.ToString("+0;-0;0") + ")");
            }

            if (text.Contains("nn"))
            {
                var nn = z80.Memory.ReadWord(state.Address);
                state.Address += 2;
                text = text.Replace("nn", String.Format(HexWord, nn));
            }

            if (text.Contains("n"))
            {
                var n = z80.Memory.ReadByte(state.Address++);
                text = text.Replace("n", String.Format(HexByte, n));
            }

            return text;
        }
Пример #6
0
 public Disassembler(Z80CPU z80)
 {
     this.z80 = z80;
 }