예제 #1
0
파일: Nes.cs 프로젝트: DualBrain/emu6502-1
        public Nes(string romfile)
        {
            ActiveNes = this;
            Rom       = new Rom(romfile);
            Mem       = new NesMemory(this);
            Cpu       = new Chip6502(Mem);
            Ppu       = new Ppu(this);
            switch (Rom.MapperNumber)
            {
            case 0:
                Mapper = new NROM(this);
                break;

            case 1:
                Mapper = new MMC1(this);
                break;

            case 2:
                Mapper = new UxROM(this);
                break;

            default:
                // TODO: Cleaner...
                throw new Exception("Unknown mapper");
            }

            Reset();
        }
예제 #2
0
파일: Nes.cs 프로젝트: shilrobot/emu6502
        public Nes(string romfile)
        {
            ActiveNes=this;
            Rom = new Rom(romfile);
            Mem = new NesMemory(this);
            Cpu = new Chip6502(Mem);
            Ppu = new Ppu(this);
            switch (Rom.MapperNumber)
            {
                case 0:
                    Mapper = new NROM(this);
                    break;
                case 1:
                    Mapper = new MMC1(this);
                    break;
                case 2:
                    Mapper = new UxROM(this);
                    break;
                default:
                    // TODO: Cleaner...
                    throw new Exception("Unknown mapper");
            }

            Reset();
        }