示例#1
0
        private void LoadSNA(string path)
        {
            byte[]    snapshot = File.ReadAllBytes(path);
            Registers r        = _cpu.Registers;

            r.I = snapshot[0];

            r.ExchangeBCDEHL();
            r.HL = getWord(1);
            r.DE = getWord(3);
            r.BC = getWord(5);
            r.AF = getWord(7);

            r.ExchangeBCDEHL();
            r.HL = getWord(9);
            r.DE = getWord(11);
            r.BC = getWord(13);
            r.IY = getWord(15);
            r.IX = getWord(17);

            if (snapshot[19].GetBit(2))
            {
                _cpu.EnableInterrupts();
            }

            r.R = snapshot[20];
            r[WordRegister.AF] = getWord(21);
            r.SP = getWord(23);

            _cpu.SetInterruptMode((InterruptMode)snapshot[25]);
            _screen.SetBorderColour(DisplayColour.FromThreeBit(snapshot[26]));

            _cpu.Memory.Untimed.WriteBytesAt(16384, snapshot[27..]);