Exemplo n.º 1
0
		public GBA(CoreComm comm, byte[] file)
		{
			ServiceProvider = new BasicServiceProvider(this);
			Tracer = new TraceBuffer
			{
				Header = "   -Addr--- -Opcode- -Instruction------------------- -R0----- -R1----- -R2----- -R3----- -R4----- -R5----- -R6----- -R7----- -R8----- -R9----- -R10---- -R11---- -R12---- -R13(SP) -R14(LR) -R15(PC) -CPSR--- -SPSR---"
			};

			(ServiceProvider as BasicServiceProvider).Register<ITraceable>(Tracer);

			CoreComm = comm;

			comm.VsyncNum = 262144;
			comm.VsyncDen = 4389;
			comm.NominalWidth = 240;
			comm.NominalHeight = 160;

			byte[] bios = CoreComm.CoreFileProvider.GetFirmware("GBA", "Bios", true, "GBA bios file is mandatory.");

			if (bios.Length != 16384)
				throw new InvalidDataException("GBA bios must be exactly 16384 bytes!");
			if (file.Length > 32 * 1024 * 1024)
				throw new InvalidDataException("Rom file is too big!  No GBA game is larger than 32MB");
			Init();
			LibMeteor.libmeteor_hardreset();
			LibMeteor.libmeteor_loadbios(bios, (uint)bios.Length);
			LibMeteor.libmeteor_loadrom(file, (uint)file.Length);

			SetUpMemoryDomains();
		}
Exemplo n.º 2
0
		private void ConnectTracer()
		{
			Tracer = new TraceBuffer
				{
					Header = TraceHeader
				};
			(ServiceProvider as BasicServiceProvider).Register<ITraceable>(Tracer);
			_tracecb = new LibQuickNES.TraceCallback(MakeTrace);
		}
Exemplo n.º 3
0
        public AppleII(CoreComm comm, GameInfo game, byte[] rom, Settings settings)
        {
            GameInfoSet = new List<GameInfo>();

            var ser = new BasicServiceProvider(this);
            ServiceProvider = ser;
            CoreComm = comm;

            Tracer = new TraceBuffer
            {
                Header = "6502: PC, opcode, register (A, X, Y, P, SP, Cy) flags (NVTBDIZC)"
            };

            MemoryCallbacks = new MemoryCallbackSystem();
            InputCallbacks = new InputCallbackSystem();

            _disk1 = rom;
            RomSet.Add(rom);

            _appleIIRom = comm.CoreFileProvider.GetFirmware(
                SystemId, "AppleIIe", true, "The Apple IIe BIOS firmware is required");
            _diskIIRom = comm.CoreFileProvider.GetFirmware(
                SystemId, "DiskII", true, "The DiskII firmware is required");

            _machine = new Machine(_appleIIRom, _diskIIRom);

            _machine.BizInitialize();

            //make a writeable memory stream cloned from the rom.
            //for junk.dsk the .dsk is important because it determines the format from that
            InitDisk();

            ser.Register<ITraceable>(Tracer);

            setCallbacks();

            InitSaveStates();
            SetupMemoryDomains();
            PutSettings(settings ?? new Settings());
        }