Exemple #1
0
        public TimerModule(ulong clocks)
        {
            var maxCount = clocks - 1;

            CapacityBits = RTLCalculators.CalcBitsForValue(maxCount);
            countTo      = new RTLBitArray(maxCount).Resized(CapacityBits).Unsigned();
        }
Exemple #2
0
        public VGASyncModule(uint visible, uint fp, uint sp, uint bp)
        {
            this.visible = visible;
            this.fp      = this.visible + fp;
            this.sp      = this.fp + sp;
            this.bp      = this.sp + bp;

            max      = visible + fp + sp + bp - 1;
            capacity = RTLCalculators.CalcBitsForValue(max);
        }
        public VGAController(VGAControllerMode mode)
        {
            switch (mode)
            {
            case VGAControllerMode.SVGA_800_600_60:
                hSync    = new VGASyncModule(800, 40, 128, 88);
                vSync    = new VGASyncModule(600, 1, 4, 23);
                addrBits = RTLCalculators.CalcBitsForValue(800 * 600);
                break;

            case VGAControllerMode.Test:
                hSync    = new VGASyncModule(80, 40, 128, 88);
                vSync    = new VGASyncModule(60, 1, 4, 23);
                addrBits = RTLCalculators.CalcBitsForValue(80 * 60);
                break;
            }
        }