Beispiel #1
0
        public BitTests()
        {
            this.cpu = this.board.CPU;

            this.board.Poke(0, 0x85);
            this.board.Poke(1, 0xe0);
        }
Beispiel #2
0
        public VectrexHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ object settings, object syncSettings)
        {
            var ser = new BasicServiceProvider(this);

            cpu = new MC6809
            {
                ReadMemory      = ReadMemory,
                WriteMemory     = WriteMemory,
                PeekMemory      = PeekMemory,
                DummyReadMemory = ReadMemory,
                OnExecFetch     = ExecFetch,
            };

            audio      = new Audio();
            ppu        = new PPU();
            serialport = new SerialPort();

            CoreComm = comm;

            _settings       = (VectrexSettings)settings ?? new VectrexSettings();
            _syncSettings   = (VectrexSyncSettings)syncSettings ?? new VectrexSyncSettings();
            _controllerDeck = new VectrexHawkControllerDeck(_syncSettings.Port1);

            byte[] Bios = null;
            Bios  = comm.CoreFileProvider.GetFirmware("Vectrex", "Bios", true, "BIOS Not Found, Cannot Load");
            _bios = Bios;

            Buffer.BlockCopy(rom, 0x100, header, 0, 0x50);
            string hash_md5 = null;

            hash_md5 = "md5:" + rom.HashMD5(0, rom.Length);
            Console.WriteLine(hash_md5);

            _rom = rom;
            Setup_Mapper();

            _frameHz = 60;

            audio.Core      = this;
            ppu.Core        = this;
            serialport.Core = this;

            ser.Register <IVideoProvider>(this);
            ser.Register <ISoundProvider>(audio);
            ServiceProvider = ser;

            _settings     = (VectrexSettings)settings ?? new VectrexSettings();
            _syncSettings = (VectrexSyncSettings)syncSettings ?? new VectrexSyncSettings();

            _tracer = new TraceBuffer {
                Header = cpu.TraceHeader
            };
            ser.Register <ITraceable>(_tracer);

            SetupMemoryDomains();
            HardReset();

            cpu.SetCallbacks(ReadMemory, PeekMemory, PeekMemory, WriteMemory);
        }
Beispiel #3
0
        public Profiler(Bus board, MC6809 processor, Disassembler disassembler)
        {
            this.board        = board;
            this.processor    = processor;
            this.disassembler = disassembler;

            this.instructionCounts = new ulong[0x10000];
            this.addressProfiles   = new ulong[0x10000];
            this.addressCounts     = new ulong[0x10000];
        }
Beispiel #4
0
        public BgtTests()
        {
            this.cpu = this.board.CPU;

            this.board.Poke(0, 0x2e);    // BGT
            this.board.Poke(1, 0x03);
            this.board.Poke(2, 0x86);    // LDA #1
            this.board.Poke(3, 0x01);
            this.board.Poke(4, 0x12);    // NOP
            this.board.Poke(5, 0x86);    // LDA #2
            this.board.Poke(6, 0x02);
            this.board.Poke(7, 0x12);    // NOP
        }
Beispiel #5
0
        public VectrexHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ object settings, object syncSettings)
        {
            var ser = new BasicServiceProvider(this);

            cpu = new MC6809
            {
                ReadMemory      = ReadMemory,
                WriteMemory     = WriteMemory,
                PeekMemory      = PeekMemory,
                DummyReadMemory = ReadMemory,
                OnExecFetch     = ExecFetch,
            };

            audio      = new Audio();
            ppu        = new PPU();
            serialport = new SerialPort();

            CoreComm = comm;

            _settings       = (VectrexSettings)settings ?? new VectrexSettings();
            _syncSettings   = (VectrexSyncSettings)syncSettings ?? new VectrexSyncSettings();
            _controllerDeck = new VectrexHawkControllerDeck(_syncSettings.Port1, _syncSettings.Port2);

            byte[] Bios = null;
            byte[] Mine = null;

            Bios  = comm.CoreFileProvider.GetFirmware("Vectrex", "Bios", true, "BIOS Not Found, Cannot Load");
            _bios = Bios;

            Mine      = comm.CoreFileProvider.GetFirmware("Vectrex", "Minestorm", true, "Minestorm Not Found, Cannot Load");
            minestorm = Mine;

            Console.WriteLine("SHA1:" + rom.HashSHA1(0, rom.Length));

            _rom = rom;

            // If the game is minstorm, then no cartridge is inserted, retun 0xFF
            if ((rom.HashSHA1(0, rom.Length) == "65D07426B520DDD3115D40F255511E0FD2E20AE7") ||
                (rom.HashSHA1(0, rom.Length) == "1FDCC6E54AE5177BC9CDC79CE616AE3401E5C229"))
            {
                _rom = new byte[0x8000];

                for (int i = 0; i < 0x8000; i++)
                {
                    _rom[i] = 0xFF;
                }
            }

            // mirror games that are too small
            if (_rom.Length < 0x8000)
            {
                _rom = new byte[0x8000];

                for (int i = 0; i < 0x8000 / rom.Length; i++)
                {
                    for (int j = 0; j < rom.Length; j++)
                    {
                        _rom[j + i * rom.Length] = rom[j];
                    }
                }
            }

            // RAM appears to power up to either random values or 0xFF, otherwise all the asteroids in minestorm are on the same side if RAM[0x7E]=0
            for (int i = 0; i < RAM.Length; i++)
            {
                RAM[i] = 0xFF;
            }

            Setup_Mapper();

            _frameHz = 50;

            audio.Core      = this;
            ppu.Core        = this;
            serialport.Core = this;

            ser.Register <IVideoProvider>(this);
            ser.Register <ISoundProvider>(audio);
            ServiceProvider = ser;

            _settings     = (VectrexSettings)settings ?? new VectrexSettings();
            _syncSettings = (VectrexSyncSettings)syncSettings ?? new VectrexSyncSettings();

            _tracer = new TraceBuffer {
                Header = cpu.TraceHeader
            };
            ser.Register <ITraceable>(_tracer);

            SetupMemoryDomains();
            HardReset();

            cpu.SetCallbacks(ReadMemory, PeekMemory, PeekMemory, WriteMemory);
        }
