Ejemplo n.º 1
0
        public BgControlRegister(GameboyAdvance gba, LcdController lcd, int bgNumber, UInt32 address)
        {
            this.lcd      = lcd;
            this.bgNumber = bgNumber;

            MemoryRegister8WithSetHook r0 = new MemoryRegister8WithSetHook(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);

            r0.OnSet = (oldValue, newValue) =>
            {
                lcd.Bg[bgNumber].CacheRenderData();
            };

            r1.OnSet = (oldValue, newValue) =>
            {
                // This *should* be 0x1F but it breaks bg on mario kart track 1. Hopefully we can just get rid of tilemap reset and be done with this
                //if ((oldValue & 0x1F) != (newValue & 0x1F))
                {
                    // THIS HAS GOT TO GO! Mario Kart canes it!
                    lcd.Bg[bgNumber].TileMap.Reset();
                }

                lcd.Bg[bgNumber].CacheRenderData();
            };
        }
Ejemplo n.º 2
0
        public DisplayStatusRegister(GameboyAdvance gba, LcdController lcd)
        {
            this.lcd = lcd;
            DispStatRegister r0 = new DispStatRegister(lcd, this, gba.Memory, 0x4000004);
            MemoryRegister8  r1 = new MemoryRegister8(gba.Memory, 0x4000005, true, true);

            register = new MemoryRegister16(gba.Memory, 0x4000004, true, true, r0, r1);
        }
Ejemplo n.º 3
0
        public DisplayControlRegister(GameboyAdvance gba, LcdController lcd)
        {
            this.lcd = lcd;

            MemoryRegister8WithSetHook r0 = new MemoryRegister8WithSetHook(gba.Memory, 0x4000000, true, true);
            MemoryRegister8            r1 = new MemoryRegister8(gba.Memory, 0x4000001, true, true);

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

            r0.OnSet = (oldValue, newValue) =>
            {
                // BgMode changed?
                if ((oldValue & 0x07) != (newValue & 0x07))
                {
                    lcd.Bg[0].CacheRenderData();
                    lcd.Bg[1].CacheRenderData();
                    lcd.Bg[2].CacheRenderData();
                    lcd.Bg[3].CacheRenderData();
                }
            };
        }
Ejemplo n.º 4
0
 public BgControlRegister(LcdController lcd, int bgNumber)
 {
     this.lcd      = lcd;
     this.bgNumber = bgNumber;
 }
Ejemplo n.º 5
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();
        }
Ejemplo n.º 6
0
 public void Dispose()
 {
     PoweredOn = false;
     LcdController.Dispose();
 }
Ejemplo n.º 7
0
 public DisplayControlRegister(LcdController lcd)
 {
     this.lcd = lcd;
 }
Ejemplo n.º 8
0
 public void Dispose()
 {
     LcdController.Dispose();
 }
Ejemplo n.º 9
0
 public PixelCoefficientRegister(LcdController lcd, GameboyAdvance gba, UInt32 address)
 {
     this.lcd = lcd;
     register = new MemoryRegister16(gba.Memory, address, true, true);
 }
Ejemplo n.º 10
0
 public DispStatRegister(LcdController lcd, DisplayStatusRegister dspStat, Memory memory, UInt32 address) :
     base(memory, address, true, true)
 {
     this.lcd     = lcd;
     this.dspStat = dspStat;
 }
Ejemplo n.º 11
0
 public BlendControlRegister(LcdController lcd, GameboyAdvance gba)
 {
     this.lcd = lcd;
     register = new MemoryRegister16(gba.Memory, 0x4000050, true, true);
 }