예제 #1
0
        public LEM1802( DCPU16Emulator cpu, int rows = 12, int cols = 32, int scale = 2 )
            : base(( cols + 4 ) * 4 * scale, ( rows + 2 ) * 8 * scale,
                new GraphicsMode( new ColorFormat( 8, 8, 8, 0 ), 0 ),
                "DCPU16 Virtual Display")
        {
            CPU = cpu;

            Rows = rows;
            Columns = cols;
            Scale = scale;

            VideoBufferLoc = 0;
            VideoBufferLength = (ushort) ( Rows * Columns );
            CharacterSetLoc = 0;

            myKeyIndex = 0;
            myKeyQueue = new Queue<ushort>();

            myDumping = false;
        }
예제 #2
0
        public int Interrupt( DCPU16Emulator cpu )
        {
            switch ( cpu.A )
            {
                case 0: // MEM_MAP_SCREEN
                    VideoBufferLoc = cpu.B;
                    return 0;
                case 1: // MEM_MAP_FONT
                    CharacterSetLoc = cpu.B;
                    return 0;
                case 2: // MEM_MAP_PALETTE
                    throw new NotImplementedException();
                case 3: // SET_BORDER_COLOR
                    throw new NotImplementedException();
                case 4: // MEM_DUMP_FONT
                    myDumping = true;
                    for ( int i = 0; i < 256; ++i )
                        cpu.SetMemory( cpu.B + i, myDefaultCharSet[ i ] );
                    myDumping = false;
                    return 256;
                case 5: // MEM_DUMP_PALETTE
                    throw new NotImplementedException();
            }

            return 0;
        }