Пример #1
0
        public NuSystem(Gpu gpu)
        {
            Memory = new MemoryManager
            {
                SRAM     = new MemoryRAM(MemoryMap.SRAM_START, MemoryMap.SRAM_SIZE), // 1MB SRAM
                DRAM     = new MemoryRAM(MemoryMap.DRAM_START, MemoryMap.DRAM_SIZE), // 8MB DRAM
                IOBuffer = new IODevice(MemoryMap.IO_START, MemoryMap.IO_SIZE)       // 64K IO space in bank $7F
            };
            this.CPU = new CPU(Memory);
            this.CPU.SimulatorCommand += CPU_SimulatorCommand;
            this.gpu    = gpu;
            gpu.VRAM    = Memory.DRAM;
            gpu.CodeRAM = Memory.SRAM;
            gpu.LoadCharacterData(Memory.DRAM, Memory.SRAM);

            KeyboardBuffer = new MemoryBuffer(
                Memory.SRAM,
                MemoryMap.KEY_BUFFER,
                MemoryMap.KEY_BUFFER_SIZE,
                MemoryMap.KEY_BUFFER_RPOS,
                MemoryMap.KEY_BUFFER_WPOS);

            for (int i = MemoryMap.SCREEN_PAGE0; i < MemoryMap.SCREEN_PAGE1; i++)
            {
                this.Memory[i] = 64;
            }

            this.Basic   = new Basic.Immediate(this);
            this.Monitor = new Monitor.Monitor(this);
        }