예제 #1
0
 internal VideoFrameData(GameBoyMemoryBus bus)
 {
     VideoMemorySnapshot = new VideoMemorySnapshot(bus);
     VideoPortAccessList = new List <PortAccess>(1000);
     PaletteAccessList   = new List <PaletteAccess>(1000);
     SgbCharacterData    = new byte[0x2000];
     SgbBorderMapData    = new ushort[0x800];
 }
예제 #2
0
		public Mapper(GameBoyMemoryBus bus)
		{
			if (bus == null) throw new ArgumentNullException();

			this.bus = bus;
			this.ramWriteInternalHandler = HandleRamWriteInternal;
			this.ramWriteHandler = HandleRamWrite;
		}
예제 #3
0
 public unsafe VideoMemorySnapshot(GameBoyMemoryBus bus)
 {
     _bus = bus;
     _videoMemoryBlock           = new MemoryBlock(16384);
     VideoMemory                 = (byte *)this._videoMemoryBlock.Pointer;
     _objectAttributeMemoryBlock = new MemoryBlock(0xA0);             // Do not allocate more bytes than needed… GameBoyMemoryBus allocates 0x100 because of the segmented memory.
     ObjectAttributeMemory       = (byte *)_objectAttributeMemoryBlock.Pointer;
     _paletteMemoryBlock         = new MemoryBlock(16 * 4 * sizeof(ushort));
     PaletteMemory               = (byte *)this._paletteMemoryBlock.Pointer;
 }
예제 #4
0
		public unsafe VideoStatusSnapshot(GameBoyMemoryBus bus)
		{
			this.bus = bus;
			this.videoMemoryBlock = new MemoryBlock(bus.VideoRam.Length);
			this.VideoMemory = (byte*)this.videoMemoryBlock.Pointer;
			this.objectAttributeMemoryBlock = new MemoryBlock(0xA0); // Do not allocate more bytes than needed… GameBoyMemoryBus allocates 0x100 because of the segmented memory.
			this.ObjectAttributeMemory = (byte*)this.objectAttributeMemoryBlock.Pointer;
			this.paletteMemoryBlock = new MemoryBlock(bus.PaletteMemory.Length);
			this.PaletteMemory = (byte*)this.paletteMemoryBlock.Pointer;
		}
예제 #5
0
        public Mapper(GameBoyMemoryBus bus)
        {
            if (bus == null)
            {
                throw new ArgumentNullException();
            }

            this._bus = bus;
            this._ramWriteInternalHandler = HandleRamWriteInternal;
            this._ramWriteHandler         = HandleRamWrite;
        }
예제 #6
0
		public EmulatedGameBoy(IContainer container)
		{
			bus = new GameBoyMemoryBus();
			frameStopwatch = new Stopwatch();
			frameRateStopwatch = new Stopwatch();
#if WITH_THREADING
			bus.EmulationStarted += OnEmulationStarted;	
			bus.EmulationStopped += OnEmulationStopped;
			bus.ClockManager = this;
#else
			Application.Idle += OnApplicationIdle;
#endif
			bus.ReadKeys += new EventHandler<ReadKeysEventArgs>(OnReadKeys);
			emulationStatus = bus.UseBootRom ? EmulationStatus.Paused : EmulationStatus.Stopped;
			if (container != null) container.Add(this);
		}
예제 #7
0
			private GameBoyMemoryBus @this; // “This” will better emphazize the fact that this structure does not hold any valuable data.

			internal JoypadState(GameBoyMemoryBus bus) { this.@this = bus; }
예제 #8
0
		public unsafe AudioStatusSnapshot(GameBoyMemoryBus bus)
		{
			this.bus = bus;
			this.wavePatternMemoryBlock = new MemoryBlock(16);
			this.WavePatternMemory = (byte*)this.wavePatternMemoryBlock.Pointer;
		}
예제 #9
0
 public unsafe AudioStatusSnapshot(GameBoyMemoryBus bus)
 {
     this.bus = bus;
     this.wavePatternMemoryBlock = new MemoryBlock(16);
     this.WavePatternMemory      = (byte *)this.wavePatternMemoryBlock.Pointer;
 }
예제 #10
0
		internal Processor(GameBoyMemoryBus bus) { this.bus = bus; }
예제 #11
0
 internal Processor(GameBoyMemoryBus bus)
 {
     this.bus = bus;
 }
예제 #12
0
		public void Dispose()
		{
			if (bus != null)
			{
				bus.Dispose();
				bus = null;
				if (Disposed != null) Disposed(this, EventArgs.Empty);
			}
		}