Пример #1
0
        public void PowerOn(string romName)
        {
            PoweredOn = true;

            bootstrapRom = new BootRom("../../../../DMG_BootRom.bin");
            rom          = new Rom(romName);
            //rom = new Rom("../../../../roms/games/tetris.gb");
            //rom = new Rom("../../../../roms/games/Dr. Mario.gb");
            //rom = new Rom("../../../../roms/games/Bubble Ghost (J).gb");
            //rom = new Rom("../../../../roms/games/Super Mario Land.gb");
            //rom = new Rom("../../../../roms/games/Super Mario Land 2 - 6 Golden Coins (UE) (V1.2).gb");
            //rom = new Rom("../../../../roms/games/Wario Land - Super Mario Land 3.gb");
            //rom = new Rom("../../../../roms/games/Bootleg Marioland 4.gb");
            //rom = new Rom("../../../../roms/games/Teenage Mutant Hero Turtles - Back from the Sewers (E).gb");
            //rom = new Rom("../../../../roms/games/Teenage Mutant Hero Turtles - Fall of the Foot Clan (E).gb");
            //rom = new Rom("../../../../roms/games/Teenage Mutant Hero Turtles III - Radical Rescue (E) [!].gb");
            //rom = new Rom("../../../../roms/games/Legend of Zelda, The - Link's Awakening (U) (V1.2).gb");
            //rom = new Rom("../../../../roms/games/Pokemon - Blue.gb");
            //rom = new Rom("../../../../roms/games/Gargoyle's Quest - Ghosts'n Goblins.gb");
            //rom = new Rom("../../../../roms/games/Mega Man V.gb");
            //rom = new Rom("../../../../roms/games/Donkey Kong.gb");
            //rom = new Rom("../../../../roms/games/Donkey Kong Land (U) [S][!].gb");
            //rom = new Rom("../../../../roms/games/Donkey Kong Land 2 (UE) [S][!].gb");
            //rom = new Rom("../../../../roms/games/Donkey Kong Land III (U) [S][!].gb");
            //rom = new Rom("../../../../roms/games/X - Xekkusu.gb");
            //rom = new Rom("../../../../roms/games/Wave race.gb");
            //rom = new Rom("../../../../roms/games/F-1 Race.gb");
            //rom = new Rom("../../../../roms/games/Pinball Deluxe (U).gb");
            //rom = new Rom("../../../../roms/games/Prehistorik Man.gb");
            //rom = new Rom("../../../../roms/games/Amazing Spider-Man 3, The - Invasion of the Spider-Slayers (U) [!].gb");
            //rom = new Rom("../../../../roms/games/Tennis (JUE) [!].gb");

            //rom = new Rom("../../../../roms/bgbtest.gb");
            //rom = new Rom("../../../../roms/tellinglys.gb");                  //passes

            // Blargg CPU tests
            //rom = new Rom("../../../../roms/cpu_instrs.gb");
            //rom = new Rom("../../../../roms/01-special.gb");                  // passes
            //rom = new Rom("../../../../roms/02-interrupts.gb");               // passes
            //rom = new Rom("../../../../roms/03-op sp,hl.gb");                 // passes
            //rom = new Rom("../../../../roms/04-op r,imm.gb");                 // passes
            //rom = new Rom("../../../../roms/05-op rp.gb");                    // passes
            //rom = new Rom("../../../../roms/06-ld r,r.gb");                   // passes
            //rom = new Rom("../../../../roms/07-jr,jp,call,ret,rst.gb");       // passes
            //rom = new Rom("../../../../roms/08-misc instrs.gb");              // passes
            //rom = new Rom("../../../../roms/09-op r,r.gb");                   // passes
            //rom = new Rom("../../../../roms/10-bit ops.gb");                  // passes
            //rom = new Rom("../../../../roms/11-op a,(hl).gb");                // passes

            //rom = new Rom("../../../../roms/instr_timing.gb");                // passes
            //rom = new Rom("../../../../roms/mem_timing.gb");                  // passes
            //rom = new Rom("../../../../roms/mem_timing2.gb");                 // passes
            //rom = new Rom("../../../../roms/interrupt_time.gb");              // fails (GBC only)
            //rom = new Rom("../../../../roms/halt_bug.gb");

            // Mooneye tests
            //rom = new Rom("../../../../roms/bits_bank1.gb");                    // pass

            if (rom.Type == Rom.RomType.UnSupported)
            {
                throw new InvalidDataException("Unsupported ROM type");
            }

            interrupts = new Interrupts(this);
            ppu        = new Ppu(this);
            memory     = new Memory(this);
            cpu        = new Cpu(memory, interrupts, this);
            timer      = new DmgTimer(this);
            pad        = new Joypad(interrupts, this);
            spu        = new GameBoySpu(this);
            spu.Initialize();

            mixer = new GameBoyNAudioMixer();
            mixer.Connect(spu);
            player = new DirectSoundOut();
            player.Init(mixer);
            player.Play();

            cpu.Reset();
            ppu.Reset();
            interrupts.Reset();
            timer.Reset();
            pad.Reset();

            EmulatorTimer.Reset();
            EmulatorTimer.Start();

            if (rom.Type == Rom.RomType.MBC1_Ram_Battery)
            {
                rom.LoadMbc1BatteryBackData();
            }

            ticksPerSecond       = 0;
            secondsSinceLastSave = 0;
        }
