Exemplo n.º 1
0
        public void TestShiftRegister(byte lowByte, byte highByte, byte offset, byte expectedResult)
        {
            var app = new SpaceInvadersApplication(System.Array.Empty <byte>());

            app.Out(2, offset);
            app.Out(4, lowByte);
            app.Out(4, highByte);
            Assert.Equal(expectedResult, app.In(3));
        }
Exemplo n.º 2
0
        public void TestMemoryBusReadWrite()
        {
            var program   = new byte[0x2000];
            var memoryBus = new SpaceInvadersApplication(program);

            for (ushort ii = 0; ii < ushort.MaxValue; ii++)
            {
                memoryBus.WriteByte((byte)(ii + 1), ii);
                if (ii < 0x2000)
                {
                    Assert.Equal(0, memoryBus.ReadByte(ii));
                }
                else
                {
                    Assert.Equal((byte)(ii + 1), memoryBus.ReadByte(ii));
                }
            }
        }