Beispiel #6
0
 public Disassembler(Bus bus, MC6809 targetProcessor)
 {
     this.BUS = bus;
     this.CPU = targetProcessor;
 }
Beispiel #7
0
        public EorTests()
        {
            this.cpu = this.board.CPU;

            this.board.Poke(0, 0x4f);
        }
Beispiel #8
0
        public AslTests()
        {
            this.cpu = this.board.CPU;

            this.board.Poke(0, 0x48);
        }
Beispiel #9
0
        public VectrexHawk(CoreComm comm, byte[] rom, VectrexHawk.VectrexSyncSettings syncSettings)
        {
            var ser = new BasicServiceProvider(this);

            cpu = new MC6809
            {
                ReadMemory      = ReadMemory,
                WriteMemory     = WriteMemory,
                PeekMemory      = PeekMemory,
                DummyReadMemory = ReadMemory,
                OnExecFetch     = ExecFetch,
            };

            audio      = new Audio();
            ppu        = new PPU();
            serialport = new SerialPort();

            _settings       = new object();       // TODO: wtf is this
            _syncSettings   = (VectrexSyncSettings)syncSettings ?? new VectrexSyncSettings();
            _controllerDeck = new VectrexHawkControllerDeck(_syncSettings.Port1, _syncSettings.Port2);

            /*var Bios =*/ _bios     = comm.CoreFileProvider.GetFirmwareOrThrow(new("VEC", "Bios"), "BIOS Not Found, Cannot Load");
            /*var Mine =*/ minestorm = comm.CoreFileProvider.GetFirmwareOrThrow(new("VEC", "Minestorm"), "Minestorm Not Found, Cannot Load");

            var romHashSHA1 = rom.HashSHA1();

            Console.WriteLine($"SHA1:{romHashSHA1}");

            _rom = rom;

            // If the game is minstorm, then no cartridge is inserted, retun 0xFF
            if (romHashSHA1 == RomChecksums.Minestorm)
            {
                _rom = new byte[0x8000];

                for (int i = 0; i < 0x8000; i++)
                {
                    _rom[i] = 0xFF;
                }
            }

            // mirror games that are too small
            if (_rom.Length < 0x8000)
            {
                _rom = new byte[0x8000];

                for (int i = 0; i < 0x8000 / rom.Length; i++)
                {
                    for (int j = 0; j < rom.Length; j++)
                    {
                        _rom[j + i * rom.Length] = rom[j];
                    }
                }
            }

            // RAM appears to power up to either random values or 0xFF, otherwise all the asteroids in minestorm are on the same side if RAM[0x7E]=0
            for (int i = 0; i < RAM.Length; i++)
            {
                RAM[i] = 0xFF;
            }

            Setup_Mapper();

            _frameHz = 50;

            audio.Core      = this;
            ppu.Core        = this;
            serialport.Core = this;

            ser.Register <IVideoProvider>(this);
            ser.Register <ISoundProvider>(audio);
            ServiceProvider = ser;

            _settings     = new object();         // TODO: wtf is this
            _syncSettings = (VectrexSyncSettings)syncSettings ?? new VectrexSyncSettings();

            _tracer = new TraceBuffer(cpu.TraceHeader);
            ser.Register <ITraceable>(_tracer);
            ser.Register <IStatable>(new StateSerializer(SyncState));
            SetupMemoryDomains();
            HardReset();

            cpu.SetCallbacks(ReadMemory, PeekMemory, PeekMemory, WriteMemory);
        }
Beispiel #10
0
        public AbxTests()
        {
            this.cpu = this.board.CPU;

            this.board.Poke(0, 0x3a);
        }
Beispiel #11
0
        public AsrTests()
        {
            this.cpu = this.board.CPU;

            this.board.Poke(0, 0x47);
        }