示例#1
0
        public DmaControlRegister(GameboyAdvance gba, DmaChannel channel, UInt32 address)
        {
            this.channel = channel;

            MemoryRegister8            r0 = new MemoryRegister8(gba.Memory, address, true, true);
            MemoryRegister8WithSetHook r1 = new MemoryRegister8WithSetHook(gba.Memory, address + 1, true, true);

            register = new MemoryRegister16(gba.Memory, address, true, true, r0, r1);

            r1.OnSet = (oldValue, newValue) =>
            {
                bool oldEnable = ((oldValue & 0x80) != 0);
                bool newEnable = ((newValue & 0x80) != 0);
                if (oldEnable == false && newEnable == true)
                {
                    // Dma transfers take 2 cycles to start
                    channel.DelayTransfer          = 2;
                    channel.ScheduledUpdateOnCycle = gba.Cpu.Cycles + 2;

                    gba.Scheduler.RefreshSchedule();
                }
            };
        }
示例#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();
        }
示例#3
0
 public DmaControlRegister(DmaChannel channel)
 {
     this.channel = channel;
 }