Пример #2
0
        public void PowerOn()
        {
            PoweredOn = true;

            this.Bios = new Bios(this, "../../../../GBA.BIOS");

            //this.Rom = new Rom("../../../../roms/TestRoms/armwrestler.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/suite.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/arm.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/hello.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/irq_demo.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/OrganHarvester/if_ack.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/tmr_demo.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/brin_demo.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/obj_demo.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/obj_aff.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/sbb_aff.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/win_demo.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/dma_demo.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/m3_demo.gba");
            //this.Rom = new Rom("../../../../roms/TestRoms/m7_demo.gba");

            //this.Rom = new Rom("../../../../roms/Super Dodgeball Advance.gba");
            this.Rom = new Rom("../../../../roms/Kirby.gba");
            //this.Rom = new Rom("../../../../roms/Metal Slug Advance (U).gba");
            //this.Rom = new Rom("../../../../roms/Super Mario Advance 2 - Super Mario World (U) [!].gba");
            //this.Rom = new Rom("../../../../roms/Legend of Zelda, The - The Minish Cap (U).gba");
            //this.Rom = new Rom("../../../../roms/Legend of Zelda, The - A Link To The Past Four Swords.gba");
            //this.Rom = new Rom("../../../../roms/Pokemon Mystery Dungeon - Red Rescue Team (U).gba");
            //this.Rom = new Rom("../../../../roms/Teenage Mutant Ninja Turtles.gba");
            //this.Rom = new Rom("../../../../roms/Barbie Horse Adventures.gba");
            //this.Rom = new Rom("../../../../roms/Pokemon Pinball.gba");
            //this.Rom = new Rom("../../../../roms/Contra Advance - The Alien Wars Ex.gba");
            //this.Rom = new Rom("../../../../roms/Castlevania - Aria of Sorrow.GBA");
            //this.Rom = new Rom("../../../../roms/Castlevania - Harmony Of Dissonance.GBA");
            //this.Rom = new Rom("../../../../roms/Baseball Advance.GBA");
            //this.Rom = new Rom("../../../../roms/Donkey Kong Country 3.gba");
            //this.Rom = new Rom("../../../../roms/Final Fantasy - Tactics Advanced.GBA");
            //this.Rom = new Rom("../../../../roms/Mario Golf - Advance Tour.gba");
            //this.Rom = new Rom("../../../../roms/Yoshi's Island - Super Mario Advance 3.gba");
            //this.Rom = new Rom("../../../../roms/Fire Emblem.gba");
            //this.Rom = new Rom("../../../../roms/Darius R.GBA");
            //this.Rom = new Rom("../../../../roms/Max Payne Advance.gba");
            //this.Rom = new Rom("../../../../roms/Mario & Luigi - Superstar Saga.gba");
            //this.Rom = new Rom("../../../../roms/Mario Kart Super Circuit (U).gba");
            //this.Rom = new Rom("../../../../roms/F-Zero - Maximum Velocity.gba");
            //this.Rom = new Rom("../../../../roms/Konami Krazy Racers.gba");
            //this.Rom = new Rom("../../../../roms/Sega Rally Championship.gba");

            // Intro uses OBJ Win...
            //this.Rom = new Rom("../../../../roms/Pokemon - Emerald Version (U).gba");

            //this.Rom = new Rom("../../../../roms/Advance Wars.gba");
            //this.Rom = new Rom("../../../../roms/Advanced Wars 2 - Black Hole Rising.gba");


            //this.Rom = new Rom("../../../../roms/");


            this.Memory        = new Memory(this);
            this.Cpu           = new Cpu(this);
            this.Interrupts    = new Interrupts(this);
            this.Timers        = new Timers(this);
            this.LcdController = new LcdController(this);
            this.Joypad        = new Joypad(this);
            this.Dma           = new DmaChannel[4];
            for (int i = 0; i < 4; i++)
            {
                Dma[i] = new DmaChannel(this, i);
                Dma[i].Reset();
            }
            this.Scheduler = new Scheduler(this);

            EmulatorTimer.Reset();
            EmulatorTimer.Start();

            Cpu.Reset();
            LcdController.Reset();
            Joypad.Reset();
        }