Example #1
0
        // The Game Boy contains two 32x32 tile background maps in VRAM at addresses 9800h-9BFFh and 9C00h-9FFFh.
        // Each can be used either to display "normal" background, or "window" background.
        public TileMap(IPpu ppu, IMemoryReader memory, ushort vramOffset)
        {
            if (vramOffset != 0x9800 && vramOffset != 0x9C00)
            {
                throw new ArgumentException("Background map must be located at cofrrect address");
            }
            this.vramOffset = vramOffset;

            this.ppu    = ppu;
            this.memory = memory;
        }
Example #2
0
 public Emulator(ICpu cpu, IPpu ppu, IMemory memory)
 {
     this.cpu = cpu;
     this.ppu = ppu;
     this.memory = memory;
 }
Example #3
0
 public LcdControlRegister(IPpu ppu)
 {
     this.ppu = ppu;
 }
Example #4
0
 public PpuMemoryRegisters(IPpu ppu)
 {
     this.ppu = ppu;
     LCDC     = new LcdControlRegister(ppu);
     STAT     = new LcdStatusRegister(ppu);
 }
Example #5
0
 public LcdStatusRegister(IPpu ppu)
 {
     this.ppu = ppu;
 }
Example #6
0
 public Memory(IPpu ppu, Lazy<IIO> io)
 {
     this.ppu = ppu;
     this.io = io;
     ram = new byte[ushort.MaxValue];
 }