Example #1
0
 public Machine(ISound sound, IM6809 cpu, IInput input, IMemory memory)
 {
     _mem  = memory;
     Sound = sound;
     Input = input;
     _cpu  = cpu;
     cpu.Reset();
     Screen = new Screen(_mem);
 }
Example #2
0
        private void ReadBit(IM6809 machine)
        {
            if (!IsFileOpened)
            {
                return;
            }

            // need to read 1 byte ?
            if (_k7Bit == 0x00)
            {
                try
                {
                    _k7Byte = _k7FileStream.ReadByte();
                }
                catch (Exception)
                {
                }

                _k7Bit = 0x80;
            }

            var octet = _mem.Read(0x2045) << 1;

            if ((_k7Byte & _k7Bit) == 0)
            {
                machine.RegA = 0;
            }
            else
            {
                octet       |= 0x01;
                machine.RegA = 0xFF;
            }
            // positionne l'octet dans la page 0 du moniteur
            _mem.Write(0x2045, octet & 0xFF);

            _k7Bit = _k7Bit >> 1;
        }