Example #1
0
        public MEM(ARM7TDMI cpu)
        {
            this.cpu = cpu;
            this.bus = cpu.bus;

            this.BIOS      = new BIOSSection(cpu);
            this.IO        = cpu.IO;
            this.VRAM      = new VRAMSection(cpu.IO);
            this.GamePak_L = new cROMSection(this, false);
            this.GamePak_H = new cROMSection(this, true);
            this.Backup    = new BackupSection(cpu.DMAChannels[3]);

            this.MemorySections = new IMemorySection[16]
            {
                this.BIOS,
                this.UnusedSection,
                this.eWRAM,
                this.iWRAM,
                this.IO,
                this.PAL,
                this.VRAM,
                this.OAM,

                this.GamePak_L,
                this.GamePak_H,
                this.GamePak_L,
                this.GamePak_H,
                this.GamePak_L,
                this.GamePak_H,
                this.Backup,
                this.Backup
            };
        }
Example #2
0
        public PPU(GBA gba, ushort[] display, IORAMSection IO)
        {
            this.gba     = gba;
            this.IO      = IO;
            this.Display = display;

            this.ResetBGScanlines(0, 1, 2, 3);
            this.ResetOBJScanlines();
        }
Example #3
0
        public GBA(ushort[] display)
        {
            this.cpu = new ARM7TDMI(this, this.EventQueue);
            this.IO  = this.cpu.IO;
            this.mem = this.cpu.mem;
            this.bus = this.cpu.bus;

            this.apu = new APU(this.cpu, this.EventQueue);
            this.ppu = new PPU(this, display, this.IO);

            this.mem.Init(this.ppu);
            this.IO.Init(this.ppu, this.bus);
            this.IO.Layout(this.cpu, this.apu);

            // this.mem.UseNormattsBIOS();

            this.display = display;
#if THREADED_RENDERING
            this.RenderThread = new Thread(() => ppu.Mainloop());
#endif
        }
Example #4
0
File: CPU.cs Project: DenSinH/GBAC-
        public ARM7TDMI(GBA gba, Scheduler.Scheduler scheduler)
        {
            this.gba      = gba;
            this.Pipeline = new cPipeline(this);

            this.InitARM();
            this.InitTHUMB();
            this.InitTimers(scheduler);

            // IO requires bus to be initialized
            this.bus = new BUS(this);
            this.IO  = new IORAMSection();

            // DMAChannels require bus AND IO to be initialized
            this.DMAChannels[0] = new DMAChannel(this, 0);
            this.DMAChannels[1] = new DMAChannel(this, 1);
            this.DMAChannels[2] = new DMAChannel(this, 2);
            this.DMAChannels[3] = new DMAChannel(this, 3);

            // mem requires IO AND DMAChannels to be initialized
            this.mem = new MEM(this);

            this.SystemBank     = new uint[16];
            this.FIQBank        = new uint[16];
            this.SupervisorBank = new uint[16];
            // this.AbortBank      = new uint[16];
            this.IRQBank = new uint[16];
            // this.UndefinedBank  = new uint[16];
            this.state = State.ARM;

            // need banked registers for CPSR initialization
            this.CPSR = 0x0000005F;

            this.PipelineFlush();
            this.PC += 4;
        }
Example #5
0
 public VRAMSection(IORAMSection IO) : base(0x18000)
 {
     this.IO = IO;
 }